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

Problems with the treemap Algorithem. #68

Closed
mark3448 opened this issue Nov 17, 2016 · 3 comments
Closed

Problems with the treemap Algorithem. #68

mark3448 opened this issue Nov 17, 2016 · 3 comments

Comments

@mark3448
Copy link

Trying to follow the examples i met a strange glitch in the treemap code, can't seem to find the problem.
here is a fiddle with the problem:
https://fiddle.jshell.net/40xoLecy/

same code with different data works well:
https://fiddle.jshell.net/40xoLecy/3/

what seems to be the problem with the layout? why is it a a pile of rects?

@mark3448
Copy link
Author

after playing a bit with the data, i found out the 0 is what makes the pile problem , why aren't 0 allowed?

@mbostock
Copy link
Member

Unrelated to your issue (which I am investigating), but you don’t need d3.stratify to create a flat tree. You can use d3.hierarchy:

var rootNode = d3.hierarchy({children: clonedData}).sum(d => d);
mbostock added a commit that referenced this issue Nov 17, 2016
@mark3448
Copy link
Author

mark3448 commented Nov 20, 2016

Thank you for the quick fix, any date on the release?

also using d3.hierarchy makes strange rect layout:
https://fiddle.jshell.net/40xoLecy/4/

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