1)安装pydot半天没有弄好
2)下载安装包:
https://graphviz.org/download/
有很多版本
graphviz-12.2.1
- graphviz-12.2.1 (64-bit) ZIP archive [sha256] (contains all tools and libraries)
- graphviz-12.2.1 (32-bit) EXE installer [sha256]
- graphviz-12.2.1 (64-bit) EXE installer [sha256]
- graphviz-12.2.1 (32-bit) ZIP archive [sha256] (contains all tools and
3)安装时选择加入环境变量就行
我的环境变量就有这些:
典型的码农
还有游戏也是服了
4)
运行命令 dot -version
dot - graphviz version 12.2.0 (20241103.1931)
libdir = "D:\Program Files\Graphviz\bin"
Activated plugin library: gvplugin_dot_layout.dll
Using layout: dot:dot_layout
Activated plugin library: gvplugin_core.dll
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
D:\Program Files\Graphviz\bin\config6
was successfully loaded.
render : cairo dot dot_json fig gd gdiplus json json0 map pic pov ps svg svg_inline tk vrml xdot xdot_json
layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
textlayout : textlayout
device : bmp canon cmap cmapx cmapx_np dot dot_json emf emfplus eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg json json0 kitty kittyz metafile pdf pic plain plain-ext png pov ps ps2 svg svg_inline svgz tif tiff tk vrml vt vt-24bit vt-4up vt-6up vt-8up wbmp webp xdot xdot1.2 xdot1.4 xdot_json
loadimage : (lib) bmp eps gd gd2 gif jpe jpeg jpg png ps svg webp
确实安装了
5)
查看bin目录
里面各种各样的小工具还是挺多的。
6)pydot不行,那就生成dot格式文件,再直接 运行dot命令就行嘛
7)测试例子
graph pic1 {
a -- b
a -- b
b -- a [color=blue]
b -- c
b -- e
c -- d
}
8)测试结果
9)总结
不能不说
graphviz这种古老的工具还是挺牛逼的。