Questions tagged [sankey-diagram]

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.

752 questions
8
votes
2 answers

Label size in sankey plots (riverplot package)

Use case: I am using the riverplot package to plot sankey charts. I need to adjust the text size of the nodes labels in the plot. The default size is too big in my case. Problem, what I tried already: Unfortunately the package does not work with a…
user2030503
  • 3,064
  • 2
  • 36
  • 53
8
votes
1 answer

Adding Color to Sankey Diagram in rCharts

I've created a sankey diagram in rCharts but have one question. How do I add color? I'd like to represent each node with a different color so it's easier to vizualize the paths, instead of just seeing the same grey lines connecting everything. Code…
user1620666
  • 83
  • 1
  • 4
8
votes
2 answers

Problems while reproducing Sankey chart example with d3_sankey

I am trying to reproduce simple example with rCharts library to plot sankey chart. I found this example from scratch and tried to reproduce it, however, I came up with some problems. Firstly I have tried running this code without nothing. Then I…
adomasb
  • 496
  • 4
  • 14
7
votes
0 answers

How to create sankey diagram with gradient color links in Plotly?

Is there a way to make the links in a Plotly Sankey diagram have a color gradient between the source node color and the end node color? This image is taken from a page linked by the Plotly documentation. I have seen some discussion on GitHub about…
Nick_2440
  • 75
  • 1
  • 13
7
votes
2 answers

Plotly: how to write a text over my Sankey diagram columns?

I've build a Sankey diagram using plotly. I want to name the columns giving each one a column title, like the text in red below: How can I write these column titles?
neves
  • 33,186
  • 27
  • 159
  • 192
7
votes
1 answer

Reorder Sankey diagram vertically based on label value

I'm trying to plot patient flows between 3 clusters in a Sankey diagram. I have a pd.DataFrame counts with from-to values, see below. To reproduce this DF, here is the counts dict that should be loaded into a pd.DataFrame (which is the input for the…
sandertjuh
  • 550
  • 2
  • 13
7
votes
0 answers

Is there a way to change the text alignment in Plotly Sankey diagram?

I am trying to change the orientation of the node label to be left of the node and in the white space for better readability, similar to how the 'C' labels are aligned. import plotly.graph_objects as go fig = go.Figure(data=[go.Sankey( node…
7
votes
1 answer

asymmetrical distance between groups in alluvial diagram

I would like to chance the distances between groups in an alluvial diagram using ggplot2 and ggalluvial my example is from https://corybrunson.github.io/ggalluvial/articles/ggalluvial.html data(vaccinations) levels(vaccinations$response) <-…
captcoma
  • 1,768
  • 13
  • 29
7
votes
1 answer

Fixing the order of a Sankey flow graph in R / networkD3 package

I would like to visualize a rank change (i.e. change of the relative order) of US states using a Sankey flow graph. I'm using the networkd3 package and came up with the following: library(dplyr) library(networkD3) df <-…
Ben
  • 197
  • 1
  • 9
7
votes
1 answer

Beautifying Sankey/Alluvial visualization using R

I'm currently using Alluvial package in R to create a visualization. Here is my data set: https://app.box.com/s/6qju42u0cg1cmrnhyhyzmjtp59wnsn3q Here is my code: alluvial(fb_ad_3d[,2:3], freq=fb_ad_3d$freq, col = ifelse( fb_ad_3d$Response…
user709413
  • 505
  • 2
  • 7
  • 21
7
votes
1 answer

Saving networkD3 Sankey diagram using code only

I've created a Sankey diagram in R, using the networkD3 package, that I'd like to save as a static image, using code instead of clicking on 'Export' --> 'Save as Image...'. The current code I've tried (using this Sankey diagram as an example)…
tktk234
  • 426
  • 3
  • 12
7
votes
1 answer

Weighted sankey / alluvial diagram for visualizing discrete and continuous panel data?

Questions I'm trying to visualize panel data on individuals that includes both a discrete or categorical choice and a continuous choice in each time period. One common example of this situation is customers purchasing a product/subscription and…
7
votes
1 answer

D3 Sankey minimize link crossing

On his d3 Sankey Diagram page, Mike Bostock says "The algorithm could be improved in the future, say to minimize link crossing". I would like to invest some time and do just that, but I'm not sure were to begin. Does anyone have any propositions or…
Cos
  • 1,649
  • 1
  • 27
  • 50
7
votes
2 answers

Order by name in Sankey chart

Is it possible to sort by name using sankey? For example: Example: https://jsfiddle.net/Khrys/1s3shf2m/ google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); …
Khrys
  • 2,670
  • 9
  • 49
  • 82
7
votes
3 answers

How to change node and link colors in R googleVis sankey chart

How can node and link colors be changed in R googleVis sankey chart? And link having the same color as its originating node? library(googleVis) datSK <- data.frame(From=c(rep("A",3), rep("B", 3)), To=c(rep(c("X", "Y", "Z"),2)), …
santoku
  • 3,297
  • 7
  • 48
  • 76
1 2
3
50 51