Skip to content

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

Closed

Description

@chankuyeo

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?

Activity

  1. cldougl commented on Mar 8, 2018

    @cldougl
    Member

    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/

  2. lrlucchini commented on Mar 14, 2019

    @lrlucchini

    @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?

  3. chriddyp commented on Mar 14, 2019

    @chriddyp
    Member

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

  4. aesharpe commented on Jul 30, 2019

    @aesharpe

    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.

  5. lrlucchini commented on Jul 31, 2019

    @lrlucchini
  6. theophile-dh commented on Apr 1, 2020

    @theophile-dh

    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 ;)

  7. lucasrodes commented on May 31, 2020

    @lucasrodes

    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

  8. thenineteen commented on Sep 30, 2020

    @thenineteen

    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.

  9. chriddyp commented on Oct 1, 2020

    @chriddyp
    Member

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions