Closed paulrougieux closed 6 years ago
This has been possible since #79 was merged.
library(networkD3)
links <- read.csv(header = TRUE, as.is = TRUE, text = "
source,target,value
0,1,1
1,2,1
2,0,1
")
nodes <- read.csv(header = TRUE, as.is = TRUE, text = "
name
A
B
C
")
sankeyNetwork(Links = links, Nodes = nodes, Source = "source",
Target = "target", Value = "value", NodeID = "name")
Thank you @cjyetman for the example.
Links between Sankey nodes are always uni-directional, they flow from left to right but it is not possible to link back to a previous node. For example with three nodes linked in this way: A -> B -> C It is not possible to loop back from C to A. Would it be possible to introduce Sankey diagrams with cycle or loops as discussed here: https://github.com/d3/d3-plugins/issues/1