graphviz layer 教程(非布局)

官方 pdf 上讲解的很少,没有图片.

http://www.graphviz.org/wiki/how-use-drawing-layers-overlays 这里有图片,但是又没有说如何生成.

直接用 graphviz 打开,只有一副图片. 完全不懂含义.

layer 含义:

  层次. 2层,就是两张图片叠加. [并非 平面布局] 和 包含的层次. 包含的层级是 level

代码:

layer_example.dot 文件:

digraph structs {
 layers = "spec:design:code:debug:ship";
node90
node91 [layer = "design:debug"];
node92 [layer = "all:code"];
node93 [layer = "spec:code,ship"];
node90 -> node91 [layer = "all"];
}

利用 dot 命令执行(目前 layer 只支持PostScript模式, 故参数-T 的值设置为 ps ):

dot -Tps layer_example.dot -olayer_example_out.ps

 用福新 pdf 阅读器就可以打开了,会有五页纸.

或者用专门的PostScript格式打开.

原文地址:https://www.cnblogs.com/fei33423/p/6959821.html