Skip to content

Commit f670ee3

Browse files
GraphViz init
1 parent a5ab8c4 commit f670ee3

File tree

9 files changed

+684
-0
lines changed

9 files changed

+684
-0
lines changed

ObjectOriented/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/iRage
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 2
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 2
6+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"# pip install graphviz\n",
10+
"# download GraphViz https://graphviz.gitlab.io/_pages/Download/Download_windows.html"
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": 9,
16+
"metadata": {},
17+
"outputs": [],
18+
"source": [
19+
"from graphviz import Digraph\n",
20+
"import os \n",
21+
"\n",
22+
"os.environ[\"PATH\"] += os.pathsep + 'C:/Program Files (x86)/Graphviz2.38/bin/'"
23+
]
24+
},
25+
{
26+
"cell_type": "code",
27+
"execution_count": 10,
28+
"metadata": {},
29+
"outputs": [
30+
{
31+
"name": "stdout",
32+
"output_type": "stream",
33+
"text": [
34+
"// The Round Table\n",
35+
"digraph {\n",
36+
"\tA [label=\"King Arthur\"]\n",
37+
"\tB [label=\"Sir Bedevere the Wise\"]\n",
38+
"\tL [label=\"Sir Lancelot the Brave\"]\n",
39+
"\tA -> B\n",
40+
"\tA -> L\n",
41+
"\tB -> L [constraint=false]\n",
42+
"}\n"
43+
]
44+
}
45+
],
46+
"source": [
47+
"dot = Digraph(comment='The Round Table')\n",
48+
"dot.node('A', 'King Arthur')\n",
49+
"dot.node('B', 'Sir Bedevere the Wise')\n",
50+
"dot.node('L', 'Sir Lancelot the Brave')\n",
51+
"dot.edges(['AB', 'AL'])\n",
52+
"dot.edge('B', 'L', constraint='false')\n",
53+
"print(dot.source)"
54+
]
55+
},
56+
{
57+
"cell_type": "code",
58+
"execution_count": 11,
59+
"metadata": {},
60+
"outputs": [
61+
{
62+
"data": {
63+
"text/plain": [
64+
"'test-output/round-table.gv.pdf'"
65+
]
66+
},
67+
"execution_count": 11,
68+
"metadata": {},
69+
"output_type": "execute_result"
70+
}
71+
],
72+
"source": [
73+
"dot.render('test-output/round-table.gv', view=True)"
74+
]
75+
},
76+
{
77+
"cell_type": "code",
78+
"execution_count": null,
79+
"metadata": {},
80+
"outputs": [],
81+
"source": []
82+
}
83+
],
84+
"metadata": {
85+
"kernelspec": {
86+
"display_name": "Python 3",
87+
"language": "python",
88+
"name": "python3"
89+
},
90+
"language_info": {
91+
"codemirror_mode": {
92+
"name": "ipython",
93+
"version": 3
94+
},
95+
"file_extension": ".py",
96+
"mimetype": "text/x-python",
97+
"name": "python",
98+
"nbconvert_exporter": "python",
99+
"pygments_lexer": "ipython3",
100+
"version": "3.6.3"
101+
}
102+
},
103+
"nbformat": 4,
104+
"nbformat_minor": 2
105+
}

ObjectOriented/LolViz/LolViz.ipynb

Lines changed: 538 additions & 0 deletions
Large diffs are not rendered by default.

ObjectOriented/LolViz/Source.gv

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
digraph G {
3+
nodesep=.05;
4+
node [penwidth="0.5", width=.1,height=.1];
5+
node765145432648 [shape="box", space="0.0", margin="0.01", fontcolor="#444443", fontname="Helvetica", label=<<table BORDER="0" CELLBORDER="0" CELLSPACING="0">
6+
<tr>
7+
<td cellspacing="0" cellpadding="0" bgcolor="#fefecd" border="1" sides="br" valign="top"><font color="#444443" point-size="9">0</font></td>
8+
<td cellspacing="0" cellpadding="0" bgcolor="#fefecd" border="1" sides="br" valign="top"><font color="#444443" point-size="9">1</font></td>
9+
<td cellspacing="0" cellpadding="0" bgcolor="#fefecd" border="1" sides="br" valign="top"><font color="#444443" point-size="9">2</font></td>
10+
<td cellspacing="0" cellpadding="0" bgcolor="#fefecd" border="1" sides="b" valign="top"><font color="#444443" point-size="9">3</font></td>
11+
</tr>
12+
<tr>
13+
<td port="0" bgcolor="#fefecd" border="1" sides="r" align="center"><font point-size="11">'hi'</font></td>
14+
<td port="1" bgcolor="#fefecd" border="1" sides="r" align="center"><font point-size="11">'mom'</font></td>
15+
<td port="2" bgcolor="#fefecd" border="1" sides="r" align="center"><font point-size="11">{3, 4}</font></td>
16+
<td port="3" bgcolor="#fefecd" border="0" align="center"><font point-size="11">{'parrt': 'user'}</font></td>
17+
</tr></table>
18+
>];
19+
}
22.2 KB
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// The Round Table
2+
digraph {
3+
A [label="King Arthur"]
4+
B [label="Sir Bedevere the Wise"]
5+
L [label="Sir Lancelot the Brave"]
6+
A -> B
7+
A -> L
8+
B -> L [constraint=false]
9+
}
21.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)