88} from '@h5web/lib' ;
99import {
1010 type ArrayShape ,
11- type ArrayValue ,
1211 type Dataset ,
1312 type NumericLikeType ,
13+ type Value ,
1414} from '@h5web/shared/hdf5-models' ;
1515import { type AxisMapping } from '@h5web/shared/nexus-models' ;
1616import { type NumArray } from '@h5web/shared/vis-models' ;
@@ -24,18 +24,19 @@ import {
2424 useMappedArrays ,
2525 useSlicedDimsAndMapping ,
2626 useToNumArray ,
27+ useToNumArrays ,
2728} from '../hooks' ;
2829import { DEFAULT_DOMAIN , formatNumLikeType , getSliceSelection } from '../utils' ;
2930import { type LineConfig } from './config' ;
3031import LineToolbar from './LineToolbar' ;
3132
3233interface Props {
33- dataset ? : Dataset < ArrayShape , NumericLikeType > ;
34- value : ArrayValue < NumericLikeType > ;
34+ dataset : Dataset < ArrayShape , NumericLikeType > ;
35+ value : Value < Props [ 'dataset' ] > ;
3536 valueLabel ?: string ;
3637 errors ?: NumArray ;
3738 auxLabels ?: string [ ] ;
38- auxValues ?: NumArray [ ] ;
39+ auxValues ?: Value < Props [ 'dataset' ] > [ ] ;
3940 auxErrors ?: ( NumArray | undefined ) [ ] ;
4041 dims : number [ ] ;
4142 dimMapping : DimensionMapping ;
@@ -76,12 +77,13 @@ function MappedLineVis(props: Props) {
7677 } = config ;
7778
7879 const numArray = useToNumArray ( value ) ;
80+ const numAuxArrays = useToNumArrays ( auxValues ) ;
7981 const [ slicedDims , slicedMapping ] = useSlicedDimsAndMapping ( dims , dimMapping ) ;
8082
8183 const hookArgs = [ slicedDims , slicedMapping ] as const ;
8284 const dataArray = useMappedArray ( numArray , ...hookArgs ) ;
8385 const errorArray = useMappedArray ( errors , ...hookArgs ) ;
84- const auxArrays = useMappedArrays ( auxValues , ...hookArgs ) ;
86+ const auxArrays = useMappedArrays ( numAuxArrays , ...hookArgs ) ;
8587 const auxErrorsArrays = useMappedArrays ( auxErrors , ...hookArgs ) ;
8688
8789 const dataDomain = useDomain (
@@ -114,7 +116,6 @@ function MappedLineVis(props: Props) {
114116 config = { config }
115117 getExportURL = {
116118 getExportURL &&
117- dataset &&
118119 ( ( format ) => getExportURL ( format , dataset , selection , value ) )
119120 }
120121 /> ,
@@ -135,7 +136,7 @@ function MappedLineVis(props: Props) {
135136 } }
136137 ordinateLabel = { valueLabel }
137138 title = { title }
138- dtype = { dataset && formatNumLikeType ( dataset . type ) }
139+ dtype = { formatNumLikeType ( dataset . type ) }
139140 errorsArray = { errorArray }
140141 showErrors = { showErrors }
141142 auxiliaries = { auxArrays . map ( ( array , i ) => ( {
0 commit comments