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

R - riverplot formatting nodes

I have been fiddling around with the riverplot package and have produced some very attractive and illustrative results. I am now trying to produce a somewhat more complicated plot and some of the results that I am getting are a little unexpected. I…
datawookie
  • 1,607
  • 12
  • 20
3
votes
1 answer

How to create Sankey Diagrams with curved node endpoints?

I'm using D3.js and its sankey plugin to generate sankey charts for my dataset. Long story short, I've made a few modifications to the plugin source (to get varying branch breadth), and currently have something that looks like: Now I'm trying to…
Zach Lysobey
  • 14,959
  • 20
  • 95
  • 149
3
votes
1 answer

Parsing and invalid value for D3.js sankey

I am currently trying to create a simple Sankey diagram using D3.js. I have gotten most of the way, but setting the height and y-axis is proving to be a challenge. Specifically, the error returned is the following: Error: Problem parsing d="M15,…
joseph_pindi
  • 857
  • 2
  • 10
  • 22
2
votes
1 answer

sankey diagram visualisation

I am trying to visualize my data via a sankey diagram. I have the following dataframe: sankey1 <- structure(list(pat_id = c(10037, 10264, 10302, 10302, 10302, 10344, 10482, 10482, 10482, 10613, 10613, 10613, 10628, 10851, 11052, 11203, 11214,…
RvS
  • 149
  • 8
2
votes
0 answers

ggalluvial or ggsankey - colours for different axis

I am trying to make an alluvial chart using ggalluvial on R. I was wondering if it is possible to have different colours for each segment (or between axis). In the example below, I have A on axis one going to B and C on axis 2. I would like two…
2
votes
0 answers

How to correctly position a sankey branch

I have the following example. I would like to change the position of the info Info3 and Info 2 in the group 2 to have them more on the left. I tried to change trunklength = 0.6, without success. import matplotlib.pyplot as plt from…
Johnvador
  • 21
  • 5
2
votes
0 answers

R Plotly: How to add text to links of sankey diagram?

I created a sankey diagram using plotly and R with three columns. I want to add text on the links, so that you see the value of the links without the need to hover over them. Here's some sample code. I tried out annotations but could not get it to…
netzema
  • 21
  • 2
2
votes
1 answer

sankey plot from plotly package is blank, no error or warning

I tried to generate the sankey plot by plotly package, however there is a no error or warning but the graph is blank, could you please let me know the reason I attached the data which I used, the data_long and nodes I am not sure what is the reason,…
jkatam
  • 2,691
  • 1
  • 4
  • 12
2
votes
1 answer

I used htmlwidgets::onRender to add numbers to a sankey network, but the numbers do not seem to be appear after saving the plot as png

I was following this guide and tried using htmlwidgets::onRender to add numbers next to node labels. It displays the change in an html file with no problem, but then when I tried saving it as png, the numbers seem to disappear. I was using…
nightstand
  • 329
  • 2
  • 11
2
votes
2 answers

Export manually edited htmlwidget to SVG or similar

I often create Sankey-diagrams in R via {sankeyD3}, because it seems to be the package with the most options/features to do so. However, one feature that is missing is the ability to set the order of nodes on the y-axis (although this issue tried to…
Paul Schmidt
  • 1,072
  • 10
  • 23
2
votes
3 answers

How to fix unwanted circle on / break down of SVG path element for Sankey links with d3?

I'm putting together a Sankey diagram via SVG but suddenly under some unknown conditions one of the paths show a circle where there shouldn't be any. I tried to remove as much as possible from the my SVG but removing anything further makes this no…
Spenhouet
  • 6,556
  • 12
  • 51
  • 76
2
votes
1 answer

NetworkD3 sankey chart in R creating really messy links, even though my code should be good. What is wrong?

I am trying to create a sankey diagram but the connections turn out all messed up. Here is my data: #> A tibble: 61 x 3 #> # Groups: id_2 [55] #> id_2 origin target #>
Andy
  • 109
  • 5
2
votes
1 answer

How to plot Sankey Graph with R networkD3 values and percentage below each node

Good afternoon, from the code below I am able to produce a Graph chart but it does not show the underlying values. I tried to tweak the code in this thread but I got no joy. I never used Java. What I need is a graph that has also the values and the…
Torakiki
  • 45
  • 6
2
votes
0 answers

sankeyNetwork is invisible in Shiny R

[SOLVED] I am trying to do a ShinyApp using some examples from the internet. As part of my app I want to plot a Sankey Diagram, however, I have been finding a problem. My app has a navbarPage structure and uses the example from…
2
votes
1 answer

R netWorkD3 Sankey - add percentage by js doesn't work

I'm creating a sankey chart in R with networkD3::sankeyNetwork() with the below sample data and script. I want to show percentage besides the node label. the sankey with full dataset i create has 8 layers. i just post piece of data in below…
peace
  • 299
  • 2
  • 16