graphviz 改变有向图中特定形状的方向
graphviz change orientation of a specific shape in a digraph
如何使用 graphviz 点语言将所有 "parallelogram" [查看我的代码] 放在 S 框的顶部?
所以基本上输出应该看起来像一条直线,所有 M1 M2 和 Mn 都在图的顶部。
实际输出:
期望的输出:
digraph ER {
node [group=M; shape=parallelogram]; M1; M2; M_n;
node [group=I, shape=none]; "...";
node [group=V, shape=egg]; IV; V1; V2;
node [group=C, shape=box]; "S1"; "S2"; "S_n"; f;
node [group=F, shape=hexagon]; "FINAL";
IV -> "S1";
M1 -> "S1";
"S1" -> V1;
V1 -> "S2";
M2 -> "S2";
"S2" -> V2;
V2 -> "...";
"..." -> "S_n";
M_n -> "S_n";
"S_n" -> f;
f -> "FINAL"
rankdir=LR;
}
与rank
attribute allows constraining two (or more) nodes of the same subgraph同级。考虑到这一点:
digraph ER {
rankdir=LR;
node [shape=none]; "...";
node [shape=egg]; IV; V1; V2;
node [shape=box]; f;
{rank=same; "S1"; M1[shape=parallelogram];}
{rank=same; "S2"; M2[shape=parallelogram];}
{rank=same; "S_n"; M_n[shape=parallelogram];}
node [shape=hexagon]; "FINAL";
IV -> "S1";
M1 -> "S1";
"S1" -> V1;
V1 -> "S2";
M2 -> "S2";
"S2" -> V2;
V2 -> "...";
"..." -> "S_n";
M_n -> "S_n";
"S_n" -> f;
f -> "FINAL"
}
如何使用 graphviz 点语言将所有 "parallelogram" [查看我的代码] 放在 S 框的顶部?
所以基本上输出应该看起来像一条直线,所有 M1 M2 和 Mn 都在图的顶部。
实际输出:
digraph ER {
node [group=M; shape=parallelogram]; M1; M2; M_n;
node [group=I, shape=none]; "...";
node [group=V, shape=egg]; IV; V1; V2;
node [group=C, shape=box]; "S1"; "S2"; "S_n"; f;
node [group=F, shape=hexagon]; "FINAL";
IV -> "S1";
M1 -> "S1";
"S1" -> V1;
V1 -> "S2";
M2 -> "S2";
"S2" -> V2;
V2 -> "...";
"..." -> "S_n";
M_n -> "S_n";
"S_n" -> f;
f -> "FINAL"
rankdir=LR;
}
与rank
attribute allows constraining two (or more) nodes of the same subgraph同级。考虑到这一点:
digraph ER {
rankdir=LR;
node [shape=none]; "...";
node [shape=egg]; IV; V1; V2;
node [shape=box]; f;
{rank=same; "S1"; M1[shape=parallelogram];}
{rank=same; "S2"; M2[shape=parallelogram];}
{rank=same; "S_n"; M_n[shape=parallelogram];}
node [shape=hexagon]; "FINAL";
IV -> "S1";
M1 -> "S1";
"S1" -> V1;
V1 -> "S2";
M2 -> "S2";
"S2" -> V2;
V2 -> "...";
"..." -> "S_n";
M_n -> "S_n";
"S_n" -> f;
f -> "FINAL"
}