d3 / d3

Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:
https://d3js.org
ISC License
109.09k stars 22.86k forks source link

Treemap rounding buggy? #136

Closed mbostock closed 13 years ago

mbostock commented 13 years ago

Need to investigate… saw some fishy cases, negative sizes.

jasondavies commented 13 years ago

I'm seeing something like this too: https://github.com/jasondavies/d3/tree/treemap-bug (see the treemap-svg example).

It also occurs with zero padding and with the code prior to padding being added. It seems like the rounding error correction is a likely culprit, but I haven't managed to figure it out yet.

mbostock commented 13 years ago

Nice, thanks for the reproducible example! We should be able to plug this into the treemap-test and figure out a solution.

jasondavies commented 13 years ago

Looks like there are three instances of negative widths/heights, and three overflowing cells, so these may be related.