Graphviz
Graphviz 是一款由 AT&T Research 和 Lucent Bell 实验室开源的可视化图形工具,可以很方便的用来绘制结构化的图形网络,支持多种格式输出
使用dot作为脚本语言
官网 https://www.graphviz.org/
下载 https://www.graphviz.org/download/
安装graphviz并设置环境变量,eg:D:\Program Files\Graphviz 2.44.1\bin
检查是否安装成功
eg:
first.dot
digraph first2{ a; b; c; d; a->b; b->d; c->d; }
运行
dot -Tpng first.dot -o first.png
添加顶点和边的新定义
digraph first2{ node [shape="record"]; edge [style="dashed"]; a; b; c; d; a->b; b->d; c->d; }
digraph g { node[peripheries=2, style=filled, color="#eecc80"]; a->b [color=red, style=dashed]; b->c; b->d [arrowhead=box]; b->e [dir=none]; d->f [dir=both]; f->h [label=go]; f->k [arrowhead=diamond]; }
digraph g { node [shape = record,height=.1]; node0[label = "<f0> |<f1> G|<f2> "]; node1[label = "<f0> |<f1> E|<f2> "]; node2[label = "<f0> |<f1> B|<f2> "]; node3[label = "<f0> |<f1> F|<f2> "]; node4[label = "<f0> |<f1> R|<f2> "]; node5[label = "<f0> |<f1> H|<f2> "]; node6[label = "<f0> |<f1> Y|<f2> "]; node7[label = "<f0> |<f1> A|<f2> "]; node8[label = "<f0> |<f1> C|<f2> "]; "node0":f2 -> "node4":f1; "node0":f0 -> "node1":f1; "node1":f0 -> "node2":f1; "node1":f2 -> "node3":f1; "node2":f2 -> "node8":f1; "node2":f0 -> "node7":f1; "node4":f2 -> "node6":f1; "node4":f0 -> "node5":f1; }