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
2
votes
1 answer

ggalluvial: identical strata order of the first and second axis

I want to keep the second axis of an alluvial plot in the same order as the first axis. Namely as the first axis is a higher-level taxonomy of the second, its main purpose is to show an overview and grouping of the organisms to enhance readability…
bathyscapher
  • 1,615
  • 1
  • 13
  • 18
2
votes
0 answers

How to set line width of individual nodes in a Plotly Sankey diagram?

According to the Plotly documentation for Sankey diagrams, the node.line property takes a dictionary of color and width, where "width is a number or array of numbers greater than or equal to 0" (emphasize mine). I assume that supplying an array…
Emile
  • 2,200
  • 27
  • 36
2
votes
0 answers

Is there a way to have a auto size function in D3 / Sankey chart?

In my application, you can visualize sankey charts for custom input. Some of the input consists only of 5 nodes, some other input may consist of 50 nodes. The problem is, that I have to set a fixed width and height for the sankey chart on creation. …
Andreas
  • 21
  • 1
2
votes
0 answers

Omitting specific node and their associated edges in a Sankey-diagram

I am currently creating a Sankey-diagram using the networkD3 package in R. There is one initial node, let's call it node 0, that is connected to all the other nodes. Furthermore, I have a grouping variable, let's say gender, that needs to be…
Fred
  • 410
  • 3
  • 12
2
votes
0 answers

How can I horizontally move the nodes from SankeyNetwork, using NetworkD3 in R?

links2 <- read.csv("C:/Users/tul45082/Desktop/CMA/DNA/links.csv") nodes2 <- read.csv("C:/Users/tul45082/Desktop/CMA/DNA/nodes.csv") sankeyNetwork(Links = links2, Nodes = nodes2, Source = "source", Target = "target", Value = "value",…
Messi10
  • 37
  • 1
  • 3
2
votes
1 answer

d3-sankey links not updating on drag event

Issue-1 : I am unable to update d3-sankey links on drag events. I am trying to replicate d3 vertical and horizontal drag events similar to this : https://bl.ocks.org/d3noob/5028304 When drag event is used it updates the node and the links are not…
Gagan Deep
  • 53
  • 1
  • 9
2
votes
1 answer

Google chart API: Set values of node labels in Sankey diagram

I am trying to create a simple Sankey diagram showing flows between two sets of nodes, and would like the two sets to have the same names. However, this isn't allowed (it brings up a "Cycle found in rows" error), so I add "2" to the names of the…
2
votes
1 answer

Sankey D3.js sankey.link is not a function

I'm new to JS/D3.js (so thanks in advance for any support). I'm trying to create a basic sankey diagram using Gerardo's d3.v5 fork https://bl.ocks.org/GerardoFurtado/ff2096ed1aa29bb74fa151a39e9c1387 however when I try to run the same script I'm…
2
votes
1 answer

Sankey with Matplotlib Positions of Labels

After this: Sankey with Matplotlib I made this Code: from matplotlib.sankey import Sankey import matplotlib.pyplot as plt from matplotlib import rcParams ## Plotten plt.rc('text', usetex=True) plt.rc('text.latex',…
kolja
  • 505
  • 7
  • 24
2
votes
1 answer

R Sankey Highchart: customizing node tooltip using data from a different variable

I'm trying to make a Sankey diagram with highcharter and I need to show in the node tooltip the sum of a variable, say y. For instance, for node "A" the sum of y would be 62 (34+28). I have tried this but it won't work test <- data.frame(a = c("A",…
2
votes
0 answers

Sankey plot labels are misaligned when rendered in a new window on MacOS

Using iplot will show the chart inline and is perfect (except for the resizing flexibility of a new window) plotly.offline.iplot(fig, validate=False) Using plot will open in a new window and has label backgrounds that are duplicated and misaligned…
2
votes
2 answers

Beautifying and sorting some variables in the Sankey/Alluvial diagram using R

I'm trying to improve my skills in data visualization, and I got almost what I wanted. But at some point, I got stuck and couldn't go any further. Just to be aware, guys, I've done extensive research here to try to find my doubts, it helps me a…
2
votes
1 answer

How to add value labels on the flows item of a Alluvial/Sankey plot (on R ggalluvial)?

I'm looking to label the "flow" portion of Alluvial / Sankey chart on R. The stratums (columns) can easily be labelled, but not the flows connecting them. All my attempts on reading the documentations and experimenting were to no avail. In the…
2
votes
0 answers

Is there any R function to visualize the values of the links as text inside the node?

I am using the R package networkD3 to plot the following Sankey diagram. The values set the size of the links. I need a function who adds the same value as text inside the nodes. # Library library(networkD3) library(dplyr) # Make a connection data…
2
votes
2 answers

ggalluvial - sort the order of strata

I've been trying for days now to sort the order of strata and flows in ggalluvial. I want to visualize the flow of patients through different screenings procedures (X1, X2, X3, X4) and color the flow based on the final diagnosis (Values in X4). Can…
Steen Harsted
  • 1,802
  • 2
  • 21
  • 34