drawio_dsl 0.8.2 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.builders/.data/shapes.json +193 -9
- data/.builders/.templates/basic/drawio_extensions.rb +2 -1
- data/.builders/.templates/basic/drawio_shapes.rb +1 -1
- data/.builders/blueprint/shapes.rb +88 -4
- data/.builders/generators/20-drawio-extensions.rb +1 -1
- data/.builders/generators/domain_diagram.rb +473 -0
- data/.builders/generators/parking-map.png +0 -0
- data/.builders/generators/parking_app.rb +110 -0
- data/.builders/generators/printspeak-architecture-generator.rb +45 -0
- data/.builders/generators/project-plan.rb +14 -7
- data/.builders/generators/sample_diagrams/35-ids-and-arrows.rb +16 -6
- data/CHANGELOG.md +22 -0
- data/README.md +5 -3
- data/docs/domain-modal/domain_model.drawio +265 -0
- data/docs/domain-modal/domain_model.svg +3 -0
- data/docs/domain-modal/domain_model_custom.drawio +408 -0
- data/docs/domain-modal/domain_model_custom.png +0 -0
- data/docs/domain-modal.md +9 -0
- data/docs/parking_app.drawio +25 -0
- data/docs/parking_app.svg +3 -0
- data/docs/printspeak-architecture-generator.drawio +31 -0
- data/docs/printspeak-architecture-generator.svg +3 -0
- data/docs/project-plan/project.drawio +72 -48
- data/docs/project-plan/project_done.svg +1 -1
- data/docs/project-plan/project_in_progress.svg +1 -1
- data/docs/project-plan/project_todo.svg +1 -1
- data/docs/samples/styles-glass.svg +1 -1
- data/docs/samples/styles-rounded.svg +1 -1
- data/docs/samples/styles-sketch.svg +1 -1
- data/lib/drawio_dsl/configuration_shapes.rb +7 -3
- data/lib/drawio_dsl/dom_builder.rb +1 -1
- data/lib/drawio_dsl/dom_builder_shapes.rb +19 -7
- data/lib/drawio_dsl/drawio.rb +0 -19
- data/lib/drawio_dsl/drawio_extensions.rb +3 -2
- data/lib/drawio_dsl/drawio_extensions_active.rb +1 -1
- data/lib/drawio_dsl/drawio_page.rb +22 -0
- data/lib/drawio_dsl/drawio_shapes.rb +58 -46
- data/lib/drawio_dsl/formatters/base_formatter.rb +1 -1
- data/lib/drawio_dsl/formatters/html_builder.rb +1 -1
- data/lib/drawio_dsl/formatters/interface_formatter.rb +1 -1
- data/lib/drawio_dsl/formatters/klass_formatter.rb +1 -1
- data/lib/drawio_dsl/formatters/style_builder.rb +1 -1
- data/lib/drawio_dsl/schema/_.rb +3 -1
- data/lib/drawio_dsl/schema/shapes/database.rb +9 -0
- data/lib/drawio_dsl/schema/shapes/db_json.rb +9 -0
- data/lib/drawio_dsl/schema/shapes/shape.rb +19 -0
- data/lib/drawio_dsl/version.rb +1 -1
- data/lib/drawio_dsl/xml_builder.rb +1 -1
- data/lib/drawio_dsl.rb +1 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +18 -2
@@ -3,11 +3,12 @@
|
|
3
3
|
# Attach configuration to the DrawIO DSL module
|
4
4
|
# :nocov:
|
5
5
|
module DrawioDsl
|
6
|
-
#
|
6
|
+
# Attach predefined shapes DrawIO KConfig module
|
7
7
|
module ConfigurationShapes
|
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,6 +30,8 @@ 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,
|
@@ -45,7 +48,6 @@ module DrawioDsl
|
|
45
48
|
:todo,
|
46
49
|
:face,
|
47
50
|
:triangle,
|
48
|
-
:line,
|
49
51
|
:embed_row,
|
50
52
|
:embed_col50,
|
51
53
|
:embed_col200,
|
@@ -55,6 +57,7 @@ module DrawioDsl
|
|
55
57
|
def add_shapes
|
56
58
|
@shapes = Shapes.new(
|
57
59
|
shape: ShapeDefaults.new(type: :shape, category: :element, x: 0, y: 0, w: 20, h: 20, style_modifiers: ''),
|
60
|
+
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
61
|
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
62
|
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
63
|
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,6 +79,8 @@ module DrawioDsl
|
|
76
79
|
container4: ShapeDefaults.new(type: :container4, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'swimlane;resizable=0'),
|
77
80
|
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
81
|
envelop: ShapeDefaults.new(type: :envelop, x: 0, category: :element, y: 0, w: 160, h: 100, style_modifiers: 'shape=message'),
|
82
|
+
database: ShapeDefaults.new(type: :database, x: 0, category: :element, y: 0, w: 160, h: 80, style_modifiers: 'shape=mxgraph.flowchart.database;strokeWidth=1'),
|
83
|
+
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
84
|
diamond: ShapeDefaults.new(type: :diamond, x: 0, category: :element, y: 0, w: 100, h: 100, style_modifiers: 'rhombus'),
|
80
85
|
document: ShapeDefaults.new(type: :document, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'shape=mxgraph.basic.document'),
|
81
86
|
ellipse: ShapeDefaults.new(type: :ellipse, x: 0, category: :element, y: 0, w: 200, h: 120, style_modifiers: 'ellipse'),
|
@@ -92,7 +97,6 @@ module DrawioDsl
|
|
92
97
|
todo: ShapeDefaults.new(type: :todo, x: 0, category: :element, y: 0, w: 300, h: 60, style_modifiers: ''),
|
93
98
|
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
99
|
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=entityRelationEdgeStyle;strokeWidth=1;elbow=vertical;startArrow=none;startFill=0;endArrow=block;endFill=0;targetPerimeterSpacing=0;shape=flexArrow;endSize=6;fillStyle=zigzag;'),
|
96
100
|
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
101
|
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
102
|
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')
|
@@ -2,8 +2,14 @@
|
|
2
2
|
|
3
3
|
# :nocov:
|
4
4
|
module DrawioDsl
|
5
|
-
#
|
5
|
+
# Builder methods for each shape, line and text element to attach to DomBuilder.
|
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)
|
@@ -226,12 +244,6 @@ module DrawioDsl
|
|
226
244
|
add_shape(triangle)
|
227
245
|
end
|
228
246
|
|
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
247
|
def add_embed_row(id = nil, **opts, &block)
|
236
248
|
opts = { id: id }.merge(opts) if id
|
237
249
|
embed_row = DrawioDsl::Schema::EmbedRow.new(current_page, **opts, &block)
|
data/lib/drawio_dsl/drawio.rb
CHANGED
@@ -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
|
-
|
6
|
-
|
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
|
@@ -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,104 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module DrawioDsl
|
4
|
-
#
|
4
|
+
# List of DSL methods for each common shape
|
5
5
|
# :nocov:
|
6
6
|
module DrawioShapes
|
7
7
|
def random(**opts)
|
8
|
-
case rand(
|
8
|
+
case rand(43)
|
9
9
|
when 0
|
10
|
-
|
10
|
+
line(**opts)
|
11
11
|
when 1
|
12
|
-
|
12
|
+
h1(**opts)
|
13
13
|
when 2
|
14
|
-
|
14
|
+
h2(**opts)
|
15
15
|
when 3
|
16
|
-
|
16
|
+
h3(**opts)
|
17
17
|
when 4
|
18
|
-
|
18
|
+
h4(**opts)
|
19
19
|
when 5
|
20
|
-
|
20
|
+
h5(**opts)
|
21
21
|
when 6
|
22
|
-
|
22
|
+
h6(**opts)
|
23
23
|
when 7
|
24
|
-
|
24
|
+
p(**opts)
|
25
25
|
when 8
|
26
|
-
|
26
|
+
actor(**opts)
|
27
27
|
when 9
|
28
|
-
|
28
|
+
actor2(**opts)
|
29
29
|
when 10
|
30
|
-
|
30
|
+
callout(**opts)
|
31
31
|
when 11
|
32
|
-
|
32
|
+
callout2(**opts)
|
33
33
|
when 12
|
34
|
-
|
34
|
+
callout3(**opts)
|
35
35
|
when 13
|
36
|
-
|
36
|
+
callout4(**opts)
|
37
37
|
when 14
|
38
|
-
|
38
|
+
circle(**opts)
|
39
39
|
when 15
|
40
|
-
|
40
|
+
cloud(**opts)
|
41
41
|
when 16
|
42
|
-
|
42
|
+
container(**opts)
|
43
43
|
when 17
|
44
|
-
|
44
|
+
container2(**opts)
|
45
45
|
when 18
|
46
|
-
|
46
|
+
container3(**opts)
|
47
47
|
when 19
|
48
|
-
|
48
|
+
container4(**opts)
|
49
49
|
when 20
|
50
|
-
|
50
|
+
cross(**opts)
|
51
51
|
when 21
|
52
|
-
|
52
|
+
envelop(**opts)
|
53
53
|
when 22
|
54
|
-
|
54
|
+
database(**opts)
|
55
55
|
when 23
|
56
|
-
|
56
|
+
db_json(**opts)
|
57
57
|
when 24
|
58
|
-
|
58
|
+
diamond(**opts)
|
59
59
|
when 25
|
60
|
-
|
60
|
+
document(**opts)
|
61
61
|
when 26
|
62
|
-
|
62
|
+
ellipse(**opts)
|
63
63
|
when 27
|
64
|
-
|
64
|
+
hexagon(**opts)
|
65
65
|
when 28
|
66
|
-
|
66
|
+
interface(**opts)
|
67
67
|
when 29
|
68
|
-
|
68
|
+
klass(**opts)
|
69
69
|
when 30
|
70
|
-
|
70
|
+
note(**opts)
|
71
71
|
when 31
|
72
|
-
|
72
|
+
process(**opts)
|
73
73
|
when 32
|
74
|
-
|
74
|
+
rectangle(**opts)
|
75
75
|
when 33
|
76
|
-
|
76
|
+
rectangle2(**opts)
|
77
77
|
when 34
|
78
|
-
|
78
|
+
square(**opts)
|
79
79
|
when 35
|
80
|
-
|
80
|
+
step(**opts)
|
81
81
|
when 36
|
82
|
-
|
82
|
+
tick(**opts)
|
83
83
|
when 37
|
84
|
-
|
84
|
+
todo(**opts)
|
85
85
|
when 38
|
86
|
-
|
86
|
+
face(**opts)
|
87
87
|
when 39
|
88
|
-
|
88
|
+
triangle(**opts)
|
89
89
|
when 40
|
90
|
+
embed_row(**opts)
|
91
|
+
when 41
|
92
|
+
embed_col50(**opts)
|
93
|
+
when 42
|
90
94
|
embed_col200(**opts)
|
91
95
|
end
|
92
96
|
end
|
93
97
|
|
98
|
+
def line(id = nil, **opts, &block)
|
99
|
+
builder.add_line(id, **opts, &block)
|
100
|
+
end
|
101
|
+
|
94
102
|
def h1(id = nil, **opts, &block)
|
95
103
|
builder.add_h1(id, **opts, &block)
|
96
104
|
end
|
@@ -175,6 +183,14 @@ module DrawioDsl
|
|
175
183
|
builder.add_envelop(id, **opts, &block)
|
176
184
|
end
|
177
185
|
|
186
|
+
def database(id = nil, **opts, &block)
|
187
|
+
builder.add_database(id, **opts, &block)
|
188
|
+
end
|
189
|
+
|
190
|
+
def db_json(id = nil, **opts, &block)
|
191
|
+
builder.add_db_json(id, **opts, &block)
|
192
|
+
end
|
193
|
+
|
178
194
|
def diamond(id = nil, **opts, &block)
|
179
195
|
builder.add_diamond(id, **opts, &block)
|
180
196
|
end
|
@@ -239,10 +255,6 @@ module DrawioDsl
|
|
239
255
|
builder.add_triangle(id, **opts, &block)
|
240
256
|
end
|
241
257
|
|
242
|
-
def line(id = nil, **opts, &block)
|
243
|
-
builder.add_line(id, **opts, &block)
|
244
|
-
end
|
245
|
-
|
246
258
|
def embed_row(id = nil, **opts, &block)
|
247
259
|
builder.add_embed_row(id, **opts, &block)
|
248
260
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
7
|
+
# Build the style attribute for a HTML element
|
8
8
|
class StyleBuilder
|
9
9
|
MAPPINGS = {
|
10
10
|
margin: 'margin',
|
data/lib/drawio_dsl/schema/_.rb
CHANGED
@@ -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,6 +34,8 @@ 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'
|
@@ -49,7 +52,6 @@ require_relative 'shapes/tick'
|
|
49
52
|
require_relative 'shapes/todo'
|
50
53
|
require_relative 'shapes/face'
|
51
54
|
require_relative 'shapes/triangle'
|
52
|
-
require_relative 'shapes/line'
|
53
55
|
require_relative 'shapes/embed_row'
|
54
56
|
require_relative 'shapes/embed_col50'
|
55
57
|
require_relative 'shapes/embed_col200'
|
@@ -47,6 +47,9 @@ module DrawioDsl
|
|
47
47
|
attr_accessor :h
|
48
48
|
attr_accessor :style_modifiers
|
49
49
|
|
50
|
+
attr_accessor :source
|
51
|
+
attr_accessor :target
|
52
|
+
|
50
53
|
def initialize(page, **args, &block)
|
51
54
|
args[:classification] = :shape
|
52
55
|
super(page, **args)
|
@@ -83,6 +86,9 @@ module DrawioDsl
|
|
83
86
|
@h = args[:h] || shape_defaults.h
|
84
87
|
@style_modifiers = args[:style_modifiers] || shape_defaults.style_modifiers
|
85
88
|
|
89
|
+
@source = args[:source]
|
90
|
+
@target = args[:target]
|
91
|
+
|
86
92
|
@fill_color = args[:fill_color] || (category == :text ? nil : theme_palette.fill_color)
|
87
93
|
@stroke_color = args[:stroke_color] || (category == :text ? nil : theme_palette.stroke_color)
|
88
94
|
@gradient = args[:gradient] || (category == :text ? nil : theme_palette.gradient)
|
@@ -113,11 +119,24 @@ module DrawioDsl
|
|
113
119
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
114
120
|
|
115
121
|
def as_xml(xml)
|
122
|
+
# log.error category
|
123
|
+
# log.error type
|
124
|
+
draw_element(xml) if category == :element
|
125
|
+
draw_line(xml) if category == :line
|
126
|
+
end
|
127
|
+
|
128
|
+
def draw_element(xml)
|
116
129
|
xml.mxCell(id: id, value: value, style: style, vertex: 1, parent: parent&.id) do
|
117
130
|
xml.mxGeometry(x: x, y: y, width: w, height: h, as: 'geometry')
|
118
131
|
end
|
119
132
|
end
|
120
133
|
|
134
|
+
def draw_line(xml)
|
135
|
+
xml.mxCell(id: id, value: value, style: style, parent: parent&.id, source: source, target: target, edge: 1) do
|
136
|
+
xml.mxGeometry(relative: 1, as: 'geometry')
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
121
140
|
def to_h
|
122
141
|
result = {
|
123
142
|
id: id,
|
data/lib/drawio_dsl/version.rb
CHANGED
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
|
+
"version": "0.8.5",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "drawio_dsl",
|
9
|
-
"version": "0.8.
|
9
|
+
"version": "0.8.5",
|
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
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.
|
4
|
+
version: 0.8.5
|
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-
|
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.png
|
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
|