drawio_dsl 0.8.3 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.builders/.data/shapes.json +27 -0
  3. data/.builders/.templates/basic/drawio_extensions.rb +2 -1
  4. data/.builders/.templates/basic/drawio_shapes.rb +1 -1
  5. data/.builders/blueprint/shapes.rb +3 -0
  6. data/.builders/generators/20-drawio-extensions.rb +1 -1
  7. data/.builders/generators/domain_diagram.rb +473 -0
  8. data/.builders/generators/parking-map.png +0 -0
  9. data/.builders/generators/parking_app.rb +110 -0
  10. data/.builders/generators/printspeak-architecture-generator.rb +45 -0
  11. data/.builders/generators/project-plan.rb +6 -5
  12. data/.builders/generators/sample_diagrams/20-styles.rb +2 -2
  13. data/.builders/generators/sample_diagrams/35-ids-and-arrows.rb +0 -2
  14. data/CHANGELOG.md +22 -0
  15. data/README.md +5 -3
  16. data/docs/domain-modal/domain_model.drawio +265 -0
  17. data/docs/domain-modal/domain_model.svg +3 -0
  18. data/docs/domain-modal/domain_model_custom.drawio +408 -0
  19. data/docs/domain-modal/domain_model_custom.svg +1 -0
  20. data/docs/domain-modal.md +9 -0
  21. data/docs/parking_app.drawio +25 -0
  22. data/docs/parking_app.svg +3 -0
  23. data/docs/printspeak-architecture-generator.drawio +31 -0
  24. data/docs/printspeak-architecture-generator.svg +3 -0
  25. data/docs/project-plan/project.drawio +60 -54
  26. data/docs/project-plan/project_done.svg +1 -1
  27. data/docs/project-plan/project_in_progress.svg +1 -1
  28. data/docs/project-plan/project_todo.svg +1 -1
  29. data/docs/samples/styles-glass.svg +1 -1
  30. data/docs/samples/styles-plain.svg +1 -1
  31. data/docs/samples/styles-rounded.svg +1 -1
  32. data/docs/samples/styles-shadow.svg +1 -1
  33. data/docs/samples/styles-sketch.svg +1 -1
  34. data/lib/drawio_dsl/configuration_shapes.rb +8 -2
  35. data/lib/drawio_dsl/dom_builder.rb +1 -1
  36. data/lib/drawio_dsl/dom_builder_shapes.rb +24 -6
  37. data/lib/drawio_dsl/drawio.rb +0 -19
  38. data/lib/drawio_dsl/drawio_extensions.rb +3 -2
  39. data/lib/drawio_dsl/drawio_extensions_active.rb +1 -1
  40. data/lib/drawio_dsl/drawio_page.rb +22 -0
  41. data/lib/drawio_dsl/drawio_shapes.rb +64 -46
  42. data/lib/drawio_dsl/formatters/base_formatter.rb +1 -1
  43. data/lib/drawio_dsl/formatters/html_builder.rb +1 -1
  44. data/lib/drawio_dsl/formatters/interface_formatter.rb +1 -1
  45. data/lib/drawio_dsl/formatters/klass_formatter.rb +1 -1
  46. data/lib/drawio_dsl/formatters/style_builder.rb +1 -1
  47. data/lib/drawio_dsl/schema/_.rb +4 -1
  48. data/lib/drawio_dsl/schema/shapes/database.rb +9 -0
  49. data/lib/drawio_dsl/schema/shapes/db_json.rb +9 -0
  50. data/lib/drawio_dsl/schema/shapes/group.rb +9 -0
  51. data/lib/drawio_dsl/schema/shapes/shape.rb +2 -2
  52. data/lib/drawio_dsl/version.rb +1 -1
  53. data/lib/drawio_dsl/xml_builder.rb +1 -1
  54. data/lib/drawio_dsl.rb +1 -0
  55. data/package-lock.json +2 -2
  56. data/package.json +1 -1
  57. metadata +19 -2
