lutaml 0.11.9 → 0.11.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docs.yml +87 -0
  3. data/.github/workflows/links.yml +113 -0
  4. data/.github/workflows/rake.yml +52 -0
  5. data/.github/workflows/release.yml +83 -0
  6. data/.gitignore +29 -0
  7. data/CLAUDE.md +27 -0
  8. data/Gemfile +2 -2
  9. data/docs/.github/workflows/docs.yml +66 -0
  10. data/docs/.github/workflows/links.yml +78 -0
  11. data/docs/CONTINUATION_PLAN.md +168 -0
  12. data/docs/Gemfile +13 -0
  13. data/docs/MIGRATION_GUIDE.md +202 -0
  14. data/docs/README.md +252 -0
  15. data/docs/REFACTOR_PLAN.md +214 -0
  16. data/docs/_config.yml +144 -0
  17. data/docs/_guides/cli-usage.adoc +43 -0
  18. data/docs/_guides/diagram-generation.adoc +316 -0
  19. data/docs/_guides/index.adoc +136 -0
  20. data/docs/_guides/parsing/express-parsing.adoc +42 -0
  21. data/docs/_guides/parsing/index.adoc +78 -0
  22. data/docs/_guides/parsing/qea-parsing.adoc +47 -0
  23. data/docs/_guides/parsing/xmi-parsing.adoc +40 -0
  24. data/docs/_guides/repository-management.adoc +44 -0
  25. data/docs/_guides/sysml-modeling.adoc +37 -0
  26. data/docs/_guides/uml-modeling.adoc +115 -0
  27. data/docs/_pages/concepts/diagram-generation.adoc +337 -0
  28. data/docs/_pages/concepts/lur-format.adoc +711 -0
  29. data/docs/_pages/concepts/qea-parsing.adoc +418 -0
  30. data/docs/_pages/concepts/uml-models.adoc +43 -0
  31. data/docs/_pages/core/architecture.adoc +329 -0
  32. data/docs/_pages/core/installation.adoc +321 -0
  33. data/docs/_pages/core/overview.adoc +197 -0
  34. data/docs/_pages/index.adoc +49 -0
  35. data/docs/_pages/uml-syntax.adoc +1011 -0
  36. data/docs/_references/api/parsers.adoc +61 -0
  37. data/docs/_references/api/presenters.adoc +43 -0
  38. data/docs/_references/api/repository.adoc +67 -0
  39. data/docs/_references/cli/commands.adoc +72 -0
  40. data/docs/_references/configuration/diagram-styles.adoc +716 -0
  41. data/docs/_references/configuration/index.adoc +53 -0
  42. data/docs/_references/configuration/package-metadata.adoc +416 -0
  43. data/docs/_references/formats/index.adoc +43 -0
  44. data/docs/_references/formats/lur-format.adoc +39 -0
  45. data/docs/_references/formats/lutaml-syntax.adoc +379 -0
  46. data/docs/_references/formats/qea-structure.adoc +1364 -0
  47. data/docs/_references/index.adoc +198 -0
  48. data/docs/_tutorials/documentation-site.adoc +47 -0
  49. data/docs/_tutorials/first-lur-package.adoc +45 -0
  50. data/docs/_tutorials/generating-diagrams.adoc +42 -0
  51. data/docs/_tutorials/getting-started.adoc +45 -0
  52. data/docs/_tutorials/index.adoc +100 -0
  53. data/docs/_tutorials/querying-models.adoc +44 -0
  54. data/docs/examples/build_package.rb +12 -0
  55. data/docs/examples/build_site.rb +12 -0
  56. data/docs/examples/city_model.rb +21 -0
  57. data/docs/examples/present_class.rb +10 -0
  58. data/docs/examples/query_model.rb +12 -0
  59. data/docs/examples/render_diagram.rb +11 -0
  60. data/docs/index.adoc +64 -0
  61. data/docs/lml-models-and-instances-syntax.adoc +931 -0
  62. data/docs/lml.adoc +210 -0
  63. data/docs/lychee.toml +50 -0
  64. data/lib/lutaml/version.rb +1 -1
  65. data/lib/lutaml.rb +6 -1
  66. data/lutaml.gemspec +8 -6
  67. metadata +75 -131
  68. data/exe/lutaml-lml +0 -6
  69. data/exe/lutaml-lml-lsp +0 -11
  70. data/lib/lutaml/lml/association_label_resolver.rb +0 -52
  71. data/lib/lutaml/lml/cli.rb +0 -506
  72. data/lib/lutaml/lml/data_processor/attribute_processing.rb +0 -133
  73. data/lib/lutaml/lml/data_processor/collection_processing.rb +0 -37
  74. data/lib/lutaml/lml/data_processor/instance_processing.rb +0 -77
  75. data/lib/lutaml/lml/data_processor/value_declaration_processing.rb +0 -70
  76. data/lib/lutaml/lml/data_processor/value_processing.rb +0 -103
  77. data/lib/lutaml/lml/data_processor/view_processing.rb +0 -26
  78. data/lib/lutaml/lml/data_processor.rb +0 -59
  79. data/lib/lutaml/lml/diagnostic.rb +0 -149
  80. data/lib/lutaml/lml/document_builder.rb +0 -481
  81. data/lib/lutaml/lml/entity_types.rb +0 -30
  82. data/lib/lutaml/lml/executor/adapter_helpers.rb +0 -45
  83. data/lib/lutaml/lml/executor/condition_evaluator.rb +0 -169
  84. data/lib/lutaml/lml/executor/csv_adapter.rb +0 -88
  85. data/lib/lutaml/lml/executor/format_adapter.rb +0 -54
  86. data/lib/lutaml/lml/executor/xml_adapter.rb +0 -102
  87. data/lib/lutaml/lml/executor.rb +0 -96
  88. data/lib/lutaml/lml/format/adapter/document.rb +0 -11
  89. data/lib/lutaml/lml/format/adapter/mapping.rb +0 -31
  90. data/lib/lutaml/lml/format/adapter/standard_adapter.rb +0 -162
  91. data/lib/lutaml/lml/format/adapter/transform.rb +0 -11
  92. data/lib/lutaml/lml/format.rb +0 -29
  93. data/lib/lutaml/lml/formatter/base.rb +0 -79
  94. data/lib/lutaml/lml/formatter/canonical.rb +0 -736
  95. data/lib/lutaml/lml/formatter/elk.rb +0 -45
  96. data/lib/lutaml/lml/formatter/svg_pdf/path_parser.rb +0 -134
  97. data/lib/lutaml/lml/formatter/svg_pdf.rb +0 -285
  98. data/lib/lutaml/lml/formatter.rb +0 -11
  99. data/lib/lutaml/lml/grammar/lml.artifact.json +0 -14993
  100. data/lib/lutaml/lml/grammar/lml.parg +0 -389
  101. data/lib/lutaml/lml/grammar.rb +0 -60
  102. data/lib/lutaml/lml/has_attributes.rb +0 -14
  103. data/lib/lutaml/lml/import_resolver.rb +0 -96
  104. data/lib/lutaml/lml/layout/elk_engine.rb +0 -15
  105. data/lib/lutaml/lml/layout/elk_graph_builder.rb +0 -129
  106. data/lib/lutaml/lml/layout/elk_svg_markers.rb +0 -45
  107. data/lib/lutaml/lml/layout/elk_svg_renderer.rb +0 -119
  108. data/lib/lutaml/lml/layout/engine.rb +0 -17
  109. data/lib/lutaml/lml/layout.rb +0 -12
  110. data/lib/lutaml/lml/literal_value.rb +0 -32
  111. data/lib/lutaml/lml/lsp/conversions.rb +0 -78
  112. data/lib/lutaml/lml/lsp/keywords.rb +0 -43
  113. data/lib/lutaml/lml/lsp/server.rb +0 -378
  114. data/lib/lutaml/lml/lsp/store.rb +0 -68
  115. data/lib/lutaml/lml/lsp/transport.rb +0 -53
  116. data/lib/lutaml/lml/lsp.rb +0 -16
  117. data/lib/lutaml/lml/model_compiler/enums.rb +0 -172
  118. data/lib/lutaml/lml/model_compiler/hydration.rb +0 -123
  119. data/lib/lutaml/lml/model_compiler/serialization_mappings.rb +0 -188
  120. data/lib/lutaml/lml/model_compiler/string_formats.rb +0 -42
  121. data/lib/lutaml/lml/model_compiler/validation.rb +0 -65
  122. data/lib/lutaml/lml/model_compiler.rb +0 -323
  123. data/lib/lutaml/lml/models/action.rb +0 -10
  124. data/lib/lutaml/lml/models/association.rb +0 -29
  125. data/lib/lutaml/lml/models/cardinality.rb +0 -10
  126. data/lib/lutaml/lml/models/collection.rb +0 -11
  127. data/lib/lutaml/lml/models/constraint.rb +0 -23
  128. data/lib/lutaml/lml/models/data_type.rb +0 -41
  129. data/lib/lutaml/lml/models/derived_field.rb +0 -14
  130. data/lib/lutaml/lml/models/diagram.rb +0 -20
  131. data/lib/lutaml/lml/models/document.rb +0 -84
  132. data/lib/lutaml/lml/models/enum.rb +0 -38
  133. data/lib/lutaml/lml/models/fidelity.rb +0 -10
  134. data/lib/lutaml/lml/models/group.rb +0 -11
  135. data/lib/lutaml/lml/models/instance.rb +0 -26
  136. data/lib/lutaml/lml/models/instance_collection.rb +0 -16
  137. data/lib/lutaml/lml/models/instances_export.rb +0 -10
  138. data/lib/lutaml/lml/models/instances_import.rb +0 -11
  139. data/lib/lutaml/lml/models/mapping.rb +0 -15
  140. data/lib/lutaml/lml/models/mapping_rule.rb +0 -16
  141. data/lib/lutaml/lml/models/member_field.rb +0 -14
  142. data/lib/lutaml/lml/models/namespace.rb +0 -16
  143. data/lib/lutaml/lml/models/operation.rb +0 -26
  144. data/lib/lutaml/lml/models/operation_parameter.rb +0 -12
  145. data/lib/lutaml/lml/models/package.rb +0 -26
  146. data/lib/lutaml/lml/models/primitive_type.rb +0 -33
  147. data/lib/lutaml/lml/models/reference.rb +0 -23
  148. data/lib/lutaml/lml/models/serialization_mapping.rb +0 -19
  149. data/lib/lutaml/lml/models/string_format.rb +0 -16
  150. data/lib/lutaml/lml/models/top_element_attribute.rb +0 -116
  151. data/lib/lutaml/lml/models/uml_class.rb +0 -85
  152. data/lib/lutaml/lml/models/value.rb +0 -15
  153. data/lib/lutaml/lml/models/view_filter.rb +0 -11
  154. data/lib/lutaml/lml/models/view_import.rb +0 -11
  155. data/lib/lutaml/lml/parser.rb +0 -19
  156. data/lib/lutaml/lml/pipeline.rb +0 -73
  157. data/lib/lutaml/lml/positioned.rb +0 -13
  158. data/lib/lutaml/lml/preprocessor.rb +0 -130
  159. data/lib/lutaml/lml/quoting.rb +0 -60
  160. data/lib/lutaml/lml/source.rb +0 -49
  161. data/lib/lutaml/lml/source_position.rb +0 -20
  162. data/lib/lutaml/lml/symbol_index.rb +0 -200
  163. data/lib/lutaml/lml/transform.rb +0 -119
  164. data/lib/lutaml/lml/types/text_type.rb +0 -28
  165. data/lib/lutaml/lml/types.rb +0 -10
  166. data/lib/lutaml/lml/validator.rb +0 -458
  167. data/lib/lutaml/lml/version.rb +0 -10
  168. data/lib/lutaml/lml/view_resolution.rb +0 -32
  169. data/lib/lutaml/lml/view_resolver.rb +0 -48
  170. data/lib/lutaml/lml/yaml_parser.rb +0 -17
  171. data/lib/lutaml/lml.rb +0 -130
