Skip to content

allow users to sort nodes in Sankey plot #4373

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

Open
Mahdis-z opened this issue Nov 20, 2019 · 7 comments
Open

allow users to sort nodes in Sankey plot #4373

Mahdis-z opened this issue Nov 20, 2019 · 7 comments
Labels
feature something new P3 backlog

Comments

@Mahdis-z
Copy link

Would be very useful to add a feature to enable users to sort nodes based on their desired output.

@etpinard
Copy link
Contributor

@antoinerg can you confirm that the current sankey implementation does not allow sorting nodes?

@antoinerg
Copy link
Contributor

@etpinard I confirm we don't currently allow sorting nodes. However, it seems like underlying engines support it:

@etpinard etpinard added the feature something new label Nov 26, 2019
@1kastner
Copy link

It would be great to have this feature!

@hohuyhoangg
Copy link

@archmoj I really need this feature.

@adamreeve
Copy link
Contributor

I'm also interested in this feature, and had a look into implementing this. The main challenge is that the plotly fork of d3-sankey (https://github.com/plotly/d3-sankey) is quite old and doesn't include the nodeSort feature, so either that feature needs to be ported to the plotly fork, or recent changes from upstream need to be merged into the fork. plotly/d3-sankey-circular would also need updating.

Then you can simply call sankey.nodeSort(null) so that the order of nodes is based on the order in the input array rather than letting the layout reorder them.

@scodesido-at-proton
Copy link

Pinging here, this feature would be really useful for reproducibility. I understand we can specify x/y coordinates, but if I have to do a nontrivial layout like that, I may as well paint traces myself without using Plotly. It is a bit weird that this is supported by the underlying d3 but plotly cannot expose. This kind of issue has been open for years now...

@gvwilson gvwilson self-assigned this Jul 8, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson changed the title Sankey: sort nodes allow users to sort nodes in Sankey plot Aug 9, 2024
@gvwilson gvwilson added the P3 backlog label Aug 9, 2024
@Nats1rt
Copy link

Nats1rt commented Feb 28, 2025

Would still be useful. It makes the use of Sankey diagrams combined to sliders rather irrelevant, as position of the nodes might change at each step...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 backlog
Projects
None yet
Development

No branches or pull requests

9 participants