一、简单数据结构图

digraph structs {
    node [shape=record];
    struct1 [shape=record,label="<f0> left|<f1> mid\ dle|<f2> right"];
    //record图形,三个属性f0,f1,f2
    struct2 [shape=record,label="<f0> one|<f1> two"];
    struct3 [shape=record,label="hello\nworld |{ b |{c|<here> d|e}| f}| g | h"];
    struct1 -> struct2:f1;
    //指向struct2 的f1属性
    struct1 -> struct3;
}

113003989.png


二、子图

digraph g {
    subgraph cluster0 {
        //我是一个子图,subgraph定义了我,
        node[style = filled, color = white];
        //我之内的节点都是这种样式
        style = filled;
        //我的样式是填充
        color = lightgrey;
        //我的颜色
        a0->a1->a2->a3;
        label = "prcess #1"
        //我的标题
    }
    subgraph cluster1 {
        //我也是一个子图
        node[style = filled];
        b0->b1->b2->b3;
        label = "process #2";
        color = blue;
    }
             
}

131744355.png

画一个子图就是subgraph cluster#,必须有cluster 前缀。