Skip to content

How do I set default order of my sankey diagram? #960

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

Closed
chankuyeo opened this issue Mar 7, 2018 · 9 comments
Closed

How do I set default order of my sankey diagram? #960

chankuyeo opened this issue Mar 7, 2018 · 9 comments

Comments

@chankuyeo
Copy link

Whenever I display my sankey diagrm(sankey chart) with python plotly,
the order of nodes change depending on some unknown rules.
How do i fix the order of the nodes?

@cldougl
Copy link
Member

cldougl commented Mar 8, 2018

Hi there,
It is not possible to set default ordering at this time. You can see the list of available sankey attributes here: https://plot.ly/python/reference/#sankey
The attributes of the sankey chart are determined in our plotly.js repo (plotly's core graphing library).
We ask users to reserve issues in this repo for bugs with Plotly's python api, if you have additional plotting questions feel free to post in our community forum: https://community.plot.ly/

@cldougl cldougl closed this as completed Mar 8, 2018
@lrlucchini
Copy link

@cldougl could you shed some light into the logic to determine the ordering of the nodes? How is it decided which ones are rendered on top?

@chriddyp
Copy link
Member

This is done automatically by plotly.js. Custom ordering is currently being worked on in plotly/plotly.js#3583.

@aesharpe
Copy link

aesharpe commented Jul 30, 2019

Hi! Is this still not possible? It seems like defining node order would be a great feature (I'm currently trying to make my sankey more static). I've used the arrangement = 'fixed' attribute to help, but I'd now like to define a fixed node order if possible.

@lrlucchini
Copy link

lrlucchini commented Jul 31, 2019 via email

@theophile-dh
Copy link

I don't know if it's still relevant, but you can actually drag and drop them on the UI. Far from perfect, but it will save you if you have a presentation to make quickly ;)

@lucasrodes
Copy link

lucasrodes commented May 31, 2020

Any updates? I was trying to manually define the positions of the nodes with x and y arguments of node. For both x and y I use values between 1 and 0 (these not included). Seems to work ok until I change the value of the orientation to vertical, i.e. orientation='v'.

How does these normalized values x and y actually work? Thanks

@thenineteen
Copy link

I have to agree this is very disappointing as half the value of a Sankey diagram is in its presentation and being able to eyeball trends. For example, if the first level is by Year, a random order is not useful for deciphering patterns.

@chriddyp
Copy link
Member

chriddyp commented Oct 1, 2020

@thenineteen et al - As mentioned above, can you please create a new issue in the plotly.js repo and comment when you do so? That’s where the rendering work is done for plotly.py. A new issue in the proper repository will get more attention than one that’s been closed for 2.5 years :) https://github.com/plotly/plotly.js/issues

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

No branches or pull requests

8 participants