drawio_dsl 0.9.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/config/configuration.json +1889 -510
- data/docs/printspeak-architecture-controllers.drawio +47 -47
- data/docs/printspeak-architecture-generator-custom.drawio +306 -0
- data/docs/printspeak-architecture-generator-custom.png +0 -0
- data/docs/project-plan/project.drawio +112 -73
- 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/grid-direction-horizontal.svg +1 -1
- data/docs/samples/grid-direction-vertical.svg +1 -1
- data/docs/samples/styles-glass.svg +1 -1
- data/docs/samples/styles-plain.svg +1 -1
- data/docs/samples/styles-rounded.svg +1 -1
- data/docs/samples/styles-shadow.svg +1 -1
- data/docs/samples/styles-sketch.svg +1 -1
- data/docs/samples/themes-random.svg +1 -1
- data/docs/samples/willoughby-council.svg +1 -1
- data/lib/drawio_dsl/configuration.rb +215 -76
- data/lib/drawio_dsl/schema/diagram.rb +17 -11
- data/lib/drawio_dsl/schema/element.rb +1 -1
- data/lib/drawio_dsl/schema/page.rb +9 -3
- data/lib/drawio_dsl/schema/shape.rb +6 -1
- data/lib/drawio_dsl/schema/text.rb +1 -1
- data/lib/drawio_dsl/version.rb +1 -1
- data/lib/drawio_dsl.rb +1 -3
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +4 -5
- data/docs/printspeak-architecture-generator.drawio +0 -107
- data/lib/drawio_dsl/configuration_shapes.rb +0 -109
- data/lib/drawio_dsl/configuration_themes.rb +0 -63
@@ -1,107 +0,0 @@
|
|
1
|
-
<mxfile host="65bd71144e">
|
2
|
-
<diagram id="mBj" name="Thin Controllers">
|
3
|
-
<mxGraphModel dx="1172" dy="583" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" background="#fafafa" math="0" shadow="0">
|
4
|
-
<root>
|
5
|
-
<mxCell id="page_root_mBj"/>
|
6
|
-
<mxCell id="node_root_mBj" parent="page_root_mBj"/>
|
7
|
-
<mxCell id="21RrXMzRurO5l1FjHA6U-0" style="edgeStyle=none;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;fillColor=#f8cecc;strokeColor=#b85450;" edge="1" parent="node_root_mBj" source="mBj-2" target="mBj-3">
|
8
|
-
<mxGeometry relative="1" as="geometry"/>
|
9
|
-
</mxCell>
|
10
|
-
<mxCell id="21RrXMzRurO5l1FjHA6U-1" style="edgeStyle=none;shape=connector;rounded=1;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.027;entryY=0.547;entryDx=0;entryDy=0;entryPerimeter=0;labelBackgroundColor=default;fontFamily=Helvetica;fontSize=11;fontColor=default;endArrow=classic;strokeColor=#b85450;fillColor=#f8cecc;" edge="1" parent="node_root_mBj" source="mBj-2" target="mBj-4">
|
11
|
-
<mxGeometry relative="1" as="geometry"/>
|
12
|
-
</mxCell>
|
13
|
-
<mxCell id="21RrXMzRurO5l1FjHA6U-2" style="edgeStyle=none;shape=connector;rounded=1;html=1;exitX=1;exitY=0.75;exitDx=0;exitDy=0;entryX=0.017;entryY=0.455;entryDx=0;entryDy=0;entryPerimeter=0;labelBackgroundColor=default;fontFamily=Helvetica;fontSize=11;fontColor=default;endArrow=classic;strokeColor=#b85450;fillColor=#f8cecc;" edge="1" parent="node_root_mBj" source="mBj-2" target="mBj-5">
|
14
|
-
<mxGeometry relative="1" as="geometry"/>
|
15
|
-
</mxCell>
|
16
|
-
<mxCell id="21RrXMzRurO5l1FjHA6U-5" style="edgeStyle=none;shape=connector;rounded=1;html=1;entryX=0.002;entryY=0.48;entryDx=0;entryDy=0;entryPerimeter=0;labelBackgroundColor=default;fontFamily=Helvetica;fontSize=11;fontColor=default;endArrow=classic;strokeColor=#b85450;fillColor=#f8cecc;exitX=0.987;exitY=1.02;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="node_root_mBj" source="mBj-3" target="21RrXMzRurO5l1FjHA6U-4">
|
17
|
-
<mxGeometry relative="1" as="geometry"/>
|
18
|
-
</mxCell>
|
19
|
-
<mxCell id="mBj-2" value="<p style="margin:0px;margin-left:4px;margin-bottom:4px;text-align:center"><b>Reports#sales_by_profit</b></p><hr size="1"/><h3 style="margin:0px;margin-left:4px;margin-bottom:6.912px">Thin Controller</h3><h5 style="margin:0px;margin-left:4px;margin-bottom:4.8px">Param marshalling</h5><p style="margin:0px;margin-left:4px;margin-bottom:4px">my_action_params()</p><h5 style="margin:0px;margin-left:4px;margin-bottom:4.8px">Call query</h5><p style="margin:0px;margin-left:4px;margin-bottom:4px">MyActionQuery.query(scope, **inputs)</p><hr size="1"/><h5 style="margin:0px;margin-left:4px;margin-bottom:4.8px">Present</h5><p style="margin:0px;margin-left:4px;margin-bottom:4px">@vm = MyActionPresenter.new(**outputs)</p>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica" parent="node_root_mBj" vertex="1">
|
20
|
-
<mxGeometry x="72" y="167" width="249" height="196" as="geometry"/>
|
21
|
-
</mxCell>
|
22
|
-
<mxCell id="mBj-3" value="<b>Param marshaling</b><br><br>@sales_by_profit_params ||= <br>params.permit(...)<br>&nbsp;&nbsp;.symbolize_keys" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333;shape=mxgraph.basic.cloud_rect" parent="node_root_mBj" vertex="1">
|
23
|
-
<mxGeometry x="448" y="59" width="200" height="120" as="geometry"/>
|
24
|
-
</mxCell>
|
25
|
-
<mxCell id="mBj-4" value="<b>Call Query</b><br><br>SalesByProfitQuery<br>&nbsp;&nbsp;.query(scope, **custom, **params)" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333;shape=mxgraph.basic.cloud_rect" parent="node_root_mBj" vertex="1">
|
26
|
-
<mxGeometry x="448" y="202" width="200" height="120" as="geometry"/>
|
27
|
-
</mxCell>
|
28
|
-
<mxCell id="mBj-5" value="<b>Present</b><br><br>SalesByProfitPresenter<br>&nbsp;&nbsp;.new(**query.outputs)" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333;shape=mxgraph.basic.cloud_rect" parent="node_root_mBj" vertex="1">
|
29
|
-
<mxGeometry x="448" y="351" width="200" height="120" as="geometry"/>
|
30
|
-
</mxCell>
|
31
|
-
<mxCell id="21RrXMzRurO5l1FjHA6U-3" value="<b>Form Object</b><br><br>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333;shape=mxgraph.basic.cloud_rect" vertex="1" parent="node_root_mBj">
|
32
|
-
<mxGeometry x="671" y="59" width="200" height="53" as="geometry"/>
|
33
|
-
</mxCell>
|
34
|
-
<mxCell id="21RrXMzRurO5l1FjHA6U-4" value="<b>Query#contract</b>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333;shape=mxgraph.basic.cloud_rect" vertex="1" parent="node_root_mBj">
|
35
|
-
<mxGeometry x="671" y="169" width="200" height="53" as="geometry"/>
|
36
|
-
</mxCell>
|
37
|
-
</root>
|
38
|
-
</mxGraphModel>
|
39
|
-
</diagram>
|
40
|
-
<diagram id="hn6" name="Fat Controllers">
|
41
|
-
<mxGraphModel dx="0" dy="0" background="#fafafa" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
42
|
-
<root>
|
43
|
-
<mxCell id="page_root_hn6" parent="hn6"/>
|
44
|
-
<mxCell id="node_root_hn6" parent="page_root_hn6"/>
|
45
|
-
<mxCell id="hn6-2" value="<p style="margin:0px;margin-left:4px;margin-bottom:4px;text-align:center"><b>Reports#sales_by_profit</b></p><hr size="1"/><h3 style="margin:0px;margin-left:4px;margin-bottom:6.912px">Fat Controller</h3><h5 style="margin:0px;margin-left:4px;margin-bottom:4.8px">Param marshalling</h5><p style="margin:0px;margin-left:4px;margin-bottom:4px">params[:date_from]</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">params[:date_to]</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">params[:sort] || "gross_sales"</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">params[:direction] || "desc"</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">params[:filter_str]</p><h5 style="margin:0px;margin-left:4px;margin-bottom:4.8px">Dynamic query construction</h5><p style="margin:0px;margin-left:4px;margin-bottom:4px">switch params[:filter_str]</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">invoice_date_query</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">ugly query</p><hr size="1"/><h5 style="margin:0px;margin-left:4px;margin-bottom:4.8px">Query in controller</h5><p style="margin:0px;margin-left:4px;margin-bottom:4px">ActiveRecord::Base.connection.execute(query)</p><hr size="1"/><h5 style="margin:0px;margin-left:4px;margin-bottom:4.8px">Build outputs</h5><p style="margin:0px;margin-left:4px;margin-bottom:4px">@net_sales_total</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">@vat_total</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">@gross_sales_total</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">@document_data</p><h5 style="margin:0px;margin-left:4px;margin-bottom:4.8px">Composite outputs</h5><p style="margin:0px;margin-left:4px;margin-bottom:4px">params[:sort]</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">params[:direction]</p>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica" vertex="1" parent="node_root_hn6">
|
46
|
-
<mxGeometry x="30" y="30" width="160" height="160" as="geometry"/>
|
47
|
-
</mxCell>
|
48
|
-
<mxCell id="hn6-3" value="<b>Paramater marshalling</b><br><br>reading the params[] object<br>setting sane defaults<br><i>do not alter and reuse params[]</i>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333;shape=mxgraph.basic.cloud_rect" vertex="1" parent="node_root_hn6">
|
49
|
-
<mxGeometry x="230" y="50" width="200" height="120" as="geometry"/>
|
50
|
-
</mxCell>
|
51
|
-
<mxCell id="hn6-4" value="<b>Dynamic query construction</b><br><br>query = "select ..."<br><i>ActiveRelation vs interpolation</i>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333;shape=mxgraph.basic.cloud_rect" vertex="1" parent="node_root_hn6">
|
52
|
-
<mxGeometry x="450" y="50" width="200" height="120" as="geometry"/>
|
53
|
-
</mxCell>
|
54
|
-
<mxCell id="hn6-5" value="<b>Query in controller</b><br><i>Move out to Query object</i>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333;shape=mxgraph.basic.cloud_rect" vertex="1" parent="node_root_hn6">
|
55
|
-
<mxGeometry x="670" y="50" width="200" height="120" as="geometry"/>
|
56
|
-
</mxCell>
|
57
|
-
<mxCell id="hn6-6" value="<b>Build outputs</b><br>Multiple @instance vars<br><i>single view model @vm</i>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333;shape=mxgraph.basic.cloud_rect" vertex="1" parent="node_root_hn6">
|
58
|
-
<mxGeometry x="10" y="270" width="200" height="120" as="geometry"/>
|
59
|
-
</mxCell>
|
60
|
-
<mxCell id="hn6-7" value="<b>Composite outputs</b><br>sort, direction, page_no, page_size<br><i>single order, page or list object</i>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333;shape=mxgraph.basic.cloud_rect" vertex="1" parent="node_root_hn6">
|
61
|
-
<mxGeometry x="230" y="270" width="200" height="120" as="geometry"/>
|
62
|
-
</mxCell>
|
63
|
-
</root>
|
64
|
-
</mxGraphModel>
|
65
|
-
</diagram>
|
66
|
-
<diagram id="yyO" name="Style-Plain">
|
67
|
-
<mxGraphModel dx="0" dy="0" background="#fafafa" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
68
|
-
<root>
|
69
|
-
<mxCell id="page_root_yyO" parent="yyO"/>
|
70
|
-
<mxCell id="node_root_yyO" parent="page_root_yyO"/>
|
71
|
-
<mxCell id="yyO-2" value="Data Sources (Documents)" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;fontSize=20;verticalAlign=top" vertex="1" parent="node_root_yyO">
|
72
|
-
<mxGeometry x="5" y="5" width="210" height="210" as="geometry"/>
|
73
|
-
</mxCell>
|
74
|
-
<mxCell id="yyO-3" value="schema.rb" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;shape=mxgraph.flowchart.database;strokeWidth=1" vertex="1" parent="node_root_yyO">
|
75
|
-
<mxGeometry x="250" y="90" width="160" height="40" as="geometry"/>
|
76
|
-
</mxCell>
|
77
|
-
<mxCell id="yyO-4" value="db_schema.json" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;shape=mxgraph.flowchart.database;strokeWidth=1" vertex="1" parent="node_root_yyO">
|
78
|
-
<mxGeometry x="470" y="90" width="160" height="40" as="geometry"/>
|
79
|
-
</mxCell>
|
80
|
-
<mxCell id="yyO-5" value="sql_count.json" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;shape=mxgraph.flowchart.database;strokeWidth=1" vertex="1" parent="node_root_yyO">
|
81
|
-
<mxGeometry x="690" y="90" width="160" height="40" as="geometry"/>
|
82
|
-
</mxCell>
|
83
|
-
<mxCell id="yyO-6" value="robocop.txt" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;shape=mxgraph.flowchart.database;strokeWidth=1" vertex="1" parent="node_root_yyO">
|
84
|
-
<mxGeometry x="910" y="90" width="160" height="40" as="geometry"/>
|
85
|
-
</mxCell>
|
86
|
-
<mxCell id="yyO-7" value="rubocop.json" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;shape=mxgraph.flowchart.database;strokeWidth=1" vertex="1" parent="node_root_yyO">
|
87
|
-
<mxGeometry x="1130" y="90" width="160" height="40" as="geometry"/>
|
88
|
-
</mxCell>
|
89
|
-
<mxCell id="yyO-8" value="domain_model.json" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;shape=mxgraph.flowchart.database;strokeWidth=1" vertex="1" parent="node_root_yyO">
|
90
|
-
<mxGeometry x="30" y="310" width="160" height="40" as="geometry"/>
|
91
|
-
</mxCell>
|
92
|
-
<mxCell id="yyO-9" value="data_context.json" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;shape=mxgraph.flowchart.database;strokeWidth=1" vertex="1" parent="node_root_yyO">
|
93
|
-
<mxGeometry x="250" y="310" width="160" height="40" as="geometry"/>
|
94
|
-
</mxCell>
|
95
|
-
<mxCell id="yyO-10" value="routes.json" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;shape=mxgraph.flowchart.database;strokeWidth=1" vertex="1" parent="node_root_yyO">
|
96
|
-
<mxGeometry x="470" y="310" width="160" height="40" as="geometry"/>
|
97
|
-
</mxCell>
|
98
|
-
<mxCell id="yyO-11" value="<p style="margin:0px;margin-left:4px;margin-bottom:4px;text-align:center"><b>Container</b></p><hr size="1"/>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#333333;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica" vertex="1" parent="node_root_yyO">
|
99
|
-
<mxGeometry x="690" y="250" width="160" height="160" as="geometry"/>
|
100
|
-
</mxCell>
|
101
|
-
<mxCell id="yyO-12" value="<p style="margin:0px;margin-left:4px;margin-bottom:4px;text-align:center"><i>&lt;&lt; Subsystems &gt;&gt;</i></p><p style="margin:0px;margin-left:4px;margin-bottom:4px;text-align:center"><b>Block Processor</b></p><hr size="1"/><p style="margin:0px;margin-left:4px;margin-bottom:4px">block: proc</p><p style="margin:0px;margin-left:4px;margin-bottom:4px">block_state: symbol</p><hr size="1"/><p style="margin:0px;margin-left:4px;margin-bottom:4px">depend_on()</p>" style="whiteSpace=wrap;html=1;rounded=0;fillColor=#dae8fc;strokeColor=#6c8ebf;fontColor=#333333;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica" vertex="1" parent="node_root_yyO">
|
102
|
-
<mxGeometry x="910" y="250" width="160" height="160" as="geometry"/>
|
103
|
-
</mxCell>
|
104
|
-
</root>
|
105
|
-
</mxGraphModel>
|
106
|
-
</diagram>
|
107
|
-
</mxfile>
|
@@ -1,109 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Attach configuration to the DrawIO DSL module
|
4
|
-
# :nocov:
|
5
|
-
module DrawioDsl
|
6
|
-
# Used to attach configuration to KConfig module
|
7
|
-
module ConfigurationShapes
|
8
|
-
ShapeDefaults = Struct.new(:type, :category, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
|
9
|
-
Shapes = Struct.new(
|
10
|
-
:shape,
|
11
|
-
:solid,
|
12
|
-
:h1,
|
13
|
-
:h2,
|
14
|
-
:h3,
|
15
|
-
:h4,
|
16
|
-
:h5,
|
17
|
-
:h6,
|
18
|
-
:p,
|
19
|
-
:actor,
|
20
|
-
:actor2,
|
21
|
-
:callout,
|
22
|
-
:callout2,
|
23
|
-
:callout3,
|
24
|
-
:callout4,
|
25
|
-
:circle,
|
26
|
-
:cloud,
|
27
|
-
:container,
|
28
|
-
:container2,
|
29
|
-
:container3,
|
30
|
-
:container4,
|
31
|
-
:cross,
|
32
|
-
:envelop,
|
33
|
-
:database,
|
34
|
-
:db_json,
|
35
|
-
:diamond,
|
36
|
-
:document,
|
37
|
-
:ellipse,
|
38
|
-
:group,
|
39
|
-
:hexagon,
|
40
|
-
:interface,
|
41
|
-
:klass,
|
42
|
-
:note,
|
43
|
-
:process,
|
44
|
-
:rectangle,
|
45
|
-
:rectangle2,
|
46
|
-
:square,
|
47
|
-
:step,
|
48
|
-
:tick,
|
49
|
-
:todo,
|
50
|
-
:face,
|
51
|
-
:triangle,
|
52
|
-
:embed_row,
|
53
|
-
:embed_col50,
|
54
|
-
:embed_col200,
|
55
|
-
keyword_init: true
|
56
|
-
)
|
57
|
-
|
58
|
-
def add_shapes
|
59
|
-
@shapes = Shapes.new(
|
60
|
-
shape: ShapeDefaults.new(type: :shape, category: :element, x: 0, y: 0, w: 20, h: 20, style_modifiers: ''),
|
61
|
-
solid: ShapeDefaults.new(type: :solid, 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'),
|
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'),
|
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'),
|
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'),
|
65
|
-
h4: ShapeDefaults.new(type: :h4, x: 0, category: :text, y: 0, w: 100, h: 50, style_modifiers: 'text;fontSize=37;fontColor=#ffffff;fontStyle=1;fillColor=none'),
|
66
|
-
h5: ShapeDefaults.new(type: :h5, x: 0, category: :text, y: 0, w: 100, h: 50, style_modifiers: 'text;fontSize=28;fontColor=#ffffff;fontStyle=1;fillColor=none'),
|
67
|
-
h6: ShapeDefaults.new(type: :h6, x: 0, category: :text, y: 0, w: 100, h: 50, style_modifiers: 'text;fontSize=21;fontColor=#ffffff;fontStyle=1;fillColor=none'),
|
68
|
-
p: ShapeDefaults.new(type: :p, x: 0, category: :text, y: 0, w: 100, h: 50, style_modifiers: 'text;fontSize=16;fontColor=#ffffff;fontStyle=1;fillColor=none'),
|
69
|
-
actor: ShapeDefaults.new(type: :actor, x: 0, category: :element, y: 0, w: 40, h: 50, style_modifiers: 'shape=actor'),
|
70
|
-
actor2: ShapeDefaults.new(type: :actor2, x: 0, category: :element, y: 0, w: 30, h: 50, style_modifiers: 'shape=umlActor;verticalLabelPosition=bottom;outlineConnect=1'),
|
71
|
-
callout: ShapeDefaults.new(type: :callout, x: 0, category: :element, y: 0, w: 160, h: 120, style_modifiers: 'shape=callout'),
|
72
|
-
callout2: ShapeDefaults.new(type: :callout2, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'shape=mxgraph.basic.oval_callout'),
|
73
|
-
callout3: ShapeDefaults.new(type: :callout3, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'shape=mxgraph.basic.cloud_callout'),
|
74
|
-
callout4: ShapeDefaults.new(type: :callout4, x: 0, category: :element, y: 0, w: 160, h: 120, style_modifiers: 'shape=mxgraph.basic.roundRectCallout;dx=30;dy=15;size=5;boundedLbl=1;'),
|
75
|
-
circle: ShapeDefaults.new(type: :circle, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'ellipse'),
|
76
|
-
cloud: ShapeDefaults.new(type: :cloud, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'shape=cloud'),
|
77
|
-
container: ShapeDefaults.new(type: :container, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'swimlane'),
|
78
|
-
container2: ShapeDefaults.new(type: :container2, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'swimlane;horizontal=0'),
|
79
|
-
container3: ShapeDefaults.new(type: :container3, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'swimlane;startSize=50'),
|
80
|
-
container4: ShapeDefaults.new(type: :container4, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'swimlane;resizable=0'),
|
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'),
|
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'),
|
85
|
-
diamond: ShapeDefaults.new(type: :diamond, x: 0, category: :element, y: 0, w: 100, h: 100, style_modifiers: 'rhombus'),
|
86
|
-
document: ShapeDefaults.new(type: :document, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'shape=mxgraph.basic.document'),
|
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'),
|
89
|
-
hexagon: ShapeDefaults.new(type: :hexagon, x: 0, category: :element, y: 0, w: 200, h: 120, style_modifiers: 'shape=hexagon'),
|
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'),
|
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
|
-
note: ShapeDefaults.new(type: :note, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'shape=note'),
|
93
|
-
process: ShapeDefaults.new(type: :process, x: 0, category: :element, y: 0, w: 200, h: 120, style_modifiers: 'shape=process'),
|
94
|
-
rectangle: ShapeDefaults.new(type: :rectangle, x: 0, category: :element, y: 0, w: 200, h: 120, style_modifiers: ''),
|
95
|
-
rectangle2: ShapeDefaults.new(type: :rectangle2, x: 0, category: :element, y: 0, w: 200, h: 120, style_modifiers: 'shape=mxgraph.basic.cloud_rect'),
|
96
|
-
square: ShapeDefaults.new(type: :square, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: ''),
|
97
|
-
step: ShapeDefaults.new(type: :step, x: 0, category: :element, y: 0, w: 120, h: 80, style_modifiers: 'shape=step;perimeter=stepPerimeter;fixedSize=1'),
|
98
|
-
tick: ShapeDefaults.new(type: :tick, x: 0, category: :element, y: 0, w: 50, h: 50, style_modifiers: 'verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.basic.tick'),
|
99
|
-
todo: ShapeDefaults.new(type: :todo, x: 0, category: :element, y: 0, w: 300, h: 60, style_modifiers: ''),
|
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'),
|
101
|
-
triangle: ShapeDefaults.new(type: :triangle, x: 0, category: :element, y: 0, w: 100, h: 100, style_modifiers: 'triangle'),
|
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'),
|
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'),
|
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')
|
105
|
-
)
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
# :nocov:
|
@@ -1,63 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Attach configuration to the DrawIO DSL module
|
4
|
-
module DrawioDsl
|
5
|
-
# Configuration for each theme
|
6
|
-
module ConfigurationThemes
|
7
|
-
ShapeThemeStyle = Struct.new(:fill_color, :stroke_color, :gradient, :element_font_color, :text_font_color, keyword_init: true)
|
8
|
-
|
9
|
-
attr_accessor :themes
|
10
|
-
|
11
|
-
def add_theme(name, **opts)
|
12
|
-
@themes[name] = ShapeThemeStyle.new(**opts)
|
13
|
-
end
|
14
|
-
|
15
|
-
def add_themes
|
16
|
-
@themes = {}
|
17
|
-
|
18
|
-
add_theme(:style_01 , fill_color: '#f5f5f5', stroke_color: '#666666', gradient: nil , element_font_color: '#333333', text_font_color: '#aaaaaa')
|
19
|
-
add_theme(:style_02 , fill_color: '#dae8fc', stroke_color: '#6c8ebf', gradient: nil , element_font_color: '#333333', text_font_color: '#aaaaaa')
|
20
|
-
add_theme(:style_03 , fill_color: '#d5e8d4', stroke_color: '#82b366', gradient: nil , element_font_color: '#333333', text_font_color: '#aaaaaa')
|
21
|
-
add_theme(:style_04 , fill_color: '#ffe6cc', stroke_color: '#d79b00', gradient: nil , element_font_color: '#333333', text_font_color: '#aaaaaa')
|
22
|
-
add_theme(:style_05 , fill_color: '#fff2cc', stroke_color: '#d6b656', gradient: nil , element_font_color: '#333333', text_font_color: '#aaaaaa')
|
23
|
-
add_theme(:style_06 , fill_color: '#f8cecc', stroke_color: '#b85450', gradient: nil , element_font_color: '#333333', text_font_color: '#aaaaaa')
|
24
|
-
add_theme(:style_07 , fill_color: '#e1d5e7', stroke_color: '#9673a6', gradient: nil , element_font_color: '#333333', text_font_color: '#aaaaaa')
|
25
|
-
add_theme(:style_08 , fill_color: '#60a917', stroke_color: '#2D7600', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
26
|
-
add_theme(:style_09 , fill_color: '#008a00', stroke_color: '#005700', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
27
|
-
add_theme(:style_10 , fill_color: '#1ba1e2', stroke_color: '#006EAF', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
28
|
-
add_theme(:style_11 , fill_color: '#0050ef', stroke_color: '#001DBC', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
29
|
-
add_theme(:style_12 , fill_color: '#6a00ff', stroke_color: '#3700CC', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
30
|
-
add_theme(:style_13 , fill_color: '#aa00ff', stroke_color: '#7700CC', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
31
|
-
add_theme(:style_14 , fill_color: '#d80073', stroke_color: '#A50040', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
32
|
-
add_theme(:style_15 , fill_color: '#a20025', stroke_color: '#6F0000', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
33
|
-
add_theme(:style_16 , fill_color: '#e51400', stroke_color: '#B20000', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
34
|
-
add_theme(:style_17 , fill_color: '#fa6800', stroke_color: '#C73500', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
35
|
-
add_theme(:style_18 , fill_color: '#f0a30a', stroke_color: '#BD7000', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
36
|
-
add_theme(:style_19 , fill_color: '#e3c800', stroke_color: '#B09500', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
37
|
-
add_theme(:style_20 , fill_color: '#6d8764', stroke_color: '#3A5431', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
38
|
-
add_theme(:style_21 , fill_color: '#647687', stroke_color: '#314354', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
39
|
-
add_theme(:style_22 , fill_color: '#76608a', stroke_color: '#432D57', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
40
|
-
add_theme(:style_23 , fill_color: '#a0522d', stroke_color: '#6D1F00', gradient: nil , element_font_color: '#ffffff', text_font_color: '#aaaaaa')
|
41
|
-
add_theme(:style_24 , fill_color: '#fad7ac', stroke_color: '#b46504', gradient: nil , element_font_color: '#333333', text_font_color: '#aaaaaa')
|
42
|
-
add_theme(:style_25 , fill_color: '#fad9d5', stroke_color: '#ae4132', gradient: nil , element_font_color: '#333333', text_font_color: '#aaaaaa')
|
43
|
-
add_theme(:style_26 , fill_color: '#b0e3e6', stroke_color: '#0e8088', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
44
|
-
add_theme(:style_27 , fill_color: '#b1ddf0', stroke_color: '#10739e', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
45
|
-
add_theme(:style_28 , fill_color: '#d0cee2', stroke_color: '#56517e', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
46
|
-
add_theme(:style_29 , fill_color: '#bac8d3', stroke_color: '#23445d', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
47
|
-
add_theme(:style_30 , fill_color: '#f5f5f5', stroke_color: '#666666', gradient: '#b3b3b3', element_font_color: '#000000', text_font_color: '#aaaaaa')
|
48
|
-
add_theme(:style_31 , fill_color: '#dae8fc', stroke_color: '#6c8ebf', gradient: '#7ea6e0', element_font_color: '#000000', text_font_color: '#aaaaaa')
|
49
|
-
add_theme(:style_32 , fill_color: '#d5e8d4', stroke_color: '#82b366', gradient: '#97d077', element_font_color: '#000000', text_font_color: '#aaaaaa')
|
50
|
-
add_theme(:style_33 , fill_color: '#ffcd28', stroke_color: '#d79b00', gradient: '#ffa500', element_font_color: '#000000', text_font_color: '#aaaaaa')
|
51
|
-
add_theme(:style_34 , fill_color: '#fff2cc', stroke_color: '#d6b656', gradient: '#ffd966', element_font_color: '#000000', text_font_color: '#aaaaaa')
|
52
|
-
add_theme(:style_35 , fill_color: '#f8cecc', stroke_color: '#b85450', gradient: '#ea6b66', element_font_color: '#000000', text_font_color: '#aaaaaa')
|
53
|
-
add_theme(:style_36 , fill_color: '#e6d0de', stroke_color: '#996185', gradient: '#d5739d', element_font_color: '#000000', text_font_color: '#aaaaaa')
|
54
|
-
add_theme(:style_37 , fill_color: '#eeeeee', stroke_color: '#36393d', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
55
|
-
add_theme(:style_38 , fill_color: '#f9f7ed', stroke_color: '#36393d', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
56
|
-
add_theme(:style_39 , fill_color: '#ffcc99', stroke_color: '#36393d', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
57
|
-
add_theme(:style_40 , fill_color: '#cce5ff', stroke_color: '#36393d', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
58
|
-
add_theme(:style_41 , fill_color: '#ffff88', stroke_color: '#36393d', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
59
|
-
add_theme(:style_42 , fill_color: '#cdeb8b', stroke_color: '#36393d', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
60
|
-
add_theme(:style_43 , fill_color: '#ffcccc', stroke_color: '#36393d', gradient: nil , element_font_color: '#000000', text_font_color: '#aaaaaa')
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|