我尝试使用DOT格式生成基本的UML状态图。这是我目前的档案:
digraph {
compound=true;
node [shape=Mrecord]
rankdir="LR"
subgraph cluster0
{
label = "D"
B [label = "B"]
C [label = "C"]
}
A [label = "A|entry / EnterA\nexit / ExitA"]
A -> B [ style="solid",label="X" ];
A -> C [ style="solid",label="X" ];
}
通过Erdos graphing engine运行,它看起来非常像我想要的除了我无法弄清楚如何使超级D具有圆角以及水平线和进入/退出条件如状态A确实
有没有办法将这些东西添加到DOT子图中?
P.S。 Graphviz说" The record-based shape has largely been superseded and greatly generalized by HTML-like labels"但是当我尝试这个时,大多数引擎都给了我一张看起来非常糟糕的图表,其中过渡箭头甚至没有触及状态,这就是为什么我要做的过时"过时的"基于记录的形状而不是HTML。
答案 0 :(得分:1)
子图可以有style = rounded属性,所以我想这就是你想要的 (还将html标签作为奖励投放):
digraph {
compound=true;
node [shape=Mrecord]
rankdir="LR"
subgraph cluster0 {
label = "D"
style = rounded
B [label = "B"]
C [label = "C"]
}
A [label = <<table cellborder="0" style="rounded">
<tr><td>A</td></tr>
<hr/>
<tr><td>entry / EnterA<br/>exit / ExitA</td></tr>
</table>>
margin=0 shape=none]
A -> B [style="solid" label="X"];
A -> C [style="solid" label="X"];
}