Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graph with auto layout using d3 (a tree with multiple parent nodes)

Tags:

graph

tree

d3.js

How to draw a graph with auto layout, many-to-many with lines not crossing the boxes using d3?

I'd like to accomplish something like this: http://www.graphdracula.net/showcase/ http://live.yworks.com/yfiles-for-html/1.1/demos/DataBinding/demo.yfiles.binding.interactivegraphsource/index.html

I guess that's the best description of what I need (something like tree, but with multiple parents): enter image description here

like image 346
El Kopyto Avatar asked Apr 02 '14 16:04

El Kopyto


3 Answers

To minimize line crossings, you probably need a layered digraph layout. Just google that phrase.

like image 55
Fuzzy Avatar answered Oct 18 '22 18:10

Fuzzy


Dagre-d3 is the best solution that I found:

https://github.com/cpettitt/dagre-d3

like image 43
El Kopyto Avatar answered Oct 18 '22 17:10

El Kopyto


For anyone else who comes across this, here's another possible solution: (see the "Directed Graph with downward-pointing edges" example)

http://marvl.infotech.monash.edu/webcola/

It can also be plugged into d3.js and used in place of the force layout.

like image 24
patorjk Avatar answered Oct 18 '22 19:10

patorjk