I am trying to use networkD3 to create a Sankey diagram and I have difficulties creating the preferred layers in the diagram.
I see that the famous example below has a wonder distinct layer, but cannot figure out how this can be produced. For example, how can we put the layer in the exact column of figure as we preferred?
This is the code for the example.
URL <- paste0('https://cdn.rawgit.com/christophergandrud/networkD3/',
'master/JSONdata/energy.json')
energy <- jsonlite::fromJSON(URL)
# Plot
sankeyNetwork(Links = energy$links, Nodes = energy$nodes, Source = 'source',
Target = 'target', Value = 'value', NodeID = 'name',
units = 'TWh', fontSize = 12, nodeWidth = 30)
Thank you very much in advance.