案例教程 - 链接中有更多案例
https://renenyffenegger.ch/notes/tools/Graphviz/examples/index
digraph D {
node [fontname="Arial"];
node_A [shape=record label="shape=record|{above|middle|below}|right"];
node_B [shape=plaintext label="shape=plaintext|{curly|braces and|bars without}|effect"];
}
案例 - 链接中有更多案例
digraph html {
rankdir = LR;
{
node[shape = plaintext];
1995 -> 1996 -> 1997 -> 1998 -> 1999 -> 2000 -> 2001;
}
{
node[shape = box, style = filled];
WAR3 -> Xhero -> Footman -> DOTA:
WAR3 -> Battleship;
}
{rank = same; 1996; WAR3;}
{rank = same; 1998; Xhero; Battleship;}
{rank = same; 1999; Footman;}
{rank = same; 2001; DOTA;}
}
---------------------
版权声明:本文为CSDN博主「zhangskd」的原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zhangskd/article/details/8250470
案例 - 链接中有更多案例
https://renenyffenegger.ch/notes/tools/Graphviz/examples/index
digraph D {
label = <The <font color='red'><b>foo</b></font>,<br/> the <font point-size='20'>bar</font> and<br/> the <i>baz</i>>;
labelloc = "t"; // place the label at the top (b seems to be default)
node [shape=plaintext]
FOO -> {BAR, BAZ};
}
案例
https://renenyffenegger.ch/notes/development/databases/SQL/data-types/index#sql-data-type-hierarchy
案例代码
// vi: foldmethod=marker foldmarker={{{,}}}
digraph SQL_DATATYPES {
root [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td><font point-size='19'><b>SQL Data Types</b></font></td></tr>
</table>
>]; // }}}
constructed [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td align=left>Constructed data types</td></tr>
<tr><td align=left>A.k.a composite data types</td></tr>
</table>
>]; // }}}
predefined [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td><b>Predefined</b> data types</td></tr>
</table>
>]; // }}}
numeric [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='1' cellborder='0'>
<tr><td align='left'>Numeric</td></tr>
</table>
>]; // }}}
numeric_excact [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1' cellspacing='0'>
<tr><td align='left' colspan='2'>Exact</td></tr>
<tr><td align='left'><font point-size='8' face='Courier'>NUMERIC</font></td><td align='left'></td></tr>
<tr><td align='left'><font point-size='8' face='Courier'>DECIMAL(p,s)</font></td><td align='left'><font point-size='8'><font face='Courier'>p</font> digits, <font face='Courier'>s</font> decimals</font></td></tr>
<tr><td align='left'><font point-size='8' face='Courier'>SMALLINT</font></td><td align='left'><font point-size='8'>2 byte (signed short)</font></td></tr>
<tr><td align='left'><font point-size='8' face='Courier'>INT/INTEGER</font></td><td align='left'><font point-size='8'>4 byte (signed int)</font></td></tr>
<tr><td align='left'><font point-size='8' face='Courier'>BIGINT</font></td><td></td></tr>
</table>
>]; // }}}
numeric_approximate [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1' cellspacing='0'>
<tr><td align='left'>Approximate</td></tr>
<tr><td align='left'><font point-size='8' face='Courier'>FLOAT</font></td></tr>
<tr><td align='left'><font point-size='8' face='Courier'>REAL</font></td></tr>
<tr><td align='left'><font point-size='8' face='Courier'>DOUBLE PRECISION</font></td></tr>
</table>
>]; // }}}
string [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td>String</td></tr>
</table>
>]; // }}}
string_blob [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td align='left'><font face='Courier'>BLOB</font></td></tr>
</table>
>]; // }}}
character [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td>Character</td></tr>
</table>
>]; // }}}
character_fixed [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1' cellspacing='0'>
<tr><td align='left'>Fixed</td></tr>
<tr><td align='left'><font face='Courier' point-size='8'>CHAR(n)</font></td></tr>
</table>
>]; // }}}
character_varying [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1' cellspacing='0'>
<tr><td align='left'>varying</td></tr>
<tr><td align='left'><font face='Courier' point-size='8'>VARCHAR(n)</font></td></tr>
<tr><td align='left'><font face='Courier' point-size='8'>TEXT</font></td></tr>
</table>
>]; // }}}
clob [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td><font face='Courier'>CLOB</font></td></tr>
</table>
>]; // }}}
datetime [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td>Datetime</td></tr>
</table>
>]; // }}}
date [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td>Date</td></tr>
</table>
>]; // }}}
time [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td>Time</td></tr>
</table>
>]; // }}}
timestamp [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td>Timestamp</td></tr>
</table>
>]; // }}}
boolean [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td>Boolean</td></tr>
</table>
>]; // }}}
interval [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td>Interval</td></tr>
</table>
>]; // }}}
udt [ // {{{
shape = plaintext
color = "#cccccc"
label = <
<table border='0' cellborder='1'>
<tr><td>User-defined types (UDT)</td></tr>
</table>
>]; // }}}
root -> constructed;
root -> predefined;
predefined -> numeric;
numeric -> numeric_excact;
numeric -> numeric_approximate;
predefined -> string;
string -> string_blob;
string -> character;
character -> character_fixed;
character -> character_varying;
character -> clob;
predefined -> datetime;
datetime -> date;
datetime -> time;
datetime -> timestamp;
predefined -> boolean;
predefined -> interval;
root -> udt;
}
案例时序图 - 链接中有更多案例
digraph G {
rankdir="LR";
node[shape="point", width=0, height=0];
edge[arrowhead="none", style="dashed"]
{
rank="same";
edge[style="solided"];
LC[shape="plaintext"];
LC -> step00 -> step01 -> step02 -> step03 -> step04 -> step05;
}
{
rank="same";
edge[style="solided"];
Agency[shape="plaintext"];
Agency -> step10 -> step11 -> step12 -> step13 -> step14 -> step15;
}
{
rank="same";
edge[style="solided"];
Agent[shape="plaintext"];
Agent -> step20 -> step21 -> step22 -> step23 -> step24 -> step25;
}
step00 -> step10 [label="sends email new custumer", arrowhead="normal"];
step11 -> step01 [label="declines", arrowhead="normal"];
step12 -> step02 [label="accepts", arrowhead="normal"];
step13 -> step23 [label="forward to", arrowhead="normal"];
step24 -> step14;
step14 -> step04 [arrowhead="normal"];
}
其他学习参考资料
官方文档
Node, Edge and Graph Attributes
DOT
如何使用graphviz绘制流程图
dot language 学习笔记