drawio_dsl 0.5.0 → 0.5.3

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.builders/.data/shapes.json +119 -2
  3. data/.builders/.templates/basic/configuration_shapes.rb +3 -3
  4. data/.builders/.templates/basic/schema_require.rb +1 -0
  5. data/.builders/blueprint/shapes.rb +42 -28
  6. data/.builders/generators/02-generate-app.rb +2 -0
  7. data/.builders/generators/project_plans/drawio_dsl.rb +24 -0
  8. data/.builders/generators/sample_diagrams/50-willoughby-council.rb +52 -0
  9. data/.rubocop.yml +5 -0
  10. data/CHANGELOG.md +23 -0
  11. data/lib/drawio_dsl/configuration_shapes.rb +49 -29
  12. data/lib/drawio_dsl/dom_builder.rb +5 -5
  13. data/lib/drawio_dsl/dom_builder_shapes.rb +50 -0
  14. data/lib/drawio_dsl/drawio_shapes.rb +87 -27
  15. data/lib/drawio_dsl/layout_engine.rb +1 -8
  16. data/lib/drawio_dsl/schema/_.rb +11 -0
  17. data/lib/drawio_dsl/schema/layouts/grid_layout.rb +17 -10
  18. data/lib/drawio_dsl/schema/node.rb +29 -24
  19. data/lib/drawio_dsl/schema/node_list.rb +37 -0
  20. data/lib/drawio_dsl/schema/page.rb +5 -5
  21. data/lib/drawio_dsl/schema/shapes/embed_col200.rb +9 -0
  22. data/lib/drawio_dsl/schema/shapes/embed_col50.rb +9 -0
  23. data/lib/drawio_dsl/schema/shapes/embed_row.rb +9 -0
  24. data/lib/drawio_dsl/schema/shapes/h1.rb +9 -0
  25. data/lib/drawio_dsl/schema/shapes/h2.rb +9 -0
  26. data/lib/drawio_dsl/schema/shapes/h3.rb +9 -0
  27. data/lib/drawio_dsl/schema/shapes/h4.rb +9 -0
  28. data/lib/drawio_dsl/schema/shapes/h5.rb +9 -0
  29. data/lib/drawio_dsl/schema/shapes/h6.rb +9 -0
  30. data/lib/drawio_dsl/schema/shapes/p.rb +9 -0
  31. data/lib/drawio_dsl/schema/shapes/shape.rb +15 -4
  32. data/lib/drawio_dsl/version.rb +1 -1
  33. data/lib/drawio_dsl/xml_builder.rb +2 -12
  34. data/package-lock.json +2 -2
  35. data/package.json +1 -1
  36. metadata +15 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4cd7150000e0bd48916f7c5605f1da32d91d5fa20cb221253a9acbaa8538e06
4
- data.tar.gz: 84355154d1847979120f71315f9cd1b9f79965e652184255bb849e24e6c54832
3
+ metadata.gz: 4e735678bedd529db9a041d28a842688541af3ed033de9d668db46dbfc27d0a9
4
+ data.tar.gz: 3405bc43946cff333fc0f6f8d0d80a0b6148499661c503493e08e41b096b177f
5
5
  SHA512:
6
- metadata.gz: b36ecdb34dcbcd5efc9309671650526590a98c41d7f7fb762349c401cd977284d33346ef8517b3dde60f827013f85b088dd839560e0d03b7c9dda1384e0816fa
7
- data.tar.gz: 58eacb1d2c4eee64d09380cc9e1c9c7c9c9e6b105377494df083c3a1895d70e78b92a8309caeb7582e706e09c72f51625aa1fec852522c4b48af34d2fef88817
6
+ metadata.gz: f43ae6045334b52711170355daca9fed592dbd2fbfae1600f7b2292ba97fe3945aca83beb847dbdf4fff4fcefb6a1925f332faffe2092efb792901085bb7c190
7
+ data.tar.gz: 7772b8d310b725a5cd328bc7d8c4494d733ff120dc2b18583e49206f3b3d4a44697d0f31e46767a93afb2f46b91bbd8dbe258400083a5feccaefa0c086f60c4c
@@ -1,6 +1,70 @@
1
1
  [
2
+ {
3
+ "type": "h1",
4
+ "text_only": true,
5
+ "x": 0,
6
+ "y": 0,
7
+ "w": 100,
8
+ "h": 50,
9
+ "style_modifiers": "text;fontSize=89;fontColor=#ffffff;fontStyle=1;fillColor=none"
10
+ },
11
+ {
12
+ "type": "h2",
13
+ "text_only": true,
14
+ "x": 0,
15
+ "y": 0,
16
+ "w": 100,
17
+ "h": 50,
18
+ "style_modifiers": "text;fontSize=67;fontColor=#ffffff;fontStyle=1;fillColor=none"
19
+ },
20
+ {
21
+ "type": "h3",
22
+ "text_only": true,
23
+ "x": 0,
24
+ "y": 0,
25
+ "w": 100,
26
+ "h": 50,
27
+ "style_modifiers": "text;fontSize=50;fontColor=#ffffff;fontStyle=1;fillColor=none"
28
+ },
29
+ {
30
+ "type": "h4",
31
+ "text_only": true,
32
+ "x": 0,
33
+ "y": 0,
34
+ "w": 100,
35
+ "h": 50,
36
+ "style_modifiers": "text;fontSize=37;fontColor=#ffffff;fontStyle=1;fillColor=none"
37
+ },
38
+ {
39
+ "type": "h5",
40
+ "text_only": true,
41
+ "x": 0,
42
+ "y": 0,
43
+ "w": 100,
44
+ "h": 50,
45
+ "style_modifiers": "text;fontSize=28;fontColor=#ffffff;fontStyle=1;fillColor=none"
46
+ },
47
+ {
48
+ "type": "h6",
49
+ "text_only": true,
50
+ "x": 0,
51
+ "y": 0,
52
+ "w": 100,
53
+ "h": 50,
54
+ "style_modifiers": "text;fontSize=21;fontColor=#ffffff;fontStyle=1;fillColor=none"
55
+ },
56
+ {
57
+ "type": "p",
58
+ "text_only": true,
59
+ "x": 0,
60
+ "y": 0,
61
+ "w": 100,
62
+ "h": 50,
63
+ "style_modifiers": "text;fontSize=16;fontColor=#ffffff;fontStyle=1;fillColor=none"
64
+ },
2
65
  {
3
66
  "type": "actor",
67
+ "text_only": false,
4
68
  "x": 0,
5
69
  "y": 0,
6
70
  "w": 40,
@@ -9,6 +73,7 @@
9
73
  },
10
74
  {
11
75
  "type": "actor2",
76
+ "text_only": false,
12
77
  "x": 0,
13
78
  "y": 0,
14
79
  "w": 30,
@@ -17,6 +82,7 @@
17
82
  },
18
83
  {
19
84
  "type": "callout",
85
+ "text_only": false,
20
86
  "x": 0,
21
87
  "y": 0,
22
88
  "w": 160,
@@ -25,6 +91,7 @@
25
91
  },
26
92
  {
27
93
  "type": "callout2",
94
+ "text_only": false,
28
95
  "x": 0,
29
96
  "y": 0,
30
97
  "w": 160,
@@ -33,6 +100,7 @@
33
100
  },
34
101
  {
35
102
  "type": "callout3",
103
+ "text_only": false,
36
104
  "x": 0,
37
105
  "y": 0,
38
106
  "w": 160,
@@ -41,6 +109,7 @@
41
109
  },
42
110
  {
43
111
  "type": "callout4",
112
+ "text_only": false,
44
113
  "x": 0,
45
114
  "y": 0,
46
115
  "w": 160,
@@ -49,6 +118,7 @@
49
118
  },
50
119
  {
51
120
  "type": "circle",
121
+ "text_only": false,
52
122
  "x": 0,
53
123
  "y": 0,
54
124
  "w": 160,
@@ -57,6 +127,7 @@
57
127
  },
58
128
  {
59
129
  "type": "cloud",
130
+ "text_only": false,
60
131
  "x": 0,
61
132
  "y": 0,
62
133
  "w": 160,
@@ -65,6 +136,7 @@
65
136
  },
66
137
  {
67
138
  "type": "cross",
139
+ "text_only": false,
68
140
  "x": 0,
69
141
  "y": 0,
70
142
  "w": 50,
@@ -73,6 +145,7 @@
73
145
  },
74
146
  {
75
147
  "type": "envelop",
148
+ "text_only": false,
76
149
  "x": 0,
77
150
  "y": 0,
78
151
  "w": 160,
@@ -81,6 +154,7 @@
81
154
  },
82
155
  {
83
156
  "type": "diamond",
157
+ "text_only": false,
84
158
  "x": 0,
85
159
  "y": 0,
86
160
  "w": 100,
@@ -89,6 +163,7 @@
89
163
  },
90
164
  {
91
165
  "type": "document",
166
+ "text_only": false,
92
167
  "x": 0,
93
168
  "y": 0,
94
169
  "w": 160,
@@ -97,6 +172,7 @@
97
172
  },
98
173
  {
99
174
  "type": "ellipse",
175
+ "text_only": false,
100
176
  "x": 0,
101
177
  "y": 0,
102
178
  "w": 200,
@@ -105,6 +181,7 @@
105
181
  },
106
182
  {
107
183
  "type": "hexagon",
184
+ "text_only": false,
108
185
  "x": 0,
109
186
  "y": 0,
110
187
  "w": 200,
@@ -113,22 +190,25 @@
113
190
  },
114
191
  {
115
192
  "type": "container",
193
+ "text_only": false,
116
194
  "x": 0,
117
195
  "y": 0,
118
196
  "w": 160,
119
197
  "h": 160,
120
- "style_modifiers": "swimlane;horizontal=0"
198
+ "style_modifiers": "swimlane"
121
199
  },
122
200
  {
123
201
  "type": "container2",
202
+ "text_only": false,
124
203
  "x": 0,
125
204
  "y": 0,
126
205
  "w": 160,
127
206
  "h": 160,
128
- "style_modifiers": "swimlane"
207
+ "style_modifiers": "swimlane;horizontal=0"
129
208
  },
130
209
  {
131
210
  "type": "container3",
211
+ "text_only": false,
132
212
  "x": 0,
133
213
  "y": 0,
134
214
  "w": 160,
@@ -137,6 +217,7 @@
137
217
  },
138
218
  {
139
219
  "type": "container4",
220
+ "text_only": false,
140
221
  "x": 0,
141
222
  "y": 0,
142
223
  "w": 160,
@@ -145,6 +226,7 @@
145
226
  },
146
227
  {
147
228
  "type": "note",
229
+ "text_only": false,
148
230
  "x": 0,
149
231
  "y": 0,
150
232
  "w": 160,
@@ -153,6 +235,7 @@
153
235
  },
154
236
  {
155
237
  "type": "process",
238
+ "text_only": false,
156
239
  "x": 0,
157
240
  "y": 0,
158
241
  "w": 200,
@@ -161,6 +244,7 @@
161
244
  },
162
245
  {
163
246
  "type": "rectangle",
247
+ "text_only": false,
164
248
  "x": 0,
165
249
  "y": 0,
166
250
  "w": 200,
@@ -169,6 +253,7 @@
169
253
  },
170
254
  {
171
255
  "type": "rectangle2",
256
+ "text_only": false,
172
257
  "x": 0,
173
258
  "y": 0,
174
259
  "w": 200,
@@ -177,6 +262,7 @@
177
262
  },
178
263
  {
179
264
  "type": "square",
265
+ "text_only": false,
180
266
  "x": 0,
181
267
  "y": 0,
182
268
  "w": 160,
@@ -185,6 +271,7 @@
185
271
  },
186
272
  {
187
273
  "type": "step",
274
+ "text_only": false,
188
275
  "x": 0,
189
276
  "y": 0,
190
277
  "w": 120,
@@ -193,6 +280,7 @@
193
280
  },
194
281
  {
195
282
  "type": "tick",
283
+ "text_only": false,
196
284
  "x": 0,
197
285
  "y": 0,
198
286
  "w": 50,
@@ -201,6 +289,7 @@
201
289
  },
202
290
  {
203
291
  "type": "face",
292
+ "text_only": false,
204
293
  "x": 0,
205
294
  "y": 0,
206
295
  "w": 100,
@@ -209,10 +298,38 @@
209
298
  },
210
299
  {
211
300
  "type": "triangle",
301
+ "text_only": false,
212
302
  "x": 0,
213
303
  "y": 0,
214
304
  "w": 100,
215
305
  "h": 100,
216
306
  "style_modifiers": "triangle"
307
+ },
308
+ {
309
+ "type": "embed_row",
310
+ "text_only": false,
311
+ "x": 0,
312
+ "y": 0,
313
+ "w": 200,
314
+ "h": 40,
315
+ "style_modifiers": "shape=partialRectangle;collapsible=0;dropTarget=0;pointerEvents=0;top=0;left=0;bottom=1;right=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest"
316
+ },
317
+ {
318
+ "type": "embed_col50",
319
+ "text_only": false,
320
+ "x": 0,
321
+ "y": 0,
322
+ "w": 50,
323
+ "h": 40,
324
+ "style_modifiers": "shape=partialRectangle;connectable=0;top=0;left=0;bottom=0;right=0;fontStyle=1;overflow=hidden"
325
+ },
326
+ {
327
+ "type": "embed_col200",
328
+ "text_only": false,
329
+ "x": 0,
330
+ "y": 0,
331
+ "w": 150,
332
+ "h": 40,
333
+ "style_modifiers": "shape=partialRectangle;connectable=0;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden"
217
334
  }
218
335
  ]
