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
2
votes
1 answer
How to add Axis labels using networkD3 in R
I'm making a Sankey diagram using the networkD3 package, I have included my code below. I want to add a title, footnotes, and label both the left side and right side of the diagram. But I'm not sure how to do this as networkD3 has no built in…

jessie Jones
- 23
- 3
2
votes
1 answer
Creating Sankey diagram in R; making the plot output interpretable
I am creating Sankey diagrams for the first time in R, showing the connections between antecedent and consequent events and the number of times that they occur. Here is a mock example of the type of data that I am working with:-
#df…

metaltoaster
- 380
- 2
- 15
2
votes
1 answer
How to convert category data to Sankey plot in python?
I have a data:
for eg:
Roll no. 1 2 3 4
0 30 Good Fair Excellent Good
1 31 Poor Fair Good NaN
2 34 Excellent Good Poor Fair
3 35 Good …

Pri D
- 55
- 4
2
votes
1 answer
Plotly Sankey Diagram, aligning nodes
I created a Sankey diagram using plotly (python) and it looks like this:
As you can see, some links overlap, but this plot can be easily changed (manually) to this:
I think the overlapping result comes from the 3rd column of nodes being centered…

Koen
- 174
- 1
- 10
2
votes
1 answer
floWeaver does not draw basic diagrams from quick tutorial and does not show error message
Following the floWeaver tutorial and beginning with the Quickstart where flows are defined, the second step of plotting the flows does not work. The problem is that I do not get any error message.
The code consists of two blocks, with the second…

Ale
- 21
- 3
2
votes
1 answer
How to create a sankey diagram when certain values are omitted
I need to create a sankey diagram in R with plotly over 3 years. My group column should be the nodes (1 == worst, 2 == bad, 3 == good and 4 == best), but however in year 2019 and 2020 I have/need an additional node 5 == not available.
My data is…

MikiK
- 398
- 6
- 19
2
votes
1 answer
Remove text labels in Plotly Sankey diagram, but keep the data when hovering [Plotly Python Sankey question]
I want to keep the labels when you hover, but hide the labels from just appearing over the Sankey as text.
Here is my code:
labels = df_mapping['Name'].to_numpy().tolist() + labels
count_dict = {}
source = []
target = []
value =…

Amateur Pythoner
- 43
- 5
2
votes
0 answers
Sankey plot in R, display numbers/frequencies by default
I'd like to make a sankey plot in R and save it as a non-interactive picture (e.g. jpeg/png). However I'd like to show the numbers or frequencies of the flows by default, without hovering over the flows in R.
Is there any way to do this? I couldn't…

Jajo123
- 75
- 4
2
votes
2 answers
Alluvial plot in R: how to space the strata?
Background
I have been working on creating an alluvial plot (kind of Sankey diagram) using ggplot and the ggalluvial package to visualize frequency differences over time and their origins.
As example, I have created a simple dataset of 100 imaginary…

user213544
- 2,046
- 3
- 22
- 52
2
votes
0 answers
Plotly Sankey constant link thickness
I would like to be able to specify a maximum length for Sankey plot links.
My use case is the following : using a Plotly slider, I dynamically remove/add links. In my plot, the number of links ranges from very few links (e.g. 3) too many links (e.g.…

Yoann
- 112
- 6
2
votes
0 answers
Trying to sort the nodes in Sankey Diagram using R?
I used application called 'displayr' to create a sankey digaram and it will generate the chart based on the spreadsheet you upload. However, I want to sort the right part of the nodes to make it more visual. It will be best to sort the data by DESC…

严蓉冰
- 53
- 3
2
votes
1 answer
Plotly Sankey Diagram: color defaults to black and labels not showing
I'm having the toughest time getting a simple Sankey diagram to work using the Plotly library. The data are simple:
Individuals are grouped in six different categories (UE,UI,EU,EI,IE,IU).
Every month, individuals can move from one group to…

Encomium
- 257
- 4
- 14
2
votes
2 answers
Create a Sankey Diagram with tidy data in R
I have 'tidied' my data in R using dplyr and tidyr functions and have created a data frame that looks as follows:
df <- data.frame(PROD = c("A","A","A","A"), REJECT = c("YES","YES","NO","NO"),ALT_PROD = c("A","B","C","D"), VALUE =…

TheGoat
- 2,587
- 3
- 25
- 58
2
votes
0 answers
How can I sort the nodes of Sankey chart in rechart?
I want to sort my nodes in Sankey chart. How can I do that?
For example, for the following data:
const data0 = {
nodes: [
{ name: "L0" },
{ name: "L1" },
{ name: "L2" },
{ name: "L3" },
{ name: "L4" },
{ name: "R5" },
{…

Vahid Boreiri
- 3,418
- 1
- 19
- 34
2
votes
1 answer
Is there a way to put chart created in google apps script in a tab on google sheet?
I am new to google apps scripts and coding but I created a Sankey diagram in google apps script using the google visualization HTML code. I am using the data from a google sheet because it is dynamic data. Currently I successfully deployed the…

Caroline
- 31
- 3