My New Sankey Article on Medium

Hi All, I have written a new article about styling Sankey charts and posted it on Medium. It contains information on the following/

  • Specifying colours for nodes
  • Specifying colours for links
  • Specifying X and Y coordinates for nodes
  • Adding annotations to the Sankey
  • Hiding label text on the diagram but having it available when hovering your mouse over an area.

With the above information, I was able to create this.

The article can be found at the following link Further Adventures in Plotly Sankey Diagrams | by Tom Welsh | Apr, 2023 | Medium

1 Like

Thank you Tom,

Itโ€™s amazing. Love the way you setting annotation for each node.
Iโ€™m thinking about using your code to make a Sankey diagram to show financial distribution. Need to think more about arrange my data.

Thanks @hoatran.

It was an interesting exercise. The annotations do bring the Sankey to life but are a tedious job to start with. Knowing the centre is x = 0.5, y = 0.5 really helped in the end. As you add more annotations you get very good at โ€˜guesstimatingโ€™ positions on the chart. Below is my basic understanding of positioning.

Feel free to use my code. It would be excellent to be able to work out how to automatically set annotation positions.
I look forward to seeing what you come up with