network_drawer 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/examples/simple.json +18 -14
- data/examples/simple.png +0 -0
- data/examples/simple.svg +118 -92
- data/examples/simple.yml +9 -9
- data/lib/network_drawer/cli.rb +3 -0
- data/lib/network_drawer/diagram.rb +1 -0
- data/lib/network_drawer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54206d3c0db05645a83f274b6900a4166abcb162
|
4
|
+
data.tar.gz: 249d6d136532330d9b7cd4f1fdd92d31a4e8fc73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9d48a3419d26a17037316c07730ba32042dacfe008e17e388ab3834470c30bbb5203b2f374d0d6f26f9c741339a8b70d527b72ac8fb9e86a714e67bccdf6c86
|
7
|
+
data.tar.gz: a10a95559f0415afaadd4a979c34814513b81af29b26e79fc39ac438cad7a5f1ade9545ba49633568dbf453e85b584117ed57dc0d61337e1450d223c836888c0
|
data/README.md
CHANGED
@@ -48,6 +48,10 @@ You can draw a network diagram with specified style:
|
|
48
48
|
|
49
49
|
$ bundle exec network_drawer draw examples/simple.yml -s examples/simple_style.yml
|
50
50
|
|
51
|
+
You can draw a network diagram with specified layout(dot, fdp..):
|
52
|
+
|
53
|
+
$ bundle exec network_drawer draw examples/simple.json -l fdp
|
54
|
+
|
51
55
|
You can draw a network diagram with png format:
|
52
56
|
|
53
57
|
$ bundle exec network_drawer draw examples/simple.json -f png
|
data/examples/simple.json
CHANGED
@@ -12,22 +12,26 @@
|
|
12
12
|
},
|
13
13
|
{ "Web001": { "ports": ["80/tcp"] } },
|
14
14
|
{ "Web002": { "ports": ["80/tcp"] } }
|
15
|
-
]
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
15
|
+
],
|
16
|
+
"layers": [
|
17
|
+
{
|
18
|
+
"Image": {
|
19
|
+
"nodes": [
|
20
|
+
{
|
21
|
+
"ImageWeb001": {
|
22
|
+
"ports": ["80/tcp"]
|
23
|
+
}
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"ImageWeb002": {
|
27
|
+
"ports": ["80/tcp"]
|
28
|
+
}
|
29
|
+
}
|
30
|
+
]
|
27
31
|
}
|
28
32
|
}
|
29
|
-
|
30
|
-
|
33
|
+
]
|
34
|
+
}
|
31
35
|
},
|
32
36
|
{
|
33
37
|
"App": {
|
data/examples/simple.png
CHANGED
Binary file
|
data/examples/simple.svg
CHANGED
@@ -4,35 +4,61 @@
|
|
4
4
|
<!-- Generated by graphviz version 2.34.0 (20140129.0153)
|
5
5
|
-->
|
6
6
|
<!-- Title: simple Pages: 1 -->
|
7
|
-
<svg width="
|
8
|
-
viewBox="0.00 0.00
|
9
|
-
<g id="0" class="graph" transform="scale(1 1) rotate(0) translate(4
|
7
|
+
<svg width="533pt" height="492pt"
|
8
|
+
viewBox="0.00 0.00 533.00 492.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
9
|
+
<g id="0" class="graph" transform="scale(1 1) rotate(0) translate(4 488)">
|
10
10
|
<title>simple</title>
|
11
|
-
<polygon fill="white" stroke="white" points="-4,4 -4,-
|
11
|
+
<polygon fill="white" stroke="white" points="-4,4 -4,-488 529,-488 529,4 -4,4"/>
|
12
12
|
<g id="1" class="cluster"><title>cluster_Web</title>
|
13
|
-
<polygon fill="none" stroke="black" points="
|
14
|
-
<text text-anchor="middle" x="
|
13
|
+
<polygon fill="none" stroke="black" points="104,-212 104,-440 517,-440 517,-212 104,-212"/>
|
14
|
+
<text text-anchor="middle" x="310.5" y="-422" font-family="Helvetica,sans-Serif" font-size="14.00">Web</text>
|
15
15
|
</g>
|
16
|
-
<g id="2" class="cluster"><title>
|
17
|
-
<polygon fill="none" stroke="black" points="
|
18
|
-
<text text-anchor="middle" x="
|
16
|
+
<g id="2" class="cluster"><title>cluster_Image</title>
|
17
|
+
<polygon fill="none" stroke="black" points="240,-308 240,-408 509,-408 509,-308 240,-308"/>
|
18
|
+
<text text-anchor="middle" x="374.5" y="-390" font-family="Helvetica,sans-Serif" font-size="14.00">Image</text>
|
19
|
+
</g>
|
20
|
+
<g id="3" class="cluster"><title>cluster_App</title>
|
21
|
+
<polygon fill="none" stroke="black" points="46,-8 46,-204 303,-204 303,-8 46,-8"/>
|
22
|
+
<text text-anchor="middle" x="174.5" y="-186" font-family="Helvetica,sans-Serif" font-size="14.00">App</text>
|
19
23
|
</g>
|
20
24
|
<!-- 0 -->
|
21
25
|
<g id="0" class="node"><title>0</title>
|
22
|
-
<g id="a_0"><a xlink:
|
23
|
-
<
|
24
|
-
<polygon fill="none" stroke="black" points="
|
25
|
-
<text text-anchor="start" x="
|
26
|
-
<polygon fill="none" stroke="black" points="
|
27
|
-
<text text-anchor="start" x="
|
28
|
-
<polygon fill="none" stroke="black" points="151,-322 151,-344 249,-344 249,-322 151,-322"/>
|
29
|
-
<text text-anchor="start" x="177.168" y="-327" font-family="Helvetica,sans-Serif" font-size="14.00">WebLB</text>
|
26
|
+
<g id="a_0"><a xlink:title="ImageWeb001">
|
27
|
+
<polygon fill="none" stroke="black" points="500.25,-375.5 383.75,-375.5 383.75,-316.5 500.25,-316.5 500.25,-375.5"/>
|
28
|
+
<polygon fill="none" stroke="black" points="394,-346 394,-369 491,-369 491,-346 394,-346"/>
|
29
|
+
<text text-anchor="start" x="423.431" y="-351.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
|
30
|
+
<polygon fill="none" stroke="black" points="394,-322 394,-344 491,-344 491,-322 394,-322"/>
|
31
|
+
<text text-anchor="start" x="397.096" y="-327" font-family="Helvetica,sans-Serif" font-size="14.00">ImageWeb001</text>
|
30
32
|
</a>
|
31
33
|
</g>
|
32
34
|
</g>
|
33
35
|
<!-- 1 -->
|
34
36
|
<g id="1" class="node"><title>1</title>
|
35
|
-
<g id="a_1"><a xlink:title="
|
37
|
+
<g id="a_1"><a xlink:title="ImageWeb002">
|
38
|
+
<polygon fill="none" stroke="black" points="365.25,-375.5 248.75,-375.5 248.75,-316.5 365.25,-316.5 365.25,-375.5"/>
|
39
|
+
<polygon fill="none" stroke="black" points="259,-346 259,-369 356,-369 356,-346 259,-346"/>
|
40
|
+
<text text-anchor="start" x="288.431" y="-351.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
|
41
|
+
<polygon fill="none" stroke="black" points="259,-322 259,-344 356,-344 356,-322 259,-322"/>
|
42
|
+
<text text-anchor="start" x="262.096" y="-327" font-family="Helvetica,sans-Serif" font-size="14.00">ImageWeb002</text>
|
43
|
+
</a>
|
44
|
+
</g>
|
45
|
+
</g>
|
46
|
+
<!-- 2 -->
|
47
|
+
<g id="2" class="node"><title>2</title>
|
48
|
+
<g id="a_2"><a xlink:href="https://github.com/otahi/network_drawer/" xlink:title="WebLB">
|
49
|
+
<path fill="azure" stroke="black" stroke-dasharray="1,5" d="M218,-375.5C218,-375.5 124,-375.5 124,-375.5 118,-375.5 112,-369.5 112,-363.5 112,-363.5 112,-328.5 112,-328.5 112,-322.5 118,-316.5 124,-316.5 124,-316.5 218,-316.5 218,-316.5 224,-316.5 230,-322.5 230,-328.5 230,-328.5 230,-363.5 230,-363.5 230,-369.5 224,-375.5 218,-375.5"/>
|
50
|
+
<polygon fill="none" stroke="black" points="122,-346 122,-369 167,-369 167,-346 122,-346"/>
|
51
|
+
<text text-anchor="start" x="125.431" y="-351.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
|
52
|
+
<polygon fill="none" stroke="black" points="169,-346 169,-369 220,-369 220,-346 169,-346"/>
|
53
|
+
<text text-anchor="start" x="171.538" y="-351.9" font-family="Helvetica,sans-Serif" font-size="14.00">443/tcp</text>
|
54
|
+
<polygon fill="none" stroke="black" points="122,-322 122,-344 220,-344 220,-322 122,-322"/>
|
55
|
+
<text text-anchor="start" x="148.168" y="-327" font-family="Helvetica,sans-Serif" font-size="14.00">WebLB</text>
|
56
|
+
</a>
|
57
|
+
</g>
|
58
|
+
</g>
|
59
|
+
<!-- 3 -->
|
60
|
+
<g id="3" class="node"><title>3</title>
|
61
|
+
<g id="a_3"><a xlink:title="Web001">
|
36
62
|
<polygon fill="none" stroke="black" points="191,-279.5 113,-279.5 113,-220.5 191,-220.5 191,-279.5"/>
|
37
63
|
<polygon fill="none" stroke="black" points="123,-250 123,-273 181,-273 181,-250 123,-250"/>
|
38
64
|
<text text-anchor="start" x="132.931" y="-255.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
|
@@ -41,14 +67,14 @@
|
|
41
67
|
</a>
|
42
68
|
</g>
|
43
69
|
</g>
|
44
|
-
<!--
|
45
|
-
<g id="3" class="edge"><title>
|
46
|
-
<path fill="none" stroke="blue" d="
|
47
|
-
<polygon fill="blue" stroke="blue" points="
|
70
|
+
<!-- 2->3 -->
|
71
|
+
<g id="3" class="edge"><title>2->3:p80tcp</title>
|
72
|
+
<path fill="none" stroke="blue" d="M159.728,-316.444C156.596,-306.662 153.73,-295.356 152.558,-284.18"/>
|
73
|
+
<polygon fill="blue" stroke="blue" points="156.042,-283.793 152,-274 149.053,-284.177 156.042,-283.793"/>
|
48
74
|
</g>
|
49
|
-
<!--
|
50
|
-
<g id="
|
51
|
-
<g id="
|
75
|
+
<!-- 4 -->
|
76
|
+
<g id="4" class="node"><title>4</title>
|
77
|
+
<g id="a_4"><a xlink:title="Web002">
|
52
78
|
<polygon fill="none" stroke="black" points="287,-279.5 209,-279.5 209,-220.5 287,-220.5 287,-279.5"/>
|
53
79
|
<polygon fill="none" stroke="black" points="219,-250 219,-273 277,-273 277,-250 219,-250"/>
|
54
80
|
<text text-anchor="start" x="228.931" y="-255.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
|
@@ -57,14 +83,14 @@
|
|
57
83
|
</a>
|
58
84
|
</g>
|
59
85
|
</g>
|
60
|
-
<!--
|
61
|
-
<g id="4" class="edge"><title>
|
62
|
-
<path fill="none" stroke="blue" d="
|
63
|
-
<polygon fill="blue" stroke="blue" points="212.
|
86
|
+
<!-- 2->4 -->
|
87
|
+
<g id="4" class="edge"><title>2->4:p80tcp</title>
|
88
|
+
<path fill="none" stroke="blue" d="M184.178,-316.436C192.374,-299.367 202.768,-279.054 210.398,-268.737"/>
|
89
|
+
<polygon fill="blue" stroke="blue" points="212.837,-271.252 218,-262 208.195,-266.013 212.837,-271.252"/>
|
64
90
|
</g>
|
65
|
-
<!--
|
66
|
-
<g id="
|
67
|
-
<g id="
|
91
|
+
<!-- 5 -->
|
92
|
+
<g id="5" class="node"><title>5</title>
|
93
|
+
<g id="a_5"><a xlink:title="AppLB">
|
68
94
|
<path fill="azure" stroke="black" stroke-dasharray="1,5" d="M218.25,-171.5C218.25,-171.5 131.75,-171.5 131.75,-171.5 125.75,-171.5 119.75,-165.5 119.75,-159.5 119.75,-159.5 119.75,-124.5 119.75,-124.5 119.75,-118.5 125.75,-112.5 131.75,-112.5 131.75,-112.5 218.25,-112.5 218.25,-112.5 224.25,-112.5 230.25,-118.5 230.25,-124.5 230.25,-124.5 230.25,-159.5 230.25,-159.5 230.25,-165.5 224.25,-171.5 218.25,-171.5"/>
|
69
95
|
<polygon fill="none" stroke="black" points="130,-142 130,-165 175,-165 175,-142 130,-142"/>
|
70
96
|
<text text-anchor="start" x="133.431" y="-147.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
|
@@ -75,92 +101,92 @@
|
|
75
101
|
</a>
|
76
102
|
</g>
|
77
103
|
</g>
|
78
|
-
<!--
|
79
|
-
<g id="5" class="edge"><title>
|
104
|
+
<!-- 3->5 -->
|
105
|
+
<g id="5" class="edge"><title>3->5:p80tcp</title>
|
80
106
|
<path fill="none" stroke="blue" d="M152,-220.191C152,-207.217 152,-191.442 152,-176.321"/>
|
81
107
|
<polygon fill="blue" stroke="blue" points="155.5,-176 152,-166 148.5,-176 155.5,-176"/>
|
82
108
|
</g>
|
83
|
-
<!--
|
84
|
-
<g id="6" class="edge"><title>
|
109
|
+
<!-- 4->5 -->
|
110
|
+
<g id="6" class="edge"><title>4->5:p80tcp</title>
|
85
111
|
<path fill="none" stroke="blue" d="M212.526,-220.441C192.443,-204.036 169.215,-184.601 158.292,-173.792"/>
|
86
112
|
<polygon fill="blue" stroke="blue" points="161.006,-171.581 152,-166 155.559,-175.979 161.006,-171.581"/>
|
87
113
|
</g>
|
88
|
-
<!--
|
89
|
-
<g id="
|
90
|
-
<g id="
|
91
|
-
<polygon fill="none" stroke="black" points="
|
92
|
-
<polygon fill="none" stroke="black" points="
|
93
|
-
<text text-anchor="start" x="
|
94
|
-
<polygon fill="none" stroke="black" points="
|
95
|
-
<text text-anchor="start" x="
|
96
|
-
<polygon fill="none" stroke="black" points="
|
97
|
-
<text text-anchor="start" x="
|
114
|
+
<!-- 6 -->
|
115
|
+
<g id="6" class="node"><title>6</title>
|
116
|
+
<g id="a_6"><a xlink:title="App001">
|
117
|
+
<polygon fill="none" stroke="black" points="165.25,-75.5 54.75,-75.5 54.75,-16.5 165.25,-16.5 165.25,-75.5"/>
|
118
|
+
<polygon fill="none" stroke="black" points="65,-46 65,-69 110,-69 110,-46 65,-46"/>
|
119
|
+
<text text-anchor="start" x="68.4312" y="-51.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
|
120
|
+
<polygon fill="none" stroke="black" points="112,-46 112,-69 156,-69 156,-46 112,-46"/>
|
121
|
+
<text text-anchor="start" x="114.931" y="-51.9" font-family="Helvetica,sans-Serif" font-size="14.00">25/tcp</text>
|
122
|
+
<polygon fill="none" stroke="black" points="65,-22 65,-44 156,-44 156,-22 65,-22"/>
|
123
|
+
<text text-anchor="start" x="86.3657" y="-27" font-family="Helvetica,sans-Serif" font-size="14.00">App001</text>
|
98
124
|
</a>
|
99
125
|
</g>
|
100
126
|
</g>
|
101
|
-
<!--
|
102
|
-
<g id="7" class="edge"><title>
|
103
|
-
<path fill="none" stroke="green" d="
|
104
|
-
<polygon fill="green" stroke="green" points="
|
127
|
+
<!-- 5->6 -->
|
128
|
+
<g id="7" class="edge"><title>5->6:p25tcp</title>
|
129
|
+
<path fill="none" stroke="green" d="M149.5,-112.32C143.052,-102.894 137.306,-91.8436 135.033,-80.2736"/>
|
130
|
+
<polygon fill="green" stroke="green" points="138.483,-79.5995 134,-70 131.518,-80.3001 138.483,-79.5995"/>
|
105
131
|
</g>
|
106
|
-
<!--
|
107
|
-
<g id="8" class="edge"><title>
|
108
|
-
<path fill="none" stroke="blue" d="
|
109
|
-
<polygon fill="blue" stroke="blue" points="
|
132
|
+
<!-- 5->6 -->
|
133
|
+
<g id="8" class="edge"><title>5->6:p80tcp</title>
|
134
|
+
<path fill="none" stroke="blue" d="M119.268,-117.548C104.806,-108.2 92.1675,-95.862 88.2503,-80.1911"/>
|
135
|
+
<polygon fill="blue" stroke="blue" points="91.6918,-79.4993 87,-70 84.7439,-80.3518 91.6918,-79.4993"/>
|
110
136
|
</g>
|
111
|
-
<!--
|
112
|
-
<g id="
|
113
|
-
<g id="
|
114
|
-
<polygon fill="none" stroke="black" points="
|
115
|
-
<polygon fill="none" stroke="black" points="
|
116
|
-
<text text-anchor="start" x="
|
117
|
-
<polygon fill="none" stroke="black" points="
|
118
|
-
<text text-anchor="start" x="
|
119
|
-
<polygon fill="none" stroke="black" points="
|
120
|
-
<text text-anchor="start" x="
|
137
|
+
<!-- 7 -->
|
138
|
+
<g id="7" class="node"><title>7</title>
|
139
|
+
<g id="a_7"><a xlink:title="App002">
|
140
|
+
<polygon fill="none" stroke="black" points="294.25,-75.5 183.75,-75.5 183.75,-16.5 294.25,-16.5 294.25,-75.5"/>
|
141
|
+
<polygon fill="none" stroke="black" points="194,-46 194,-69 239,-69 239,-46 194,-46"/>
|
142
|
+
<text text-anchor="start" x="197.431" y="-51.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
|
143
|
+
<polygon fill="none" stroke="black" points="241,-46 241,-69 285,-69 285,-46 241,-46"/>
|
144
|
+
<text text-anchor="start" x="243.931" y="-51.9" font-family="Helvetica,sans-Serif" font-size="14.00">25/tcp</text>
|
145
|
+
<polygon fill="none" stroke="black" points="194,-22 194,-44 285,-44 285,-22 194,-22"/>
|
146
|
+
<text text-anchor="start" x="215.366" y="-27" font-family="Helvetica,sans-Serif" font-size="14.00">App002</text>
|
121
147
|
</a>
|
122
148
|
</g>
|
123
149
|
</g>
|
124
|
-
<!--
|
125
|
-
<g id="9" class="edge"><title>
|
126
|
-
<path fill="none" stroke="green" d="M230.
|
127
|
-
<polygon fill="green" stroke="green" points="
|
150
|
+
<!-- 5->7 -->
|
151
|
+
<g id="9" class="edge"><title>5->7:p25tcp</title>
|
152
|
+
<path fill="none" stroke="green" d="M230.732,-117.548C245.194,-108.2 257.833,-95.862 261.75,-80.1911"/>
|
153
|
+
<polygon fill="green" stroke="green" points="265.256,-80.3518 263,-70 258.308,-79.4993 265.256,-80.3518"/>
|
128
154
|
</g>
|
129
|
-
<!--
|
130
|
-
<g id="10" class="edge"><title>
|
131
|
-
<path fill="none" stroke="blue" d="
|
132
|
-
<polygon fill="blue" stroke="blue" points="
|
155
|
+
<!-- 5->7 -->
|
156
|
+
<g id="10" class="edge"><title>5->7:p80tcp</title>
|
157
|
+
<path fill="none" stroke="blue" d="M200.5,-112.32C206.948,-102.894 212.694,-91.8436 214.967,-80.2736"/>
|
158
|
+
<polygon fill="blue" stroke="blue" points="218.482,-80.3001 216,-70 211.517,-79.5995 218.482,-80.3001"/>
|
133
159
|
</g>
|
134
|
-
<!--
|
135
|
-
<g id="
|
136
|
-
<g id="
|
137
|
-
<polygon fill="none" stroke="black" points="
|
138
|
-
<text text-anchor="start" x="
|
160
|
+
<!-- 8 -->
|
161
|
+
<g id="8" class="node"><title>8</title>
|
162
|
+
<g id="a_8"><a xlink:title="Browser">
|
163
|
+
<polygon fill="none" stroke="black" points="208,-484 132,-484 132,-448 208,-448 208,-484"/>
|
164
|
+
<text text-anchor="start" x="144.328" y="-459.9" font-family="Helvetica,sans-Serif" font-size="14.00">Browser</text>
|
139
165
|
</a>
|
140
166
|
</g>
|
141
167
|
</g>
|
142
|
-
<!--
|
143
|
-
<g id="0" class="edge"><title>
|
144
|
-
<path fill="none" stroke="blue" d="
|
145
|
-
<polygon fill="blue" stroke="blue" points="
|
168
|
+
<!-- 8->2 -->
|
169
|
+
<g id="0" class="edge"><title>8->2:p80tcp</title>
|
170
|
+
<path fill="none" stroke="blue" d="M162.34,-447.876C155.599,-431.413 146.54,-405.394 144.445,-380.295"/>
|
171
|
+
<polygon fill="blue" stroke="blue" points="147.929,-379.839 144,-370 140.935,-380.142 147.929,-379.839"/>
|
146
172
|
</g>
|
147
|
-
<!--
|
148
|
-
<g id="1" class="edge"><title>
|
149
|
-
<path fill="none" stroke="black" d="
|
150
|
-
<polygon fill="black" stroke="black" points="
|
173
|
+
<!-- 8->2 -->
|
174
|
+
<g id="1" class="edge"><title>8->2:p443tcp</title>
|
175
|
+
<path fill="none" stroke="black" d="M177.366,-447.848C183.847,-431.362 192.557,-405.325 194.572,-380.272"/>
|
176
|
+
<polygon fill="black" stroke="black" points="198.081,-380.137 195,-370 191.087,-379.846 198.081,-380.137"/>
|
151
177
|
</g>
|
152
|
-
<!--
|
153
|
-
<g id="
|
154
|
-
<g id="
|
178
|
+
<!-- 9 -->
|
179
|
+
<g id="9" class="node"><title>9</title>
|
180
|
+
<g id="a_9"><a xlink:title="Mail Server">
|
155
181
|
<polygon fill="none" stroke="black" points="94.25,-268 -0.25,-268 -0.25,-232 94.25,-232 94.25,-268"/>
|
156
182
|
<text text-anchor="start" x="12.1035" y="-243.9" font-family="Helvetica,sans-Serif" font-size="14.00">Mail Server</text>
|
157
183
|
</a>
|
158
184
|
</g>
|
159
185
|
</g>
|
160
|
-
<!--
|
161
|
-
<g id="2" class="edge"><title>
|
162
|
-
<path fill="none" stroke="green" d="
|
163
|
-
<polygon fill="green" stroke="green" points="201.
|
186
|
+
<!-- 9->5 -->
|
187
|
+
<g id="2" class="edge"><title>9->5:p25tcp</title>
|
188
|
+
<path fill="none" stroke="green" d="M69.6461,-231.889C78.8316,-225.297 89.6903,-217.933 100,-212 138.766,-189.69 190.193,-210.654 197.991,-176.054"/>
|
189
|
+
<polygon fill="green" stroke="green" points="201.484,-176.299 199,-166 194.519,-175.601 201.484,-176.299"/>
|
164
190
|
</g>
|
165
191
|
</g>
|
166
192
|
</svg>
|
data/examples/simple.yml
CHANGED
@@ -13,15 +13,15 @@ layers:
|
|
13
13
|
- Web002:
|
14
14
|
ports:
|
15
15
|
- 80/tcp
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
ImageWeb001:
|
20
|
-
|
21
|
-
|
22
|
-
ImageWeb002:
|
23
|
-
|
24
|
-
|
16
|
+
layers:
|
17
|
+
- Image:
|
18
|
+
nodes:
|
19
|
+
- ImageWeb001:
|
20
|
+
ports:
|
21
|
+
- 80/tcp
|
22
|
+
- ImageWeb002:
|
23
|
+
ports:
|
24
|
+
- 80/tcp
|
25
25
|
- App:
|
26
26
|
nodes:
|
27
27
|
- AppLB:
|
data/lib/network_drawer/cli.rb
CHANGED
@@ -7,6 +7,8 @@ module NetworkDrawer
|
|
7
7
|
desc 'draw SOURCE', 'draw network diagram with SOURCE file'
|
8
8
|
option(:style, aliases: :s,
|
9
9
|
banner: 'STYLE_FILE_IN_JSON')
|
10
|
+
option(:layout, aliases: :l,
|
11
|
+
banner: 'GRAPHVIZ LAYOUT such as dot fdp ..')
|
10
12
|
option(:format, aliases: :f,
|
11
13
|
banner: 'OUTPUT_FILE_FORMAT such as svg, png',
|
12
14
|
default: :svg)
|
@@ -14,6 +16,7 @@ module NetworkDrawer
|
|
14
16
|
src = Source.read(source_file)
|
15
17
|
op = {}
|
16
18
|
op = { style: Source.read(options[:style]) } if options[:style]
|
19
|
+
op.merge!(layout: options[:layout])
|
17
20
|
op.merge!(format: options[:format])
|
18
21
|
dest_file = source_file.gsub(File.extname(source_file), '')
|
19
22
|
Diagram.draw(src, dest_file, op)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: network_drawer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Ota
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gviz
|