Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanky diagram with cycle - loops #244

Closed
paulrougieux opened this issue Jul 20, 2018 · 2 comments
Closed

Sanky diagram with cycle - loops #244

paulrougieux opened this issue Jul 20, 2018 · 2 comments

Comments

@paulrougieux
Copy link

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:
d3/d3-plugins#1

@cjyetman
Copy link
Collaborator

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")

sankey

@paulrougieux
Copy link
Author

Thank you @cjyetman for the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants