christophergandrud / networkD3

D3 JavaScript Network Graphs from R
http://christophergandrud.github.io/networkD3
650 stars 269 forks source link

Feature request: diagonal networks with multiple root nodes and node/edge data frames #253

Open wlandau opened 5 years ago

wlandau commented 5 years ago

Diagonal networks would be an amazing addition to drake's dependency graph visualizations. However, there are two obstacles:

  1. The List data structure, which I would have to compute using the existing Nodes and Links data frames.
  2. The requirement that we have only a single root node.

Is there a way to easily transition from sankeyNetwork() to diagonalNetwork() using the same graphs and same data structures?

cjyetman commented 5 years ago

I have written a number of conversion routines that transform various data formats into formats that the various networkD3 functions require, however, the diagonal networks and sankey networks are based on completely different D3/Javascript implementations, so there’s no “easy”, direct switching from one to the other. Additionally, the diagonal networks, being what they are, have a hard requirement that the data be hierarchical, so not every dataset that works in sankey will work with diagonal. Additionally, there is currently no ability for a diagonal network to have multiple root nodes... though two discrete diagonal networks could be used together to show to separate branches that begin at different nodes.