@peter.prib/renderengine 0.13.0 → 0.15.0

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 (124) hide show
  1. package/README.md +480 -302
  2. package/bin/renderengine.mjs +157 -0
  3. package/dist/renderengine-workspace.umd.js +49217 -37484
  4. package/dist/renderengine.umd.js +24899 -13093
  5. package/documentation/REFERENCE.md +68 -1
  6. package/package.json +13 -3
  7. package/src/CanvasRenderer.js +225 -200
  8. package/src/SVGRenderer.js +476 -454
  9. package/src/archimate.js +22 -2
  10. package/src/archimateArchiFormat.js +1735 -1701
  11. package/src/archimateArchive.js +36 -7
  12. package/src/archimateCSV.js +93 -37
  13. package/src/archimateDrawio.js +2 -0
  14. package/src/archimateExchangeFormat.js +3 -1
  15. package/src/chartCatalog.js +269 -3
  16. package/src/charting/Annotations.js +169 -0
  17. package/src/charting/ArchimateDiagramEditor.js +54 -10
  18. package/src/charting/Axis.js +217 -5
  19. package/src/charting/Chart.js +99 -9
  20. package/src/charting/Chart3D.js +7 -2
  21. package/src/charting/ChartBox.js +8 -1
  22. package/src/charting/ColorPalette.js +42 -4
  23. package/src/charting/DiagramEditor.js +174 -39
  24. package/src/charting/DiagramEditorCommands.js +28 -0
  25. package/src/charting/Edge.js +7 -0
  26. package/src/charting/Hierarchy.js +142 -0
  27. package/src/charting/InteractionManager.js +4 -0
  28. package/src/charting/ModelFileFormat.js +5 -1
  29. package/src/charting/SettingsManager.js +35 -0
  30. package/src/charting/ShapePaths.js +82 -10
  31. package/src/charting/archimate/ArchimateCsvFileFormat.js +51 -12
  32. package/src/charting/archimate/ArchimateElementTemplate.js +235 -231
  33. package/src/charting/ask/AskBar.js +388 -0
  34. package/src/charting/ask/AskView.js +400 -0
  35. package/src/charting/charts/AlluvialDiagram.js +311 -0
  36. package/src/charting/charts/AreaChart.js +69 -15
  37. package/src/charting/charts/BarChart.js +38 -3
  38. package/src/charting/charts/BarChart3D.js +6 -4
  39. package/src/charting/charts/BarChart3DOrbit.js +3 -1
  40. package/src/charting/charts/BarChartBase.js +26 -6
  41. package/src/charting/charts/BeeswarmChart.js +164 -0
  42. package/src/charting/charts/BoxPlotChart.js +25 -3
  43. package/src/charting/charts/BubbleChart.js +4 -1
  44. package/src/charting/charts/CalendarHeatmapChart.js +2 -1
  45. package/src/charting/charts/CandlestickChart.js +172 -4
  46. package/src/charting/charts/ChordDiagram.js +107 -4
  47. package/src/charting/charts/CirclePackChart.js +81 -0
  48. package/src/charting/charts/ComboChart.js +233 -0
  49. package/src/charting/charts/ContourChart.js +310 -0
  50. package/src/charting/charts/DensityChart.js +1 -1
  51. package/src/charting/charts/DonutChart3D.js +13 -0
  52. package/src/charting/charts/DumbbellChart.js +217 -0
  53. package/src/charting/charts/EcdfChart.js +150 -0
  54. package/src/charting/charts/FunnelChart.js +5 -2
  55. package/src/charting/charts/GeoMapChart.js +132 -11
  56. package/src/charting/charts/GroupedBarChart.js +44 -3
  57. package/src/charting/charts/GroupedDistributionChart.js +26 -1
  58. package/src/charting/charts/HeatmapChart.js +6 -3
  59. package/src/charting/charts/HexbinChart.js +137 -0
  60. package/src/charting/charts/HierarchyChart.js +77 -3
  61. package/src/charting/charts/HistogramChart.js +2 -2
  62. package/src/charting/charts/HorizonChart.js +105 -0
  63. package/src/charting/charts/IcicleChart.js +47 -0
  64. package/src/charting/charts/KagiChart.js +167 -0
  65. package/src/charting/charts/LineChart.js +74 -18
  66. package/src/charting/charts/LollipopChart.js +104 -0
  67. package/src/charting/charts/MarimekkoChart.js +75 -0
  68. package/src/charting/charts/OhlcChart.js +79 -0
  69. package/src/charting/charts/OutlineChart.js +10 -8
  70. package/src/charting/charts/ParallelCoordinatesChart.js +11 -3
  71. package/src/charting/charts/ParetoChart.js +92 -0
  72. package/src/charting/charts/PieChart.js +195 -17
  73. package/src/charting/charts/PieChart3D.js +137 -0
  74. package/src/charting/charts/PipeChart.js +5 -2
  75. package/src/charting/charts/PointAndFigureChart.js +198 -0
  76. package/src/charting/charts/PolarAreaChart.js +189 -0
  77. package/src/charting/charts/PopulationPyramidChart.js +4 -4
  78. package/src/charting/charts/RadarChart.js +12 -5
  79. package/src/charting/charts/RadialBarChart.js +6 -3
  80. package/src/charting/charts/RenkoChart.js +178 -0
  81. package/src/charting/charts/RidgelineChart.js +113 -0
  82. package/src/charting/charts/SankeyDiagram.js +129 -6
  83. package/src/charting/charts/ScatterChart.js +19 -3
  84. package/src/charting/charts/ScatterMatrixChart.js +119 -0
  85. package/src/charting/charts/SlopegraphChart.js +205 -0
  86. package/src/charting/charts/SparklineTableChart.js +166 -0
  87. package/src/charting/charts/StackedBarChart.js +125 -11
  88. package/src/charting/charts/StackedBarChart3DOrbit.js +14 -6
  89. package/src/charting/charts/StreamGraphChart.js +18 -3
  90. package/src/charting/charts/SunburstChart.js +28 -8
  91. package/src/charting/charts/SurfaceChart3D.js +157 -0
  92. package/src/charting/charts/TreemapChart.js +31 -11
  93. package/src/charting/charts/ViolinChart.js +20 -2
  94. package/src/charting/charts/WaterfallChart.js +2 -2
  95. package/src/charting/charts/WordCloudChart.js +2 -2
  96. package/src/charting/datamodel/ArchimateDataLink.js +70 -0
  97. package/src/charting/datamodel/DataLineage.js +150 -0
  98. package/src/charting/datamodel/DataModel.js +83 -1
  99. package/src/charting/datamodel/ModelMapping.js +87 -0
  100. package/src/charting/datamodel/SqlDdl.js +110 -85
  101. package/src/charting/datamodel/index.js +3 -0
  102. package/src/charting/decision/DecisionWorkbench.js +295 -0
  103. package/src/charting/diagrams/ArchimateDiagram.js +25 -9
  104. package/src/charting/diagrams/ArchimateModel.js +1382 -1238
  105. package/src/charting/diagrams/GraphDiagram.js +1424 -1350
  106. package/src/charting/diagrams/SketchView.js +121 -0
  107. package/src/charting/diagrams/sketchBoxKinds.js +30 -0
  108. package/src/charting/modelTree/AnalysisPanel.js +101 -23
  109. package/src/charting/modelTree/NavigatorModel.js +410 -0
  110. package/src/charting/modelTree/NavigatorPanel.js +453 -0
  111. package/src/charting/pivot/PivotChart.js +310 -13
  112. package/src/charting/pivot/PivotGridChart.js +322 -34
  113. package/src/charting/pivot/PivotView.js +626 -21
  114. package/src/charting/report/TemplatedReport.js +547 -0
  115. package/src/charting/templates/BoxTemplate.js +28 -27
  116. package/src/charting/templates/PackageTemplate.js +26 -25
  117. package/src/charting/templates/SwimlaneTemplate.js +19 -18
  118. package/src/charting/templates/Template.js +219 -212
  119. package/src/cli.js +146 -0
  120. package/src/index.js +3370 -2899
  121. package/src/workspace/Workspace.js +126 -7
  122. package/src/workspace/archimateServices.js +4 -0
  123. package/src/workspace/parts/ArchimateCanvasPart.js +1 -1
  124. package/src/workspace/styles.js +36 -1
