Does the dot Directed Graph allow for subgraphs with a different rankdir?

◇◆丶佛笑我妖孽 提交于 2019-12-10 02:51:58

问题


Using the dot directed graph language, is it possible to create subgraphs with a different rankdir?

I tried the following, which didn't work. Both graphs were left to right, despite the presence of rankdir="TB" in the subgraph.

digraph g {
    rankdir="LR";
    LEFT->RIGHT;
    clusterrank="local";

    subgraph cluster1 { 
        rankdir="TB";    
        node[style=filled];         
        color=black;
        TOP->BOTTOM;                
    }   
}

Is there some other syntax to get a Top/Bottom and Left/Right graph in the same diagram, or is this not possible?


回答1:


Seems like this is a long standing feature request: http://www.graphviz.org/bugs/b1279.html




回答2:


Desperately wanting the same feature, i Googled and there is a "trick": Essentially, you add invisible edges (and nodes if required) to sink the ranks.




回答3:


There's a clusterrank attribute for subgraphs, try this:

clusterrank=local;


来源:https://stackoverflow.com/questions/1014092/does-the-dot-directed-graph-allow-for-subgraphs-with-a-different-rankdir

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!