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
Changing the style of Sankey/Alluvial plot with different color palettes for categorical data
I am trying to change the color of Sankey/alluvial plot using Plotly.
Fake data is available here
import plotly.express as px
fake = pd.read_csv('Fake.csv')
fig = px.parallel_categories(fake)
fig.show()
My ideal output - the same plot but colored…

Anakin Skywalker
- 2,400
- 5
- 35
- 63
0
votes
0 answers
Align nodes horizontally based on group with networkD3 sankeyNetwork in R
I think the answer to this question is "it's not currently supported", which is fine, but I'm hoping to build a sankey diagram with the nodes aligned horizontally based on their group. I found this answer, which allows it to be done manually after…

Daniel Anderson
- 2,394
- 13
- 26
0
votes
0 answers
Assign levels to nodes in multi-level sankey diagram where nodes may not have connections to the first level or the last level
First, let me start by saying that I've read How to assign levels to nodes in multi-level sankey diagram?
It helps but doesn't fully solve the issue.
Also, in my example code below I use the networkD3 package but I don't need to. Any package is fine…

Obed
- 403
- 3
- 12
0
votes
1 answer
Data Visualization of User Path in R
I am working on a clickstream dataset, where I have users, the pages they visited, and the path number (1 = starting page, 2 = next page they visited, etc). I am trying to visualize user paths. I thought a Sankey diagram would be best. But I am at a…

user2845095
- 465
- 2
- 9
0
votes
1 answer
SQL aggregation based on time and location for Sankey graph
I have a situation where I'm trying to get data to populate a Sankey graph.
I have the data with timestamp and the location of the person when captured by the system.
The normal case is when a person location changes and in that case, "from" should…

Diogo Magalhães
- 3
- 1
0
votes
1 answer
Inerting multiple level into sankey diagram using googlevis
I am trying to make a sankey diagram including 6 levels in total in r-studio using the googlevis package. With the help of How to make a googleVis multiple Sankey from a data.frame? I was successful with three levels with the code presented there.…

HOX
- 1
- 1
- 1
0
votes
0 answers
Highchart: sankey how to calculate percentage for the last column
I am calculation with percentage as shown but failing in last column:
https://codepen.io/soureshcoumar/pen/ZExOmbV
nodeFormatter() {
const { point } = this;
const percentage = point.linksTo[0]
? (point.sum /…

Souresh Coumar
- 11
- 1
0
votes
1 answer
highchart: sankey how to add text bold for node text and the percentage as per the image calculations
Hi I am trying bold the labels as per the attached image in the the code base with calculation with percentage as shown
https://codepen.io/SophTooke/pen/ExorZZj
[enter code here][2]

Souresh Coumar
- 11
- 1
0
votes
1 answer
Highcharts sankey diagram node representation empty space
I have succeeded to have in a sankey diagram multiple nodes that have the same origin and same destination with different colors:
(the first blue and first pink aim at the same, second and third too).
But I'd like to make those length proportional…

Augustin Riedinger
- 20,909
- 29
- 133
- 206
0
votes
1 answer
How to enable subsequent same node engagement in Sankey Chart (Plotly)?
I am trying to plot a sankey chart and running into the issue that I am not able to plot same node interactions that happen in sequence. For example, I have sankey_df:
user |date |Source | Target | Price
1 |01-01-2022 |A | B …

titutubs
- 355
- 1
- 9
0
votes
1 answer
R: Align and center text using foreignObject and Sankeynetwork
I created this sankey network:
library(networkD3)
library(htmlwidgets)
library(data.table)
set.seed(1999)
links <- data.table(
src = rep(0:4, times=c(1,1,2,3,5)),
target = sample(1:11, 12, TRUE),
value = sample(100, 12)
)[src < target, ] #…

Ai4l2s
- 525
- 2
- 9
0
votes
0 answers
Converting a class of sankeyNetwork into a grob
I am trying to make a panel plots of 3 sankey diagram in R using networkD3 library. The Sankey diagrams are well generated and I have assigned three variables (p1, p2 and p3) to the plots. Now I want to combine them using ggarrange into one single…

user 26
- 1
- 1
0
votes
1 answer
Alter dataframe based on values in other rows
I'm trying to alter my dataframe to create a Sankey diagram.
I've 3 million rows like this:
client_id | | start_date | end_date | position
1234 16-07-2019 27-03-2021 3
1234 18-07-2021 09-10-2021 1
…

Glarp
- 103
- 1
- 10
0
votes
1 answer
Sorting Sankey chart's source & destination nodes alphabetically
I am creating Sankey chart using Highcharts where I want to sort my source and destination labels alphabetically.
In this image you can see labels are randomly assigned as per data values.
I want to sort those labels for both source and destination.…

TechQ
- 31
- 3
0
votes
1 answer
NetworkD3 sankey plot gives the wrong colors (user-defined colors)
I created a Sankey diagram with the function sankeyNetwork() from the package networkD3. I defined the colors for each node manually with the argument "colourScale" but the plot shows the wrong color for the node named "Solicitação reprovada pelo…

Luisa Souza
- 3
- 1