network_drawer 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e3fd2565dcf2fc91d794f85263bfb54214f6730
4
- data.tar.gz: 1f7503b24294cec4c9bf6d34cae092d4a2efcb2d
3
+ metadata.gz: 54206d3c0db05645a83f274b6900a4166abcb162
4
+ data.tar.gz: 249d6d136532330d9b7cd4f1fdd92d31a4e8fc73
5
5
  SHA512:
6
- metadata.gz: 5a79d2f85c393a680bc50ee2552f81cffed56741570cd6adc3a81dc0058a76bb480f7316194f1aeeb2286e6f0c352c5235b9521e750b04549ceacdf2a94b4723
7
- data.tar.gz: eef66c5545b072c38df3e58d9f61822510febc96063022b9cb87dbb5bac75b88e7f56d766172930ab5c73c8c0819cdc4b6511b7ac4362e9bf45c467f9ecba1af
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
@@ -12,22 +12,26 @@
12
12
  },
13
13
  { "Web001": { "ports": ["80/tcp"] } },
14
14
  { "Web002": { "ports": ["80/tcp"] } }
15
- ]
16
- },
17
- "layers": [
18
- {
19
- "Image": {
20
- "nodes": {
21
- "ImageWeb001": {
22
- "ports": ["80/tcp"]
23
- },
24
- "ImageWeb002": {
25
- "ports": ["80/tcp"]
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": {
Binary file
@@ -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="336pt" height="460pt"
8
- viewBox="0.00 0.00 336.00 460.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 456)">
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,-456 332,-456 332,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="105,-212 105,-408 295,-408 295,-212 105,-212"/>
14
- <text text-anchor="middle" x="200" y="-390" font-family="Helvetica,sans-Serif" font-size="14.00">Web</text>
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>cluster_App</title>
17
- <polygon fill="none" stroke="black" points="63,-8 63,-204 320,-204 320,-8 63,-8"/>
18
- <text text-anchor="middle" x="191.5" y="-186" font-family="Helvetica,sans-Serif" font-size="14.00">App</text>
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:href="https://github.com/otahi/network_drawer/" xlink:title="WebLB">
23
- <path fill="azure" stroke="black" stroke-dasharray="1,5" d="M247,-375.5C247,-375.5 153,-375.5 153,-375.5 147,-375.5 141,-369.5 141,-363.5 141,-363.5 141,-328.5 141,-328.5 141,-322.5 147,-316.5 153,-316.5 153,-316.5 247,-316.5 247,-316.5 253,-316.5 259,-322.5 259,-328.5 259,-328.5 259,-363.5 259,-363.5 259,-369.5 253,-375.5 247,-375.5"/>
24
- <polygon fill="none" stroke="black" points="151,-346 151,-369 196,-369 196,-346 151,-346"/>
25
- <text text-anchor="start" x="154.431" y="-351.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
26
- <polygon fill="none" stroke="black" points="198,-346 198,-369 249,-369 249,-346 198,-346"/>
27
- <text text-anchor="start" x="200.538" y="-351.9" font-family="Helvetica,sans-Serif" font-size="14.00">443/tcp</text>
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="Web001">
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
- <!-- 0&#45;&gt;1 -->
45
- <g id="3" class="edge"><title>0&#45;&gt;1:p80tcp</title>
46
- <path fill="none" stroke="blue" d="M199.141,-316.436C198.045,-299.18 195.572,-278.608 190.026,-268.401"/>
47
- <polygon fill="blue" stroke="blue" points="192,-265.499 182,-262 187.636,-270.972 192,-265.499"/>
70
+ <!-- 2&#45;&gt;3 -->
71
+ <g id="3" class="edge"><title>2&#45;&gt;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
- <!-- 2 -->
50
- <g id="2" class="node"><title>2</title>
51
- <g id="a_2"><a xlink:title="Web002">
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
- <!-- 0&#45;&gt;2 -->
61
- <g id="4" class="edge"><title>0&#45;&gt;2:p80tcp</title>
62
- <path fill="none" stroke="blue" d="M200.859,-316.436C201.955,-299.18 204.428,-278.608 209.974,-268.401"/>
63
- <polygon fill="blue" stroke="blue" points="212.364,-270.972 218,-262 208,-265.499 212.364,-270.972"/>
86
+ <!-- 2&#45;&gt;4 -->
87
+ <g id="4" class="edge"><title>2&#45;&gt;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
- <!-- 3 -->
66
- <g id="3" class="node"><title>3</title>
67
- <g id="a_3"><a xlink:title="AppLB">
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
- <!-- 1&#45;&gt;3 -->
79
- <g id="5" class="edge"><title>1&#45;&gt;3:p80tcp</title>
104
+ <!-- 3&#45;&gt;5 -->
105
+ <g id="5" class="edge"><title>3&#45;&gt;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
- <!-- 2&#45;&gt;3 -->
84
- <g id="6" class="edge"><title>2&#45;&gt;3:p80tcp</title>
109
+ <!-- 4&#45;&gt;5 -->
110
+ <g id="6" class="edge"><title>4&#45;&gt;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
- <!-- 4 -->
89
- <g id="4" class="node"><title>4</title>
90
- <g id="a_4"><a xlink:title="App001">
91
- <polygon fill="none" stroke="black" points="182.25,-75.5 71.75,-75.5 71.75,-16.5 182.25,-16.5 182.25,-75.5"/>
92
- <polygon fill="none" stroke="black" points="82,-46 82,-69 127,-69 127,-46 82,-46"/>
93
- <text text-anchor="start" x="85.4312" y="-51.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
94
- <polygon fill="none" stroke="black" points="129,-46 129,-69 173,-69 173,-46 129,-46"/>
95
- <text text-anchor="start" x="131.931" y="-51.9" font-family="Helvetica,sans-Serif" font-size="14.00">25/tcp</text>
96
- <polygon fill="none" stroke="black" points="82,-22 82,-44 173,-44 173,-22 82,-22"/>
97
- <text text-anchor="start" x="103.366" y="-27" font-family="Helvetica,sans-Serif" font-size="14.00">App001</text>
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
- <!-- 3&#45;&gt;4 -->
102
- <g id="7" class="edge"><title>3&#45;&gt;4:p25tcp</title>
103
- <path fill="none" stroke="green" d="M160.623,-112.37C156.71,-102.677 153.148,-91.4558 151.693,-80.2467"/>
104
- <polygon fill="green" stroke="green" points="155.167,-79.7409 151,-70 148.183,-80.2135 155.167,-79.7409"/>
127
+ <!-- 5&#45;&gt;6 -->
128
+ <g id="7" class="edge"><title>5&#45;&gt;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
- <!-- 3&#45;&gt;4 -->
107
- <g id="8" class="edge"><title>3&#45;&gt;4:p80tcp</title>
108
- <path fill="none" stroke="blue" d="M126.856,-112.424C116.765,-103.478 108.243,-92.5876 105.197,-79.976"/>
109
- <polygon fill="blue" stroke="blue" points="108.667,-79.5118 104,-70 101.716,-80.3458 108.667,-79.5118"/>
132
+ <!-- 5&#45;&gt;6 -->
133
+ <g id="8" class="edge"><title>5&#45;&gt;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
- <!-- 5 -->
112
- <g id="5" class="node"><title>5</title>
113
- <g id="a_5"><a xlink:title="App002">
114
- <polygon fill="none" stroke="black" points="311.25,-75.5 200.75,-75.5 200.75,-16.5 311.25,-16.5 311.25,-75.5"/>
115
- <polygon fill="none" stroke="black" points="211,-46 211,-69 256,-69 256,-46 211,-46"/>
116
- <text text-anchor="start" x="214.431" y="-51.9" font-family="Helvetica,sans-Serif" font-size="14.00">80/tcp</text>
117
- <polygon fill="none" stroke="black" points="258,-46 258,-69 302,-69 302,-46 258,-46"/>
118
- <text text-anchor="start" x="260.931" y="-51.9" font-family="Helvetica,sans-Serif" font-size="14.00">25/tcp</text>
119
- <polygon fill="none" stroke="black" points="211,-22 211,-44 302,-44 302,-22 211,-22"/>
120
- <text text-anchor="start" x="232.366" y="-27" font-family="Helvetica,sans-Serif" font-size="14.00">App002</text>
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
- <!-- 3&#45;&gt;5 -->
125
- <g id="9" class="edge"><title>3&#45;&gt;5:p25tcp</title>
126
- <path fill="none" stroke="green" d="M230.267,-125.47C252.302,-116.05 273.686,-101.572 278.832,-80.0328"/>
127
- <polygon fill="green" stroke="green" points="282.32,-80.3376 280,-70 275.367,-79.5283 282.32,-80.3376"/>
150
+ <!-- 5&#45;&gt;7 -->
151
+ <g id="9" class="edge"><title>5&#45;&gt;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
- <!-- 3&#45;&gt;5 -->
130
- <g id="10" class="edge"><title>3&#45;&gt;5:p80tcp</title>
131
- <path fill="none" stroke="blue" d="M181.385,-112.436C186.051,-94.4294 192.996,-72.8124 201.291,-63.1294"/>
132
- <polygon fill="blue" stroke="blue" points="203.16,-66.0907 210,-58 199.607,-60.059 203.16,-66.0907"/>
155
+ <!-- 5&#45;&gt;7 -->
156
+ <g id="10" class="edge"><title>5&#45;&gt;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
- <!-- 6 -->
135
- <g id="6" class="node"><title>6</title>
136
- <g id="a_6"><a xlink:title="Browser">
137
- <polygon fill="none" stroke="black" points="237,-452 161,-452 161,-416 237,-416 237,-452"/>
138
- <text text-anchor="start" x="173.328" y="-427.9" font-family="Helvetica,sans-Serif" font-size="14.00">Browser</text>
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
- <!-- 6&#45;&gt;0 -->
143
- <g id="0" class="edge"><title>6&#45;&gt;0:p80tcp</title>
144
- <path fill="none" stroke="blue" d="M187.672,-415.857C182.088,-406.095 176.087,-393.216 173.879,-380.063"/>
145
- <polygon fill="blue" stroke="blue" points="177.357,-379.657 173,-370 170.384,-380.267 177.357,-379.657"/>
168
+ <!-- 8&#45;&gt;2 -->
169
+ <g id="0" class="edge"><title>8&#45;&gt;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
- <!-- 6&#45;&gt;0 -->
148
- <g id="1" class="edge"><title>6&#45;&gt;0:p443tcp</title>
149
- <path fill="none" stroke="black" d="M209.893,-415.8C215.261,-406.018 221.032,-393.129 223.155,-380.02"/>
150
- <polygon fill="black" stroke="black" points="226.647,-380.259 224,-370 219.672,-379.67 226.647,-380.259"/>
173
+ <!-- 8&#45;&gt;2 -->
174
+ <g id="1" class="edge"><title>8&#45;&gt;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
- <!-- 7 -->
153
- <g id="7" class="node"><title>7</title>
154
- <g id="a_7"><a xlink:title="Mail Server">
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
- <!-- 7&#45;&gt;3 -->
161
- <g id="2" class="edge"><title>7&#45;&gt;3:p25tcp</title>
162
- <path fill="none" stroke="green" d="M70.1237,-231.94C79.4894,-225.355 90.5446,-217.983 101,-212 139.498,-189.969 190.301,-210.355 198.004,-175.979"/>
163
- <polygon fill="green" stroke="green" points="201.489,-176.298 199,-166 194.524,-175.603 201.489,-176.298"/>
186
+ <!-- 9&#45;&gt;5 -->
187
+ <g id="2" class="edge"><title>9&#45;&gt;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>
@@ -13,15 +13,15 @@ layers:
13
13
  - Web002:
14
14
  ports:
15
15
  - 80/tcp
16
- layers:
17
- - Image:
18
- nodes:
19
- ImageWeb001:
20
- ports:
21
- - 80/tcp
22
- ImageWeb002:
23
- ports:
24
- - 80/tcp
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:
@@ -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)
@@ -29,6 +29,7 @@ module NetworkDrawer
29
29
  @connections = create_connections
30
30
  draw_elements
31
31
 
32
+ @gv.global(layout: @options[:layout] ? @options[:layout] : :dot)
32
33
  @gv.save @dest_file, @options[:format]
33
34
  end
34
35
 
@@ -1,3 +1,3 @@
1
1
  module NetworkDrawer
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
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.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-18 00:00:00.000000000 Z
11
+ date: 2015-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gviz