-
Notifications
You must be signed in to change notification settings - Fork 254
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
Add support for additional Sankey diagram orientations #110
Conversation
This reverts commit 4aec193.
This reverts commit d813a6b.
- Export per-orientation constructors (sankeyTop, ...) - Rename alignment options (sankeyLeft -> sankeyAlignLeft, ...) - Rename orient* functions and variables to transform* - Move transformNodes function within Sankey class - Remove orientation getter/setter - Remove export of orientations
Co-authored-by: Curran Kelleher <[email protected]>
LGTM! |
Thanks for the review @curran! |
I've successfully used this fork to create a vertical sankey - keen to see it merged so I can depend on the official |
Thanks @jtfell - there seems to be some consensus building that maintaining a fork with these changes would be more successful than getting them included in-library here. I don't feel like I'd be an effective maintainer for a separate package (neither JavaScript nor diagramming are expertises of mine), and also I'd like to reduce the set of pull requests that I have open, so I'm going to close this. As an alternative, it's possible to use SVG transformations ( |
This looks great. Would it be possible to change the orientation independently for each node? One source from the left, one sink to the right, and one sink to the bottom? https://datavizcatalogue.com/methods/images/anatomy/sankey_diagram.png |
Adds orientation-specific sankey generator constructors:
sankeyTop
(top-to-bottom),sankeyRight
(left-to-right),sankeyBottom
(bottom-to-top) andsankeyLeft
(right-to-left).A new function
linkShape
is exposed on thesankey
generator which allows the caller to retrieve the 'correct' D3 link shape matching the orientation of the constructor.This was developed against a working copy of https://github.com/LonnyGomes/sankey-diagram-poc, with one styling modification applied for vertical mode: updating text element positioning logic to improve readability.
Bottom-to-top
Top-to-bottom
Right-to-left
Left-to-right
Resolves #55.
Revives #71.