Sankey diagrams are a kind of flow diagram, in which the width of the arrows is shown proportionally to the flow quantity. They are typically used to visualize energy or material or cost transfers between processes.
Questions tagged [sankey-diagram]
752 questions
1
vote
2 answers
Sankey plot link splitting - is it possible to have two links flow from one node?
I want to alter the Sankey plot I made using networkD3 R package so that multiple links flow from one node, here is what I did so far:
header of random sample of data:
Study Category Class
…

DeMelkbroer
- 629
- 1
- 6
- 21
1
vote
0 answers
Add legend to a riverplot
I've been having fun playing around with the riverplot package, as in the below example.
Is there a way to add a legend to a riverplot, showing what the colors correspond to? I'm imagining something below the plot with blocks of colors and text…

PaulB
- 299
- 1
- 11
1
vote
1 answer
How do I display a Sankey Diagram made using Plotly (on Python) in Power BI?
I have some code that works well in Jupyter notebook. However, when I create a Python visual in Power BI, it opens in a browser instead. To note, I saved the components of the visual (data, color, labels) into one dataframe in order to use it in…

Meggy
- 67
- 1
- 9
1
vote
1 answer
ggplot sankey diagram of income to expenses (ggsankey)
I am trying to make an income to expenses sankey diagram, preferably with ggsankey or another ggplot extension, because I need the final plot as an image (png). Here is my data:
data <- tibble::tribble(
~Name, ~Annual.Amount, …

Ljupcho Naumov
- 196
- 2
- 12
1
vote
1 answer
How to use an Alluvial Plot (or Sankey diagram) to show change of categories over time using R
I am trying to use an Alluvial plot (Sankey diagram) to show the change of different categories over two time periods. I was able to create a plot that makes sense to me when all the factor levels are represented in both time periods (pre and post),…

user1626688
- 1,583
- 4
- 18
- 27
1
vote
2 answers
D3 Sankey customization
Most libraries provide limited customization of the Sankey chart (like node color, width, padding).
Default Sankey chart (d3):
But what if I need to change node heights and center the nodes vertically? How I can do that?
My requirements:
Can…

Руслан Більмаковський
- 23
- 1
- 5
1
vote
1 answer
Hide plotly sankey nodes and links while preserving total node value
I would like to hide specific nodes (in my case, the rightmost) while preserving the size of intermediate nodes. As a simplistic example:
import plotly.graph_objects as go
link_data = dict(
source = [0,1,1],
target = [1,2,2],
value =…

Docuemada
- 1,703
- 2
- 25
- 44
1
vote
1 answer
Making the color of links the same as source nodes in Sankey Plot, Plotly in R
So I haven't found any clear solutions in the r documentation for the Sankey diagram, and hoping someone could help me! All I want to do is make the links the same color as the source node, and have the link darken when hovering above it. Here's my…

Armen Abagyan
- 11
- 1
- 3
1
vote
0 answers
saving a sankey to a file from jupyter
I have a loop where I want to render some sankeys to .png files.
Checking some docs here:
https://nbviewer.jupyter.org/github/ricklupton/ipysankeywidget/blob/master/examples/Exporting%20Images.ipynb
I would expect sankey.save_svg('test.svg') to…

dcsan
- 11,333
- 15
- 77
- 118
1
vote
1 answer
Plotly AttributeError: 'dict' object has no attribute 'write_html'
I'm attempting to export a Plotly graph as HTML, and the various documentation and SO threads out there suggest methods that fail on the figure object (a dict). Any help appreciated. The final lines are the ones causing the error. The diagram plots…

Encomium
- 257
- 4
- 14
1
vote
1 answer
Plotly animated Sankey rescaling R
I've created a large animated sankey diagram with Plotly in R. At each step in the animation Plotly rescales the the height of the links, whereas the height should be constant over time. That is, a link with a constant value should always have the…

Julian
- 11
- 3
1
vote
0 answers
Increase height of Sankey Highcharts data series bar
Using Sankey chart of highcharts, I need to know if it's possible to increase the height of the bar that is associated with each of the data, and also to show additional information in the tooltip for each of the series data in a new line.
I tried…

Shaun
- 461
- 5
- 13
1
vote
2 answers
Additional Labels in Plotly Sankey Diagram
I created a Sankey Diagram using Plotly in R and want to add vertical labels to the far left and right of the plot. Is this possible? I found the possibility of Annotations in Plotly but can't get it to work with the Diagram.
Code looks like…

Ntgllr
- 85
- 6
1
vote
0 answers
Sankey chart with fixed node height
I'm currently working on a Sankey plot using NetworkD3 library in R.
I have to plot a Sankey with fixed height irrespective of the population.
I tried using the value parameter but was able to do that for first column of nodes but for the other node…

sammy
- 11
- 2
1
vote
1 answer
Sankey NetworkD3: set link colours across entire flow
I have been following examples on stack to create Sankey charts using the NetworkD3 package. I would like to set the colour of the links specific to column variables event. The data that I have has multiple columns:
structure(list(names = c("bell",…

kpm
- 53
- 5