@@ -65,6 +65,7 @@ function shouldExpand(currentPath: number[], allErrorPaths: number[][]): boolean
6565
6666type LocalErrorTreeWithExplanation = LocalErrorTree & { explanation ?: string , path ?: number [ ] } ;
6767
68+ let valueId = 0 ;
6869
6970function TreeRow ( {
7071 node,
@@ -82,13 +83,25 @@ function TreeRow({
8283 ) ;
8384 const collapsedExpression = formatExpression ( node ) ;
8485
86+
87+
8588 function renderValue ( value : any ) {
8689 if ( value === "true" || value === "false" ) {
8790 return value ;
8891 }
92+ valueId += 1 ;
8993 const num = parseFloat ( value ) ;
9094 if ( isNaN ( num ) ) { return value ; }
91- return herbiejs . displayNumber ( num ) ;
95+ return < >
96+ < span className = "number-value"
97+ data-tooltip-id = { `value-tooltip-${ valueId } ` }
98+ >
99+ { herbiejs . displayNumber ( num ) }
100+ </ span >
101+ < Tooltip id = { `value-tooltip-${ valueId } ` } >
102+ { num . toString ( ) }
103+ </ Tooltip >
104+ </ >
92105 }
93106
94107 const isHighError = parseFloat ( node [ "percent-accuracy" ] ) < 50 ;
@@ -142,11 +155,13 @@ function TreeRow({
142155 </ div >
143156 </ span >
144157 </ td >
145- < td > { renderValue ( node [ "actual-value" ] ) } </ td >
146158 < td > { renderValue ( node [ "exact-value" ] ) } </ td >
159+ < td > { renderValue ( node [ "actual-value" ] ) } </ td >
147160 < td > { renderValue ( node [ "abs-error-difference" ] ) } </ td >
148161 < td className = "accuracy-col" >
162+ < span >
149163 { parseFloat ( node [ "percent-accuracy" ] ) . toFixed ( 1 ) } %
164+ </ span >
150165 </ td >
151166 < td className = "explanation" >
152167 { node . explanation ?
@@ -272,7 +287,7 @@ function NewLocalError({ expressionId }: { expressionId: number }) {
272287 >
273288 < svg width = "10" height = "10" viewBox = "0 0 24 24" fill = "currentColor" >
274289 < circle cx = "12" cy = "12" r = "10" stroke = "currentColor" strokeWidth = "2" fill = "none" />
275- < text x = "12" y = "16" textAnchor = "middle" fontSize = "12" fontWeight = "bold" > ? </ text >
290+ < text x = "12" y = "16" textAnchor = "middle" fontSize = "12" fontWeight = "bold" > i </ text >
276291 </ svg >
277292 </ span >
278293 < Tooltip id = { tooltipId } />
0 commit comments