GraphViz DOT有向图 - 复杂案例收集


案例教程 - 链接中有更多案例

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"];
}

案例 - 链接中有更多案例

https://blog.csdn.net/zhangskd/article/details/8250470

在这里插入图片描述

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;

}

案例时序图 - 链接中有更多案例

https://blog.csdn.net/bxh7425014/article/details/51142464

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"];
}

在这里插入图片描述

其他学习参考资料

官方文档

http://www.graphviz.org/documentation/

Node, Edge and Graph Attributes

https://graphviz.gitlab.io/_pages/doc/info/attrs.html

DOT

https://graphviz.gitlab.io/_pages/pdf/dotguide.pdf

如何使用graphviz绘制流程图

https://www.cnblogs.com/Coldbreath/articles/6238535.html

dot language 学习笔记

https://www.cnblogs.com/billnote/p/4043267.html#sec-2-1

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值