drawio_dsl 0.10.1 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,24 +4,18 @@
4
4
  module DrawioDsl
5
5
  # Configuration container for the DrawIO DSL
6
6
  class Configuration
7
- include DrawioDsl::ConfigurationShapes
7
+ extend Forwardable
8
8
 
9
9
  include KLog::Logging
10
10
 
11
11
  BaseStyle = Struct.new(:white_space, :html, :rounded, :shadow, :sketch, :glass, keyword_init: true)
12
- ElementConfig = Struct.new(:type, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
13
- LineConfig = Struct.new(:type, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
14
- TextConfig = Struct.new(:type, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
15
12
 
16
13
  attr_accessor :base_style
17
14
 
18
- attr_accessor :shapes
15
+ def_delegators :shape, :element, :line, :text
19
16
 
20
17
  def initialize
21
18
  @base_style = BaseStyle.new(white_space: :wrap, html: 1, rounded: nil, shadow: nil, sketch: nil, glass: nil)
22
-
23
- # TODO: these need to be removed
24
- add_shapes
25
19
  end
26
20
 
27
21
  def stroke(type)
@@ -51,86 +45,153 @@ module DrawioDsl
51
45
  end
52
46
  end
53
47
 
54
- def element(type)
55
- elements[type]
48
+ def shape
49
+ @shape ||= Shape.new(source_config['shape'])
56
50
  end
57
51
 
58
- def elements
59
- return @elements if defined? @elements
60
-
61
- @elements = {}
62
- source_config['shapes'].select { |shape| shape['category'] == 'element' }.each do |element|
63
- @elements[element['type'].to_sym] = ElementConfig.new(
64
- type: element['type'].to_sym,
65
- x: element['x'].to_i,
66
- y: element['y'].to_i,
67
- w: element['w'].to_i,
68
- h: element['h'].to_i,
69
- style_modifiers: element['style_modifiers']
70
- )
71
- end
52
+ def connector
53
+ @connector ||= Connector.new(source_config['connector'])
54
+ end
72
55
 
73
- @elements
56
+ def theme
57
+ @theme ||= Theme.new(source_config['theme'])
74
58
  end
75
59
 
76
- def line(type)
77
- lines[type]
60
+ def source_config
61
+ return @source_config if defined? @source_config
62
+
63
+ @source_config = begin
64
+ file = File.join(DrawioDsl::ROOT_PATH, 'config/configuration.json')
65
+ JSON.parse(File.read(file))
66
+ end
78
67
  end
79
68
 
80
- def lines
81
- return @lines if defined? @lines
82
-
83
- @lines = {}
84
- source_config['shapes'].select { |shape| shape['category'] == 'line' }.each do |line|
85
- @lines[line['type'].to_sym] = LineConfig.new(
86
- type: line['type'].to_sym,
87
- x: line['x'].to_i,
88
- y: line['y'].to_i,
89
- w: line['w'].to_i,
90
- h: line['h'].to_i,
91
- style_modifiers: line['style_modifiers']
69
+ class Shape
70
+ attr_reader :source_config
71
+
72
+ ElementShapeConfig = Struct.new(:type, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
73
+ LineShapeConfig = Struct.new(:type, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
74
+ TextShapeConfig = Struct.new(:type, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
75
+
76
+ def initialize(source_config)
77
+ @source_config = source_config
78
+ end
79
+
80
+ # Elements
81
+
82
+ def element(type)
83
+ elements[type] || ElementShapeConfig.new(
84
+ type: :square,
85
+ x: 0,
86
+ y: 0,
87
+ w: 160,
88
+ h: 160,
89
+ style_modifiers: ''
92
90
  )
93
91
  end
94
92
 
95
- @lines
96
- end
93
+ def elements
94
+ return @elements if defined? @elements
97
95
 
98
- def text(type)
99
- texts[type]
100
- end
96
+ @elements = {}
97
+ source_config['elements'].each do |element|
98
+ @elements[element['type'].to_sym] = ElementShapeConfig.new(
99
+ type: element['type'].to_sym,
100
+ x: element['x'].to_i,
101
+ y: element['y'].to_i,
102
+ w: element['w'].to_i,
103
+ h: element['h'].to_i,
104
+ style_modifiers: element['style_modifiers']
105
+ )
106
+ end
107
+
108
+ @elements
109
+ end
110
+
111
+ def element_types
112
+ elements.keys
113
+ end
114
+
115
+ def random_element_type
116
+ elements.values.sample.type
117
+ end
118
+
119
+ # Lines
101
120
 
102
- def texts
103
- return @texts if defined? @texts
104
-
105
- @texts = {}
106
- source_config['shapes'].select { |shape| shape['category'] == 'text' }.each do |text|
107
- @texts[text['type'].to_sym] = TextConfig.new(
108
- type: text['type'].to_sym,
109
- x: text['x'].to_i,
110
- y: text['y'].to_i,
111
- w: text['w'].to_i,
112
- h: text['h'].to_i,
113
- style_modifiers: text['style_modifiers']
121
+ def line(type)
122
+ lines[type] || LineShapeConfig.new(
123
+ type: :solid,
124
+ x: 0,
125
+ y: 0,
126
+ w: 50,
127
+ h: 50,
128
+ style_modifiers: 'edgeStyle=none;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0'
114
129
  )
115
130
  end
116
131
 
117
- @texts
118
- end
132
+ def lines
133
+ return @lines if defined? @lines
134
+
135
+ @lines = {}
136
+ source_config['lines'].each do |line|
137
+ @lines[line['type'].to_sym] = LineShapeConfig.new(
138
+ type: line['type'].to_sym,
139
+ x: line['x'].to_i,
140
+ y: line['y'].to_i,
141
+ w: line['w'].to_i,
142
+ h: line['h'].to_i,
143
+ style_modifiers: line['style_modifiers']
144
+ )
145
+ end
119
146
 
120
- def connector
121
- @connector ||= Connector.new(source_config['connector'])
122
- end
147
+ @lines
148
+ end
123
149
 
124
- def theme
125
- @theme ||= Theme.new(source_config['theme'])
126
- end
150
+ def line_types
151
+ lines.keys
152
+ end
127
153
 
128
- def source_config
129
- return @source_config if defined? @source_config
154
+ def random_line_type
155
+ lines.values.sample.type
156
+ end
130
157
 
131
- @source_config = begin
132
- file = File.join(DrawioDsl::ROOT_PATH, 'config/configuration.json')
133
- JSON.parse(File.read(file))
158
+ def text(type)
159
+ texts[type] || TextShapeConfig.new(
160
+ type: :p,
161
+ x: 0,
162
+ y: 0,
163
+ w: 100,
164
+ h: 50,
165
+ style_modifiers: 'text;fontSize=16;fontStyle=1;fillColor=none'
166
+ )
167
+ end
168
+
169
+ # Texts
170
+
171
+ def texts
172
+ return @texts if defined? @texts
173
+
174
+ @texts = {}
175
+ source_config['texts'].each do |text|
176
+ @texts[text['type'].to_sym] = TextShapeConfig.new(
177
+ type: text['type'].to_sym,
178
+ x: text['x'].to_i,
179
+ y: text['y'].to_i,
180
+ w: text['w'].to_i,
181
+ h: text['h'].to_i,
182
+ style_modifiers: text['style_modifiers']
183
+ )
184
+ end
185
+
186
+ @texts
187
+ end
188
+
189
+ def text_types
190
+ texts.keys
191
+ end
192
+
193
+ def random_text_type
194
+ texts.values.sample.type
134
195
  end
135
196
  end
136
197
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DrawioDsl
4
- VERSION = '0.10.1'
4
+ VERSION = '0.11.0'
5
5
  end
data/lib/drawio_dsl.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'securerandom'
4
4
  require 'nokogiri'
5
-
5
+ require 'forwardable'
6
6
  require 'k_config'
7
7
  require 'k_log'
8
8
  require 'k_director'
@@ -15,7 +15,6 @@ module DrawioDsl
15
15
  end
16
16
 
17
17
  require_relative 'drawio_dsl/configuration_extension'
18
- require_relative 'drawio_dsl/configuration_shapes'
19
18
  require_relative 'drawio_dsl/configuration'
20
19
  require_relative 'drawio_dsl/version'
21
20
  require_relative 'drawio_dsl/formatters/_'
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "drawio_dsl",
3
- "version": "0.10.1",
3
+ "version": "0.11.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "drawio_dsl",
9
- "version": "0.10.1",
9
+ "version": "0.11.0",
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.10.1",
3
+ "version": "0.11.0",
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.10.1
4
+ version: 0.11.0
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-24 00:00:00.000000000 Z
11
+ date: 2022-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: k_config
@@ -255,7 +255,8 @@ files:
255
255
  - docs/printspeak-architecture-controllers-fat.svg
256
256
  - docs/printspeak-architecture-controllers-thin.svg
257
257
  - docs/printspeak-architecture-controllers.drawio
258
- - docs/printspeak-architecture-generator.drawio
258
+ - docs/printspeak-architecture-generator-custom.drawio
259
+ - docs/printspeak-architecture-generator-custom.png
259
260
  - docs/printspeak-architecture-generator.svg
260
261
  - docs/project-plan.md
261
262
  - docs/project-plan/project.drawio
@@ -281,7 +282,6 @@ files:
281
282
  - lib/drawio_dsl.rb
282
283
  - lib/drawio_dsl/configuration.rb
283
284
  - lib/drawio_dsl/configuration_extension.rb
284
- - lib/drawio_dsl/configuration_shapes.rb
285
285
  - lib/drawio_dsl/dom_builder.rb
286
286
  - lib/drawio_dsl/dom_builder_shapes.rb
287
287
  - lib/drawio_dsl/drawio.rb
@@ -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="&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px;text-align:center&quot;&gt;&lt;b&gt;Reports#sales_by_profit&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;h3 style=&quot;margin:0px;margin-left:4px;margin-bottom:6.912px&quot;&gt;Thin Controller&lt;/h3&gt;&lt;h5 style=&quot;margin:0px;margin-left:4px;margin-bottom:4.8px&quot;&gt;Param marshalling&lt;/h5&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;my_action_params()&lt;/p&gt;&lt;h5 style=&quot;margin:0px;margin-left:4px;margin-bottom:4.8px&quot;&gt;Call query&lt;/h5&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;MyActionQuery.query(scope, **inputs)&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;h5 style=&quot;margin:0px;margin-left:4px;margin-bottom:4.8px&quot;&gt;Present&lt;/h5&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;@vm = MyActionPresenter.new(**outputs)&lt;/p&gt;" 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="&lt;b&gt;Param marshaling&lt;/b&gt;&lt;br&gt;&lt;br&gt;@sales_by_profit_params ||= &lt;br&gt;params.permit(...)&lt;br&gt;&amp;nbsp;&amp;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="&lt;b&gt;Call Query&lt;/b&gt;&lt;br&gt;&lt;br&gt;SalesByProfitQuery&lt;br&gt;&amp;nbsp;&amp;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="&lt;b&gt;Present&lt;/b&gt;&lt;br&gt;&lt;br&gt;SalesByProfitPresenter&lt;br&gt;&amp;nbsp;&amp;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="&lt;b&gt;Form Object&lt;/b&gt;&lt;br&gt;&lt;br&gt;" 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="&lt;b&gt;Query#contract&lt;/b&gt;" 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="&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px;text-align:center&quot;&gt;&lt;b&gt;Reports#sales_by_profit&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;h3 style=&quot;margin:0px;margin-left:4px;margin-bottom:6.912px&quot;&gt;Fat Controller&lt;/h3&gt;&lt;h5 style=&quot;margin:0px;margin-left:4px;margin-bottom:4.8px&quot;&gt;Param marshalling&lt;/h5&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;params[:date_from]&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;params[:date_to]&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;params[:sort] || &quot;gross_sales&quot;&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;params[:direction] || &quot;desc&quot;&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;params[:filter_str]&lt;/p&gt;&lt;h5 style=&quot;margin:0px;margin-left:4px;margin-bottom:4.8px&quot;&gt;Dynamic query construction&lt;/h5&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;switch params[:filter_str]&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;invoice_date_query&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;ugly query&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;h5 style=&quot;margin:0px;margin-left:4px;margin-bottom:4.8px&quot;&gt;Query in controller&lt;/h5&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;ActiveRecord::Base.connection.execute(query)&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;h5 style=&quot;margin:0px;margin-left:4px;margin-bottom:4.8px&quot;&gt;Build outputs&lt;/h5&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;@net_sales_total&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;@vat_total&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;@gross_sales_total&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;@document_data&lt;/p&gt;&lt;h5 style=&quot;margin:0px;margin-left:4px;margin-bottom:4.8px&quot;&gt;Composite outputs&lt;/h5&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;params[:sort]&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;params[:direction]&lt;/p&gt;" 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="&lt;b&gt;Paramater marshalling&lt;/b&gt;&lt;br&gt;&lt;br&gt;reading the params[] object&lt;br&gt;setting sane defaults&lt;br&gt;&lt;i&gt;do not alter and reuse params[]&lt;/i&gt;" 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="&lt;b&gt;Dynamic query construction&lt;/b&gt;&lt;br&gt;&lt;br&gt;query = &quot;select ...&quot;&lt;br&gt;&lt;i&gt;ActiveRelation vs interpolation&lt;/i&gt;" 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="&lt;b&gt;Query in controller&lt;/b&gt;&lt;br&gt;&lt;i&gt;Move out to Query object&lt;/i&gt;" 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="&lt;b&gt;Build outputs&lt;/b&gt;&lt;br&gt;Multiple @instance vars&lt;br&gt;&lt;i&gt;single view model @vm&lt;/i&gt;" 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="&lt;b&gt;Composite outputs&lt;/b&gt;&lt;br&gt;sort, direction, page_no, page_size&lt;br&gt;&lt;i&gt;single order, page or list object&lt;/i&gt;" 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="&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px;text-align:center&quot;&gt;&lt;b&gt;Container&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;" 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="&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px;text-align:center&quot;&gt;&lt;i&gt;&amp;lt;&amp;lt; Subsystems &amp;gt;&amp;gt;&lt;/i&gt;&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px;text-align:center&quot;&gt;&lt;b&gt;Block Processor&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;block: proc&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;block_state: symbol&lt;/p&gt;&lt;hr size=&quot;1&quot;/&gt;&lt;p style=&quot;margin:0px;margin-left:4px;margin-bottom:4px&quot;&gt;depend_on()&lt;/p&gt;" 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;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;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;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;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;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;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;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: