#+SETUPFILE: ~/Dropbox/Doc/Org_Templates/level-1.org
Integrate into Emacs
Reference: 使用graphviz画数据结构
Install
(load "graphviz-dot-mode.el" nil t t)
(add-hook 'find-file-hook (lambda()
(if (string= "dot" (file-name-extension
buffer-file-name))
(progn
(message "Enabling Setings for dot-mode")
(setq fill-column 1000)
(base-auto-pair)
(local-set-key (kbd "<C-f6>") 'compile)
)
)))
Tips
- C-cc 快速编译
- C-cp 预览图像
- M-; 注释或者取消注释
语法
digraph Name {
node [shape=record fontsize=12 fontname=Courier style=filled];
edge[color=blue];
rankdir=LR;
}
形状
name[shape=shapename]
默认是圆形, 有以下形状可供选择:
box
矩形
布局
graph [rankdir ="LR"]; // 从左到右, 默认是从上到下
子图
subgraph cluster_0 {
label = "QEMU";
backend [label="backend",color="red"];
virtserial [label="virtserialport",color="red"];
backend -> virtserial;
virtserial -> backend;
}