I'm wondering to what extent it is possible to tweak Sankey flow graphs in the networkd3 package in R. I have the following sankeyNetwork graph:
library(networkD3)
states <- state.name[1:10]
ranks <- sample.int(10)
nodes <- data.frame(name = c(states, states[ranks]))
links <- data.frame(source = 1:10 - 1, target = order(ranks) + 10 - 1, value = 1)
sankeyNetwork(Links = links, Nodes = nodes, Source = 'source',
Target = 'target', Value = 'value', NodeID = 'name',
iterations = 0)
I would like to replace the left- or right-hand side with bar charts. Something like this:
Is there any way to integrate Sankey flow graphs with bar charts? I am absolutely willing to look into JavaScript but I'm not sure where to start. I'd appreciated if somone could point me to the right resources.