Conversation
…wn table Small number values in the breakdown table below charts showed '<0.0001' with a tooltip that rounded to '0' for very small values. Replace the threshold indicator with scientific notation (e.g., '3.35E-5'), which shows the actual value and eliminates the need for a tooltip. Refs DAIN-1430 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DominikB2014
left a comment
There was a problem hiding this comment.
Code lgtm!
I'm assuming you got design to approve this? I'm wondering if we could do a more dynamic approach, i.e if we can fit the full number do that, otherwise use scientific notation.
|
@DominikB2014 it's targeted-ish! Scientific notation is only used for |
Make sense! I meant more so dynamic with available space, but we can figure that with design like u said |
Small number values in the breakdown table below charts showed
<0.0001with a tooltip that displayed0for very small values (becausetoLocaleString()without options rounds aggressively).This replaces the threshold indicator with scientific notation (e.g.,
3.35E-5), which shows the actual value precisely and eliminates the need for a tooltip. This aligns with the number formatting guidelines proposed in #112410 (though, those are in discussion)Changes:
formatBreakdownLegendValuenow returns scientific notation (3 significant digits) for smallnumber-type values instead of<0.0001<Tooltip>wrapper for small numbers inVisualizationWidgetsince the value is no longer obfuscatedformatBreakdownLegendValueI didn't bother changing anything else for this PR, though in the future as we solidify the guidelines we'll implement them more rigorously.
Closes DAIN-1430