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

Fix for large padding #63

Closed
wants to merge 3 commits into from
Closed

Conversation

antoinerg
Copy link

As shown in this Codepen using Plotly.js which is wrapping d3-sankey (https://codepen.io/anon/pen/vvgYEx) when nodePadding is too large, nodes end up with negative heights. This PR fixes this by reducing the padding appropriately to use at most 2/3 of the total vertical space.

@mbostock
Copy link
Member

mbostock commented Sep 1, 2019

Hey, thanks for the suggestion and sorry for the delayed response. This PR includes the built files (which shouldn’t be checked in), and the implementation also mutates the value of py, whereas what we should be doing instead is using a different value for py while computing the layout, such that the specified sankey.nodePadding is preserved if the layout is called again (and no reduction in the padding is required). I’m going to close this PR and try to tackle this issue myself but if you are still inclined to contribute, please reopen this PR or submit a new one. Thank you!

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