-
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
Different Link Width at Source and Target #91
Comments
The links generated by this module are made of a central path, connecting the center of the source to the center of the target. Its movement is given by the bump-x curve, and it is painted with a wide stroke. This makes it impossible (to my knowledge) to give it a variable stroke-width. By contrast, Anneya's method is creating an area (with a fill), where the top and bottom edges are two curves, each determined by a (possibly different) bump-x curve. Maybe you could emulate that approach? Unfortunately, using two parallel curves like this results in "squeezed" shapes (the ribbons appear smaller in the middle due to shearing), so it can't be the default method. This might be fixed by computing path offsets with path.getTangentAtLength and so on, but it seems like a lot of work. Refs: |
I've added a solution with @rveciana’s svg-path-properties |
I've just done this using the approach outlined here: https://observablehq.com/@enjalot/weird-sankey-links The only caveat is that I've found an issue here (#92). It may or may not affect you depending on how you use it (we were scaling values either side of a node and so needed to recalculate the link height using the adjacent link positions) hope this helps |
I would like the link width to represent Pr(target | source) at the source node (aka probability for the transition from a given source node to a specific target node) and by contrast, represent Pr(source | target) at the target node (aka probability to transition to a given target node from specific source node). Can this be done?
The motivation is well explained here: https://anneya.ca/articles/2017-10/normalized-sankey-diagrams.html
The text was updated successfully, but these errors were encountered: