Skip to content

Commit 529203e

Browse files
committed
update chapter 1
Signed-off-by: PythonShell <pythonshell@yeah.net>
1 parent b5116c7 commit 529203e

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

_static/examples/graph03.dot

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
digraph G {
2+
魔兽争霸3 -> XHero;
3+
魔兽争霸3 -> 超级战舰;
4+
XHero -> Footman;
5+
Footman -> 刀塔;
6+
}

_static/examples/graph03.jpg

17.2 KB
Loading

chap01.rst

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
第一章 快速入门
22
==============================================================================
33

4-
画一个简单的有向图
4+
1.1 画一个简单的有向图
55
------------------------------------------------------------------------------
66

77
Graphviz 编译的源文件是 dot 文件,把如下的代码保存到 graph01.dot 文件。
@@ -27,7 +27,7 @@ Graphviz 编译的源文件是 dot 文件,把如下的代码保存到 graph01.
2727
.. image:: _static/examples/graph01.jpg
2828

2929

30-
让有向图更复杂点
30+
1.2 让有向图更复杂点
3131
------------------------------------------------------------------------------
3232

3333
Graphviz 可以给点(node)或者线(edge)添加格式。
@@ -57,3 +57,24 @@ Graphviz 可以给点(node)或者线(edge)添加格式。
5757
.. image:: _static/examples/graph02.jpg
5858

5959

60+
1.3 支持中文
61+
------------------------------------------------------------------------------
62+
63+
Graphviz 支持 UTF8 下的 中文。
64+
65+
.. code-block:: none
66+
:linenos:
67+
:caption: graph03.dot
68+
:name: Graph 03
69+
70+
digraph G {
71+
魔兽争霸3 -> XHero;
72+
魔兽争霸3 -> 超级战舰;
73+
XHero -> Footman;
74+
Footman -> 刀塔;
75+
}
76+
77+
使用命令 `dot -Tjpg graph03.dot -o graph03.jpg` 可以得到如下的图片:
78+
79+
.. image:: _static/examples/graph03.jpg
80+

0 commit comments

Comments
 (0)