Skip to content

Fix for large padding - #63

Closed
antoinerg wants to merge 3 commits into
d3:masterfrom
antoinerg:fix-large-padding
Closed

antoinerg wants to merge 3 commits into
d3:masterfrom
antoinerg:fix-large-padding

Conversation

@antoinerg

Copy link
Copy Markdown

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.

@antoinerg antoinerg mentioned this pull request Jan 17, 2019
3 tasks done
@mbostock

mbostock commented Sep 1, 2019

Copy link
Copy Markdown
Member

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