@@ -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,25 @@ 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 ) ;
83+ const numErrorsArray = useToNumArray ( errors ) ;
84+ const numAuxErrorsArrays = useToNumArrays ( auxErrors ) ;
85+ const numAxisArrays = useToNumArrays ( axisValues ) ;
8286
83- const hookArgs = [ slicedDims , slicedMapping ] as const ;
8487 const dataArray = useMappedArray ( numArray , ...hookArgs ) ;
85- const errorArray = useMappedArray ( errors , ...hookArgs ) ;
88+ const errorsArray = useMappedArray ( numErrorsArray , ...hookArgs ) ;
8689 const auxArrays = useMappedArrays ( numAuxArrays , ...hookArgs ) ;
87- const auxErrorsArrays = useMappedArrays ( auxErrors , ...hookArgs ) ;
90+ const auxErrorsArrays = useMappedArrays ( numAuxErrorsArrays , ...hookArgs ) ;
8891
8992 const dataDomain = useDomain (
9093 dataArray ,
9194 yScaleType ,
92- showErrors ? errorArray : undefined ,
95+ showErrors ? errorsArray : undefined ,
9396 ignoreValue ,
9497 ) ;
9598
@@ -130,14 +133,14 @@ function MappedLineVis(props: Props) {
130133 curveType = { curveType }
131134 showGrid = { showGrid }
132135 abscissaParams = { {
133- label : axisLabels ?. [ xDimIndex ] ,
134- value : axisValues ?. [ xDimIndex ] ,
136+ label : axisLabels [ xDimIndex ] ,
137+ value : numAxisArrays [ xDimIndex ] ,
135138 scaleType : xScaleType ,
136139 } }
137140 ordinateLabel = { valueLabel }
138141 title = { title }
139142 dtype = { formatNumLikeType ( dataset . type ) }
140- errorsArray = { errorArray }
143+ errorsArray = { errorsArray }
141144 showErrors = { showErrors }
142145 auxiliaries = { auxArrays . map ( ( array , i ) => ( {
143146 label : auxLabels [ i ] ,
0 commit comments