Placing clusters on the same rank in Graphviz

后端 未结 2 1781
慢半拍i
慢半拍i 2021-02-02 07:00

I would like these two nodes to appear on the same level:

\"enter

digraph          


        
相关标签:
2条回答
  • 2021-02-02 07:57

    You may simply modify the edge between the routers:

    router1 -> router2[constraint=false];
    

    constraint indicates whether the edge should be used in the ranking of the nodes.

    0 讨论(0)
  • 2021-02-02 08:03

    You may use the newrank graph attribute (added in GraphViz 2.30) to activate the new ranking algorithm which allows defining rank=same for nodes which belong to clusters.

    Add the following line at the top:

    newrank=true;
    

    Add the following line after the cluster definitions:

    { rank=same; router1; router2; }
    

    Here's the resulting graph:

    routers with same rank

    0 讨论(0)
提交回复
热议问题