@@ -0,0 +1,716 @@
1
+ ---
2
+ title: Diagram Styling Configuration
3
+ parent: Configuration
4
+ grand_parent: Reference
5
+ nav_order: 1
6
+ ---
7
+
8
+ = Diagram Configuration Guide
9
+
10
+ Complete reference for configuring EA-style diagram generation in LutaML.
11
+
12
+ == Overview
13
+
14
+ LutaML's diagram styling system uses a three-tier priority hierarchy to merge styles from multiple sources:
15
+
16
+ 1. **EA Data** (highest) - Styles embedded in QEA/XMI files
17
+ 2. **User Configuration** - Custom YAML configuration files
18
+ 3. **Built-in Defaults** (lowest) - EA-style defaults shipped with LutaML
19
+
20
+ This ensures that:
21
+
22
+ * EA's original styling is always preserved when present
23
+ * Users can customize defaults without modifying code
24
+ * Sensible EA-compatible defaults are always available
25
+
26
+ == Configuration File Format
27
+
28
+ Configuration files use YAML format with the following top-level sections:
29
+
30
+ [source,yaml]
31
+ ----
32
+ stereotypes: # Styling by stereotype
33
+ <stereotype>:
34
+ colors: {...}
35
+ fonts: {...}
36
+ box: {...}
37
+
38
+ packages: # Styling by package (wildcards supported)
39
+ <pattern>:
40
+ colors: {...}
41
+ fonts: {...}
42
+
43
+ classes: # Styling by class name
44
+ <className>:
45
+ colors: {...}
46
+ fonts: {...}
47
+
48
+ connectors: # Connector styling by type
49
+ <type>:
50
+ arrow: {...}
51
+ line: {...}
52
+ labels: {...}
53
+
54
+ defaults: # Global default styles
55
+ colors: {...}
56
+ fonts: {...}
57
+ box: {...}
58
+ text: {...}
59
+
60
+ legend: # Legend configuration
61
+ enabled: true
62
+ position: "bottom_right"
63
+ entries: [...]
64
+ ----
65
+
66
+ == Priority Resolution
67
+
68
+ === Element Styling Priority
69
+
70
+ For any element (class, datatype, enum), styles are resolved in this order:
71
+
72
+ 1. **Class-specific override** (highest)
73
+ +
74
+ [source,yaml]
75
+ ----
76
+ classes:
77
+ "MySpecialClass":
78
+ colors:
79
+ fill: "#FF0000"
80
+ ----
81
+
82
+ 2. **Package-based styling** (with wildcard support)
83
+ +
84
+ [source,yaml]
85
+ ----
86
+ packages:
87
+ "CityGML::*":
88
+ colors:
89
+ fill: "#FFFFCC"
90
+ ----
91
+
92
+ 3. **Stereotype-based styling**
93
+ +
94
+ [source,yaml]
95
+ ----
96
+ stereotypes:
97
+ DataType:
98
+ colors:
99
+ fill: "#FFCCFF"
100
+ ----
101
+
102
+ 4. **Global defaults** (lowest)
103
+ +
104
+ [source,yaml]
105
+ ----
106
+ defaults:
107
+ colors:
108
+ default_fill: "#E0E0E0"
109
+ ----
110
+
111
+ **IMPORTANT**: EA data from DiagramObject.style always overrides everything when present.
112
+
113
+ === Example Resolution
114
+
115
+ Given this configuration:
116
+
117
+ [source,yaml]
118
+ ----
119
+ stereotypes:
120
+ DataType:
121
+ colors:
122
+ fill: "#FFCCFF"
123
+
124
+ packages:
125
+ "CityGML::*":
126
+ colors:
127
+ fill: "#FFFFCC"
128
+
129
+ classes:
130
+ "Building":
131
+ colors:
132
+ fill: "#FF0000"
133
+ ----
134
+
135
+ For a class named "Building" with stereotype "DataType" in package "CityGML::Core":
136
+
137
+ * **Result**: `#FF0000` (red) from class-specific override
138
+ * Without class override: `#FFFFCC` (yellow) from package pattern
139
+ * Without package match: `#FFCCFF` (pink) from stereotype
140
+ * Without stereotype: `#E0E0E0` (gray) from defaults
141
+ * **If EA data present**: EA color always wins
142
+
143
+ == Configuration Sections
144
+
145
+ === Stereotypes
146
+
147
+ Define styles for UML stereotypes:
148
+
149
+ [source,yaml]
150
+ ----
151
+ stereotypes:
152
+ DataType:
153
+ colors:
154
+ fill: "#FFCCFF" # Background color (pink)
155
+ stroke: "#000000" # Border color (black)
156
+ fonts:
157
+ class_name:
158
+ family: "Carlito, Arial, sans-serif"
159
+ size: 9
160
+ weight: 700 # Bold
161
+ style: "italic"
162
+ box:
163
+ stroke_width: 2
164
+ corner_radius: 0
165
+
166
+ FeatureType:
167
+ colors:
168
+ fill: "#FFFFCC" # Yellow
169
+ stroke: "#000000"
170
+
171
+ Interface:
172
+ fonts:
173
+ class_name:
174
+ style: "italic" # Italic names for interfaces
175
+ ----
176
+
177
+ === Packages
178
+
179
+ Define styles for package hierarchies with wildcard support:
180
+
181
+ [source,yaml]
182
+ ----
183
+ packages:
184
+ # Exact match
185
+ "ModelRoot::CityGML":
186
+ colors:
187
+ fill: "#FFFFCC"
188
+
189
+ # Wildcard: all packages under CityGML
190
+ "CityGML::*":
191
+ colors:
192
+ fill: "#FFFFCC"
193
+
194
+ # Multiple wildcards
195
+ "*::Core::*":
196
+ colors:
197
+ fill: "#CCFFFF"
198
+ ----
199
+
200
+ Wildcard patterns:
201
+
202
+ * `*` - Matches any characters (including `::`)
203
+ * `CityGML::*` - Matches `CityGML::Core`, `CityGML::Building`, etc.
204
+ * `*::Core` - Matches any package ending with `Core`
205
+
206
+ === Classes
207
+
208
+ Define styles for specific classes by name:
209
+
210
+ [source,yaml]
211
+ ----
212
+ classes:
213
+ Building:
214
+ colors:
215
+ fill: "#FF0000"
216
+ stroke: "#000000"
217
+ fonts:
218
+ class_name:
219
+ size: 11 # Larger font
220
+ weight: 700
221
+
222
+ Person:
223
+ colors:
224
+ fill: "#00FF00"
225
+ ----
226
+
227
+ === Connectors
228
+
229
+ Configure connector appearance by type:
230
+
231
+ [source,yaml]
232
+ ----
233
+ connectors:
234
+ generalization:
235
+ arrow:
236
+ type: "hollow_triangle"
237
+ size: 10
238
+ line:
239
+ stroke_width: 1
240
+ stroke: "#000000"
241
+
242
+ association:
243
+ arrow:
244
+ type: "open_arrow"
245
+ size: 8
246
+ line:
247
+ stroke_width: 1
248
+ stroke: "#000000"
249
+ labels:
250
+ show_role_names: true
251
+ show_cardinality: true
252
+ font:
253
+ family: "Carlito, Arial, sans-serif"
254
+ size: 8
255
+
256
+ aggregation:
257
+ arrow:
258
+ type: "diamond" # Hollow diamond
259
+ size: 10
260
+ line:
261
+ stroke_width: 1
262
+
263
+ composition:
264
+ arrow:
265
+ type: "filled_diamond"
266
+ size: 10
267
+
268
+ dependency:
269
+ arrow:
270
+ type: "open_arrow"
271
+ line:
272
+ stroke_width: 1
273
+ stroke_dasharray: "5,5" # Dashed line
274
+ ----
275
+
276
+ Arrow types:
277
+
278
+ * `hollow_triangle` - Generalization/inheritance
279
+ * `open_arrow` - Association, dependency
280
+ * `diamond` - Aggregation (hollow)
281
+ * `filled_diamond` - Composition (filled)
282
+
283
+ === Defaults
284
+
285
+ Global default styles applied when no specific style matches:
286
+
287
+ [source,yaml]
288
+ ----
289
+ defaults:
290
+ colors:
291
+ background: "#FFFFFF"
292
+ default_fill: "#E0E0E0"
293
+ default_stroke: "#000000"
294
+ text: "#000000"
295
+
296
+ fonts:
297
+ default:
298
+ family: "Carlito, Arial, sans-serif"
299
+ size: 9
300
+ weight: 400
301
+ style: "normal"
302
+
303
+ class_name:
304
+ family: "Carlito, Arial, sans-serif"
305
+ size: 9
306
+ weight: 700 # Bold for class names
307
+ style: "normal"
308
+
309
+ stereotype:
310
+ family: "Carlito, Arial, sans-serif"
311
+ size: 9
312
+ weight: 400
313
+ style: "normal"
314
+
315
+ attribute:
316
+ family: "Carlito, Arial, sans-serif"
317
+ size: 9
318
+ weight: 400
319
+ style: "normal"
320
+
321
+ box:
322
+ stroke_width: 2
323
+ stroke_linecap: "round"
324
+ stroke_linejoin: "bevel"
325
+ corner_radius: 0
326
+ padding: 5
327
+ fill_opacity: 1.0
328
+ stroke_opacity: 1.0
329
+
330
+ text:
331
+ visibility_public: "+"
332
+ visibility_private: "-"
333
+ visibility_protected: "#"
334
+ visibility_package: "~"
335
+ cardinality_format: "[%s]"
336
+ stereotype_format: "«%s»"
337
+ ----
338
+
339
+ === Legend
340
+
341
+ Configure diagram legends (optional):
342
+
343
+ [source,yaml]
344
+ ----
345
+ legend:
346
+ enabled: true
347
+ position: "bottom_right" # or top_left, top_right, bottom_left
348
+ title: "Legend"
349
+ entries:
350
+ - label: "i-UR DataTypes"
351
+ color: "#FFCCFF"
352
+ - label: "CityGML FeatureTypes"
353
+ color: "#FFFFCC"
354
+ - label: "GML Types"
355
+ color: "#CCFFCC"
356
+ ----
357
+
358
+ == Color Format
359
+
360
+ Colors must be specified as hex strings:
361
+
362
+ * `"#RRGGBB"` format (6 digits)
363
+ * `"#RGB"` shorthand also supported
364
+ * Examples: `"#FFCCFF"`, `"#000"`, `"#F0F"`
365
+
366
+ EA stores colors as BGR integers internally. LutaML automatically converts:
367
+
368
+ * EA BGR `16764159` → `"#FFCCFF"` (pink)
369
+ * EA BGR `16777164` → `"#FFFFCC"` (yellow)
370
+ * EA BGR `13434828` → `"#CCFFCC"` (green)
371
+
372
+ == Font Configuration
373
+
374
+ === Font Properties
375
+
376
+ [source,yaml]
377
+ ----
378
+ fonts:
379
+ class_name:
380
+ family: "Carlito, Arial, sans-serif" # Font stack
381
+ size: 9 # Point size
382
+ weight: 700 # 400=normal, 700=bold
383
+ style: "normal" # or "italic"
384
+ ----
385
+
386
+ === Font Contexts
387
+
388
+ Different font contexts for different text elements:
389
+
390
+ * `default` - Base font for all text
391
+ * `class_name` - Element names (classes, datatypes)
392
+ * `stereotype` - Stereotype labels («DataType»)
393
+ * `attribute` - Attribute text
394
+ * `operation` - Operation text
395
+
396
+ === Font Stack
397
+
398
+ Always specify fallback fonts:
399
+
400
+ [source,yaml]
401
+ ----
402
+ family: "Carlito, Arial, sans-serif"
403
+ ----
404
+
405
+ Reasons:
406
+
407
+ * Carlito matches EA's default font metrics
408
+ * Arial is widely available
409
+ * sans-serif ensures generic fallback
410
+
411
+ == Box Styling
412
+
413
+ Control element box appearance:
414
+
415
+ [source,yaml]
416
+ ----
417
+ box:
418
+ stroke_width: 2 # Border thickness
419
+ stroke_linecap: "round" # round | square | butt
420
+ stroke_linejoin: "bevel" # bevel | miter | round
421
+ corner_radius: 0 # Rounded corners (0 = square)
422
+ padding: 5 # Internal padding
423
+ fill_opacity: 1.0 # 0.0 to 1.0
424
+ stroke_opacity: 1.0 # 0.0 to 1.0
425
+ ----
426
+
427
+ == Text Formatting
428
+
429
+ Configure text display conventions:
430
+
431
+ [source,yaml]
432
+ ----
433
+ text:
434
+ visibility_public: "+"
435
+ visibility_private: "-"
436
+ visibility_protected: "#"
437
+ visibility_package: "~"
438
+ cardinality_format: "[%s]" # e.g., [0..*]
439
+ stereotype_format: "«%s»" # e.g., «DataType»
440
+ ----
441
+
442
+ == Configuration File Locations
443
+
444
+ LutaML searches for configuration files in this order:
445
+
446
+ 1. Path specified via `config_path` parameter
447
+ 2. `config/diagram_styles.yml` (project-specific)
448
+ 3. `~/.lutaml/diagram_styles.yml` (user-specific)
449
+ 4. Built-in defaults (always available)
450
+
451
+ .Using custom configuration
452
+ [example]
453
+ ====
454
+ [source,ruby]
455
+ ----
456
+ presenter = DiagramPresenter.new(
457
+ diagram,
458
+ repository,
459
+ config_path: "my_custom_styles.yml"
460
+ )
461
+ ----
462
+ ====
463
+
464
+ == Common Configuration Patterns
465
+
466
+ === CityGML Styling
467
+
468
+ [source,yaml]
469
+ ----
470
+ stereotypes:
471
+ DataType:
472
+ colors:
473
+ fill: "#FFCCFF"
474
+
475
+ FeatureType:
476
+ colors:
477
+ fill: "#FFFFCC"
478
+
479
+ packages:
480
+ "CityGML::*":
481
+ colors:
482
+ fill: "#FFFFCC"
483
+
484
+ "GML::*":
485
+ colors:
486
+ fill: "#CCFFCC"
487
+ ----
488
+
489
+ === Custom Theme
490
+
491
+ [source,yaml]
492
+ ----
493
+ defaults:
494
+ colors:
495
+ background: "#F5F5F5"
496
+ default_fill: "#E8E8E8"
497
+ default_stroke: "#333333"
498
+ text: "#222222"
499
+
500
+ fonts:
501
+ default:
502
+ family: "Roboto, Arial, sans-serif"
503
+ size: 10
504
+
505
+ stereotypes:
506
+ DataType:
507
+ colors:
508
+ fill: "#E1F5FE" # Light blue
509
+ stroke: "#01579B" # Dark blue
510
+
511
+ FeatureType:
512
+ colors:
513
+ fill: "#FFF9C4" # Light yellow
514
+ stroke: "#F57F17" # Dark yellow
515
+ ----
516
+
517
+ === Monochrome Theme
518
+
519
+ [source,yaml]
520
+ ----
521
+ defaults:
522
+ colors:
523
+ background: "#FFFFFF"
524
+ default_fill: "#FFFFFF"
525
+ default_stroke: "#000000"
526
+
527
+ stereotypes:
528
+ DataType:
529
+ colors:
530
+ fill: "#FFFFFF"
531
+ fonts:
532
+ class_name:
533
+ style: "italic"
534
+
535
+ FeatureType:
536
+ colors:
537
+ fill: "#FFFFFF"
538
+ box:
539
+ stroke_width: 3
540
+ ----
541
+
542
+ == Troubleshooting
543
+
544
+ === Colors Not Applied
545
+
546
+ 1. **Check Priority**: EA data overrides config. If diagram has embedded colors, they take precedence.
547
+
548
+ 2. **Verify Stereotype Names**: Stereotypes are case-sensitive. `"DataType"` ≠ `"datatype"`.
549
+
550
+ 3. **Check Package Patterns**: Ensure wildcard patterns match. Test with:
551
+ +
552
+ [source,ruby]
553
+ ----
554
+ config = Lutaml::Ea::Diagram::Configuration.new("styles.yml")
555
+ puts config.matches_package?("CityGML::Core", "CityGML::*") # Should be true
556
+ ----
557
+
558
+ === Fonts Not Rendering
559
+
560
+ 1. **Font Availability**: Ensure fonts are installed or use web-safe fallbacks.
561
+
562
+ 2. **Font Stack**: Always include fallbacks:
563
+ +
564
+ [source,yaml]
565
+ ----
566
+ family: "Carlito, Arial, sans-serif"
567
+ ----
568
+
569
+ 3. **Size Units**: Font size should be numeric (points assumed):
570
+ +
571
+ [source,yaml]
572
+ ----
573
+ size: 9 # Correct
574
+ size: "9pt" # Also works but numeric preferred
575
+ ----
576
+
577
+ === Configuration Not Loading
578
+
579
+ 1. **File Path**: Verify configuration file exists and path is correct.
580
+
581
+ 2. **YAML Syntax**: Validate YAML syntax with:
582
+ +
583
+ [source,ruby]
584
+ ----
585
+ require 'yaml'
586
+ YAML.load_file("diagram_styles.yml")
587
+ ----
588
+
589
+ 3. **File Permissions**: Ensure file is readable.
590
+
591
+ == Advanced Patterns
592
+
593
+ === Conditional Styling by Package Hierarchy
594
+
595
+ [source,yaml]
596
+ ----
597
+ packages:
598
+ # Root level
599
+ "ModelRoot":
600
+ colors:
601
+ fill: "#F0F0F0"
602
+
603
+ # Second level wildcard
604
+ "ModelRoot::*":
605
+ colors:
606
+ fill: "#E0E0E0"
607
+
608
+ # Specific subfolder
609
+ "ModelRoot::CityGML::Core":
610
+ colors:
611
+ fill: "#FFFFCC"
612
+
613
+ # Deep wildcard
614
+ "*::Core::*":
615
+ colors:
616
+ fill: "#CCFFFF"
617
+ ----
618
+
619
+ === Multiple Stereotype Handling
620
+
621
+ Classes can have multiple stereotypes. LutaML uses the first matching stereotype:
622
+
623
+ [source,yaml]
624
+ ----
625
+ stereotypes:
626
+ DataType:
627
+ colors:
628
+ fill: "#FFCCFF"
629
+
630
+ Abstract:
631
+ fonts:
632
+ class_name:
633
+ style: "italic"
634
+ ----
635
+
636
+ For a class with stereotypes `["DataType", "Abstract"]`:
637
+
638
+ * Color from `DataType` (first match)
639
+ * Font from `Abstract` if `DataType` doesn't define fonts
640
+
641
+ === Per-Element Type Styling
642
+
643
+ [source,yaml]
644
+ ----
645
+ # Different styles for different classifiers
646
+ stereotypes:
647
+ DataType:
648
+ colors:
649
+ fill: "#FFCCFF"
650
+
651
+ Enumeration:
652
+ colors:
653
+ fill: "#E0FFE0"
654
+ fonts:
655
+ class_name:
656
+ family: "monospace"
657
+
658
+ Interface:
659
+ colors:
660
+ fill: "#FFFFEE"
661
+ fonts:
662
+ class_name:
663
+ style: "italic"
664
+ ----
665
+
666
+ == Performance Considerations
667
+
668
+ * **File Size**: Keep configuration files under 100KB
669
+ * **Pattern Count**: Limit wildcards to <50 patterns
670
+ * **Caching**: Configuration is loaded once per rendering session
671
+ * **Priority**: Early matches short-circuit pattern checking
672
+
673
+ == API Integration
674
+
675
+ === Using Configuration Programmatically
676
+
677
+ [source,ruby]
678
+ ----
679
+ require 'lutaml/ea/diagram/configuration'
680
+
681
+ # Load configuration
682
+ config = Lutaml::Ea::Diagram::Configuration.new("my_styles.yml")
683
+
684
+ # Query styles
685
+ fill = config.style_for(element, "colors.fill")
686
+ font = config.style_for(element, "fonts.class_name.family")
687
+
688
+ # Check patterns
689
+ matches = config.matches_package?("CityGML::Core", "CityGML::*")
690
+
691
+ # Get full config
692
+ data = config.to_h
693
+ ----
694
+
695
+ === Using with StyleResolver
696
+
697
+ [source,ruby]
698
+ ----
699
+ require 'lutaml/ea/diagram/style_resolver'
700
+
701
+ # Create resolver with config
702
+ resolver = Lutaml::Ea::Diagram::StyleResolver.new("my_styles.yml")
703
+
704
+ # Resolve complete element style
705
+ style = resolver.resolve_element_style(element, diagram_object)
706
+ # Returns: { fill: "#FFCCFF", stroke: "#000000", font_family: "Carlito", ... }
707
+
708
+ # Resolve connector style
709
+ conn_style = resolver.resolve_connector_style(connector, diagram_link)
710
+ ----
711
+
712
+ == See Also
713
+
714
+ * link:{site-baseurl}/guides/diagram-generation/[Diagram Generation Guide]
715
+ * link:https://github.com/lutaml/lutaml/blob/main/README.md[LutaML README]
716
+ * link:{site-baseurl}/references/configuration/diagram-styles/#configuration-file-format[Configuration File Format]