Readable Sankey Plot; Zoom and Pan does not appear as options in graph window

I’m generating Sankey plots in a Dash App on the fly by filtering through a data frame. Some Sankey plots get very cluttered and I have not found a good way to solve this problem programatically.

Do more experienced users have any suggestions/code that can make cluttered diagrams more readable? I am already slicing the data into smaller bits which helps with readability, but sometimes a Sankey plot may have too many nodes which makes it very wide and so the plot gets squished in the middle.

Zooming and Panning could solve this issue but for some reason Zoom or Pan does not appear as options in a Sankey plot window.


That’s a good idea. Do you have a screenshot that you could share?

@chriddyp I’ve got one

I tried setting modeBarButtons and modeBarButtonsToAddwith zoom2d but it failed silently and no figure is produced.

Wow, that’s impressive. What if you make the height really tall for now?

Yep easily done but dynamically selecting the height is a little trickier. I have a set of filters that adjust the content, often you might have a sankey with a handful of elements vertically, yet other times you end up with the giant mess shown above.

Giving the user control would make it easier. Actually at the moment I have a button to download the Sankey and the user can select the resolution they would like.

Conventional plot-making (not necessarily Dash/Plotly) wisdom would be to group these professions into larger brackets: industry/manufacturing, healthcare, administration,…

Yes I’m aware, but sometimes you just want to see the raw data. It would still be nice to have zoom and panning controls.