我希望子图clusterCG的排名与3相同(clusterCG不包含3)
digraph G{
rankdir = LR;
node [shape = none]
1->2->3->4[arrowhead=none]
node [shape = ellipse]
A->A2->A3;
subgraph clusterCG{
shape = rect;
rank=same;
A2;
B;
C;
color=blue;
label="C";
}
{ rank=same; 1; A;}
{ rank=same; 3; CG;}
{ rank=same; 4; A3;}
}
CG生成为具有等级3的独立节点。
我希望子图clusterCG具有等级3.
答案 0 :(得分:8)
也许不是最好的解决方案,但似乎零大小的节点是唯一可行的
digraph G{
rankdir = LR;
node [shape = none]
1->2->3->4[arrowhead=none]
node [shape = ellipse]
ACG[shape = none,label="",width=0, height=0];
CG->A2 [style=invis,constraint=false];
A->ACG[arrowhead=none];
ACG->A2->A3;
subgraph clusterCG{
shape = rect;
rank=same;
A2;
B;
C;
color=blue;
label="C";
}
{ rank=same; 1; A;}
{ rank=same; 2; ACG;}
{ rank=same; 4; A3;}
}
答案 1 :(得分:8)
使用不同的排名算法" newrank = true"
digraph G {
newrank=true
rankdir = LR;
node [shape = none]
1->2->3->4[arrowhead=none]
node [shape = ellipse]
A->A2->A3;
subgraph clusterCG{
shape = rect;
rank=same;
A2;
B;
C;
color=blue;
label="C";
}
{ rank=same; 1; A;}
{ rank=same; 3; A2}
{ rank=same; 4; A3;}
}