I need your help in order to create a Sankey Diagram like:
Does anyone has an example file?
Hi Juan I read your post and I was pluzzed in how to plot this on Knime, I read this post "From D3 example to interactive KNIME view in 10 minutes" which uses the same code of this website http://bl.ocks.org/oyyd/859fafc8122977a3afd6.
I managed to load the json data (the energy one) and change the code to import the file. I think the problem is that the sankey code is calling a function called d3.sankey() which is in a library: https://github.com/d3/d3-sankey/releases/tag/v0.7.1. For that reason I was NOT able to plot the Sankey.
Please find attached the workflow if helps.
Maybe one other thing:
we have a node for it on our roadmap. I added your thread as a +1 to the request :-)
Thank you mauuuuu5 and Iris for your replies.
I also wasn't able to use a library from the Internet.
I mean to use another library than the ones on the Node (D3, JSFreeChart, jQuery...)
Maybe there is something I'm missing... but if the JS is outside those included-Dependencies... it doesn't work.
Thank you mauuuuu5 for trying.
Will wait for Iris to include it, or maybe can you post some insights on what are we doing wrong?
Hi juanbretti I managed to make a Sankey Diagram, but using an R package called networkD3. The plot shows immediately when the nodes finishes to execute and prompts a new browser window.
I do not know how to make that HTML object as an “ordinary” R plot.
Please find the workflow attachedSankey.knwf (17.7 KB)
Hope it helps
Thank you very much for the implementation of the R code.
Works very easily. Not the fastest, but works.
Just for future reference, I leave copy in the post of the R code you had used:
nodes <- tibble(`name`=c("A","B", "C", "D"))
links <- tribble(
~`source`, ~`target`, ~`value`,
0, 1, 10,
0, 2, 20,
1, 3, 30,
2, 3, 40)
sankeyNetwork(Links = links, Nodes = nodes,
Source = "source", Target = "target",
Value = "value", NodeID = "name",
fontSize= 12, nodeWidth = 30)
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.