Understanding Plotly Sankey Diagrams

Tom Welsh
15 min readOct 30, 2022

An adventure of sorts

A Plotly Sanket chart showing an example Operational Risk Taxonomy flow
Sankey of a possible Operational Risk Taxonomy Mapping — Image by Author

I have wanted to utilise Sankey diagrams to analyse data for some time. However, I have always found it daunting to figure out how to set these up. For some reason or another, I managed not to 'find time to dig into this area.

Well, that was till this weekend. What's a guy meant to do when they find themself at a loose end, with no family around, and nothing needs doing? It looks like it's Sankey time!!

What is a Sankey Diagram?

A Sankey diagram can display the flow of information, resources, etc., through a process. The thickness of the lines denotes where the process is most active, and thinner lines reflect the opposite.

Let's start at the beginning.

As I started learning about Sankeys, I realised that I would need to look on Medium, Python in Plain English, or Stackoverflow for learning resources. So I started with an article from Arslan Shahid on Python in Plain English, which was a great start. He provided some handy insights, and the following resonated with me.

I would highly encourage you to try different configurations manually to figure out how the diagram would change. Try adding more nodes and more intricate links etc. — Arslan Shahid, Python in Plain English

--

--

Tom Welsh

Python aficionado, passionate about data analysis & visualization. Tech-savvy, Cybersecurity & Risk professional by day, Linux & IT infrastructure by night.