@@ -103,6 +103,18 @@ function updateStatisticsHeader() {
103103 parts . push ( `Total ${ formatTooltipInteger ( histogramState . total ) } ` ) ;
104104 }
105105
106+ if ( Number . isFinite ( histogramState . zeroCount ) && histogramState . zeroCount > 0 ) {
107+ parts . push ( `Zeros ${ formatTooltipInteger ( histogramState . zeroCount ) } ` ) ;
108+ }
109+
110+ const clippedLow = Number . isFinite ( histogramState . clippedLow ) ? histogramState . clippedLow : 0 ;
111+ const clippedHigh = Number . isFinite ( histogramState . clippedHigh ) ? histogramState . clippedHigh : 0 ;
112+ if ( clippedLow > 0 || clippedHigh > 0 ) {
113+ const lowLabel = formatTooltipInteger ( clippedLow ) ;
114+ const highLabel = formatTooltipInteger ( clippedHigh ) ;
115+ parts . push ( `Outliers ${ lowLabel } low / ${ highLabel } high` ) ;
116+ }
117+
106118 if ( Number . isFinite ( histogramState . rangeMin )
107119 && Number . isFinite ( histogramState . rangeMax )
108120 && histogramState . rangeMax >= histogramState . rangeMin ) {
@@ -140,6 +152,9 @@ function syncHistogramToViewport(fetchAfterResize) {
140152 histogramState . bins = [ ] ;
141153 histogramState . maxCount = 0 ;
142154 histogramState . total = 0 ;
155+ histogramState . clippedLow = 0 ;
156+ histogramState . clippedHigh = 0 ;
157+ histogramState . zeroCount = 0 ;
143158 clearHistogramCanvas ( ) ;
144159 if ( heatmapState . tensor && fetchAfterResize ) {
145160 void fetchHistogram ( ) ;
@@ -197,12 +212,18 @@ async function fetchHistogram() {
197212 const maxCount = Number . isFinite ( data . maxCount ) ? Number ( data . maxCount ) : 0 ;
198213 const rangeMin = Number . isFinite ( data . min ) ? Number ( data . min ) : Number . NaN ;
199214 const rangeMax = Number . isFinite ( data . max ) ? Number ( data . max ) : Number . NaN ;
215+ const clippedLow = Number . isFinite ( data . clippedLow ) ? Number ( data . clippedLow ) : 0 ;
216+ const clippedHigh = Number . isFinite ( data . clippedHigh ) ? Number ( data . clippedHigh ) : 0 ;
217+ const zeroCount = Number . isFinite ( data . zeroCount ) ? Number ( data . zeroCount ) : 0 ;
200218 histogramState . tensor = heatmapState . tensor ;
201219 histogramState . slice = typeof data . slice === "number" ? data . slice : heatmapState . slice ;
202220 histogramState . bins = bins ;
203221 histogramState . maxCount = maxCount ;
204222 histogramState . rangeMin = rangeMin ;
205223 histogramState . rangeMax = rangeMax ;
224+ histogramState . clippedLow = clippedLow ;
225+ histogramState . clippedHigh = clippedHigh ;
226+ histogramState . zeroCount = zeroCount ;
206227 if ( Number . isFinite ( data . total ) ) {
207228 histogramState . total = Number ( data . total ) ;
208229 } else {
@@ -249,6 +270,9 @@ function resetHistogram(message = STATISTICS_DEFAULT_HEADER_MESSAGE) {
249270 histogramState . bins = [ ] ;
250271 histogramState . maxCount = 0 ;
251272 histogramState . total = 0 ;
273+ histogramState . clippedLow = 0 ;
274+ histogramState . clippedHigh = 0 ;
275+ histogramState . zeroCount = 0 ;
252276 histogramState . rangeMin = Number . NaN ;
253277 histogramState . rangeMax = Number . NaN ;
254278 histogramState . fetching = false ;
0 commit comments