我正在尝试创建一个带有两个子图的图形.代码如下:
digraph G {
subgraph step1 {
style=filled;
node [label="Compiler"] step1_Compiler;
node [label="Maschine"] step1_Maschine;
color=lightgrey;
}
subgraph step2 {
style=filled;
color=lightgrey;
node [label="Interpretierer"] step2_Interpretierer;
node [label="Maschine"] step2_Maschine;
label="Virtuelle Maschine";
}
"Programm (Java)" -> step1_Compiler;
step1_Compiler -> step1_Maschine;
step1_Maschine -> "Bytecode";
"Bytecode" -> step2_Interpretierer;
step2_Interpretierer -> step2_Maschine;
step2_Maschine -> "Ergebnis";
}
Run Code Online (Sandbox Code Playgroud)
我得到的结果如下:

我希望两个子图周围都能看到一个方框.我在这里错过了什么?
mar*_*pet 114
您必须在子集的名称前加上集群:
subgraph clusterstep1 {
Run Code Online (Sandbox Code Playgroud)
和
subgraph clusterstep2 {
Run Code Online (Sandbox Code Playgroud)
为了获得风格和标签.
子图的第三个角色直接涉及图形将如何由某些布局引擎布局.如果子图的名称以簇开头,则Graphviz将子图注释为特殊的簇子图.如果支持,布局引擎将执行布局,以便将属于集群的节点绘制在一起,并将集群的整个绘图包含在边界矩形内.请注意,无论好坏,集群子图都不是DOT语言的一部分,而只是某些布局引擎所遵循的语法约定.
| 归档时间: |
|
| 查看次数: |
15782 次 |
| 最近记录: |