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-squarify: skip zero values to avoid breaking treemap #69

Closed
wants to merge 1 commit into from
Closed

Treemap-squarify: skip zero values to avoid breaking treemap #69

wants to merge 1 commit into from

Conversation

technix
Copy link

@technix technix commented Nov 20, 2016

If there are zero values in the treemap data, the treemap itself renders incorrectly when 'squarify' algorithm is used:
diagram
It happens because of division by 0. As a result, newRatio becomes equal to Infinity, and never changes back.

Archive with the working example of the issue: d3-issue-example.zip

@mbostock
Copy link
Member

Duplicate of #68; fixed in a1a0399.

@mbostock mbostock closed this Nov 20, 2016
@mbostock
Copy link
Member

(Also, the committed fix correctly handles the leading zero at the start of a squarified row or column.)

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.

2 participants