Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treemap don't display single elements with a zero value properly #2657

Closed
romsson opened this issue Nov 25, 2015 · 1 comment
Closed

Treemap don't display single elements with a zero value properly #2657

romsson opened this issue Nov 25, 2015 · 1 comment

Comments

@romsson
Copy link

romsson commented Nov 25, 2015

A single element with a zero value (mapped to size) appears as a fairly large rectangle (bottom right on attached screenshot) while it should not be visible at all. See http://bl.ocks.org/romsson/133279a7548a5f4a59c9 (tested with v3.5.9)

This may probably be already part of the treemap layout rewriting effort but this is a case I haven't see mentioned in the list of tests (#2419 and #2419).

screen shot 2015-11-25 at 3 47 06 pm

@mbostock
Copy link
Member

Duplicate of d3/d3-hierarchy#2.

The rounding mechanism in 3.x is flawed; it ensures that rounded cells are exactly the same size, but then assigns any unused space to the last cell, even if that cell has zero area. This is fixed in d3/d3-hierarchy#14, although that pull request is not yet finished. (I also plan on supporting tabular input data; see d3/d3-hierarchy#18.)

So, there will be a lot of improvements to this layout in 4.0, but the work isn’t quite done yet. Due to the substantial nature of the rewrite, I’m not planning on back-porting the features to 3.x, though it should be easy for you to pull in just the new d3-hierarchy module when it’s released and use that with the rest of 3.x (just replacing the treemap layout).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants