【发布时间】:2021-11-30 10:36:06
【问题描述】:
我必须每周创建多次流程图。我研究了graphviz,以使过程不那么繁琐。我刚开始学习它,它真的很棒。但是,我不知道如何使用子图来创建我想要的布局。
- 我想要一个带有流程图的“车道”/“行”
- 我想要一个带有注释的“车道”/“行”,以显示该步骤在 时刻
- 我想要一个“车道”/“行”,其中包含有关 过程
我尝试摆弄子图,但没有奏效。有什么方法可以实现吗?这是示例的代码。我还添加了一张图片来说明我想要实现的目标:
digraph{
graph[rankdir =LR]
// the steps
subgraph steps{
node[shape = box]
S_1[label="Step 1"];
S_2[label = "Step 2"];
S_3[label = "Step ..."];
S_4[label = "Step k"]
S_1 -> S_2 -> S_3 -> S_4;
}
// the problems
subgraph problem {
node[shape = box, color = "red",fontsize = 8]
S_1p[label= "This is not working\nat all. People simply skip this\nstep."]
S_3p[label = "Instead of changing\nthe session setting,\nusers simply call colleagues via phone"]
S_1p->S_1 //argh
S_3p -> S_3 //argh
}
//the notes
subgraph notes{
node[shape = plaintext, color = "black",fontsize = 8]
S_1n[label="This is really important additional information"]
S_3n[label="This one as well"]
S_1n -> S_1;
S_3n -> S_3;
}
}
【问题讨论】:
-
也许您应该查看:
{ rank=same; S_1; S_2; S_3; S_4;},而不是在图中设置tankdir。