基本使用
最简单的图只定义node
// ClassDiagram 可以写,也可以不写
digraph ClassDiagram {
a->b;
b->c;
a->c;
c->d;
}
更改node说明
// ClassDiagram 可以写,也可以不写
digraph {
a[label="begin开始"];
b[label="第一步" shape="box"];
c[label="aa \n bb" shape="box" width="2"];
d[shape="box" label=<<table><tr><td>11</td><td>22</td></tr><tr><td>33</td><td>44</td></tr></table>>];
e[label="结束"];
a->b;
b->c;
a->c;
c->d;
d->e;
}//ClassDiagram
有node后,edit定义图线条样式
digraph {
a->b[color="red"];
b->c[headport="se" color="blue"];
a->c[style="dotted"];
c->d[label=" 这是一条线"];
}//ClassDiagram
Graph属性定义图片样式和方向
digraph {
label = "owen.bai";
rankdir=LR;
bgcolor="#FAF0E6";
fontcolor="#008B00";
a->b[color="red"];
b->c[headport="se" color="blue"];
a->c[style="dotted"];
c->d[label=" 这是一条线"];
}
subgraph 定义信息更完善的节点
digraph G {
rankdir=LR;
subgraph cluster1 {
fontsize = 20;
label = "Group 1";
rank=same;
A B C D [constraint=false];
style = "dashed";
}
subgraph cluster2 {
fontsize = 20;
label = "Group 2";
rank=same;
Z Y X W [dir=back, constraint=false];
style = "dashed";
}
// O [shape=box];
{A,B,C,D}->{Z,Y,X,W}
}