You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug is in the determination of the tick format precision when the scale’s domain is collapsed (here, [0.5, 0.5], meaning that the start and end values are the same). When the domain is collapsed we should not attempt to compute the precision but should instead use the default of 6 while trimming trailing zeroes.
Activity
mbostock commentedon Jan 13, 2026
Here’s an even smaller reduction…
You can workaround it by setting the tickFormat option explicitly, say:
The bug is in the determination of the tick format precision when the scale’s domain is collapsed (here, [0.5, 0.5], meaning that the start and end values are the same). When the domain is collapsed we should not attempt to compute the precision but should instead use the default of 6 while trimming trailing zeroes.
mbostock commentedon Jan 13, 2026
This is really a bug in d3-scale/d3-format:
The problem is that tickStep returns zero for a collapsed domain:
Then precisionFixed returns 0 (which should probably be NaN or Infinity?):
This then results in a zero precision format: