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

Riverplot package in R - output plot covered in gridlines or outlines

I've made a Sankey diagram in R Riverplot (v0.5), the output looks OK small in RStudio, but when exported or zoomed in it the colours have dark outlines or gridlines. I think it may be because the outlines of the shapes are not matching the…
String
  • 123
  • 1
  • 8
11
votes
1 answer

D3 Sankey chart using circle node instead of rectangle node

I want to use Sankey chart but with circle's instead of rectangles. I am following the example from Mike Bostock. I changed the code there to use circle by setting radius, but how to place the lines connecting nodes around circle. Any…
user2300875
  • 529
  • 1
  • 6
  • 20
10
votes
2 answers

Adjusting sankey plot in tabbed section

In the r-markdown document given below, I use tabbed sections to display sankey plots. However, when a sankey plot is in a tab other than the first, adjusting (using htmlwidgets::onRender function) does not work. Does anybody know a way to overcome…
gd047
  • 29,749
  • 18
  • 107
  • 146
10
votes
1 answer

Place text values to right of sankey diagram

Is there a trick to placing text on a sankey diagram rendered using networkD3? I would like to have the values of the endpoints be displayed as text to the right of their boxes. I realize that hovering over the boxes displays the value, but as the…
Rorschach
  • 31,301
  • 5
  • 78
  • 129
10
votes
1 answer

d3 Sankey - Highlight all connected paths from start to end

I'm trying to highlight all the connected links and links of their target nodes till the end of the layout. The first level of highlighting can be easily achieved as follows - On node click, call highlight_paths(1); function…
Ashish Singh
  • 1,004
  • 11
  • 23
9
votes
3 answers

Ribbon chart in R

I search in R implementation (may be html widget on java script) a stacked bar chart in ribbon style, which allows you to see the rating change for each category in the dynamics. It's look like ribbon chart in power bi desktop Search rseek.org gave…
9
votes
2 answers

Overlay multiple riverplots (Sankey diagrams) on a map of the world

The fascinating chart below is in the Economist, Jan. 30, 2016 at 61. It depicts exports of liquified natural gas (LNG) from five regions to six regions. How can R draw something similar to it, perhaps with several Sankey diagrams (from the…
lawyeR
  • 7,488
  • 5
  • 33
  • 63
9
votes
1 answer

Sankey diagram in R

Attempting to make a fairly generic Sankey diagram with the help of R's networkD3 package. Just for reference--here's the example from the package's manual library(networkD3) library(jsonlite) library(magrittr) energy <-…
tomw
  • 3,114
  • 4
  • 29
  • 51
9
votes
1 answer

How to force y position of one branch in d3 sankey plugin?

I would like to force one branch of sankey diagram to be on top. Instead of diagram like this: would like to generate diagram where nodes 1, 2, 7, 15, 10 and 14 are always on top: Link to fiddle with current code:…
tomazzlender
  • 1,123
  • 12
  • 22
8
votes
1 answer

How to add columnn titles in a Sankey chart networkD3

I am making a Sankey chart and I would like to add text on top of each column in order to give a brief description of what is shown. Example code taken from the r-graph galery: library(networkD3) # A connection data frame is a list of flows with…
User2321
  • 2,952
  • 23
  • 46
8
votes
2 answers

Decision tree using rpart to produce a sankey diagram

I can create a tree with Rpart using the Kyphosis data set which is part of base R: fit <- rpart(Kyphosis ~ Age + Number + Start, method="class", data=kyphosis) printcp(fit) plot(fit, uniform=TRUE,main="Classification Tree for…
Matt Lourens
  • 171
  • 9
8
votes
1 answer

Tiny plot output from sankeyNetwork (NetworkD3) in Firefox

As per object, I get a very small plot in Firefox when using sankeyNetwork() from networkd3 in shiny but not in Chrome or RStudio. I have not included any CSS or JS in the script - the code below produces this result for me. Is there any CSS…
Andrea
  • 110
  • 6
8
votes
1 answer

Printing a sankey diagram in Shiny

I created a sankey diagram like this: #install.packages("networkD3") library(networkD3) nodes = data.frame("name" = c("Retour", # Node 0 "niet tevreden/ontevreden", # Node 1 "fout",…
Henk Straten
  • 1,365
  • 18
  • 39
8
votes
1 answer

How to sort source and/or target nodes in a sankey diagram within a shiny app?

I have a simple sankey diagram, generated using networkD3 package inside a shiny app. How can source and/or target nodes be sorted? As you can see in the MWE, by default, neither source nodes (A, B, C, D, E) nor target nodes (V, W, X, Y, Z) are…
jmjr
  • 2,090
  • 2
  • 21
  • 31
8
votes
2 answers

Creating a Sankey Diagram using NetworkD3 package in R

Currently I am trying to create an interactive Sankey with the networkD3 Package following the instructions by Chris Grandrud (https://christophergandrud.github.io/networkD3/). What I don't understand is is table-format, since he just uses two…
Phipsy
  • 81
  • 1
  • 2
1
2
3
50 51