2

I'm using the rCharts package to make interactive Sankey charts in R. I'm able to get the chart like I want to, but the issue is, the paths are not collapsible.

For example, if I click on the first node, I want to see just the paths of that particular node (This can be done in Tableau).

Can anyone help me out with this?

The code for creating the chart :

library(rCharts)
colnames(edgelist) <- c("source","target","value")
#make character rather than numeric for proper functioning
edgelist$source <- as.character(edgelist$source)
edgelist$target <- as.character(edgelist$target)
sankeyPlot <- rCharts$new()
sankeyPlot$setLib('http://timelyportfolio.github.io/rCharts_d3_sankey/libraries/widgets/d3_sankey')
sankeyPlot$setTemplate(script ="http://timelyportfolio.github.io/rCharts_d3_sankey/libraries//widgets/d3_sankey/layouts/chart.html")
sankeyPlot$set(
  data = edgelist,
  nodeWidth = 15,
  nodePadding = 10,
  layout = 32,
  width = 960,
  height = 500
)


sankeyPlot

Edit: Here's edgelist

kaelthaas
  • 41
  • 3

0 Answers0