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
0
votes
1 answer
Iterating over a dataframe twice: which is the ideal way?
I am trying to create a dataframe for Sankey chart in Power BI which needs source and destination like this.
id
Source
Destination
1
Starting a
next point b
1
next point b
final point c
1
final point c
end
2
Starting a
next point…

Rach
- 37
- 5
0
votes
0 answers
Sankey diagram of HIGHCHARTS, highchart-node duplicate line (left line and right line)
How to show 1 line of node in sankey diagram highcharts?
in ['Portugal', 'Portugal', 2], I want to show only one line (right) and set height of only this line smaller.
Please help me!
link: https://jsfiddle.net/nd28eymv/
In my picture, I want to…

Dương Thành Nhân
- 1
- 1
0
votes
0 answers
Control columns in Sankey diagram
I wish to use create a Sankey diagram in R with the sankeyNetwork() function from networkD3 where I want to control in what "columns" nodes are located. Consider the following code
library(networkD3)
links <- data.frame(source=c("1_a", "1_b",…

matnor
- 479
- 1
- 5
- 17
0
votes
0 answers
labeling values over the link and nodes in Sankey Diagram with networkD3
Following is the code I used to create Sankey diagram -
links <- FinalFlow
# From these flows we need to create a node data frame: it lists every entities involved in the flow
nodes <- data.frame(
name=c(as.character(links$From),
…

Kazi Masel
- 25
- 4
0
votes
2 answers
plotly sankey diagram positioning
I'd like to add some annotations to Plotly Sankey diagram.
And I want to draw them right over the blocks of sankey nodes (with the same x-position)
but couldn't find the way to do it, or even to find the X coordinates of nodes. (Think it would be…

Denis Ka
- 137
- 1
- 1
- 10
0
votes
1 answer
Column Labels in Sankey Charts in Highcharts
I've been working on a visualisation using Sankey chart using Highcharts library. It looks like below.
I need help with adding labels to each column as highlighted in the above image. I couldn't find any workaround using formatters since there are…

Sai Babu B
- 162
- 2
- 14
0
votes
2 answers
How can we format numbers in a Sankey chart and set labels outside of the chart?
I've got some simple code that produces a nice Sankey chart.
import holoviews as hv
import plotly.graph_objects as go
import plotly.express as pex
hv.extension('bokeh')
sankey1 = hv.Sankey(df_final, kdims=['Sub_Market', 'Sport League'],…

ASH
- 20,759
- 19
- 87
- 200
0
votes
1 answer
Sankey graph not displaying outflow and target undefined
I created a Sankey graph from a dataframe using this SO squestion. but my target shows undefined when I hover the graph, my outflowing count also displays 0
below is my code and my dataframe.
# imports
import pandas as pd
import numpy as np
import…

chuky pedro
- 756
- 1
- 8
- 26
0
votes
0 answers
Sankey Diagram in Plotly Dash
I want to create a Sankey diagram in plotly dash related to a time dropdown. I guess I'm not really understanding how to do so! The dropdown is done correctly, but the Sankey is kind of hard for me.
I have a dataframe with multiple columns which I…

jackie
- 39
- 5
0
votes
0 answers
Sankey Diagram with D3 - links coloring
I'm trying to render a Sankey Diagram based on this example.
TL:DR - The color() function works for coloring the nodes but not the links.
While I got it working and rendering (I'm using latest version of D3 and React inside of Next.js), I'm having a…

OmerWow
- 21
- 5
0
votes
0 answers
Cannot understand python sankey plot, and how source/ target work
I am stuck on sankey plots. I would like the green bar on the image below to represent a width of 525, but at the moment it is 1131. I think this is because the source is the purple 1131 to the left of the green, but I cannot figure out how to…

firefly
- 339
- 2
- 10
0
votes
2 answers
Sankey diagrams only support acyclic graphs - error message I get
So I'm trying to generate a snakey diagram from this dataframe :
a b v
0 0 0 1
1 0 2 1
2 0 3 2
3 1 0 1
4 1 1 1
5 1 2 2
6 1 3 2
7 2 0 1
8 2 1 3
9 3 0 1
10 3 1 2
11 3 3 1
12…
user9364978
0
votes
1 answer
sankeyNetwork Function - Help required to set Node and Link data frame
I'm trying to create a Sankey Diagram for the following dataset (only categorical variables), but I'm not having luck setting up the sankeyNetwork parameters (target, source, value).
Find below my code.
Could you please help me clarify what is wrong…

mndsnascimento
- 3
- 2
0
votes
0 answers
Plot 2 plots- 1 from NetworkD3 and one from plot function
I'm trying to add legend to sankey network plot using NetworkD3 library and as NetworkD3 does not have a legend option, I'm trying to create a legend by using legend() function however its not working.
This is what I tried, but it gives only the…

sammy
- 11
- 2
0
votes
0 answers
Sankey Network- Display nodes with no target
So I'm currently trying to create a sankey network tracking a patient's treatment journey.
The problem is some patients would stop with the first treatment and not go to the second.
I'm currently using networkD3 and I'm forced to remove all the…

sammy
- 11
- 2