我有一个这样的图形文件:
digraph {
"Step1" -> "Step2" -> "Step3";
subgraph step2detail {
"Step2" -> "note1";
"Step2" -> "note2";
"Step2" -> "note3";
"Step2" -> "note4";
rankdir=TB
}
}我希望子图step2detail挂在“Step2”的右边。
现在它看起来是这样的:

我希望Step1,Step2和Step3都在彼此的垂直下方,并在1列中。
发布于 2010-08-31 21:40:21
获得您所描述的图的诀窍是使用两个子图并从一个子图链接到另一个子图。“细节”中不可见的边缘是使注释保持对齐的原因。
digraph {
rankdir="LR";
subgraph steps {
rank="same";
"Step1" -> "Step2" -> "Step3";
}
subgraph details {
rank="same";
edge[style="invisible",dir="none"];
"note1" -> "note2" -> "note3" -> "note4";
}
"Step2" -> "note1";
"Step2" -> "note2";
"Step2" -> "note3";
"Step2" -> "note4";
}结果是:

发布于 2011-11-16 04:09:15
下面是最简单的--只需使用group属性让graphviz优先选择直边即可:
digraph {
node[group=a, fontname="Arial", fontsize=14];
"Step1" -> "Step2" -> "Step3";
node[group=""];
"Step2" -> "note1";
"Step2" -> "note2";
"Step2" -> "note3";
"Step2" -> "note4";
}

发布于 2009-12-10 13:57:00
通过将步骤节点分组到聚类子图中,输出如下:
digraph {
subgraph cluster_0 {
color=invis;
"Step1" -> "Step2" -> "Step3";
}
subgraph cluster_1 {
color=invis;
"Step2" -> "note4";
"Step2" -> "note3";
"Step2" -> "note2";
"Step2" -> "note1";
}
}

color=invis将移除在集群周围绘制的边框
https://stackoverflow.com/questions/1554635
复制相似问题