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

Columns stacked on top of each other #31

Open
StuYuXu opened this issue Dec 16, 2024 · 0 comments
Open

Columns stacked on top of each other #31

StuYuXu opened this issue Dec 16, 2024 · 0 comments

Comments

@StuYuXu
Copy link

StuYuXu commented Dec 16, 2024

Hello, friends.
The package you developed works really well, but for some reason, the columns on the right side of my image are stacked together.
My code is
`library(sankeyD3)
nodes = data.frame("name" =
c("a", # Node 0
"b", # Node 1
"c", # Node 2
"d",
"e",
"f",
"g",
"test",
"test1",
"test2"),
"PosX"=c((7389-5950),
(7389-3900),
(7389-7389),
(7389-4505),
(7389-4049),
(7389-3000),
(7389-2222),
(7389-2222),
(6000),
6000))# Node 3
links = as.data.frame(matrix(c(
0, 5, 0.066, # Each row represents a link. The first number
1, 5, 0.025, # represents the node being conntected from.
2, 5, 0.909, # the second number represents the node connected to.
0, 4, 0.9,
3,4,0.1,
4,6,1,
5,7,1,
7,8,1,
7,9,1),# The third number is the value of the node
byrow = TRUE, ncol = 3))
names(links) = c("source", "target", "value")

sankeyNetwork(Links = links, Nodes = nodes,
Source = "source", Target = "target",
Value = "value", NodeID = "name",nodeStrokeWidth =5,
fontSize= 12, nodeWidth = 5,NodePosX="PosX",iterations=32,dragX=T,dragY=T
)`

The output is
Uploading 20241216231410.png…

Hope you can help me, thank you!

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

No branches or pull requests

1 participant