drawio_dsl 0.5.4 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.builders/.templates/basic/schema_require.rb +3 -1
- data/.builders/generators/project_plans/drawio_dsl.rb +19 -15
- data/.builders/generators/project_plans/k_doc.rb +39 -0
- data/.builders/generators/sample_diagrams/05-samples.rb +23 -0
- data/.builders/generators/sample_diagrams/10-page-margin.rb +4 -8
- data/.builders/generators/sample_diagrams/15-grid-direction.rb +9 -7
- data/.builders/generators/sample_diagrams/16-grid-alignment.rb +6 -9
- data/.builders/generators/sample_diagrams/20-styles.rb +43 -45
- data/.builders/generators/sample_diagrams/25-themes.rb +21 -8
- data/.builders/generators/sample_diagrams/50-willoughby-council.rb +5 -6
- data/.rubocop.yml +3 -1
- data/CHANGELOG.md +22 -0
- data/README.md +6 -3
- data/docs/project_done.svg +1 -1
- data/docs/project_in_progress.svg +1 -1
- data/docs/project_todo.svg +1 -1
- data/docs/samples/grid-alignment-center.svg +3 -0
- data/docs/samples/grid-alignment.svg +3 -0
- data/docs/samples/grid-direction-horizontal.svg +3 -0
- data/docs/samples/grid-direction-vertical.svg +3 -0
- data/docs/samples/samples.md +48 -0
- data/docs/samples/samples.svg +3 -0
- data/docs/samples/styles-glass.svg +3 -0
- data/docs/samples/styles-plain.svg +3 -0
- data/docs/samples/styles-rounded.svg +3 -0
- data/docs/samples/styles-shadow.svg +3 -0
- data/docs/samples/styles-sketch.svg +3 -0
- data/docs/samples/themes-circle.svg +3 -0
- data/docs/samples/themes-random.svg +3 -0
- data/docs/samples/themes-square.svg +3 -0
- data/docs/samples/willoughby-council.svg +3 -0
- data/lib/drawio_dsl/drawio.rb +16 -0
- data/lib/drawio_dsl/schema/_.rb +2 -0
- data/lib/drawio_dsl/schema/node.rb +6 -0
- data/lib/drawio_dsl/schema/page.rb +4 -0
- data/lib/drawio_dsl/schema/virtual/anchor.rb +24 -0
- data/lib/drawio_dsl/version.rb +1 -1
- data/lib/drawio_dsl/xml_builder.rb +6 -5
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +20 -3
- data/.builders/generators/sample_diagrams/30-shapes.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbcff9217d4dba5b4cde6bc9d0fd2e9448ef7c6d953ce721055c3fb09ae8e6b6
|
4
|
+
data.tar.gz: 618b5bb6db0a4688a4263f671ef83d8f0f188553ced55e9a975898abf84bb5ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55c4572a400d3a101261243c417b34d202303954eb83078ded151e4cd3bf7f8b3af1b39214cdbd97b899ce4884a1a9ca85a03b85a66eb9bbbf14e836da662e55
|
7
|
+
data.tar.gz: bdef286ff06b834b0cf93cc1a3f59dbf966040da92ebaf787722c240d922b9a4b5e3be38f6caa9507abf1f007099abff7ba8b36d4aff60d5ad3467245c089173
|
@@ -1,28 +1,28 @@
|
|
1
1
|
KManager.action :todo_drawio_dsl do
|
2
2
|
action do
|
3
3
|
|
4
|
-
|
5
|
-
director = DrawioDsl::Drawio
|
4
|
+
DrawioDsl::Drawio
|
6
5
|
.init(k_builder, on_exist: :write, on_action: :execute)
|
7
6
|
.diagram(rounded: 1, glass: 1)
|
8
7
|
.page('In progress', theme: :style_03, margin_left: 0, margin_top: 0) do
|
9
8
|
|
10
|
-
h5(x: 300, y: 0, w: 400, h: 80, title: 'DrawIO DSL')
|
11
|
-
p(x: 350, y: 40, w: 400, h: 80, title: 'Project plan - In progress')
|
9
|
+
# h5(x: 300, y: 0, w: 400, h: 80, title: 'DrawIO DSL')
|
10
|
+
# p(x: 350, y: 40, w: 400, h: 80, title: 'Project plan - In progress')
|
12
11
|
|
13
12
|
grid_layout(y:90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
|
14
13
|
|
15
|
-
square(w: 300, h: 60, title: '
|
14
|
+
square(w: 300, h: 60, title: 'First level child nodes need to hang of node 1')
|
15
|
+
square(w: 300, h: 60, title: 'Add page background to theme, use it whenever the theme is set at a diagram/page level')
|
16
16
|
end
|
17
17
|
.page('To Do', theme: :style_02, margin_left: 0, margin_top: 0) do
|
18
18
|
|
19
|
-
h5(x: 300, y: 0, w: 400, h: 80, title: 'DrawIO DSL')
|
20
|
-
p(x: 350, y: 40, w: 400, h: 80, title: 'Project plan')
|
19
|
+
# h5(x: 300, y: 0, w: 400, h: 80, title: 'DrawIO DSL')
|
20
|
+
# p(x: 350, y: 40, w: 400, h: 80, title: 'Project plan')
|
21
21
|
|
22
22
|
grid_layout(y:90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
|
23
23
|
|
24
|
-
square(w: 300, h: 60, title: '
|
25
|
-
square(w: 300, h: 60, title: '
|
24
|
+
square(w: 300, h: 60, title: 'write SVG directly into other projects')
|
25
|
+
square(w: 300, h: 60, title: 'add :shape and :text-only to random shape generator')
|
26
26
|
square(w: 300, h: 60, title: 'Nodes need to support child nodes')
|
27
27
|
square(w: 300, h: 60, title: 'Grid layout does no position itself in relation to the last element')
|
28
28
|
square(w: 300, h: 60, title: 'Dynamic sized shapes that expand to the size of their text')
|
@@ -37,20 +37,24 @@ KManager.action :todo_drawio_dsl do
|
|
37
37
|
end
|
38
38
|
.page('Done', theme: :style_06, margin_left: 0, margin_top: 0) do
|
39
39
|
|
40
|
-
h5(x: 300, y: 0, w: 400, h: 80, title: 'DrawIO DSL')
|
41
|
-
p(x: 350, y: 40, w: 400, h: 80, title: 'Done')
|
40
|
+
# h5(x: 300, y: 0, w: 400, h: 80, title: 'DrawIO DSL')
|
41
|
+
# p(x: 350, y: 40, w: 400, h: 80, title: 'Done')
|
42
42
|
|
43
43
|
grid_layout(y:90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
|
44
44
|
|
45
|
-
square(w: 300, h: 60, title: '
|
45
|
+
square(w: 300, h: 60, title: 'Nodes can belong to a parent node, the top level node responds with truthy to root?')
|
46
|
+
square(w: 300, h: 60, title: 'add sample diagram for the github readme file')
|
47
|
+
square(w: 300, h: 60, title: 'write samples into docs folder and display in readme')
|
48
|
+
square(w: 300, h: 60, title: 'add export as .PNG, needs to take a page number as the PNG will not support multiple pages')
|
46
49
|
square(w: 300, h: 60, title: 'add export as .SVG, needs to take a page number as the SVG will not support multiple pages')
|
50
|
+
square(w: 300, h: 60, title: 'add save as .drawio')
|
47
51
|
|
48
52
|
end
|
49
53
|
.cd(:spec)
|
50
54
|
.save('project-plans/drawio_dsl.drawio')
|
51
55
|
.cd(:docs)
|
52
|
-
.export_svg('project_in_progress
|
53
|
-
.export_svg('project_todo
|
54
|
-
.export_svg('project_done
|
56
|
+
.export_svg('project_in_progress', page: 1)
|
57
|
+
.export_svg('project_todo' , page: 2)
|
58
|
+
.export_svg('project_done' , page: 3)
|
55
59
|
end
|
56
60
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
KManager.action :todo_drawio_dsl do
|
2
|
+
action do
|
3
|
+
|
4
|
+
DrawioDsl::Drawio
|
5
|
+
.init(k_builder, on_exist: :write, on_action: :execute)
|
6
|
+
.diagram(rounded: 1, glass: 1)
|
7
|
+
.page('In progress', theme: :style_03, margin_left: 0, margin_top: 0) do
|
8
|
+
|
9
|
+
# h5(x: 300, y: 0, w: 400, h: 80, title: 'DrawIO DSL')
|
10
|
+
# p(x: 350, y: 40, w: 400, h: 80, title: 'Project plan - In progress')
|
11
|
+
|
12
|
+
grid_layout(y:90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
|
13
|
+
|
14
|
+
square(w: 300, h: 60, title: '')
|
15
|
+
end
|
16
|
+
.page('To Do', theme: :style_02, margin_left: 0, margin_top: 0) do
|
17
|
+
|
18
|
+
# h5(x: 300, y: 0, w: 400, h: 80, title: 'DrawIO DSL')
|
19
|
+
# p(x: 350, y: 40, w: 400, h: 80, title: 'Project plan')
|
20
|
+
|
21
|
+
grid_layout(y:90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
|
22
|
+
|
23
|
+
end
|
24
|
+
.page('Done', theme: :style_06, margin_left: 0, margin_top: 0) do
|
25
|
+
|
26
|
+
# h5(x: 300, y: 0, w: 400, h: 80, title: 'DrawIO DSL')
|
27
|
+
# p(x: 350, y: 40, w: 400, h: 80, title: 'Done')
|
28
|
+
|
29
|
+
grid_layout(y:90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
|
30
|
+
|
31
|
+
end
|
32
|
+
.cd(:spec)
|
33
|
+
.save('project-plans/k_doc.drawio')
|
34
|
+
# .cd(:k_doc_docs)
|
35
|
+
# .export_svg('project_in_progress', page: 1)
|
36
|
+
# .export_svg('project_todo' , page: 2)
|
37
|
+
# .export_svg('project_done' , page: 3)
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
def rnd(max)
|
2
|
+
Random.rand(0..max) == 0 ? 1 : 0
|
3
|
+
end
|
4
|
+
KManager.action :bootstrap do
|
5
|
+
action do
|
6
|
+
DrawioDsl::Drawio
|
7
|
+
.init(k_builder, on_exist: :write, on_action: :execute)
|
8
|
+
.diagram(theme: :style_01)
|
9
|
+
.page('Samples') do
|
10
|
+
grid_layout(wrap_at: 5)
|
11
|
+
|
12
|
+
KConfig.configuration.drawio.shapes.select { |shape| shape.type != :shape && !shape.text_only }.each do |shape|
|
13
|
+
# print random number between 0 and 1
|
14
|
+
send(shape.type, theme: KConfig.configuration.drawio.random_theme, title: shape.type.to_s, shape: shape, rounded: rnd(2), gloss: rnd(2), sketch: rnd(8))
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
.cd(:spec)
|
19
|
+
.save('.samples/05-samples.drawio')
|
20
|
+
.cd(:docs)
|
21
|
+
.export_svg('samples/samples', page: 1)
|
22
|
+
end
|
23
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
KManager.action :bootstrap do
|
2
2
|
action do
|
3
|
-
|
4
|
-
.init(k_builder)
|
3
|
+
DrawioDsl::Drawio
|
4
|
+
.init(k_builder, on_exist: :write, on_action: :execute)
|
5
5
|
.diagram(theme: :style_01)
|
6
6
|
.page('PgMargin-default') do
|
7
7
|
grid_layout(wrap_at: 4)
|
@@ -36,11 +36,7 @@ KManager.action :bootstrap do
|
|
36
36
|
square
|
37
37
|
circle
|
38
38
|
end
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
File.write('../spec/.samples/drawio/10-page-margin.xml', diagram.build)
|
44
|
-
File.write('../spec/.samples/drawio/10-page-margin.drawio', diagram.build)
|
39
|
+
.cd(:spec)
|
40
|
+
.save('.samples/10-page-margin.drawio')
|
45
41
|
end
|
46
42
|
end
|
@@ -8,11 +8,12 @@ KManager.action :bootstrap do
|
|
8
8
|
# KConfig.configuration.drawio.rectangle.w = KConfig.configuration.drawio.rectangle.w / 4
|
9
9
|
# KConfig.configuration.drawio.rectangle.h = KConfig.configuration.drawio.rectangle.h / 4
|
10
10
|
|
11
|
-
|
12
|
-
.init(k_builder)
|
11
|
+
DrawioDsl::Drawio
|
12
|
+
.init(k_builder, on_exist: :write, on_action: :execute)
|
13
13
|
.diagram(theme: :style_01)
|
14
14
|
.page('Horizontal', margin_left: 0, margin_top: 0) do
|
15
15
|
grid_layout(wrap_at: 3, direction: :horizontal)
|
16
|
+
h4(title: 'Horizontal')
|
16
17
|
circle(title: '01')
|
17
18
|
square(title: '02')
|
18
19
|
circle(title: '03')
|
@@ -23,6 +24,7 @@ KManager.action :bootstrap do
|
|
23
24
|
end
|
24
25
|
.page('Vertical', margin_left: 0, margin_top: 0) do
|
25
26
|
grid_layout(wrap_at: 3, direction: :vertical)
|
27
|
+
h4(title: 'Vertical')
|
26
28
|
circle(title: '01')
|
27
29
|
square(title: '02')
|
28
30
|
circle(title: '03')
|
@@ -31,10 +33,10 @@ KManager.action :bootstrap do
|
|
31
33
|
square(title: '06')
|
32
34
|
circle(title: '07')
|
33
35
|
end
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
.cd(:spec)
|
37
|
+
.save('.samples/15-grid-direction.drawio')
|
38
|
+
.cd(:docs)
|
39
|
+
.export_svg('samples/grid-direction-horizontal', page: 1)
|
40
|
+
.export_svg('samples/grid-direction-vertical', page: 2)
|
39
41
|
end
|
40
42
|
end
|
@@ -9,10 +9,7 @@ KManager.action :bootstrap do
|
|
9
9
|
# KConfig.configuration.drawio.rectangle.h = KConfig.configuration.drawio.rectangle.h / 4
|
10
10
|
|
11
11
|
director = DrawioDsl::Drawio
|
12
|
-
.init(k_builder,
|
13
|
-
on_exist: :skip, # %i[skip write compare]
|
14
|
-
on_action: :queue # %i[queue execute]
|
15
|
-
)
|
12
|
+
.init(k_builder, on_exist: :write, on_action: :execute)
|
16
13
|
.diagram(theme: :style_01)
|
17
14
|
.page('Grid-Center', margin_left: 0, margin_top: 0) do
|
18
15
|
grid_layout(wrap_at: 3)
|
@@ -64,10 +61,10 @@ KManager.action :bootstrap do
|
|
64
61
|
square
|
65
62
|
circle
|
66
63
|
end
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
64
|
+
.cd(:spec)
|
65
|
+
.save('.samples/16-grid-alignment.drawio')
|
66
|
+
.cd(:docs)
|
67
|
+
# note: there is no difference between center and top/bottom/left/right using SVG/PNG
|
68
|
+
.export_svg('samples/grid-alignment', page: 1)
|
72
69
|
end
|
73
70
|
end
|
@@ -3,62 +3,60 @@ KManager.action :bootstrap do
|
|
3
3
|
|
4
4
|
# :rounded, :shadow, :sketch, :glass
|
5
5
|
director = DrawioDsl::Drawio
|
6
|
-
.init(k_builder)
|
6
|
+
.init(k_builder, on_exist: :write, on_action: :execute)
|
7
7
|
.diagram(theme: :style_06)
|
8
8
|
.page('Style-Plain', margin_left: 0, margin_top: 0) do
|
9
|
-
grid_layout(wrap_at:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
circle
|
9
|
+
grid_layout(wrap_at: 5)
|
10
|
+
|
11
|
+
KConfig.configuration.drawio.shapes.members.each do |shape|
|
12
|
+
next if shape == :shape
|
13
|
+
|
14
|
+
send(shape, title: shape.to_s, shape: shape)
|
15
|
+
end
|
17
16
|
end
|
18
17
|
.page('Style-Shadow', shadow: 1, margin_left: 0, margin_top: 0) do
|
19
|
-
grid_layout(wrap_at:
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
circle
|
18
|
+
grid_layout(wrap_at: 5)
|
19
|
+
|
20
|
+
KConfig.configuration.drawio.shapes.members.each do |shape|
|
21
|
+
next if shape == :shape
|
22
|
+
|
23
|
+
send(shape, title: shape.to_s, shape: shape)
|
24
|
+
end
|
27
25
|
end
|
28
26
|
.page('Style-Rounded', rounded: 1, margin_left: 0, margin_top: 0) do
|
29
|
-
grid_layout(wrap_at:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
circle
|
27
|
+
grid_layout(wrap_at: 5)
|
28
|
+
|
29
|
+
KConfig.configuration.drawio.shapes.members.each do |shape|
|
30
|
+
next if shape == :shape
|
31
|
+
|
32
|
+
send(shape, title: shape.to_s, shape: shape)
|
33
|
+
end
|
37
34
|
end
|
38
35
|
.page('Style-Glass', glass: 1, margin_left: 0, margin_top: 0) do
|
39
|
-
grid_layout(wrap_at:
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
circle
|
36
|
+
grid_layout(wrap_at: 5)
|
37
|
+
|
38
|
+
KConfig.configuration.drawio.shapes.members.each do |shape|
|
39
|
+
next if shape == :shape
|
40
|
+
|
41
|
+
send(shape, title: shape.to_s, shape: shape)
|
42
|
+
end
|
47
43
|
end
|
48
44
|
.page('Style-Sketch', sketch: 1, margin_left: 0, margin_top: 0) do
|
49
|
-
grid_layout(wrap_at:
|
50
|
-
circle
|
51
|
-
square
|
52
|
-
circle
|
53
|
-
square
|
54
|
-
circle
|
55
|
-
square
|
56
|
-
circle
|
57
|
-
end
|
45
|
+
grid_layout(wrap_at: 5)
|
58
46
|
|
59
|
-
|
47
|
+
KConfig.configuration.drawio.shapes.members.each do |shape|
|
48
|
+
next if shape == :shape
|
60
49
|
|
61
|
-
|
62
|
-
|
50
|
+
send(shape, title: shape.to_s, shape: shape)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
.cd(:spec)
|
54
|
+
.save('.samples/20-styles.drawio')
|
55
|
+
.cd(:docs)
|
56
|
+
.export_svg('samples/styles-plain', page: 1)
|
57
|
+
.export_svg('samples/styles-shadow', page: 2)
|
58
|
+
.export_svg('samples/styles-rounded', page: 3)
|
59
|
+
.export_svg('samples/styles-glass', page: 4)
|
60
|
+
.export_svg('samples/styles-sketch', page: 5)
|
63
61
|
end
|
64
62
|
end
|
@@ -2,23 +2,36 @@ KManager.action :bootstrap do
|
|
2
2
|
action do
|
3
3
|
|
4
4
|
# :rounded, :shadow, :sketch, :glass
|
5
|
-
|
6
|
-
.init(k_builder)
|
5
|
+
DrawioDsl::Drawio
|
6
|
+
.init(k_builder, on_exist: :write, on_action: :execute)
|
7
7
|
.diagram(theme: :style_06)
|
8
8
|
.page('Style-Plain', margin_left: 0, margin_top: 0, rounded: 1, background: '#FFEADB') do
|
9
9
|
grid_layout(wrap_at: 8)
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
KConfig.configuration.drawio.themes.keys.each do |theme|
|
12
|
+
square(title: theme.to_s, theme: theme)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
.page('Style-Plain', margin_left: 0, margin_top: 0, rounded: 1, background: '#FFEADB') do
|
16
|
+
grid_layout(wrap_at: 8)
|
13
17
|
|
14
18
|
KConfig.configuration.drawio.themes.keys.each do |theme|
|
15
|
-
|
19
|
+
circle(title: theme.to_s, theme: theme)
|
16
20
|
end
|
17
21
|
end
|
22
|
+
.page('Style-Plain', margin_left: 0, margin_top: 0, rounded: 1, background: '#FFEADB') do
|
23
|
+
grid_layout(wrap_at: 8)
|
18
24
|
|
19
|
-
|
25
|
+
KConfig.configuration.drawio.themes.keys.each do |theme|
|
26
|
+
random(title: theme.to_s, theme: theme)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
.cd(:spec)
|
30
|
+
.save('.samples/25-themes.drawio')
|
31
|
+
.cd(:docs)
|
32
|
+
.export_svg('samples/themes-square', page: 1)
|
33
|
+
.export_svg('samples/themes-circle', page: 2)
|
34
|
+
.export_svg('samples/themes-random', page: 3)
|
20
35
|
|
21
|
-
File.write('../spec/.samples/drawio/25-themes.xml', diagram.build)
|
22
|
-
File.write('../spec/.samples/drawio/25-themes.drawio', diagram.build)
|
23
36
|
end
|
24
37
|
end
|
@@ -3,7 +3,7 @@ KManager.action :bootstrap do
|
|
3
3
|
|
4
4
|
# :rounded, :shadow, :sketch, :glass
|
5
5
|
director = DrawioDsl::Drawio
|
6
|
-
.init(k_builder)
|
6
|
+
.init(k_builder, on_exist: :write, on_action: :execute)
|
7
7
|
.diagram(theme: :style_03)
|
8
8
|
.page('Shapes', margin_left: 0, margin_top: 0, rounded: 1) do
|
9
9
|
grid_layout(direction: :vertical, grid_h: 120, grid_w: 400, wrap_at: 10, grid: 0)
|
@@ -43,10 +43,9 @@ KManager.action :bootstrap do
|
|
43
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've taken and to be able to justify it')
|
44
44
|
|
45
45
|
end
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
File.write('../spec/.samples/drawio/50-willoughby-council.drawio', diagram.build)
|
46
|
+
.cd(:spec)
|
47
|
+
.save('.samples/50-willoughby-council.drawio')
|
48
|
+
.cd(:docs)
|
49
|
+
.export_svg('samples/willoughby-council', page: 1)
|
51
50
|
end
|
52
51
|
end
|
data/.rubocop.yml
CHANGED
@@ -11,7 +11,6 @@ AllCops:
|
|
11
11
|
- ".builders/**/*"
|
12
12
|
- "spec/samples/**/*"
|
13
13
|
|
14
|
-
|
15
14
|
Metrics/BlockLength:
|
16
15
|
Exclude:
|
17
16
|
- "**/spec/**/*"
|
@@ -52,6 +51,9 @@ Style/BlockComments:
|
|
52
51
|
Include:
|
53
52
|
- "**/spec/*"
|
54
53
|
|
54
|
+
Style/RegexpLiteral:
|
55
|
+
Enabled: false
|
56
|
+
|
55
57
|
# My Preferences - Start
|
56
58
|
Metrics/ClassLength:
|
57
59
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
## [0.5.6](https://github.com/klueless-io/drawio_dsl/compare/v0.5.5...v0.5.6) (2022-03-08)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* add sample diagram for the github readme file ([3fe7dfc](https://github.com/klueless-io/drawio_dsl/commit/3fe7dfcdd2de0721539cd78d9c8bb3a5552f2489))
|
7
|
+
|
8
|
+
## [0.5.5](https://github.com/klueless-io/drawio_dsl/compare/v0.5.4...v0.5.5) (2022-03-08)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* add support for PNG/SVG and add sample documents ([4393be1](https://github.com/klueless-io/drawio_dsl/commit/4393be1db0deaf2040a4f395fd6f5c86ab4778db))
|
14
|
+
|
15
|
+
## [0.5.4](https://github.com/klueless-io/drawio_dsl/compare/v0.5.3...v0.5.4) (2022-03-08)
|
16
|
+
|
17
|
+
|
18
|
+
### Bug Fixes
|
19
|
+
|
20
|
+
* add generated project plan ([fa36f25](https://github.com/klueless-io/drawio_dsl/commit/fa36f25ff6f6d137ed3b1a3b141097305d4b6c19))
|
21
|
+
* add generated project plan ([7faf9b0](https://github.com/klueless-io/drawio_dsl/commit/7faf9b03da5b1aaf8461c73eb375b506aca05124))
|
22
|
+
|
1
23
|
## [0.5.3](https://github.com/klueless-io/drawio_dsl/compare/v0.5.2...v0.5.3) (2022-03-08)
|
2
24
|
|
3
25
|
|
data/README.md
CHANGED
@@ -32,14 +32,17 @@ gem install drawio_dsl
|
|
32
32
|
|
33
33
|
As a Developer, I to use natural language to build diagrams quickly, so that I can create visual documentation
|
34
34
|
|
35
|
-
See
|
35
|
+
See [project plan](./docs/project-plan.md)
|
36
36
|
|
37
|
+
## Samples
|
37
38
|
|
38
|
-
|
39
|
+
See all [samples](./docs/samples/samples.md)
|
39
40
|
|
40
|
-
|
41
|
+
![](docs/samples/samples.svg)
|
41
42
|
|
43
|
+
## Usage
|
42
44
|
|
45
|
+
See all [usage examples](./USAGE.md)
|
43
46
|
|
44
47
|
## Development
|
45
48
|
|
data/docs/project_done.svg
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="942px" height="142px" viewBox="-0.5 -0.5 942 142"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffffff-0.9-ffffff-0.1-s-0"><stop offset="0%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.9;"/><stop offset="100%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"/></linearGradient></defs><g><rect x="0" y="0" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 10.15 -1 Q -1 -1 -1 10.15 L -1 24 Q 150 42 301 24 L 301 10.15 Q 301 -1 289.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Nodes can belong to a parent node, the top level node responds with truthy to root?</div></div></div></foreignObject><text x="150" y="34" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">Nodes can belong to a parent node, the top level n...</text></switch></g><rect x="320" y="0" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 330.15 -1 Q 319 -1 319 10.15 L 319 24 Q 470 42 621 24 L 621 10.15 Q 621 -1 609.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">add sample diagram for the github readme file</div></div></div></foreignObject><text x="470" y="34" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">add sample diagram for the github readme file</text></switch></g><rect x="640" y="0" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 650.15 -1 Q 639 -1 639 10.15 L 639 24 Q 790 42 941 24 L 941 10.15 Q 941 -1 929.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">write samples into docs folder and display in readme</div></div></div></foreignObject><text x="790" y="34" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">write samples into docs folder and display in read...</text></switch></g><rect x="0" y="80" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 10.15 79 Q -1 79 -1 90.15 L -1 104 Q 150 122 301 104 L 301 90.15 Q 301 79 289.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">add export as .PNG, needs to take a page number as the PNG will not support multiple pages</div></div></div></foreignObject><text x="150" y="114" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">add export as .PNG, needs to take a page number as...</text></switch></g><rect x="320" y="80" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 330.15 79 Q 319 79 319 90.15 L 319 104 Q 470 122 621 104 L 621 90.15 Q 621 79 609.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">add export as .SVG, needs to take a page number as the SVG will not support multiple pages</div></div></div></foreignObject><text x="470" y="114" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">add export as .SVG, needs to take a page number as...</text></switch></g><rect x="640" y="80" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 650.15 79 Q 639 79 639 90.15 L 639 104 Q 790 122 941 104 L 941 90.15 Q 941 79 929.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">add save as .drawio</div></div></div></foreignObject><text x="790" y="114" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">add save as .drawio</text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="622px" height="62px" viewBox="-0.5 -0.5 622 62"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffffff-0.9-ffffff-0.1-s-0"><stop offset="0%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.9;"/><stop offset="100%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"/></linearGradient></defs><g><rect x="0" y="0" width="300" height="60" rx="9" ry="9" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/><path d="M 10.15 -1 Q -1 -1 -1 10.15 L -1 24 Q 150 42 301 24 L 301 10.15 Q 301 -1 289.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">First level child nodes need to hang of node 1</div></div></div></foreignObject><text x="150" y="34" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">First level child nodes need to hang of node 1</text></switch></g><rect x="320" y="0" width="300" height="60" rx="9" ry="9" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/><path d="M 330.15 -1 Q 319 -1 319 10.15 L 319 24 Q 470 42 621 24 L 621 10.15 Q 621 -1 609.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Add page background to theme, use it whenever the theme is set at a diagram/page level</div></div></div></foreignObject><text x="470" y="34" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">Add page background to theme, use it whenever the...</text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
|