package/README.md CHANGED
@@ -1,302 +1,480 @@
1
- # RenderEngine
2
-
3
- **An ArchiMate modeller, a data modeller, a requirements story map, a diagram editor and a chart library that run
4
- in any browser tab, with no install and no runtime dependencies.**
5
-
6
- Open an Archi model, edit it the way you would in Archi, and save it back to the same `.archimate` file, without
7
- installing anything. Model data at three levels, governed and checked the way DAMA-DMBOK2 has it, with banking at
8
- BIAN level built in. Or put the same editors in your own app: it's a JavaScript library and a set of workbench
9
- parts, not a desktop application.
10
-
11
- ![The ArchiMate modeller: a layered view of an online shop, the model tree by layer with each type's picture, and the palette](https://gitlab.com/peter.prib/renderengine/-/raw/master/docs/images/archimate-modeller.png)
12
-
13
- ---
14
-
15
- ## Try it
16
-
17
- ```bash
18
- git clone https://gitlab.com/peter.prib/renderengine.git
19
- cd renderengine
20
- npm start # the ArchiMate modeller
21
- npm run diagram # the diagram editor (flowcharts, UML and more)
22
- npm run datamodel # the data modeller: an enterprise ontology and a retail bank at BIAN level
23
- ```
24
-
25
- No server is needed, and nothing needs installing first, because the built bundles are in `dist/`. You can also
26
- open the pages directly:
27
-
28
- - `examples/archimate.html`: the ArchiMate modeller
29
- - `examples/diagram-editor.html`: the diagram editor
30
- - `examples/data-model.html`: the data modeller
31
-
32
- The models they open come from [modelengine](https://gitlab.com/peter.prib/modelengine), kept apart from the tools: with
33
- it checked out beside renderengine, the pages open on its models (File ▸ Open from ▸ modelengine lists them by domain);
34
- without it they start empty.
35
-
36
- All work in current Chrome, Edge, Firefox and Safari. Save writes back to the file you opened in Chrome and Edge;
37
- other browsers download the file instead.
38
-
39
- ---
40
-
41
- ## The ArchiMate modeller
42
-
43
- ### Works with Archi
44
-
45
- - **Open and save Archi files** (`.archimate`, and archives that include pictures). Save writes back to the file you
46
- opened; Save As picks a new one. Unsaved changes are marked (•), and the page asks before you leave or close them.
47
- - **Kept in the browser, backed up to the cloud.** Every model is kept in the browser as you edit it, and those open
48
- reopen next time, with no file saved. File ▸ This browser backs them all up to a folder you choose once: pick one
49
- that OneDrive, Google Drive or Dropbox syncs and the backups reach the cloud (each named with the date and time,
50
- plus one under its plain name); browsers that cannot write to a folder download them instead.
51
- - **Import a spreadsheet** into the open model: choose the name, type, id, documentation, property and "related
52
- to" columns; existing elements are updated, not duplicated (Archi's elements.csv imports as it is).
53
- - **draw.io export**: every view a page, in draw.io's ArchiMate shapes, with the elements' properties.
54
- - **Open Group Exchange Format** import and export, the standard way into Sparx, BiZZdesign and other tools.
55
- Checked with Archi 5.8, which validates and opens the files.
56
- - **Every element Archi receives is a valid ArchiMate 3.2 class.** A type Archi lacks is written as its nearest
57
- 3.2 type, and its own type is kept so it comes back on the next import.
58
- - **Canvases, sketches, notes, groups and Archi's canvas templates** come through import and export.
59
-
60
- ### Modelling
61
-
62
- - A **palette** of every element type, grouped by layer and limited by the view's viewpoint.
63
- - **Connecting two elements offers only the relationship kinds the ArchiMate rules allow** between them.
64
- - **Nesting**: drop an element inside another and choose what the nesting stands for (composition, aggregation,
65
- assignment, realization or specialization). It goes into the model, and the nesting shows it.
66
- - **Add from text**: paste a list of names, from a document or a spreadsheet's columns, and get an element for
67
- each.
68
- - **Copy and paste** within a model and between models, **Duplicate**, and **Generate View For** an element and
69
- what it relates to.
70
- - **Delete from model**, from the tree or a diagram, after a dialog listing the views it is on and the
71
- relationships that go with it; one undo puts it all back.
72
- - **Several models open at once**, a tab each. Each has its own file and its own undo history.
73
- - **Undo for everything**, one history per model as in Archi: edits on any view, and adding, renaming and deleting
74
- views. Undoing an edit made on another view takes you to that view.
75
- - **Specializations**, custom viewpoints, label expressions (`${name}` and `{name}`), and properties with types.
76
-
77
- ### Editing
78
-
79
- - **Align, distribute and match size**, to the shape you selected last, as in Archi; **automatic layouts** (grid,
80
- circle, tree, force-directed, by layer) and **Nest its parts inside**, following composition and aggregation.
81
- - **Properties of several shapes at once**: colours and text style, the elements' type and specialization, and a
82
- property to set on all of them.
83
- - **Format painter**: copy one shape's look onto others.
84
- - **Colour by** layer, type, specialization or any property (a heat map, e.g. by lifecycle: invest, maintain,
85
- retire), by a formula over properties (`Cost * Risk_score`), or by the change work packages and deliverables make
86
- (create, update, delete, boxes and lines), with a legend boxed round its entries; or a legend of the element types
87
- on the view.
88
- - **Find and replace** across names, documentation and property values, with match case, whole words and
89
- regular expressions; **transform names** (Title Case, split camelCase, ...) and **rename a property** across the
90
- model; **fit a shape to its text**.
91
- - **Groups and locks on any view**, multi-select, a marquee, Archi's tabbed groups, bendpoints, pinned line ends,
92
- and orthogonal, curved or straight routing. Lines take the shortest way between shapes, as in Archi.
93
-
94
- ### Understanding and sharing a model
95
-
96
- - A **model tree** by layer, by type or flat, each element with its type's picture, with search and filters (type, specialization, property) that dim the
97
- diagram too.
98
- - An **analysis panel** for the selected element: which views it's on, and its incoming and outgoing relationships.
99
- - **Check model** finds relationships the rules don't allow, likely duplicates (by their words, so "System of
100
- Order Management" matches "order-management system"), unused elements and relationships, empty views, nested
101
- elements with no relationship, and unprintable characters. **Merge…** makes duplicates one element, keeping
102
- every relationship and appearance on a view.
103
- - **Derived relationships**, worked out and shown as dotted lines.
104
- - **Roadmaps**: generate a view of work packages, plateaus or anything with start and end dates, as bars under
105
- the months.
106
- - An **HTML report** in one self-contained file: a tree, search, a page per element, relationship and view, and
107
- diagrams whose elements link to their pages.
108
- - **Images**: export PNG or SVG, or copy to the clipboard: the whole drawing with a margin (or only what is in
109
- sight), at a scale you choose, from the File menu or a right-click; a setting shows where the picture will end.
110
-
111
- ### Beyond Archi
112
-
113
- It runs in the browser and embeds in other apps. It also has:
114
-
115
- - ArchiMate 4 types alongside 3.2;
116
- - derived relationships without scripts;
117
- - invalid relationships shown as you choose (highlight, tooltip or hidden), per view, per model or for the tool;
118
- - groups and locks on every view, not just canvases;
119
- - a canvas template library shared across models;
120
- - two drawing backends, SVG and Canvas.
121
-
122
- ---
123
-
124
- ## The data modeller
125
-
126
- One model at the conceptual, logical and physical levels, read by each stakeholder in their own terms, governed and
127
- checked the way DAMA-DMBOK2 has a model reviewed, and ready for banking at BIAN level. A model can be imported
128
- from pasted JSON, an assistant's answer included. It shares the modeller's
129
- workbench: several models open at once, undo for everything, files saved back where they came from, models kept in
130
- the browser and backed up.
131
-
132
- ![The data modeller: a retail bank's logical model through its Sensitive data lens, each entity coloured by how sensitive its data is](https://gitlab.com/peter.prib/renderengine/-/raw/master/docs/images/data-model.png)
133
-
134
- ### One model, three levels
135
-
136
- - **Concepts, logical entities and tables, each a schema of its own**, mapped any number either way: a concept
137
- realised by several entities, several entities kept in one table. The **mapping view** draws the three side by
138
- side, and **lineage** shows, for anything, what it realises and what realises it, all the way up and down.
139
- - **Perspectives and contexts**: each stakeholder's names for the concepts, and what they mean in a context, with
140
- its rules and where and when it applies, drawn as notes.
141
- - **Chen, Crow's Foot and UML**, switched with one choice; **subtypes** (complete or not, disjoint or overlapping);
142
- **data types and enumerations** defined once, code sets with their source and version, each linked to its
143
- **ISO 20022** type.
144
- - **Edit it on the diagram**: double-click an entity for its attribute table (keys, required, what a foreign key
145
- references, classification), right-click for new and delete. Every edit is one undo step.
146
-
147
- ### Banking at BIAN level
148
-
149
- - **Service domains** with their control records, behaviour qualifiers and the service operations BIAN names for
150
- them, and the **service landscape**: every service domain in its business area and domain.
151
- - **Read BIAN's own published material instead of retyping it.** A BIAN semantic API (all 258 of release 14 read,
152
- plain or with ISO 20022) becomes a control record, its qualifiers, their data types and ISO 20022 types in one
153
- step. BIAN's service landscape in ArchiMate becomes service domains in their areas and domains: run over BIAN's
154
- v14 model, every one it places lands in the right place.
155
- - BIAN's vocabulary, its functional patterns, artifacts, action terms and qualifier types, is as BIAN's v14 model
156
- has it.
157
-
158
- ### Governed and checked (DAMA-DMBOK2)
159
-
160
- - **Stewardship**: a business owner, data steward and technical custodian on each entity.
161
- - **Classification**: sensitivity levels and categories (PII, PCI...) on entities and attributes, **checked down
162
- the mappings**, so a table is never classified lower than the data it holds; a **lens** colours the model by it.
163
- - **Check model** reviews it as DMBOK2 would: missing keys, foreign keys without relationships, repeating groups,
164
- unresolved many-to-many, one name with two types, concepts without definitions, names against the **naming
165
- standard** you set, **data quality rules** by dimension (completeness, validity, uniqueness...), and BIAN's one
166
- owner per business object.
167
- - **The Data Model Scorecard**: Steve Hoberman's ten categories, six measured from the model and four for a
168
- reviewer, weighted as you choose, in one total.
169
-
170
- ### To the database and the warehouse
171
-
172
- - **SQL DDL**: the physical level as `CREATE TABLE`s with keys, foreign keys and comments.
173
- - **A dimensional scheme**: facts at their grain with additive, semi-additive or non-additive measures, dimensions
174
- with their history type and conformed across facts, a **star schema** view, and checks as Kimball would make
175
- them.
176
- - **Bases** to start a model from, and **compare and merge** between models.
177
-
178
- ---
179
-
180
- ## Requirements and story maps
181
-
182
- Bring in the epics and stories your team already has: a Jira, Azure DevOps or GitLab export (CSV or JSON), or a
183
- storyboard written in Markdown. Read as a **story map** (epics across, releases down) or a **backlog**, each story
184
- carries its "As a … I want … so that …", its acceptance criteria (read from their own field, a list in the
185
- description, or Given/When/Then) and its **traces** to what realises it: an ArchiMate requirement or work package,
186
- a component, a data concept, entity or table. Drag a card to another epic or release; the toolbar says how many
187
- stories say when they are done and how many trace to something, and **Check model** lists what is missing.
188
-
189
- - **Every model alike**: kept, compared and merged as the ArchiMate and data models are, a newer tracker export
190
- brought in over the old one replacing what changed.
191
- - **Yours to extend**: a host says what can be traced to, what a story's live state is, and how to find stories by
192
- meaning (a vector store) — the SqlEngine workbench does all three.
193
-
194
- ## The diagram editor
195
-
196
- The ArchiMate modeller is built on a general diagram editor, and every editing feature above is part of that
197
- editor rather than of ArchiMate: align, format painter, properties of several shapes, find and replace, copy and
198
- paste, groups and locks, undo, HTML report, image export, several models at once. The diagram editor gives you all
199
- of them for its own palettes:
200
-
201
- - basic shapes
202
- - flowchart and BPMN
203
- - swimlanes
204
- - UML: class, sequence, activity, state machine, use case, component, deployment
205
- - entity-relationship
206
- - data flow
207
- - network
208
- - org chart
209
-
210
- Each model can hold several diagrams, with line styles inherited from the diagram, then the model, then the tool.
211
-
212
- ![The diagram editor: an order flowchart with a decision, labelled lines and the flowchart palette](https://gitlab.com/peter.prib/renderengine/-/raw/master/docs/images/diagram-editor.png)
213
-
214
- ## The chart library
215
-
216
- The engine underneath draws 24 chart types: bar, line, area, pie, scatter, bubble, heatmap, candlestick,
217
- waterfall, histogram, box plot, violin, radar, funnel, treemap, sunburst, gauges (dial, arc, ring, rings, bar, bullet, thermometer, KPI tiles; with bands, targets, LED segments and animation), 3D bars and others. It also
218
- draws graph and railroad diagrams, all to SVG or Canvas. `test/charts.html` is the full gallery, and
219
- `examples/csv-chart-builder.html` builds a chart from a CSV file without code.
220
-
221
- ![Gauges: a dial with bands, ticks and a target; arc, ring and nested rings; a two-needle dial; LED segments; a thermometer; KPI tiles with sparklines](https://gitlab.com/peter.prib/renderengine/-/raw/master/docs/images/gauges.png)
222
-
223
- ![Charts from the gallery: bar, grouped bar, line and line with error bars](https://gitlab.com/peter.prib/renderengine/-/raw/master/docs/images/charts.png)
224
-
225
- ---
226
-
227
- ## Put it in your own page
228
-
229
- ```bash
230
- npm install @peter.prib/renderengine
231
- ```
232
-
233
- The package is the ES module source and the built bundles:
234
-
235
- - `import { ArchimateModel, RenderEngine } from '@peter.prib/renderengine'`: the engine and the models (this also
236
- imports under Node).
237
- - `import '@peter.prib/renderengine/workspace'`: the workbench shell and its parts (browser only).
238
- - `@peter.prib/renderengine/dist/renderengine-workspace.umd.js`: the same as one classic script.
239
-
240
- The modeller is a part in the `<ws-workspace>` workbench shell. One script tag and a JSON spec is the whole host
241
- page:
242
-
243
- ```html
244
- <script src="dist/renderengine-workspace.umd.js"></script>
245
- <script>
246
- const { el, registerBuiltinParts, ArchimateCanvasPart } = RenderEngineWorkspace;
247
- const ws = document.body.appendChild(el({ tag: 'ws-workspace', attrs: { label: 'Modeller' } }));
248
- registerBuiltinParts(ws);
249
- ws.registerPart(ArchimateCanvasPart);
250
- ws.addParts([{
251
- id: 'models', type: 'models', editorType: 'archimate-canvas', // several models, a tab each
252
- models: [{
253
- id: 'shop', name: 'Shop',
254
- elements: [{ id: 'c', name: 'Customer', type: 'business-actor' }, { id: 'o', name: 'Order', type: 'business-process' }],
255
- relationships: [{ source: 'c', target: 'o', kind: 'assignment' }],
256
- views: [{ id: 'v', name: 'Main', elementIds: ['c', 'o'], layout: { c: { x: 100, y: 100 }, o: { x: 320, y: 100 } } }],
257
- }],
258
- }]);
259
- ws.registerPerspective('Modelling', { type: 'part', partId: 'models' });
260
- ws.activatePerspective('Modelling');
261
- </script>
262
- ```
263
-
264
- Use `editorType: 'diagram-editor'` with `DiagramEditorPart` for the diagram editor, `editorType: 'data-model'`
265
- with `DataModelPart` for the data modeller, and `editorType: 'requirements'` with `RequirementsPart` for the story
266
- map. The models are plain JavaScript APIs (`ArchimateModel`, `DiagramModel`, `DataModel`, `RequirementsModel`), so
267
- you can also build, check, score, search, report on and export models with no UI at all, under Node too:
268
- `new DataModel(spec).checker().run()`, `new SqlDdl().write(model)`,
269
- `new RequirementsModel(new TrackerExport().read(csv)).coverage()`.
270
-
271
- ---
272
-
273
- ## Documentation
274
-
275
- | Document | What it covers |
276
- |---|---|
277
- | `documentation/REFERENCE.md` | The API: chart methods and options, the editors, models, commands, file formats |
278
- | `documentation/WORKSPACE_ARCHITECTURE.md` | The `<ws-workspace>` shell: parts, layout, context bus, work area |
279
- | `documentation/ARCHITECTURE.md` | Module layout and the chart-type catalog |
280
- | `documentation/LLM_ARCHIMATE_GUIDE.md` | Generating valid ArchiMate model data, with a prompt template |
281
- | `documentation/tasks.md` | What's still to come |
282
-
283
- ## Build and test
284
-
285
- ```bash
286
- npm install # dev tools only: Rollup
287
- npm run build # dist/renderengine.umd.js and dist/renderengine-workspace.umd.js
288
- npm test # Node's built-in test runner, no browser needed
289
- npm run screenshots # this README's pictures, from the example pages (headless Chrome)
290
- ```
291
-
292
- There are two bundles:
293
-
294
- - `renderengine.umd.js` (global `RenderEngine`): the engine.
295
- - `renderengine-workspace.umd.js` (global `RenderEngineWorkspace`): the workbench shell and its parts, plus the
296
- whole engine API, so one script tag is enough.
297
-
298
- The source is plain ES modules. `src/index.js` imports under Node, which is how the tests run.
299
-
300
- ## Licence
301
-
302
- MIT. Contributions welcome.
1
+ # RenderEngine
2
+
3
+ **An ArchiMate modeller, a data modeller, a requirements story map, a diagram editor, an OLAP cube & predictive query studio, and a 50+ type chart library that run in any browser tab, with no install and no runtime dependencies.**
4
+
5
+ Open an Archi model, edit it the way you would in Archi, and save it back to the same `.archimate` file, without
6
+ installing anything. Model data at three levels, governed and checked the way DAMA-DMBOK2 has it, with banking at
7
+ BIAN level built in. Slice, drill and chart multi-dimensional OLAP cubes across 35+ linked chart types with live
8
+ statistical aggregations, derived formula measures and predictive natural-language querying. Or put the same editors
9
+ and charts in your own app: it's a JavaScript library and a set of workbench parts, not a desktop application.
10
+
11
+ ![The ArchiMate modeller: a layered view of an online shop, the model tree by layer with each type's picture, and the palette](https://gitlab.com/peter.prib/renderengine/-/raw/master/docs/images/archimate-modeller.png)
12
+
13
+ ---
14
+
15
+ ## Try it
16
+
17
+ ```bash
18
+ git clone https://gitlab.com/peter.prib/renderengine.git
19
+ cd renderengine
20
+ npm start # the ArchiMate modeller
21
+ npm run diagram # the diagram editor (flowcharts, UML and more)
22
+ npm run datamodel # the data modeller: an enterprise ontology and a retail bank at BIAN level
23
+ ```
24
+
25
+ No server is needed, and nothing needs installing first, because the built bundles are in `dist/`. You can also
26
+ open the pages directly:
27
+
28
+ - `examples/archimate.html`: the ArchiMate modeller
29
+ - `examples/diagram-editor.html`: the diagram editor
30
+ - `examples/data-model.html`: the data modeller
31
+ - `test/charts.html`: the full interactive chart, diagram and OLAP cubing gallery
32
+
33
+ The models they open come from [modelengine](https://gitlab.com/peter.prib/modelengine), kept apart from the tools: with
34
+ it checked out beside renderengine, the pages open on its models (File ▸ Open from ▸ modelengine lists them by domain);
35
+ without it they start empty.
36
+
37
+ All work in current Chrome, Edge, Firefox and Safari. Save writes back to the file you opened in Chrome and Edge;
38
+ other browsers download the file instead.
39
+
40
+ ---
41
+
42
+ ## The ArchiMate modeller
43
+
44
+ ### Works with Archi
45
+
46
+ - **Open and save Archi files** (`.archimate`, and archives that include pictures). Save writes back to the file you
47
+ opened; Save As picks a new one. Unsaved changes are marked (•), and the page asks before you leave or close them.
48
+ - **Kept in the browser, backed up to the cloud.** Every model is kept in the browser as you edit it, and those open
49
+ reopen next time, with no file saved. File ▸ This browser backs them all up to a folder you choose once: pick one
50
+ that OneDrive, Google Drive or Dropbox syncs and the backups reach the cloud (each named with the date and time,
51
+ plus one under its plain name); browsers that cannot write to a folder download them instead.
52
+ - **Import a spreadsheet** into the open model: choose the name, type, id, documentation, property and "related
53
+ to" columns; existing elements are updated, not duplicated (Archi's elements.csv imports as it is).
54
+ - **draw.io export**: every view a page, in draw.io's ArchiMate shapes, with the elements' properties.
55
+ - **Open Group Exchange Format** import and export, the standard way into Sparx, BiZZdesign and other tools.
56
+ Checked with Archi 5.8, which validates and opens the files.
57
+ - **Every element Archi receives is a valid ArchiMate 3.2 class.** A type Archi lacks is written as its nearest
58
+ 3.2 type, and its own type is kept so it comes back on the next import.
59
+ - **Canvases, sketches, notes, groups and Archi's canvas templates** come through import and export.
60
+
61
+ ### Modelling
62
+
63
+ - A **palette** of every element type, grouped by layer and limited by the view's viewpoint.
64
+ - **Connecting two elements offers only the relationship kinds the ArchiMate rules allow** between them.
65
+ - **Nesting**: drop an element inside another and choose what the nesting stands for (composition, aggregation,
66
+ assignment, realization or specialization). It goes into the model, and the nesting shows it.
67
+ - **Add from text**: paste a list of names, from a document or a spreadsheet's columns, and get an element for
68
+ each.
69
+ - **Copy and paste** within a model and between models, **Duplicate**, and **Generate View For** an element and
70
+ what it relates to.
71
+ - **Delete from model**, from the tree or a diagram, after a dialog listing the views it is on and the
72
+ relationships that go with it; one undo puts it all back.
73
+ - **Several models open at once**, a tab each. Each has its own file and its own undo history.
74
+ - **Undo for everything**, one history per model as in Archi: edits on any view, and adding, renaming and deleting
75
+ views. Undoing an edit made on another view takes you to that view.
76
+ - **Specializations**, custom viewpoints, label expressions (`${name}` and `{name}`), and properties with types.
77
+
78
+ ### Editing
79
+
80
+ - **Align, distribute and match size**, to the shape you selected last, as in Archi; **automatic layouts** (grid,
81
+ circle, tree, force-directed, by layer) and **Nest its parts inside**, following composition and aggregation.
82
+ - **Properties of several shapes at once**: colours and text style, the elements' type and specialization, and a
83
+ property to set on all of them.
84
+ - **Format painter**: copy one shape's look onto others.
85
+ - **Colour by** layer, type, specialization or any property (a heat map, e.g. by lifecycle: invest, maintain,
86
+ retire), by a formula over properties (`Cost * Risk_score`), or by the change work packages and deliverables make
87
+ (create, update, delete, boxes and lines), with a legend boxed round its entries; or a legend of the element types
88
+ on the view.
89
+ - **Find and replace** across names, documentation and property values, with match case, whole words and
90
+ regular expressions; **transform names** (Title Case, split camelCase, ...) and **rename a property** across the
91
+ model; **fit a shape to its text**.
92
+ - **Groups and locks on any view**, multi-select, a marquee, Archi's tabbed groups, bendpoints, pinned line ends,
93
+ and orthogonal, curved or straight routing. Lines take the shortest way between shapes, as in Archi.
94
+
95
+ ### Understanding and sharing a model
96
+
97
+ - A **model tree** by layer, by type or flat, each element with its type's picture, with search and filters (type, specialization, property) that dim the
98
+ diagram too.
99
+ - An **analysis panel** for the selected element: which views it's on, and its incoming and outgoing relationships.
100
+ - **Check model** finds relationships the rules don't allow, likely duplicates (by their words, so "System of
101
+ Order Management" matches "order-management system"), unused elements and relationships, empty views, nested
102
+ elements with no relationship, and unprintable characters. **Merge…** makes duplicates one element, keeping
103
+ every relationship and appearance on a view.
104
+ - **Derived relationships**, worked out and shown as dotted lines.
105
+ - **Roadmaps**: generate a view of work packages, plateaus or anything with start and end dates, as bars under
106
+ the months.
107
+ - An **HTML report** in one self-contained file: a tree, search, a page per element, relationship and view, and
108
+ diagrams whose elements link to their pages.
109
+ - **Images**: export PNG or SVG, or copy to the clipboard: the whole drawing with a margin (or only what is in
110
+ sight), at a scale you choose, from the File menu or a right-click; a setting shows where the picture will end.
111
+
112
+ ### Beyond Archi
113
+
114
+ It runs in the browser and embeds in other apps. It also has:
115
+
116
+ - ArchiMate 4 types alongside 3.2;
117
+ - derived relationships without scripts;
118
+ - invalid relationships shown as you choose (highlight, tooltip or hidden), per view, per model or for the tool;
119
+ - groups and locks on every view, not just canvases;
120
+ - a canvas template library shared across models;
121
+ - two drawing backends, SVG and Canvas.
122
+
123
+ ---
124
+
125
+ ## The data modeller
126
+
127
+ One model at the conceptual, logical and physical levels, read by each stakeholder in their own terms, governed and
128
+ checked the way DAMA-DMBOK2 has a model reviewed, and ready for banking at BIAN level. A model can be imported
129
+ from pasted JSON, an assistant's answer included. It shares the modeller's
130
+ workbench: several models open at once, undo for everything, files saved back where they came from, models kept in
131
+ the browser and backed up.
132
+
133
+ ![The data modeller: a retail bank's logical model through its Sensitive data lens, each entity coloured by how sensitive its data is](https://gitlab.com/peter.prib/renderengine/-/raw/master/docs/images/data-model.png)
134
+
135
+ ### One model, three levels
136
+
137
+ - **Concepts, logical entities and tables, each a schema of its own**, mapped any number either way: a concept
138
+ realised by several entities, several entities kept in one table. The **mapping view** draws the three side by
139
+ side, and **lineage** shows, for anything, what it realises and what realises it, all the way up and down.
140
+ - **Perspectives and contexts**: each stakeholder's names for the concepts, and what they mean in a context, with
141
+ its rules and where and when it applies, drawn as notes.
142
+ - **Chen, Crow's Foot and UML**, switched with one choice; **subtypes** (complete or not, disjoint or overlapping);
143
+ **data types and enumerations** defined once, code sets with their source and version, each linked to its
144
+ **ISO 20022** type.
145
+ - **Edit it on the diagram**: double-click an entity for its attribute table (keys, required, what a foreign key
146
+ references, classification), right-click for new and delete. Every edit is one undo step.
147
+
148
+ ### Banking at BIAN level
149
+
150
+ - **Service domains** with their control records, behaviour qualifiers and the service operations BIAN names for
151
+ them, and the **service landscape**: every service domain in its business area and domain.
152
+ - **Read BIAN's own published material instead of retyping it.** A BIAN semantic API (all 258 of release 14 read,
153
+ plain or with ISO 20022) becomes a control record, its qualifiers, their data types and ISO 20022 types in one
154
+ step. BIAN's service landscape in ArchiMate becomes service domains in their areas and domains: run over BIAN's
155
+ v14 model, every one it places lands in the right place.
156
+ - BIAN's vocabulary, its functional patterns, artifacts, action terms and qualifier types, is as BIAN's v14 model
157
+ has it.
158
+
159
+ ### Governed and checked (DAMA-DMBOK2)
160
+
161
+ - **Stewardship**: a business owner, data steward and technical custodian on each entity.
162
+ - **Classification**: sensitivity levels and categories (PII, PCI...) on entities and attributes, **checked down
163
+ the mappings**, so a table is never classified lower than the data it holds; a **lens** colours the model by it.
164
+ - **Check model** reviews it as DMBOK2 would: missing keys, foreign keys without relationships, repeating groups,
165
+ unresolved many-to-many, one name with two types, concepts without definitions, names against the **naming
166
+ standard** you set, **data quality rules** by dimension (completeness, validity, uniqueness...), and BIAN's one
167
+ owner per business object.
168
+ - **The Data Model Scorecard**: Steve Hoberman's ten categories, six measured from the model and four for a
169
+ reviewer, weighted as you choose, in one total.
170
+
171
+ ### To the database and the warehouse
172
+
173
+ - **SQL DDL**: the physical level as `CREATE TABLE`s with keys, foreign keys and comments.
174
+ - **A dimensional scheme**: facts at their grain with additive, semi-additive or non-additive measures, dimensions
175
+ with their history type and conformed across facts, a **star schema** view, and checks as Kimball would make
176
+ them.
177
+ - **Bases** to start a model from, and **compare and merge** between models.
178
+
179
+ ---
180
+
181
+ ## Requirements and story maps
182
+
183
+ Bring in the epics and stories your team already has: a Jira, Azure DevOps or GitLab export (CSV or JSON), or a
184
+ storyboard written in Markdown. Read as a **story map** (epics across, releases down) or a **backlog**, each story
185
+ carries its "As a … I want … so that …", its acceptance criteria (read from their own field, a list in the
186
+ description, or Given/When/Then) and its **traces** to what realises it: an ArchiMate requirement or work package,
187
+ a component, a data concept, entity or table. Drag a card to another epic or release; the toolbar says how many
188
+ stories say when they are done and how many trace to something, and **Check model** lists what is missing.
189
+
190
+ - **Every model alike**: kept, compared and merged as the ArchiMate and data models are, a newer tracker export
191
+ brought in over the old one replacing what changed.
192
+ - **Yours to extend**: a host says what can be traced to, what a story's live state is, and how to find stories by
193
+ meaning (a vector store) — the SqlEngine workbench does all three.
194
+
195
+ ---
196
+
197
+ ## The diagram editor
198
+
199
+ The ArchiMate modeller is built on a general diagram editor, and every editing feature above is part of that
200
+ editor rather than of ArchiMate: align, format painter, properties of several shapes, find and replace, copy and
201
+ paste, groups and locks, undo, HTML report, image export, several models at once. The diagram editor gives you all
202
+ of them for its own palettes:
203
+
204
+ - basic shapes
205
+ - flowchart and BPMN
206
+ - swimlanes
207
+ - UML: class, sequence, activity, state machine, use case, component, deployment
208
+ - entity-relationship
209
+ - data flow
210
+ - network
211
+ - org chart
212
+
213
+ Each model can hold several diagrams, with line styles inherited from the diagram, then the model, then the tool.
214
+
215
+ ![The diagram editor: an order flowchart with a decision, labelled lines and the flowchart palette](https://gitlab.com/peter.prib/renderengine/-/raw/master/docs/images/diagram-editor.png)
216
+
217
+ ---
218
+
219
+ ## OLAP cubing, linked pivot charts and predictive Ask
220
+
221
+ Turn any rolled-up query result (`GROUP BY ROLLUP`, `semanticengine`, or in-memory facts) into an interactive
222
+ multi-dimensional cube grid (`pivotView`), a synchronized chart (`pivotChart`) that follows every slice and drill,
223
+ and a natural-language query bar (`askBar`) with configurable next-word prediction.
224
+
225
+ ### The cube grid (`pivotView` / `PivotView`)
226
+
227
+ - **Interactive layout chips (PresentBlox)**: move dimensions between rows, columns, and page filters, reorder
228
+ hierarchy levels outward or inward, or keep/exclude individual dimension members.
229
+ - **Expand, collapse and drill**: collapse any member onto its rolled-up subtotal (`▾` / `▸`), expand to a chosen
230
+ hierarchy depth (`expandToLevel`), drill down/up along a dimension hierarchy (`onDrill`), or **drill through** any
231
+ cell to inspect the underlying fact rows (`onDrillThrough`).
232
+ - **7 summary & statistical aggregations**: switch cell and subtotal calculations on the fly between **Sum**,
233
+ **Count**, **Average**, **Median**, **Minimum**, **Maximum**, and **Std Dev** (`setAggregation`), computed over raw
234
+ underlying facts (`options.facts`) or descendant leaf cells.
235
+ - **Post-rollup derived formula measures**: define calculated measures such as `Margin = Revenue - Cost` or
236
+ `MarginPct = Revenue > 0 ? Margin / Revenue * 100 : 0` (`derivedMeasures`, `addDerivedMeasure`). Formulas are
237
+ compiled once via `compileFormula` and evaluated *after* rollup so ratios and percentages are always accurate on
238
+ subtotals and grand totals.
239
+ - **Ranking, sorting and % of total**: hierarchical sibling sorting (`sortRowsBy`), **Top-N / Bottom-N** filtering
240
+ within each parent group (`setTopN`), multi-measure visibility toggles (`toggleMeasure`), percentage-of-total
241
+ display modes (`% of row total`, `% of column total`, `% of grand total`), traffic-light conditional formatting
242
+ (custom rules or automatic tertiles), and serializable saved views (`displayState` / `restoreDisplay`).
243
+
244
+ ### Linked pivot chart (`pivotChart` / `PivotChart`)
245
+
246
+ - **Follows the cube automatically**: charts the finest visible members on both axes without double-counting totals,
247
+ and redraws whenever the cube is pivoted, collapsed, sorted, filtered, or switched to a different aggregation.
248
+ - **35+ cube chart types, switchable in one click**: switch live between **Line**, **Grouped Bar**, **Stacked Bar**,
249
+ **Bar**, **Area**, **Stacked Area**, **Stream Graph**, **Pareto (80/20)**, **Waterfall**, **Marimekko / Mekko Mosaic**,
250
+ **Lollipop**, **Pipe**, **Heatmap**, **Radar / Spider**, **Parallel Coordinates**, **Population Pyramid**,
251
+ **Sankey**, **Chord**, **Treemap**, **Sunburst**, **Icicle**, **Outline**, **Pie**, **Donut**, **Funnel**,
252
+ **Radial Bar**, **Word Cloud**, **Box Plot**, **Density**, **Violin**, **Histogram**, **Q-Q Plot**, **Lag Plot**,
253
+ **Scatter**, **Bubble**, **3D Bar**, **3D Orbit Bar**, and **3D Orbit Stacked Bar** (`pivotChartLink.setType(key)`
254
+ or via the in-chart `▾` menu).
255
+ - **Click any chart mark to drill the cube**: clicking a bar, line vertex, slice, treemap/icicle cell, Sankey node,
256
+ or scatter point expands a collapsed member or drills the cube down to the next hierarchy level on either axis.
257
+
258
+ ### Predictive natural-language query bar (`askBar` / `AskView`)
259
+
260
+ - **Scrollable next-word prediction**: predicts the next keyword, measure, dimension, operator, or member value as
261
+ you type, with semantic badges (`sense`, `reference`, `relation`, `kind`) and full keyboard navigation (`↑`/`↓`,
262
+ `Tab`/`Enter` to accept, `Escape` to dismiss).
263
+ - **User-configurable viewport**: built-in `Predict next word` selector lets users choose how many predicted items
264
+ are visible at once in the scrollable list (`Off`, `3`, `5`, `8`, `10`, or custom `predictChoices`).
265
+ - **Pluggable intelligence**: pass declarative `measures`, `dimensions`, `members` and `sampleQuestions` for the
266
+ built-in grammar/bigram predictor, or wire `suggest: (text) => semanticEngine.suggest(text)` to connect directly
267
+ to `semanticengine`.
268
+
269
+ ```javascript
270
+ import { RenderEngine } from '@peter.prib/renderengine';
271
+
272
+ // 1. Render an interactive OLAP cube with derived formulas and statistical aggregations
273
+ const gridEngine = new RenderEngine('#pivot-grid', { rendererType: 'svg' });
274
+ const cube = gridEngine.pivotView(rolledUpRows, {
275
+ title: 'Revenue & Margin Cube',
276
+ rowAxis: ['Year', 'Quarter'],
277
+ columnAxis: ['Region'],
278
+ facts: rawFactRows, // enables exact Count, Avg, Median, Min, Max, Std Dev
279
+ measures: ['Revenue', 'Cost'],
280
+ derivedMeasures: [
281
+ { name: 'Margin', formula: 'Revenue - Cost' },
282
+ { name: 'MarginPct', formula: 'Revenue > 0 ? Margin / Revenue * 100 : 0' },
283
+ ],
284
+ columns: [
285
+ { name: 'Year', kind: 'time' },
286
+ { name: 'Quarter', kind: 'time' },
287
+ { name: 'Region', kind: 'categorical' },
288
+ { name: 'Revenue', kind: 'numeric', measure: 'additive' },
289
+ { name: 'Cost', kind: 'numeric', measure: 'additive' },
290
+ { name: '_rollup', kind: 'rollup', dimensions: ['Year', 'Quarter', 'Region'] },
291
+ ],
292
+ });
293
+
294
+ // Switch aggregations, Top-N ranking, or % of total programmatically (or from the ⋮ menu):
295
+ cube.setAggregation('median'); // 'sum' | 'count' | 'avg' | 'median' | 'min' | 'max' | 'stddev'
296
+ cube.setTopN(5, { measure: 'Margin', direction: 'desc' });
297
+ cube.setValueMode('rowPercent'); // 'value' | 'rowPercent' | 'columnPercent' | 'totalPercent'
298
+
299
+ // 2. Link a Pivot Chart that follows the cube and drills on click across 35+ chart types
300
+ const chartEngine = new RenderEngine('#pivot-chart', { rendererType: 'svg' });
301
+ const pivotChart = chartEngine.pivotChart(cube, { type: 'stackedBar' });
302
+ pivotChart.setType('marimekko'); // switch to 'line', 'pareto', 'icicle', 'sankey', 'radar', ...
303
+
304
+ // 3. Mount a Predictive Ask Bar with configurable next-word prediction in a scrollable list
305
+ const askEngine = new RenderEngine('#ask-results', { rendererType: 'svg' });
306
+ askEngine.askBar('#ask-bar', {
307
+ value: 'Average Revenue by Quarter and Region',
308
+ measures: ['Revenue', 'Cost', 'Margin', 'MarginPct'],
309
+ dimensions: ['Region', 'Year', 'Quarter', 'Month'],
310
+ members: (dim) => [...new Set(rawFactRows.map(r => r[dim]))],
311
+ visibleCount: 5,
312
+ predictChoices: [0, 3, 5, 8, 10], // 0 = Off, or N visible items in scrollable list
313
+ onAsk: (question) => { /* update cube & resultView */ },
314
+ });
315
+ ```
316
+
317
+ ---
318
+
319
+ ## The chart library (50+ chart & diagram types)
320
+
321
+ The engine underneath draws **over 50 chart and diagram types** to interchangeable **SVG** or **Canvas** backends,
322
+ all driven by a single declarative catalog (`CHART_CATALOG`):
323
+
324
+ - **Categorical & comparison**: `barChart`, `groupedBarChart`, `stackedBarChart` (standard and **100% normalized**
325
+ `normalize: true`; vertical and horizontal `orientation: 'horizontal'`), `comboChart` (multi-type bar + line/area with dual/secondary Y-axes),
326
+ `dumbbellChart` (before/after gap change with directional delta indicators), `slopegraph` (multi-stage
327
+ trajectory lines with direct collision-resolved labels), `lollipopChart` (single and multi-series dot-and-stem),
328
+ `marimekkoChart` (variable-width 2D mosaic), `paretoChart` (descending bars + cumulative 0–100% curve + 80% threshold line),
329
+ `waterfallChart`, `funnelChart`, `populationPyramid`, `radialBarChart`, `polarAreaChart` (2D & 3D Nightingale Rose / Coxcomb
330
+ with exploded wedges and hover pull-out), `wordCloud`.
331
+ - **Time-series & trend**: `lineChart` (with step modes `'before'|'after'|'center'`, dual Y-axes, direct data labels `showValues`, error bars and multi-series),
332
+ `areaChart` (standard, step, stacked, and **100% normalized** `normalize: true`), `stackedAreaChart`, `streamGraph`, `horizonChart`
333
+ (multi-band folded density for vertical strip comparison), `pipeChart` (variable-width flow), `candlestick` (OHLC with event markers),
334
+ `ohlcChart` (equity price bars with bullish/bearish color encoding), `ganttChart`, `calendarHeatmap`.
335
+ - **Hierarchical & part-of-whole**: `pieChart` and `donutChart` (with exploded slices, smooth hover slice pull-out,
336
+ callout leader lines, `"Other"` roll-up, and center KPI totals), `pieChart3D` and `donutChart3D` (extruded 3D
337
+ tilted wedges and rings with cylinder skirts, radial cut walls, exploded slices, and interactive hover pull-out),
338
+ `circlePackChart` (nested tangent circles with translucent branch containment and hover elevation),
339
+ `treemapChart`, `sunburstChart` (with radial hover arc pull-out), `icicleChart` (top-down rectangular partition),
340
+ `outlineChart` (collapsible indented tree with inline proportion bars).
341
+ - **Statistical & distribution**: `hexbinChart` (2D hexagonal binning density plot for dense observation clouds),
342
+ `ecdfChart` (empirical cumulative step distribution with Kolmogorov–Smirnov distance test),
343
+ `scatterMatrix` (SPLOM pairwise scatter matrix with diagonal distribution histograms),
344
+ `ridgelineChart` (vertically staggered, partially overlapping Joy plot KDE curves),
345
+ `beeswarmChart` (deterministic force-packed observation points; optional Raincloud mode pairing half-KDE cloud,
346
+ mini-box, and packed dots), `histogram`, `boxPlot` (vertical and horizontal), `densityChart` (kernel density estimation),
347
+ `violinChart` (vertical and horizontal), `qqPlot` (normal quantile-quantile), `lagPlot` (lag-1 autocorrelation),
348
+ `scatterChart` (with 2D error bars and reference lines), `bubbleChart`.
349
+ - **Multivariate, matrix & network flow**: `alluvialDiagram` (multi-stage categorical flow ribbons across arbitrary stages),
350
+ `heatmap` (correlation and matrix grids), `radarChart` (spider), `parallelCoordinates`, `sankeyDiagram`
351
+ (with interactive connected-flow hover highlighting), `chordDiagram` (with radial arc pull-out and connected-chord illumination),
352
+ `geoMap` (choropleth polygons + city bubbles).
353
+ - **3D & orbit camera**: `pieChart3D`, `donutChart3D`, `polarAreaChart` (`extrude3D: true`), `barChart3D`,
354
+ `bubbleChart3D`, `lineChart3D`, and true 4×4 matrix perspective orbit charts (`scatter3DOrbit`, `barChart3DOrbit`,
355
+ `stackedBarChart3DOrbit` with 100% normalized mode, `surfaceChart3D` continuous 3D surface mesh, `graphDiagram3D`).
356
+ - **Gauges & KPIs**: `sparklineTable` (executive KPI table with inline trend sparklines), `dialGauge` (bands, ticks, multi-needle, targets),
357
+ `arcGauge`, `ringGauge`, `ringsGauge`, `barGauge`, `bulletChart`, `thermometerGauge`, `ledGauge`, `kpiTile` (with sparklines and delta badges).
358
+ - **Interactive tables & diagrams**: `tableChart`, `resultView` (sortable, filterable, pageable table that switches
359
+ into any fitting chart via `ChartChooser`), `pivotView`, `pivotChart`, `graphDiagram` (force-directed, hierarchical
360
+ Dewey keys, table nodes, orthogonal/polyline obstacle-avoiding routing, manual bendpoints), `archimateDiagram`,
361
+ `dataModelDiagram`, `railroadDiagram`, `ebnfDiagram`.
362
+
363
+ `test/charts.html` is the full interactive workspace gallery (including the dedicated **Cubing** perspective,
364
+ nested perspective sub-menus with instant search filtering & smooth card jumping, and a **`</> JS`** button on
365
+ every card to view and 1-click copy the generating JavaScript), and `examples/csv-chart-builder.html` builds charts
366
+ from a CSV file without code.
367
+
368
+ ```javascript
369
+ const engine = new RenderEngine('#chart', { rendererType: 'svg' });
370
+
371
+ // 80/20 Pareto Chart with cumulative percentage curve and 80% reference line
372
+ engine.paretoChart([
373
+ { label: 'Timeout', value: 142 },
374
+ { label: 'Auth Expired', value: 88 },
375
+ { label: 'Rate Limit', value: 54 },
376
+ { label: 'Schema Mismatch', value: 26 },
377
+ ], { title: 'Incident Root Causes', cutoffPercent: 80 });
378
+
379
+ // 100% Normalized Stacked Bar Chart
380
+ engine.stackedBarChart([
381
+ { label: 'Q1', values: [180, 90, 50] },
382
+ { label: 'Q2', values: [210, 110, 60] },
383
+ ], { title: 'Segment Share by Quarter', normalize: true, seriesLabels: ['Enterprise', 'Mid-Market', 'SMB'], legend: true });
384
+
385
+ // Marimekko (Mekko Mosaic), Lollipop, and Icicle Partition Charts
386
+ engine.marimekkoChart(seriesData, { title: 'Market Share by Region & Segment' });
387
+ engine.lollipopChart(seriesData, { title: 'Regional Revenue Comparison', legend: true });
388
+ engine.icicleChart(hierarchyTree, { title: 'Disk Usage by Category' });
389
+
390
+ // 3D Pie & 3D Donut with pre-exploded slice and smooth hover pull-out
391
+ engine.pieChart3D(sectorData, {
392
+ title: '3D Sector Exposure',
393
+ exploded: 'max', // pre-explode largest slice (or pass index, label, array, or predicate)
394
+ hoverExplode: true, // smoothly slides any slice out along its radial angle on hover
395
+ showLabels: 'percent',
396
+ });
397
+ ```
398
+
399
+ ![Gauges: a dial with bands, ticks and a target; arc, ring and nested rings; a two-needle dial; LED segments; a thermometer; KPI tiles with sparklines](https://gitlab.com/peter.prib/renderengine/-/raw/master/docs/images/gauges.png)
400
+
401
+ ![Charts from the gallery: bar, grouped bar, line and line with error bars](https://gitlab.com/peter.prib/renderengine/-/raw/master/docs/images/charts.png)
402
+
403
+ ---
404
+
405
+ ## Put it in your own page
406
+
407
+ ```bash
408
+ npm install @peter.prib/renderengine
409
+ ```
410
+
411
+ The package is the ES module source and the built bundles:
412
+
413
+ - `import { ArchimateModel, RenderEngine } from '@peter.prib/renderengine'`: the engine and the models (this also
414
+ imports under Node).
415
+ - `import '@peter.prib/renderengine/workspace'`: the workbench shell and its parts (browser only).
416
+ - `@peter.prib/renderengine/dist/renderengine-workspace.umd.js`: the same as one classic script.
417
+
418
+ The modeller is a part in the `<ws-workspace>` workbench shell. One script tag and a JSON spec is the whole host
419
+ page:
420
+
421
+ ```html
422
+ <script src="dist/renderengine-workspace.umd.js"></script>
423
+ <script>
424
+ const { el, registerBuiltinParts, ArchimateCanvasPart } = RenderEngineWorkspace;
425
+ const ws = document.body.appendChild(el({ tag: 'ws-workspace', attrs: { label: 'Modeller' } }));
426
+ registerBuiltinParts(ws);
427
+ ws.registerPart(ArchimateCanvasPart);
428
+ ws.addParts([{
429
+ id: 'models', type: 'models', editorType: 'archimate-canvas', // several models, a tab each
430
+ models: [{
431
+ id: 'shop', name: 'Shop',
432
+ elements: [{ id: 'c', name: 'Customer', type: 'business-actor' }, { id: 'o', name: 'Order', type: 'business-process' }],
433
+ relationships: [{ source: 'c', target: 'o', kind: 'assignment' }],
434
+ views: [{ id: 'v', name: 'Main', elementIds: ['c', 'o'], layout: { c: { x: 100, y: 100 }, o: { x: 320, y: 100 } } }],
435
+ }],
436
+ }]);
437
+ ws.registerPerspective('Modelling', { type: 'part', partId: 'models' });
438
+ ws.activatePerspective('Modelling');
439
+ </script>
440
+ ```
441
+
442
+ Use `editorType: 'diagram-editor'` with `DiagramEditorPart` for the diagram editor, `editorType: 'data-model'`
443
+ with `DataModelPart` for the data modeller, and `editorType: 'requirements'` with `RequirementsPart` for the story
444
+ map. The models are plain JavaScript APIs (`ArchimateModel`, `DiagramModel`, `DataModel`, `RequirementsModel`), so
445
+ you can also build, check, score, search, report on and export models with no UI at all, under Node too:
446
+ `new DataModel(spec).checker().run()`, `new SqlDdl().write(model)`,
447
+ `new RequirementsModel(new TrackerExport().read(csv)).coverage()`.
448
+
449
+ ---
450
+
451
+ ## Documentation
452
+
453
+ | Document | What it covers |
454
+ |---|---|
455
+ | `documentation/REFERENCE.md` | The API: chart methods and options, the editors, models, commands, file formats |
456
+ | `documentation/WORKSPACE_ARCHITECTURE.md` | The `<ws-workspace>` shell: parts, layout, context bus, work area |
457
+ | `documentation/ARCHITECTURE.md` | Module layout and the chart-type catalog |
458
+ | `documentation/LLM_ARCHIMATE_GUIDE.md` | Generating valid ArchiMate model data, with a prompt template |
459
+ | `documentation/tasks.md` | What's still to come |
460
+
461
+ ## Build and test
462
+
463
+ ```bash
464
+ npm install # dev tools only: Rollup
465
+ npm run build # dist/renderengine.umd.js and dist/renderengine-workspace.umd.js
466
+ npm test # Node's built-in test runner, no browser needed
467
+ npm run screenshots # this README's pictures, from the example pages (headless Chrome)
468
+ ```
469
+
470
+ There are two bundles:
471
+
472
+ - `renderengine.umd.js` (global `RenderEngine`): the engine.
473
+ - `renderengine-workspace.umd.js` (global `RenderEngineWorkspace`): the workbench shell and its parts, plus the
474
+ whole engine API, so one script tag is enough.
475
+
476
+ The source is plain ES modules. `src/index.js` imports under Node, which is how the tests run.
477
+
478
+ ## Licence
479
+
480
+ MIT. Contributions welcome.