@@ -38,7 +38,6 @@ interface Props {
3838 auxLabels ?: string [ ] ;
3939 auxValues ?: ArrayValue < NumericLikeType > [ ] ;
4040 auxErrors ?: ( ArrayValue < NumericType > | undefined ) [ ] ;
41- dims : number [ ] ;
4241 dimMapping : DimensionMapping ;
4342 axisLabels ?: AxisMapping < string > ;
4443 axisValues ?: AxisMapping < ArrayValue < NumericType > > ;
@@ -57,10 +56,9 @@ function MappedLineVis(props: Props) {
5756 auxLabels = [ ] ,
5857 auxValues = [ ] ,
5958 auxErrors = [ ] ,
60- dims,
6159 dimMapping,
62- axisLabels,
63- axisValues,
60+ axisLabels = [ ] ,
61+ axisValues = [ ] ,
6462 title,
6563 toolbarContainer,
6664 config,
@@ -76,20 +74,22 @@ function MappedLineVis(props: Props) {
7674 showErrors,
7775 } = config ;
7876
77+ const { shape : dims } = dataset ;
78+ const [ slicedDims , slicedMapping ] = useSlicedDimsAndMapping ( dims , dimMapping ) ;
79+ const hookArgs = [ slicedDims , slicedMapping ] as const ;
80+
7981 const numArray = useToNumArray ( value ) ;
8082 const numAuxArrays = useToNumArrays ( auxValues ) ;
81- const [ slicedDims , slicedMapping ] = useSlicedDimsAndMapping ( dims , dimMapping ) ;
8283
83- const hookArgs = [ slicedDims , slicedMapping ] as const ;
8484 const dataArray = useMappedArray ( numArray , ...hookArgs ) ;
85- const errorArray = useMappedArray ( errors , ...hookArgs ) ;
85+ const errorsArray = useMappedArray ( errors , ...hookArgs ) ;
8686 const auxArrays = useMappedArrays ( numAuxArrays , ...hookArgs ) ;
8787 const auxErrorsArrays = useMappedArrays ( auxErrors , ...hookArgs ) ;
8888
8989 const dataDomain = useDomain (
9090 dataArray ,
9191 yScaleType ,
92- showErrors ? errorArray : undefined ,
92+ showErrors ? errorsArray : undefined ,
9393 ignoreValue ,
9494 ) ;
9595
@@ -130,14 +130,14 @@ function MappedLineVis(props: Props) {
130130 curveType = { curveType }
131131 showGrid = { showGrid }
132132 abscissaParams = { {
133- label : axisLabels ?. [ xDimIndex ] ,
134- value : axisValues ?. [ xDimIndex ] ,
133+ label : axisLabels [ xDimIndex ] ,
134+ value : axisValues [ xDimIndex ] ,
135135 scaleType : xScaleType ,
136136 } }
137137 ordinateLabel = { valueLabel }
138138 title = { title }
139139 dtype = { formatNumLikeType ( dataset . type ) }
140- errorsArray = { errorArray }
140+ errorsArray = { errorsArray }
141141 showErrors = { showErrors }
142142 auxiliaries = { auxArrays . map ( ( array , i ) => ( {
143143 label : auxLabels [ i ] ,
0 commit comments