Skip to content

regression fix: the last bin is sometimes 2x too wide - #297

Open
Fil wants to merge 1 commit into
mainfrom
fil/fix-bin-extend-rounding
Open

Fil wants to merge 1 commit into
mainfrom
fil/fix-bin-extend-rounding

Conversation

@Fil

@Fil Fil commented Nov 9, 2026

Copy link
Copy Markdown
Member

With the default domain, when the maximum is a threshold, bin extends the domain by one step. Since #283 (3.2.5), this happens for domains such as [0, 0.07], because Math.ceil(0.07 * 100) is 8. The domain was extended by two steps, and bin().thresholds(7)([0, 0.07]) ended with [0.07, 0.09].

Fixes #294

@Fil
Fil requested a review from mbostock November 9, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

regression: d3.bin's last bin is twice as wide when the maximum is a threshold

1 participant