@@ -8,6 +8,7 @@ module DrawioDsl
8
8
  ShapeDefaults = Struct.new(:type, :category, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
9
9
  Shapes = Struct.new(
10
10
  :shape,
11
+ :line,
11
12
  :h1,
12
13
  :h2,
13
14
  :h3,
@@ -29,9 +30,12 @@ module DrawioDsl
29
30
  :container4,
30
31
  :cross,
31
32
  :envelop,
33
+ :database,
34
+ :db_json,
32
35
  :diamond,
33
36
  :document,
34
37
  :ellipse,
38
+ :group,
35
39
  :hexagon,
36
40
  :interface,
37
41
  :klass,
@@ -45,7 +49,6 @@ module DrawioDsl
45
49
  :todo,
46
50
  :face,
47
51
  :triangle,
48
- :line,
49
52
  :embed_row,
50
53
  :embed_col50,
51
54
  :embed_col200,
@@ -55,6 +58,7 @@ module DrawioDsl
55
58
  def add_shapes
56
59
  @shapes = Shapes.new(
57
60
  shape: ShapeDefaults.new(type: :shape, category: :element, x: 0, y: 0, w: 20, h: 20, style_modifiers: ''),
61
+ line: ShapeDefaults.new(type: :line, x: 0, category: :line, y: 0, w: 50, h: 50, style_modifiers: 'edgeStyle=none;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0'),
58
62
  h1: ShapeDefaults.new(type: :h1, x: 0, category: :text, y: 0, w: 100, h: 50, style_modifiers: 'text;fontSize=89;fontColor=#ffffff;fontStyle=1;fillColor=none'),
59
63
  h2: ShapeDefaults.new(type: :h2, x: 0, category: :text, y: 0, w: 100, h: 50, style_modifiers: 'text;fontSize=67;fontColor=#ffffff;fontStyle=1;fillColor=none'),
60
64
  h3: ShapeDefaults.new(type: :h3, x: 0, category: :text, y: 0, w: 100, h: 50, style_modifiers: 'text;fontSize=50;fontColor=#ffffff;fontStyle=1;fillColor=none'),
@@ -76,9 +80,12 @@ module DrawioDsl
76
80
  container4: ShapeDefaults.new(type: :container4, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'swimlane;resizable=0'),
77
81
  cross: ShapeDefaults.new(type: :cross, x: 0, category: :element, y: 0, w: 50, h: 50, style_modifiers: 'verticalLabelPosition=bottom;verticalAlign=top;html=1;shape=mxgraph.basic.x'),
78
82
  envelop: ShapeDefaults.new(type: :envelop, x: 0, category: :element, y: 0, w: 160, h: 100, style_modifiers: 'shape=message'),
83
+ database: ShapeDefaults.new(type: :database, x: 0, category: :element, y: 0, w: 160, h: 80, style_modifiers: 'shape=mxgraph.flowchart.database;strokeWidth=1'),
84
+ db_json: ShapeDefaults.new(type: :db_json, x: 0, category: :element, y: 0, w: 160, h: 40, style_modifiers: 'shape=mxgraph.flowchart.database;strokeWidth=1'),
79
85
  diamond: ShapeDefaults.new(type: :diamond, x: 0, category: :element, y: 0, w: 100, h: 100, style_modifiers: 'rhombus'),
80
86
  document: ShapeDefaults.new(type: :document, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'shape=mxgraph.basic.document'),
81
87
  ellipse: ShapeDefaults.new(type: :ellipse, x: 0, category: :element, y: 0, w: 200, h: 120, style_modifiers: 'ellipse'),
88
+ group: ShapeDefaults.new(type: :group, x: 0, category: :element, y: 0, w: 210, h: 210, style_modifiers: 'fontSize=20;verticalAlign=top'),
82
89
  hexagon: ShapeDefaults.new(type: :hexagon, x: 0, category: :element, y: 0, w: 200, h: 120, style_modifiers: 'shape=hexagon'),
83
90
  interface: ShapeDefaults.new(type: :interface, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'align=left;overflow=fill;fontSize=12;fontFamily=Helvetica'),
84
91
  klass: ShapeDefaults.new(type: :klass, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'align=left;overflow=fill;fontSize=12;fontFamily=Helvetica'),
@@ -92,7 +99,6 @@ module DrawioDsl
92
99
  todo: ShapeDefaults.new(type: :todo, x: 0, category: :element, y: 0, w: 300, h: 60, style_modifiers: ''),
93
100
  face: ShapeDefaults.new(type: :face, x: 0, category: :element, y: 0, w: 100, h: 100, style_modifiers: 'verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.basic.smiley'),
94
101
  triangle: ShapeDefaults.new(type: :triangle, x: 0, category: :element, y: 0, w: 100, h: 100, style_modifiers: 'triangle'),
95
- line: ShapeDefaults.new(type: :line, x: 0, category: :line, y: 0, w: 50, h: 50, style_modifiers: 'edgeStyle=none;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0'),
96
102
  embed_row: ShapeDefaults.new(type: :embed_row, x: 0, category: :element, y: 0, w: 200, h: 40, 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'),
97
103
  embed_col50: ShapeDefaults.new(type: :embed_col50, x: 0, category: :element, y: 0, w: 50, h: 40, style_modifiers: 'shape=partialRectangle;connectable=0;top=0;left=0;bottom=0;right=0;fontStyle=1;overflow=hidden'),
98
104
  embed_col200: ShapeDefaults.new(type: :embed_col200, x: 0, category: :element, y: 0, w: 150, h: 40, style_modifiers: 'shape=partialRectangle;connectable=0;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden')
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DrawioDsl
4
- # DrawioDsl is a DSL for draw-io diagrams.
4
+ # Build Document object model to represent DrawioDsl output file.
5
5
  class DomBuilder
6
6
  include DomBuilderShapes
7
7
 
@@ -4,6 +4,12 @@
4
4
  module DrawioDsl
5
5
  # DrawioDsl is a DSL for draw-io diagrams.
6
6
  module DomBuilderShapes
7
+ def add_line(id = nil, **opts, &block)
8
+ opts = { id: id }.merge(opts) if id
9
+ line = DrawioDsl::Schema::Line.new(current_page, **opts, &block)
10
+ add_shape(line)
11
+ end
12
+
7
13
  def add_h1(id = nil, **opts, &block)
8
14
  opts = { id: id }.merge(opts) if id
9
15
  h1 = DrawioDsl::Schema::H1.new(current_page, **opts, &block)
@@ -130,6 +136,18 @@ module DrawioDsl
130
136
  add_shape(envelop)
131
137
  end
132
138
 
139
+ def add_database(id = nil, **opts, &block)
140
+ opts = { id: id }.merge(opts) if id
141
+ database = DrawioDsl::Schema::Database.new(current_page, **opts, &block)
142
+ add_shape(database)
143
+ end
144
+
145
+ def add_db_json(id = nil, **opts, &block)
146
+ opts = { id: id }.merge(opts) if id
147
+ db_json = DrawioDsl::Schema::DbJson.new(current_page, **opts, &block)
148
+ add_shape(db_json)
149
+ end
150
+
133
151
  def add_diamond(id = nil, **opts, &block)
134
152
  opts = { id: id }.merge(opts) if id
135
153
  diamond = DrawioDsl::Schema::Diamond.new(current_page, **opts, &block)
@@ -148,6 +166,12 @@ module DrawioDsl
148
166
  add_shape(ellipse)
149
167
  end
150
168
 
169
+ def add_group(id = nil, **opts, &block)
170
+ opts = { id: id }.merge(opts) if id
171
+ group = DrawioDsl::Schema::Group.new(current_page, **opts, &block)
172
+ add_shape(group)
173
+ end
174
+
151
175
  def add_hexagon(id = nil, **opts, &block)
152
176
  opts = { id: id }.merge(opts) if id
153
177
  hexagon = DrawioDsl::Schema::Hexagon.new(current_page, **opts, &block)
@@ -226,12 +250,6 @@ module DrawioDsl
226
250
  add_shape(triangle)
227
251
  end
228
252
 
229
- def add_line(id = nil, **opts, &block)
230
- opts = { id: id }.merge(opts) if id
231
- line = DrawioDsl::Schema::Line.new(current_page, **opts, &block)
232
- add_shape(line)
233
- end
234
-
235
253
  def add_embed_row(id = nil, **opts, &block)
236
254
  opts = { id: id }.merge(opts) if id
237
255
  embed_row = DrawioDsl::Schema::EmbedRow.new(current_page, **opts, &block)
@@ -67,23 +67,4 @@ module DrawioDsl
67
67
  self
68
68
  end
69
69
  end
70
-
71
- # DrawioDsl::DrawioPage is created when you call .page on the draw-io DSL.
72
- class DrawioPage < KDirector::Directors::ChildDirector
73
- include DrawioDsl::DrawioShapes
74
-
75
- def initialize(parent, **opts)
76
- super(parent, **opts)
77
-
78
- builder.add_page(**opts)
79
- end
80
-
81
- def grid_layout(**opts)
82
- builder.add_grid_layout(**opts)
83
- end
84
-
85
- def flex_layout(**opts)
86
- builder.add_flex_layout(**opts)
87
- end
88
- end
89
70
  end
@@ -2,8 +2,9 @@
2
2
 
3
3
  module DrawioDsl
4
4
  # :nocov:
5
- class DrawIoExtensions
6
- include DrawioDsl::DrawIoExtensionsActive
5
+ # 1000's of extension shapes derived from Extensions.js that can be used via the add_shape method
6
+ class DrawioExtensions
7
+ include DrawioDsl::DrawioExtensionsActive
7
8
 
8
9
  attr_reader :sections
9
10
  attr_reader :current_section
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DrawioDsl
4
- module DrawIoExtensionsActive
4
+ module DrawioExtensionsActive
5
5
  def apply_active_flags
6
6
  sections.each do |section|
7
7
  section[:shapes].each do |shape|
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DrawioDsl
4
+ # DrawioDsl::DrawioPage is created when you call .page on the draw-io DSL.
5
+ class DrawioPage < KDirector::Directors::ChildDirector
6
+ include DrawioDsl::DrawioShapes
7
+
8
+ def initialize(parent, **opts)
9
+ super(parent, **opts)
10
+
11
+ builder.add_page(**opts)
12
+ end
13
+
14
+ def grid_layout(**opts)
15
+ builder.add_grid_layout(**opts)
16
+ end
17
+
18
+ def flex_layout(**opts)
19
+ builder.add_flex_layout(**opts)
20
+ end
21
+ end
22
+ end
@@ -1,96 +1,106 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DrawioDsl
4
- # DrawioDsl::Shapes is a list of DSL methods (one per shape)
4
+ # List of DSL methods for each common shape
5
5
  # :nocov:
6
6
  module DrawioShapes
7
7
  def random(**opts)
8
- case rand(41)
8
+ case rand(44)
9
9
  when 0
10
- h1(**opts)
10
+ line(**opts)
11
11
  when 1
12
- h2(**opts)
12
+ h1(**opts)
13
13
  when 2
14
- h3(**opts)
14
+ h2(**opts)
15
15
  when 3
16
- h4(**opts)
16
+ h3(**opts)
17
17
  when 4
18
- h5(**opts)
18
+ h4(**opts)
19
19
  when 5
20
- h6(**opts)
20
+ h5(**opts)
21
21
  when 6
22
- p(**opts)
22
+ h6(**opts)
23
23
  when 7
24
- actor(**opts)
24
+ p(**opts)
25
25
  when 8
26
- actor2(**opts)
26
+ actor(**opts)
27
27
  when 9
28
- callout(**opts)
28
+ actor2(**opts)
29
29
  when 10
30
- callout2(**opts)
30
+ callout(**opts)
31
31
  when 11
32
- callout3(**opts)
32
+ callout2(**opts)
33
33
  when 12
34
- callout4(**opts)
34
+ callout3(**opts)
35
35
  when 13
36
- circle(**opts)
36
+ callout4(**opts)
37
37
  when 14
38
- cloud(**opts)
38
+ circle(**opts)
39
39
  when 15
40
- container(**opts)
40
+ cloud(**opts)
41
41
  when 16
42
- container2(**opts)
42
+ container(**opts)
43
43
  when 17
44
- container3(**opts)
44
+ container2(**opts)
45
45
  when 18
46
- container4(**opts)
46
+ container3(**opts)
47
47
  when 19
48
- cross(**opts)
48
+ container4(**opts)
49
49
  when 20
50
- envelop(**opts)
50
+ cross(**opts)
51
51
  when 21
52
- diamond(**opts)
52
+ envelop(**opts)
53
53
  when 22
54
- document(**opts)
54
+ database(**opts)
55
55
  when 23
56
- ellipse(**opts)
56
+ db_json(**opts)
57
57
  when 24
58
- hexagon(**opts)
58
+ diamond(**opts)
59
59
  when 25
60
- interface(**opts)
60
+ document(**opts)
61
61
  when 26
62
- klass(**opts)
62
+ ellipse(**opts)
63
63
  when 27
64
- note(**opts)
64
+ group(**opts)
65
65
  when 28
66
- process(**opts)
66
+ hexagon(**opts)
67
67
  when 29
68
- rectangle(**opts)
68
+ interface(**opts)
69
69
  when 30
70
- rectangle2(**opts)
70
+ klass(**opts)
71
71
  when 31
72
- square(**opts)
72
+ note(**opts)
73
73
  when 32
74
- step(**opts)
74
+ process(**opts)
75
75
  when 33
76
- tick(**opts)
76
+ rectangle(**opts)
77
77
  when 34
78
- todo(**opts)
78
+ rectangle2(**opts)
79
79
  when 35
80
- face(**opts)
80
+ square(**opts)
81
81
  when 36
82
- triangle(**opts)
82
+ step(**opts)
83
83
  when 37
84
- line(**opts)
84
+ tick(**opts)
85
85
  when 38
86
- embed_row(**opts)
86
+ todo(**opts)
87
87
  when 39
88
- embed_col50(**opts)
88
+ face(**opts)
89
89
  when 40
90
+ triangle(**opts)
91
+ when 41
92
+ embed_row(**opts)
93
+ when 42
94
+ embed_col50(**opts)
95
+ when 43
90
96
  embed_col200(**opts)
91
97
  end
92
98
  end
93
99
 
100
+ def line(id = nil, **opts, &block)
101
+ builder.add_line(id, **opts, &block)
102
+ end
103
+
94
104
  def h1(id = nil, **opts, &block)
95
105
  builder.add_h1(id, **opts, &block)
96
106
  end
@@ -175,6 +185,14 @@ module DrawioDsl
175
185
  builder.add_envelop(id, **opts, &block)
176
186
  end
177
187
 
188
+ def database(id = nil, **opts, &block)
189
+ builder.add_database(id, **opts, &block)
190
+ end
191
+
192
+ def db_json(id = nil, **opts, &block)
193
+ builder.add_db_json(id, **opts, &block)
194
+ end
195
+
178
196
  def diamond(id = nil, **opts, &block)
179
197
  builder.add_diamond(id, **opts, &block)
180
198
  end
@@ -187,6 +205,10 @@ module DrawioDsl
187
205
  builder.add_ellipse(id, **opts, &block)
188
206
  end
189
207
 
208
+ def group(id = nil, **opts, &block)
209
+ builder.add_group(id, **opts, &block)
210
+ end
211
+
190
212
  def hexagon(id = nil, **opts, &block)
191
213
  builder.add_hexagon(id, **opts, &block)
192
214
  end
@@ -239,10 +261,6 @@ module DrawioDsl
239
261
  builder.add_triangle(id, **opts, &block)
240
262
  end
241
263
 
242
- def line(id = nil, **opts, &block)
243
- builder.add_line(id, **opts, &block)
244
- end
245
-
246
264
  def embed_row(id = nil, **opts, &block)
247
265
  builder.add_embed_row(id, **opts, &block)
248
266
  end
@@ -4,7 +4,7 @@
4
4
  module DrawioDsl
5
5
  # HTML formatters can be used on shapes to render HTML using a DSL
6
6
  module Formatters
7
- # Create an instance of a HTML formatter on the shape
7
+ # Base for any HTML formatter
8
8
  class BaseFormatter
9
9
  attr_reader :html
10
10
 
@@ -4,7 +4,7 @@
4
4
  module DrawioDsl
5
5
  # HTML formatters can be used on shapes to render HTML using a DSL
6
6
  module Formatters
7
- # Create an instance of a HTML formatter on the shape
7
+ # HTML builder has methods for common HTML elements that get written sequentially
8
8
  class HtmlBuilder
9
9
  attr_reader :element_style_defaults
10
10
 
@@ -4,7 +4,7 @@
4
4
  module DrawioDsl
5
5
  # HTML formatters can be used on shapes to render HTML using a DSL
6
6
  module Formatters
7
- # Create an instance of a HTML formatter on the shape
7
+ # Format the HTML to display an interface on a class diagram
8
8
  class InterfaceFormatter < BaseFormatter
9
9
  def initialize
10
10
  super({ p: { margin: '0px', margin_left: '4px', margin_top: '4px' } })
@@ -4,7 +4,7 @@
4
4
  module DrawioDsl
5
5
  # HTML formatters can be used on shapes to render HTML using a DSL
6
6
  module Formatters
7
- # Create an instance of a HTML formatter on the shape
7
+ # Format the HTML to display an class on a class diagram
8
8
  class KlassFormatter < BaseFormatter
9
9
  def initialize
10
10
  super({ p: { margin: '0px', margin_left: '4px', margin_top: '4px' } })
@@ -4,7 +4,7 @@
4
4
  module DrawioDsl
5
5
  # HTML formatters can be used on shapes to render HTML using a DSL
6
6
  module Formatters
7
- # Create an instance of a HTML formatter on the shape
7
+ # Build the style attribute for a HTML element
8
8
  class StyleBuilder
9
9
  MAPPINGS = {
10
10
  margin: 'margin',
@@ -12,6 +12,7 @@ require_relative 'layouts/flex_layout'
12
12
  require_relative 'layouts/grid_layout'
13
13
 
14
14
  require_relative 'shapes/shape'
15
+ require_relative 'shapes/line'
15
16
  require_relative 'shapes/h1'
16
17
  require_relative 'shapes/h2'
17
18
  require_relative 'shapes/h3'
@@ -33,9 +34,12 @@ require_relative 'shapes/container3'
33
34
  require_relative 'shapes/container4'
34
35
  require_relative 'shapes/cross'
35
36
  require_relative 'shapes/envelop'
37
+ require_relative 'shapes/database'
38
+ require_relative 'shapes/db_json'
36
39
  require_relative 'shapes/diamond'
37
40
  require_relative 'shapes/document'
38
41
  require_relative 'shapes/ellipse'
42
+ require_relative 'shapes/group'
39
43
  require_relative 'shapes/hexagon'
40
44
  require_relative 'shapes/interface'
41
45
  require_relative 'shapes/klass'
@@ -49,7 +53,6 @@ require_relative 'shapes/tick'
49
53
  require_relative 'shapes/todo'
50
54
  require_relative 'shapes/face'
51
55
  require_relative 'shapes/triangle'
52
- require_relative 'shapes/line'
53
56
  require_relative 'shapes/embed_row'
54
57
  require_relative 'shapes/embed_col50'
55
58
  require_relative 'shapes/embed_col200'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DrawioDsl
4
+ module Schema
5
+ class Database < Shape
6
+ configure_shape(:database)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DrawioDsl
4
+ module Schema
5
+ class DbJson < Shape
6
+ configure_shape(:db_json)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DrawioDsl
4
+ module Schema
5
+ class Group < Shape
6
+ configure_shape(:group)
7
+ end
8
+ end
9
+ end
@@ -119,8 +119,8 @@ module DrawioDsl
119
119
  # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
120
120
 
121
121
  def as_xml(xml)
122
- log.error category
123
- log.error type
122
+ # log.error category
123
+ # log.error type
124
124
  draw_element(xml) if category == :element
125
125
  draw_line(xml) if category == :line
126
126
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DrawioDsl
4
- VERSION = '0.8.3'
4
+ VERSION = '0.8.6'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DrawioDsl
4
- # DrawioDsl is a DSL for draw-io diagrams.
4
+ # Build the DrawioDsl XML file that is the basis of any draw-io diagrams.
5
5
  class XmlBuilder
6
6
  include KLog::Logging
7
7
 
data/lib/drawio_dsl.rb CHANGED
@@ -21,6 +21,7 @@ require_relative 'drawio_dsl/layout_engine'
21
21
  require_relative 'drawio_dsl/drawio_shapes'
22
22
  require_relative 'drawio_dsl/drawio_extensions_active'
23
23
  require_relative 'drawio_dsl/drawio_extensions'
24
+ require_relative 'drawio_dsl/drawio_page'
24
25
  require_relative 'drawio_dsl/drawio'
25
26
 
26
27
  module DrawioDsl
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "drawio_dsl",
3
- "version": "0.8.3",
3
+ "version": "0.8.6",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "drawio_dsl",
9
- "version": "0.8.3",
9
+ "version": "0.8.6",
10
10
  "devDependencies": {
11
11
  "@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
12
12
  "@semantic-release/changelog": "^6.0.1",
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drawio_dsl",
3
- "version": "0.8.3",
3
+ "version": "0.8.6",
4
4
  "description": "DrawIO DSL can build DrawIO diagrams using a Domain Specific Language",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drawio_dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-17 00:00:00.000000000 Z
11
+ date: 2022-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: k_config
@@ -88,6 +88,10 @@ files:
88
88
  - ".builders/generators/02-generate-app.rb"
89
89
  - ".builders/generators/10-transform-drawio-js.rb"
90
90
  - ".builders/generators/20-drawio-extensions.rb"
91
+ - ".builders/generators/domain_diagram.rb"
92
+ - ".builders/generators/parking-map.png"
93
+ - ".builders/generators/parking_app.rb"
94
+ - ".builders/generators/printspeak-architecture-generator.rb"
91
95
  - ".builders/generators/project-plan.rb"
92
96
  - ".builders/generators/sample_diagrams/05-samples.rb"
93
97
  - ".builders/generators/sample_diagrams/10-page-margin.rb"
@@ -111,6 +115,11 @@ files:
111
115
  - Rakefile
112
116
  - bin/console
113
117
  - bin/setup
118
+ - docs/domain-modal.md
119
+ - docs/domain-modal/domain_model.drawio
120
+ - docs/domain-modal/domain_model.svg
121
+ - docs/domain-modal/domain_model_custom.drawio
122
+ - docs/domain-modal/domain_model_custom.svg
114
123
  - docs/extensions.md
115
124
  - docs/extensions/analyti_cs.svg
116
125
  - docs/extensions/android_inputs.svg
@@ -265,6 +274,10 @@ files:
265
274
  - docs/extensions/venn_gradient.svg
266
275
  - docs/extensions/venn_plain.svg
267
276
  - docs/extensions/vessels.svg
277
+ - docs/parking_app.drawio
278
+ - docs/parking_app.svg
279
+ - docs/printspeak-architecture-generator.drawio
280
+ - docs/printspeak-architecture-generator.svg
268
281
  - docs/project-plan.md
269
282
  - docs/project-plan/project.drawio
270
283
  - docs/project-plan/project_done.svg
@@ -297,6 +310,7 @@ files:
297
310
  - lib/drawio_dsl/drawio_extensions.json
298
311
  - lib/drawio_dsl/drawio_extensions.rb
299
312
  - lib/drawio_dsl/drawio_extensions_active.rb
313
+ - lib/drawio_dsl/drawio_page.rb
300
314
  - lib/drawio_dsl/drawio_shapes.rb
301
315
  - lib/drawio_dsl/formatters/_.rb
302
316
  - lib/drawio_dsl/formatters/base_formatter.rb
@@ -329,6 +343,8 @@ files:
329
343
  - lib/drawio_dsl/schema/shapes/container3.rb
330
344
  - lib/drawio_dsl/schema/shapes/container4.rb
331
345
  - lib/drawio_dsl/schema/shapes/cross.rb
346
+ - lib/drawio_dsl/schema/shapes/database.rb
347
+ - lib/drawio_dsl/schema/shapes/db_json.rb
332
348
  - lib/drawio_dsl/schema/shapes/diamond.rb
333
349
  - lib/drawio_dsl/schema/shapes/document.rb
334
350
  - lib/drawio_dsl/schema/shapes/ellipse.rb
@@ -337,6 +353,7 @@ files:
337
353
  - lib/drawio_dsl/schema/shapes/embed_row.rb
338
354
  - lib/drawio_dsl/schema/shapes/envelop.rb
339
355
  - lib/drawio_dsl/schema/shapes/face.rb
356
+ - lib/drawio_dsl/schema/shapes/group.rb
340
357
  - lib/drawio_dsl/schema/shapes/h1.rb
341
358
  - lib/drawio_dsl/schema/shapes/h2.rb
342
359
  - lib/drawio_dsl/schema/shapes/h3.rb