GraphViz Node Placement and Rankdir

前端 未结 2 544
遇见更好的自我
遇见更好的自我 2020-12-04 12:01

I\'m having very good luck with graphviz and have been able to make nearly every graph that I need. I\'m trying to duplicate this:

http://en.wikipedia.org/wiki/File:

2条回答
  •  青春惊慌失措
    2020-12-04 12:48

    The native Graphviz (dot) rendering does not support the organogram rendering style used in the original. While it can generate orthogonal edges (as shown), there is no way to automate the grouping of edges. The vertical layering can be achieved with minlen.

    The accepted answer is somewhat of an abuse of the notation, but altogether a reasonable approach. It will likely be difficult to automate and the recommended WYSIWIG alternative is likely to be simplest.

    The changes to the supplied solution are:

    graph [splines=ortho]; edge [dir = none];
    
    { rank = same; n2; n3; }
    n1 -> { n2; n3; };
    n1 -> n4 [minlen = 2];
    { rank = same; n5; n6; n7; n8; };
    n1 -> { n5; n6; n7; n8; } [minlen = 3];
    

提交回复
热议问题