orderGraphviz - fixed subgraphs

Deadly 提交于 2019-12-04 05:19:32

问题


I like to create a 3 column graph like this:

Code:

digraph g {
rankdir="LR";
node[shape = circle, fontsize=14];
fontsize=18;
labeljust="l";

{ rank=same;
}

edge[style=invis, fontsize=12];
subgraph clusterA {
    a->b;
    label="A";
}
subgraph clusterC {
  e->f->g;
    label="C";
}

subgraph clusterB {
 c->d;
label="B";
}

}

I want to create a graph with the subgraphs A,C,B ordering. How can I add relations to this graph (ex. c->f; and b->g;) without the remaining the order of A--C--B?


回答1:


You may try adding the edges which are not supposed to influence the layout with constraint=false. After the last cluster, insert something like:

edge[constraint=false, style=solid];
c->f;
b->g;

If the clusters get reordered anyway, you may add invisible edges (make sure that constraint=true) to enforce the layout:

c -> e [constraint=true, style=invis];
e -> a [constraint=true, style=invis];


来源:https://stackoverflow.com/questions/14269750/ordergraphviz-fixed-subgraphs

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