@@ -5,7 +5,7 @@
5
5
  module DrawioDsl
6
6
  # Used to attach configuration to KConfig module
7
7
  module ConfigurationShapes
8
- ShapeDefaults = Struct.new(:type, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
8
+ ShapeDefaults = Struct.new(:type, :text_only, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
9
9
  Shapes = Struct.new(
10
10
  :shape,
11
11
  {{#each shapes}}
@@ -16,9 +16,9 @@ module DrawioDsl
16
16
 
17
17
  def add_shapes
18
18
  @shapes = Shapes.new(
19
- shape: ShapeDefaults.new(type: :shape, x: 0, y: 0, w: 20, h: 20, style_modifiers: ''),
19
+ shape: ShapeDefaults.new(type: :shape, text_only: false, x: 0, y: 0, w: 20, h: 20, style_modifiers: ''),
20
20
  {{#each shapes}}
21
- {{snake ./type}}: ShapeDefaults.new(type: :{{snake ./type}}, x: {{./x}}, y: {{./y}}, w: {{./w}}, h: {{./h}}, style_modifiers: '{{{./style_modifiers}}}'){{#if @last}}{{^}},{{/if}}
21
+ {{snake ./type}}: ShapeDefaults.new(type: :{{snake ./type}}, x: {{./x}}, text_only: {{./text_only}}, y: {{./y}}, w: {{./w}}, h: {{./h}}, style_modifiers: '{{{./style_modifiers}}}'){{#if @last}}{{^}},{{/if}}
22
22
  {{/each}}
23
23
  )
24
24
  end
@@ -4,6 +4,7 @@ require_relative 'common_style'
4
4
  require_relative 'default_palette'
5
5
  require_relative 'diagram'
6
6
  require_relative 'node'
7
+ require_relative 'node_list'
7
8
  require_relative 'page'
8
9
 
9
10
  require_relative 'layouts/layout'
@@ -2,39 +2,53 @@ KManager.model :shapes, namespace: %i[domain] do
2
2
  # microapp = import(:handlebars_helpers, :microapp)
3
3
 
4
4
  table :shapes do
5
- fields [:type, :x, :y, :w, :h, :style_modifiers]
5
+ fields [:type, :text_only, :x, :y, :w, :h, :style_modifiers]
6
6
 
7
7
  # shape is a custom object
8
8
  # row :shape , 0, 0, 20, 20, ''
9
9
 
10
- row :actor , 0, 0, 40, 50, 'shape=actor'
11
- row :actor2 , 0, 0, 30, 50, 'shape=umlActor;verticalLabelPosition=bottom;outlineConnect=1'
12
- row :callout , 0, 0, 160, 120, 'shape=callout'
13
- row :callout2 , 0, 0, 160, 160, 'shape=mxgraph.basic.oval_callout'
14
- row :callout3 , 0, 0, 160, 160, 'shape=mxgraph.basic.cloud_callout'
15
- row :callout4 , 0, 0, 160, 120, 'shape=mxgraph.basic.roundRectCallout;dx=30;dy=15;size=5;boundedLbl=1;'
16
- row :circle , 0, 0, 160, 160, 'ellipse'
17
- row :cloud , 0, 0, 160, 160, 'shape=cloud'
18
- row :cross , 0, 0, 50, 50, 'verticalLabelPosition=bottom;verticalAlign=top;html=1;shape=mxgraph.basic.x'
19
- row :envelop , 0, 0, 160, 100, 'shape=message'
20
- row :diamond , 0, 0, 100, 100, 'rhombus'
21
- row :document , 0, 0, 160, 160, 'shape=mxgraph.basic.document'
22
- row :ellipse , 0, 0, 200, 120, 'ellipse'
23
- row :hexagon , 0, 0, 200, 120, 'shape=hexagon'
24
- row :container , 0, 0, 160, 160, 'swimlane;horizontal=0'
25
- row :container2 , 0, 0, 160, 160, 'swimlane'
26
- row :container3 , 0, 0, 160, 160, 'swimlane;startSize=50'
27
- row :container4 , 0, 0, 160, 160, 'swimlane;resizable=0'
28
- row :note , 0, 0, 160, 160, 'shape=note'
29
- row :process , 0, 0, 200, 120, 'shape=process'
30
- row :rectangle , 0, 0, 200, 120, ''
31
- row :rectangle2 , 0, 0, 200, 120, 'shape=mxgraph.basic.cloud_rect'
32
- row :square , 0, 0, 160, 160, ''
33
- row :step , 0, 0, 120, 80, 'shape=step;perimeter=stepPerimeter;fixedSize=1'
34
- row :tick , 0, 0, 50, 50, 'verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.basic.tick'
35
- row :face , 0, 0, 100, 100, 'verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.basic.smiley'
36
- row :triangle , 0, 0, 100, 100, 'triangle'
10
+ # configuration for general purpose shapes
11
+ row :h1 , true, 0, 0, 100, 50, 'text;fontSize=89;fontColor=#ffffff;fontStyle=1;fillColor=none'
12
+ row :h2 , true, 0, 0, 100, 50, 'text;fontSize=67;fontColor=#ffffff;fontStyle=1;fillColor=none'
13
+ row :h3 , true, 0, 0, 100, 50, 'text;fontSize=50;fontColor=#ffffff;fontStyle=1;fillColor=none'
14
+ row :h4 , true, 0, 0, 100, 50, 'text;fontSize=37;fontColor=#ffffff;fontStyle=1;fillColor=none'
15
+ row :h5 , true, 0, 0, 100, 50, 'text;fontSize=28;fontColor=#ffffff;fontStyle=1;fillColor=none'
16
+ row :h6 , true, 0, 0, 100, 50, 'text;fontSize=21;fontColor=#ffffff;fontStyle=1;fillColor=none'
17
+ row :p , true, 0, 0, 100, 50, 'text;fontSize=16;fontColor=#ffffff;fontStyle=1;fillColor=none'
37
18
 
19
+ row :actor , false, 0, 0, 40, 50, 'shape=actor'
20
+ row :actor2 , false, 0, 0, 30, 50, 'shape=umlActor;verticalLabelPosition=bottom;outlineConnect=1'
21
+ row :callout , false, 0, 0, 160, 120, 'shape=callout'
22
+ row :callout2 , false, 0, 0, 160, 160, 'shape=mxgraph.basic.oval_callout'
23
+ row :callout3 , false, 0, 0, 160, 160, 'shape=mxgraph.basic.cloud_callout'
24
+ row :callout4 , false, 0, 0, 160, 120, 'shape=mxgraph.basic.roundRectCallout;dx=30;dy=15;size=5;boundedLbl=1;'
25
+ row :circle , false, 0, 0, 160, 160, 'ellipse'
26
+ row :cloud , false, 0, 0, 160, 160, 'shape=cloud'
27
+ row :cross , false, 0, 0, 50, 50, 'verticalLabelPosition=bottom;verticalAlign=top;html=1;shape=mxgraph.basic.x'
28
+ row :envelop , false, 0, 0, 160, 100, 'shape=message'
29
+ row :diamond , false, 0, 0, 100, 100, 'rhombus'
30
+ row :document , false, 0, 0, 160, 160, 'shape=mxgraph.basic.document'
31
+ row :ellipse , false, 0, 0, 200, 120, 'ellipse'
32
+ row :hexagon , false, 0, 0, 200, 120, 'shape=hexagon'
33
+ row :container , false, 0, 0, 160, 160, 'swimlane'
34
+ row :container2 , false, 0, 0, 160, 160, 'swimlane;horizontal=0'
35
+ row :container3 , false, 0, 0, 160, 160, 'swimlane;startSize=50'
36
+ row :container4 , false, 0, 0, 160, 160, 'swimlane;resizable=0'
37
+ row :note , false, 0, 0, 160, 160, 'shape=note'
38
+ row :process , false, 0, 0, 200, 120, 'shape=process'
39
+ row :rectangle , false, 0, 0, 200, 120, ''
40
+ row :rectangle2 , false, 0, 0, 200, 120, 'shape=mxgraph.basic.cloud_rect'
41
+ row :square , false, 0, 0, 160, 160, ''
42
+ row :step , false, 0, 0, 120, 80, 'shape=step;perimeter=stepPerimeter;fixedSize=1'
43
+ row :tick , false, 0, 0, 50, 50, 'verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.basic.tick'
44
+ row :face , false, 0, 0, 100, 100, 'verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.basic.smiley'
45
+ row :triangle , false, 0, 0, 100, 100, 'triangle'
46
+
47
+ # configuration for embedded element shape
48
+ # note that the width / height probably should be driven of parent shape
49
+ row :embed_row , false, 0, 0, 200, 40, 'shape=partialRectangle;collapsible=0;dropTarget=0;pointerEvents=0;top=0;left=0;bottom=1;right=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest'
50
+ row :embed_col50 , false, 0, 0, 50, 40, 'shape=partialRectangle;connectable=0;top=0;left=0;bottom=0;right=0;fontStyle=1;overflow=hidden'
51
+ row :embed_col200 , false, 0, 0, 150, 40, 'shape=partialRectangle;connectable=0;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden'
38
52
  end
39
53
 
40
54
  action do
@@ -17,6 +17,7 @@ KManager.action :requires do
17
17
 
18
18
  add('schema/_.rb', template_file: 'schema_require.rb', shapes: shapes)
19
19
 
20
+ # build source code for each shape
20
21
  shapes.each do |shape|
21
22
  add("schema/shapes/#{shape['type']}.rb",
22
23
  template_file: 'schema_shape.rb',
@@ -29,6 +30,7 @@ KManager.action :requires do
29
30
 
30
31
  cd(:spec)
31
32
 
33
+ # build spec for each shape
32
34
  shapes.each do |shape|
33
35
  add("schema/shapes/#{shape['type']}_spec.rb",
34
36
  template_file: 'schema_shape_spec.rb',
@@ -0,0 +1,24 @@
1
+ KManager.action :todo_drawio_dsl do
2
+ action do
3
+
4
+ # :rounded, :shadow, :sketch, :glass
5
+ director = DrawioDsl::Drawio
6
+ .init(k_builder, on_exist: :write, on_action: :execute)
7
+ .diagram(theme: :style_03)
8
+ .page('To Do', margin_left: 0, margin_top: 0, rounded: 1) do
9
+ grid_layout(direction: :vertical, grid_h: 120, grid_w: 400, wrap_at: 10, grid: 0)
10
+
11
+ h5(w: 400, h: 80, title: 'DrawIO DSL')
12
+ p(w: 400, h: 80, title: 'Project plan')
13
+ square(w: 300, h: 80, title: 'Enter report into system')
14
+ square(w: 300, h: 80, title: 'Preliminary Review')
15
+ end
16
+
17
+ diagram = DrawioDsl::XmlBuilder.new(director.builder.diagram)
18
+
19
+ director
20
+ .cd(:spec)
21
+ .add('project-plans/drawio_dsl.drawio', content: diagram.build)
22
+
23
+ end
24
+ end
@@ -0,0 +1,52 @@
1
+ KManager.action :bootstrap do
2
+ action do
3
+
4
+ # :rounded, :shadow, :sketch, :glass
5
+ director = DrawioDsl::Drawio
6
+ .init(k_builder)
7
+ .diagram(theme: :style_03)
8
+ .page('Shapes', margin_left: 0, margin_top: 0, rounded: 1) do
9
+ grid_layout(direction: :vertical, grid_h: 120, grid_w: 400, wrap_at: 10, grid: 0)
10
+
11
+ h5(w: 400, h: 80, title: 'Preparation for Investigation')
12
+ p(w: 400, h: 80, title: '(<b>source</b>: <i>Hunter & Central Coast Regional Environmental Management Strategy – Investigations guideline</i>)')
13
+ square(w: 300, h: 80, title: 'Enter report into system')
14
+ square(w: 300, h: 80, title: 'Preliminary Review')
15
+ square(w: 300, h: 80, title: 'Insufficient Information')
16
+ square(w: 300, h: 80, title: 'Seek Additional Information')
17
+ square(w: 300, h: 80, title: 'Identify Possible Breach')
18
+ square(w: 300, h: 80, title: 'Insufficient evidence or no breach detected')
19
+ square(w: 300, h: 80, title: 'Plan follow up action')
20
+ square(w: 300, h: 80, title: 'Establish Jurisdiction - Council or other agency?')
21
+ square(w: 300, h: 80, title: 'Refer to other agency')
22
+ square(w: 300, h: 80, title: 'Council Responsibility')
23
+ square(w: 300, h: 80, title: 'Plan investigation')
24
+ square(w: 300, h: 80, title: 'Conduct investigation Gather and manage evidence (Evidence Gathering Guideline)')
25
+ square(w: 300, h: 80, title: 'Prepare recommendations report')
26
+ square(w: 300, h: 80, title: 'Make decision')
27
+ square(w: 300, h: 80, title: 'Take action (Enforcement Options Guideline)')
28
+ square(w: 300, h: 80, title: 'Review investigation')
29
+ square(w: 300, h: 80, title: 'Close case')
30
+ square(w: 300, h: 80, title: 'Feedback to complainant')
31
+
32
+ grid_layout(wrap_at: 40, direction: :vertical, grid_w: 250, grid_h: 150, wrap_at: 5)
33
+
34
+ square(theme: :style_02, w: 240, h: 140, title: '1. Complaint received by Council gets recorded into the system.')
35
+ square(theme: :style_02, w: 240, h: 140, title: '2. Council Officer will review the nature of the complaint and consider what evidence or information it has.')
36
+ square(theme: :style_02, w: 240, h: 140, title: '3. If the information given thus far is insufficient Officer can go back to complainant and seek additional information.')
37
+ square(theme: :style_02, w: 240, h: 140, title: '4. With that information Council should be in a position to identify whether there has been a breach.')
38
+ square(theme: :style_02, w: 240, h: 140, title: '5. If there has been a breach: establish whether it&apos;s a matter for which the Council has jurisdiction (ie is it a piece of legislation for which the Council has the authority to enforce?).')
39
+ square(theme: :style_02, w: 240, h: 140, title: '6. If not: Council can refer that matter to another agency; such as Police, Fisheries, Transport NSW, EPA etc')
40
+ square(theme: :style_02, w: 240, h: 140, title: '7. If it is the Councils responsibility then Council needs to plan out the investigation. That will be through: gathering and collecting evidence through statements, observations, interviews, samples, items of interest.')
41
+ square(theme: :style_02, w: 240, h: 140, title: '8. The Council Officer should prepare a recommendations report which will: <br/>* go through the history of the matter <br/>* go through the investigations that have happened <br/>* go through the evidence that the Council has and then provide a recommendation as to the future action to be taken')
42
+ square(theme: :style_02, w: 240, h: 140, title: '9. Once the Council has that evidence and is in a position that it thinks it can MAKE A DECISION')
43
+ square(theme: :style_02, w: 240, h: 140, title: '10. TAKE ACTION: Once a decision is made as to the action that should happen in respect of the breach the council can then decide as to what the appropriate action is: WARNING, CIVIL, CRIMINAL and then proceed from there => it is important to keep the complainant informed throughout the entire process to be able to explain why you have taken the course you&apos;ve taken and to be able to justify it')
44
+
45
+ end
46
+
47
+ diagram = DrawioDsl::XmlBuilder.new(director.builder.diagram)
48
+
49
+ File.write('../spec/.samples/drawio/50-willoughby-council.xml', diagram.build)
50
+ File.write('../spec/.samples/drawio/50-willoughby-council.drawio', diagram.build)
51
+ end
52
+ end
data/.rubocop.yml CHANGED
@@ -41,6 +41,8 @@ Layout/LineLength:
41
41
  # Ignores annotate output
42
42
  IgnoredPatterns: ['\A# \*\*']
43
43
  IgnoreCopDirectives: true
44
+ Exclude:
45
+ - "lib/drawio_dsl/configuration_shapes.rb"
44
46
 
45
47
  Lint/UnusedMethodArgument:
46
48
  AllowUnusedKeywordArguments: true
@@ -75,6 +77,9 @@ Metrics/MethodLength:
75
77
  - "lib/drawio_dsl/schema/shapes/page.rb"
76
78
  - "lib/drawio_dsl/configuration_shapes.rb"
77
79
  - "lib/drawio_dsl/configuration_themes.rb"
80
+ Metrics/PerceivedComplexity:
81
+ Exclude:
82
+ - "lib/drawio_dsl/drawio_shapes.rb"
78
83
  Naming/MemoizedInstanceVariableName:
79
84
  Enabled: false
80
85
  Naming/AccessorMethodName:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [0.5.2](https://github.com/klueless-io/drawio_dsl/compare/v0.5.1...v0.5.2) (2022-03-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * grid_h/w added and grid_size will drive those values ([372f262](https://github.com/klueless-io/drawio_dsl/commit/372f2626cb9daf8377d184af9746631d16cc9e50))
7
+
8
+ ## [0.5.1](https://github.com/klueless-io/drawio_dsl/compare/v0.5.0...v0.5.1) (2022-03-07)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * refactor nodes array to nodelist object ([10372a5](https://github.com/klueless-io/drawio_dsl/commit/10372a529e6274bae451dae15626dfbac4b9cccb))
14
+
15
+ # [0.5.0](https://github.com/klueless-io/drawio_dsl/compare/v0.4.1...v0.5.0) (2022-03-07)
16
+
17
+
18
+ ### Features
19
+
20
+ * add new and update older shapes ([64a0d83](https://github.com/klueless-io/drawio_dsl/commit/64a0d83dda6181183c0980914b7b2ee1520b84e6))
21
+ * final code generation in place for shapes ([ac4ed3c](https://github.com/klueless-io/drawio_dsl/commit/ac4ed3cace4e1794d38306e14d3cee60529add4b))
22
+ * final code generation in place for shapes ([4c2a6fb](https://github.com/klueless-io/drawio_dsl/commit/4c2a6fb376fe61cfd44a699677f7781c9e2b215c))
23
+
1
24
  ## [0.4.1](https://github.com/klueless-io/drawio_dsl/compare/v0.4.0...v0.4.1) (2022-03-06)
2
25
 
3
26