最近读易中天<先秦诸子百家>,一边读一边在纸上画出逻辑关系,图越来越复杂,趁中午休息索性就把图用Graphviz重新绘制了一下;由于Graphviz主动承担了绘图排版的职责,我只需要关注内容即可.
绘制出来的效果图如下,点小见大(无损图链接 http://www.cnblogs.com/me-sa/gallery/image/146547.html):
上图的源代码为:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
digraph show { // node
//rankdir = LR; node[shape="box" , fontname="DFKai-SB" fontsize=16 size="5,5" color="gray" distortion=.7]
edge[ fontname="DFKai-SB" fontsize=15 fontcolor="black" color="brown" style="filled"]
儒家[shape="egg"]
道家[shape="egg"]
法家[shape="egg"]
墨家[shape="egg"]
救世[shape="doubleoctagon"]
中庸[shape="Mdiamond"]
百家争鸣->儒家->克己复礼 百家争鸣->墨家->兼爱非攻 百家争鸣->法家法家->"不别亲疏,不殊贵贱,一断于法"
百家争鸣->道家儒家->孔子->孟子->荀子墨家->墨子墨家->为天下谋儒家->仁爱道家->杨朱->老子->庄子老子->善利万物而不争->示弱老子->无政府主义庄子->无政府主义庄子->己所不欲勿施于人->自由庄子->己所甚欲勿施于人->自由自由->逍遥游庄子->人生观->关你何事人生观->关我何事庄子->做人开心最重要->TVB杨朱->一毛不拔杨朱->且趣当生奚遑死后法家->韩非法家->两面三刀->奖惩两面三刀->势两面三刀->术两面三刀->法孔子->中庸孔子->礼乐孔子->鬼神[label="敬鬼神而远之"]
孔子->天命->使命孟子->义孟子->浩然大丈夫孟子->民权荀子->天道人性荀子->君子自强法家->君权儒家->救世[arrowhead="vee" color ="steelblue"]
墨家->救世[arrowhead="vee" color ="steelblue"]
法家->救世[arrowhead="vee" color ="steelblue"]
墨家->鬼神墨家->义士道家->儒家[arrowhead="vee" color ="gold" label="天下大骇儒墨皆起"]
道家->孔子[arrowhead="vee" color ="gold" label="圣人不死大盗不止"]
道家->墨家[arrowhead="vee" color ="gold" ]
道家->不爱道家->先存诸己而后存诸人法家->仁爱[arrowhead="vee" color ="gold" label="这玩意没用"]
法家->礼乐[arrowhead="vee" color ="gold" label="这玩意没用"]
法家->兼爱非攻[arrowhead="vee" color ="gold" label="这玩意没用"]
仁爱->兼爱非攻[arrowhead="vee" color ="gold" dir="both"]
仁爱->不爱[arrowhead="vee" color ="gold" dir="both"]
} |
想了解Graphviz?
官网在此 http://www.graphviz.org/Documentation.php
平时使用最多的参考图形和颜色,链接如下:
http://www.graphviz.org/content/color-names
http://www.graphviz.org/content/node-shapes
Just for fun!
文末需注明:本文转自博客园坚强2002的博客,原文链接:http://www.cnblogs.com/me-sa/p/just_for_fun.html,如需转载请自行联系原博主。