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
4
votes
2 answers

in Sankey diagram: make paths "as short as possible"?

I am interested in using Sankey diagrams, like http://bost.ocks.org/mike/sankey/ Specifically, I am using the block that enables cycles: http://bl.ocks.org/cfergus/3956043 But, each "start-node" is drawn on the far left and each "end-node" drawn on…
wivku
  • 2,457
  • 2
  • 33
  • 42
4
votes
1 answer

How to align text vertically on a node within a Sankey diagram (D3.JS)?

I have modified Mike Bostok example of a Sankey diagram in D3.Js from http://bost.ocks.org/mike/sankey/ to display the value of each node as this: Sankey http://uweb.cs.uvic.ca/~maleh2/sankey.png node.append("text") …
mfroese
  • 309
  • 1
  • 5
  • 18
4
votes
2 answers

Filtering data for d3.js sankey diagrams

I'm trying to have a d3.js Sankey visualisation filter a data set according to categories. I'm using d3.csv method to input the data as shown in this example - http://bl.ocks.org/timelyportfolio/5052095 I would however like to upload a data set…
4
votes
0 answers

Embedding rCharts graph into slidify slide deck

I am still trying to get a graph that I have produced using rCharts into a slidify slide deck. I have tried copying the script that rCharts produces into slidify's .Rmd file but all I get is an empty slide. Here is the .Rmd file: --- title :…
user1389960
  • 433
  • 4
  • 11
4
votes
2 answers

Matplotlib: Is it possible to create an new axis with a given y-offset, without creating subplot?

With the help of sankey-toolbox in Matplotlib, we can plot sankey-diagrams automaticly: The position of a sankey-object is automaticly calculated based on the position of its prior-object and cannot be given manually; and when a sankey-diagram is…
3
votes
0 answers

How can I create a sankey plot with Google Data Studio?

I'm working on a google data studio dashboard... I'd want to add a sankey plot but I can't find the way to do that. I found this page that explain something [link] Thank you very much!
Ector
  • 51
  • 1
  • 5
3
votes
1 answer

R plotly - sankey chart not returned

I am running below code in RStudio, and want to create sankey chart with plotly. code runs without error. but the sankey chart is not displayed. what's wrong here? library("plotly") a = read.csv('cleanSankey.csv', header=TRUE, sep=',') node_names…
peace
  • 299
  • 2
  • 16
3
votes
1 answer

Why are fixed positions for nodes in a plotly sankey graph being overridden or ignored?

I am seeking to make a large set of sankey graphs for flows between 5 nodes at Time1 and 5 nodes at Time2. I would like the nodes to be drawn in the same order every time, no matter the size of the nodes or flows. However, some of these graphs are…
3
votes
1 answer

Adding label data to sankey plot axis with ggalluvial Package

How do I add label names in the white boxes to each of the three axis on the ggalluvial sankey plot from the dataframe? (see image) Column "Country" has observations for multiple countries. In the example below I am focused on Ireland which has the…
ceallac
  • 107
  • 9
3
votes
1 answer

plotly sankey graph data formatting

plotly library has some nice sankey diagrams https://plotly.com/python/sankey-diagram/ but the data requires you to pass indexes of the source/target pairs. link = dict( source = [0, 1, 0, 2, 3, 3], # indices correspond to labels, eg A1,…
dcsan
  • 11,333
  • 15
  • 77
  • 118
3
votes
1 answer

How to Color Target Nodes in Sankey Diagram Python using Plotly?

I'm using plotly.graph_objects to build a Sankey diagram, and I'd like the target nodes to be the same color as the links that flow into them. An example of the code structure I have so far is: label = ['A', 'B', 'Z', 'Y', 'X'] source = [0, 0, 0, 1,…
griffm
  • 29
  • 2
3
votes
0 answers

Sankey diagram with D3 v7 - mouseover node highlights links

I am making a Sankey diagram with D3 v7 where I hope that on mouseover of the node all connected paths will be highlighted and the other nodes will lower in opacity. I’ve tried to follow this example: D3.js Sankey Chart - How can I highlight the set…
Exploring
  • 33
  • 5
3
votes
1 answer

In R, how to display value on the links/paths of Sankey Graph?

Background I was trying the create a Sankey graph like the following figure. Actually, I wanted to get a output where values (10, 20, 30, 40) will be set in the paths (from one node to another node). How Did I Try? At first, I tried using the…
Md. Sabbir Ahmed
  • 850
  • 8
  • 22
3
votes
1 answer

D3 Sankey Diagram: Changing Node Position

I am creating a Sankey diagram in Shiny using networkD3 library. I need to change the position of one node (rotate it on 90d and move down). For this, I use js as in the little example below. However, after changing the node I need to update the…
Olena
  • 97
  • 1
  • 8
3
votes
0 answers

Preserve custom node placement of a sankeyNetwork (networkD3) in R

I wish to customise the horizontal and vertical position of nodes in a sankeyNetwork (networkD3) in R, and export the network as a high-resolution image. I credit and use the reproducible example of CJ Yetman (enable horizontal movement of nodes in…
Cai Ladd
  • 59
  • 8