@@ -37,6 +37,7 @@ interface Props extends ClassStyleAttrs {
3737 errorsArray ?: NdArray < NumArray > ;
3838 showErrors ?: boolean ;
3939 auxiliaries ?: AuxiliaryParams [ ] ;
40+ exactNotation ?: boolean ;
4041 renderTooltip ?: ( data : TooltipData ) => ReactElement ;
4142 children ?: ReactNode ;
4243 interactions ?: DefaultInteractionsConfig ;
@@ -58,6 +59,7 @@ function LineVis(props: Props) {
5859 errorsArray,
5960 showErrors = false ,
6061 auxiliaries = [ ] ,
62+ exactNotation,
6163 renderTooltip,
6264 children,
6365 interactions,
@@ -124,7 +126,7 @@ function LineVis(props: Props) {
124126
125127 < TooltipMesh
126128 guides = "vertical"
127- renderTooltip = { ( x , _ , exact ) => {
129+ renderTooltip = { ( x ) => {
128130 const xi = abscissaToIndex ( x ) ;
129131 const abscissa = abscissas [ xi ] ;
130132
@@ -137,7 +139,7 @@ function LineVis(props: Props) {
137139
138140 return (
139141 < >
140- { `${ abscissaLabel ?? 'x' } = ${ exact ? abscissa : formatTooltipVal ( abscissa ) } ` }
142+ { `${ abscissaLabel ?? 'x' } = ${ exactNotation ? abscissa : formatTooltipVal ( abscissa ) } ` }
141143
142144 < div className = { styles . tooltipValue } >
143145 { auxiliaries . length > 0 && (
@@ -148,9 +150,11 @@ function LineVis(props: Props) {
148150 />
149151 ) }
150152 < span >
151- < strong > { exact ? value : formatTooltipVal ( value ) } </ strong >
153+ < strong >
154+ { exactNotation ? value : formatTooltipVal ( value ) }
155+ </ strong >
152156 { error !== undefined &&
153- ` ±${ exact ? error : formatTooltipErr ( error ) } ` }
157+ ` ±${ exactNotation ? error : formatTooltipErr ( error ) } ` }
154158 { dtype && < em > { ` (${ dtype } )` } </ em > }
155159 </ span >
156160 </ div >
@@ -163,9 +167,11 @@ function LineVis(props: Props) {
163167 style = { { color : auxColors [ index % auxColors . length ] } }
164168 />
165169 { label ? `${ label } = ` : '' }
166- { exact ? array . get ( xi ) : formatTooltipVal ( array . get ( xi ) ) }
170+ { exactNotation
171+ ? array . get ( xi )
172+ : formatTooltipVal ( array . get ( xi ) ) }
167173 { errors &&
168- ` ±${ exact ? errors . get ( xi ) : formatTooltipErr ( errors . get ( xi ) ) } ` }
174+ ` ±${ exactNotation ? errors . get ( xi ) : formatTooltipErr ( errors . get ( xi ) ) } ` }
169175 </ div >
170176 ) ) }
171177 </ >
0 commit comments