@peter.prib/renderengine 0.2.5 → 0.2.7

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 (67) hide show
  1. package/README.md +219 -213
  2. package/REFERENCE.md +272 -6
  3. package/dist/renderengine-workspace.umd.js +11980 -7421
  4. package/dist/renderengine.umd.js +8991 -5784
  5. package/examples/archimate.html +68 -66
  6. package/examples/data-model.html +534 -0
  7. package/package.json +70 -68
  8. package/src/bian.js +182 -0
  9. package/src/charting/CheckboxTreeSelector.js +373 -304
  10. package/src/charting/DiagramEditor.js +53 -32
  11. package/src/charting/DiagramTypeRegistry.js +13 -3
  12. package/src/charting/ModelCheckDialog.js +63 -0
  13. package/src/charting/ModelChecker.js +26 -0
  14. package/src/charting/ViewTabStrip.js +94 -81
  15. package/src/charting/archimate/ArchimateCanvasEditor.js +825 -815
  16. package/src/charting/archimate/ArchimateElementTemplate.js +208 -195
  17. package/src/charting/datamodel/BianLandscapeReader.js +185 -0
  18. package/src/charting/datamodel/BianSemanticApiReader.js +183 -0
  19. package/src/charting/datamodel/DataModel.js +645 -0
  20. package/src/charting/datamodel/DataModelChecker.js +92 -0
  21. package/src/charting/datamodel/DataModelCompared.js +127 -0
  22. package/src/charting/datamodel/DataModelContext.js +108 -0
  23. package/src/charting/datamodel/DataModelFileFormat.js +33 -0
  24. package/src/charting/datamodel/DataModelPerspective.js +129 -0
  25. package/src/charting/datamodel/DataType.js +108 -0
  26. package/src/charting/datamodel/EnumerationType.js +51 -0
  27. package/src/charting/datamodel/LevelMapping.js +38 -0
  28. package/src/charting/datamodel/LevelSchema.js +41 -0
  29. package/src/charting/datamodel/ServiceDomain.js +177 -0
  30. package/src/charting/datamodel/ServiceLandscape.js +104 -0
  31. package/src/charting/datamodel/StructuredType.js +63 -0
  32. package/src/charting/datamodel/index.js +15 -0
  33. package/src/charting/diagramModel/MergeModelCommand.js +43 -37
  34. package/src/charting/diagramModel/OpenViewList.js +75 -0
  35. package/src/charting/diagramModel/ViewSetChecker.js +22 -34
  36. package/src/charting/diagrams/DataModelDiagram.js +160 -86
  37. package/src/charting/diagrams/DataModelRelationshipStrategy.js +94 -38
  38. package/src/charting/diagrams/EdgeGeometry.js +578 -553
  39. package/src/charting/diagrams/GraphDiagram.js +11 -1
  40. package/src/charting/diagrams/NodeGeometry.js +169 -158
  41. package/src/charting/diagrams/nesting.js +31 -0
  42. package/src/charting/glyphs/PersonGlyph.js +24 -23
  43. package/src/charting/modelTree/ModelTree.js +202 -164
  44. package/src/charting/modelTree/ModelTreePanel.js +36 -3
  45. package/src/charting/modelTree/TreeViewMode.js +131 -110
  46. package/src/charting/modelTree/modes/FlatTreeMode.js +32 -46
  47. package/src/charting/modelTree/modes/LayerGroupedTreeMode.js +47 -62
  48. package/src/charting/modelTree/modes/TypeGroupedTreeMode.js +46 -60
  49. package/src/datamodel.js +132 -122
  50. package/src/diagramCatalog.js +35 -30
  51. package/src/index.js +2666 -2659
  52. package/src/workspace/EditorShell.js +166 -67
  53. package/src/workspace/PanelLayout.js +56 -0
  54. package/src/workspace/index.js +1 -0
  55. package/src/workspace/layout/TabsNode.js +205 -191
  56. package/src/workspace/parts/ArchimateCanvasPart.js +10 -9
  57. package/src/workspace/parts/ChartPart.js +6 -1
  58. package/src/workspace/parts/DataModelPart.js +544 -0
  59. package/src/workspace/parts/DiagramEditorPart.js +2 -8
  60. package/src/workspace/parts/EditorPart.js +461 -407
  61. package/src/workspace/parts/ModelFile.js +216 -187
  62. package/src/workspace/parts/ModelsPart.js +483 -192
  63. package/src/workspace/storage/BackupFolder.js +145 -0
  64. package/src/workspace/storage/KeyValueStore.js +92 -0
  65. package/src/workspace/storage/ModelLibrary.js +65 -0
  66. package/src/workspace/workArea.js +417 -413
  67. package/src/yaml/YamlReader.js +372 -0
package/README.md CHANGED
@@ -1,213 +1,219 @@
1
- # RenderEngine
2
-
3
- **An ArchiMate modeller, a diagram editor and a chart library that run in any browser tab, with no install and no
4
- 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. Or put the same editor in your own app: it's a JavaScript library and a set of workbench parts,
8
- not a desktop application.
9
-
10
- ![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)
11
-
12
- ---
13
-
14
- ## Try it
15
-
16
- ```bash
17
- git clone https://gitlab.com/peter.prib/renderengine.git
18
- cd renderengine
19
- npm start # the ArchiMate modeller
20
- npm run diagram # the diagram editor (flowcharts, UML and more)
21
- ```
22
-
23
- No server is needed, and nothing needs installing first, because the built bundles are in `dist/`. You can also
24
- open the pages directly:
25
-
26
- - `examples/archimate.html`: the ArchiMate modeller
27
- - `examples/diagram-editor.html`: the diagram editor
28
-
29
- Both work in current Chrome, Edge, Firefox and Safari. Save writes back to the file you opened in Chrome and Edge;
30
- other browsers download the file instead.
31
-
32
- ---
33
-
34
- ## The ArchiMate modeller
35
-
36
- ### Works with Archi
37
-
38
- - **Open and save Archi files** (`.archimate`, and archives that include pictures). Save writes back to the file you
39
- opened; Save As picks a new one. Unsaved changes are marked (•), and the page asks before you leave or close them.
40
- - **Import a spreadsheet** into the open model: choose the name, type, id, documentation, property and "related
41
- to" columns; existing elements are updated, not duplicated (Archi's elements.csv imports as it is).
42
- - **draw.io export**: every view a page, in draw.io's ArchiMate shapes, with the elements' properties.
43
- - **Open Group Exchange Format** import and export, the standard way into Sparx, BiZZdesign and other tools.
44
- Checked with Archi 5.8, which validates and opens the files.
45
- - **Every element Archi receives is a valid ArchiMate 3.2 class.** A type Archi lacks is written as its nearest
46
- 3.2 type, and its own type is kept so it comes back on the next import.
47
- - **Canvases, sketches, notes, groups and Archi's canvas templates** come through import and export.
48
-
49
- ### Modelling
50
-
51
- - A **palette** of every element type, grouped by layer and limited by the view's viewpoint.
52
- - **Connecting two elements offers only the relationship kinds the ArchiMate rules allow** between them.
53
- - **Nesting**: drop an element inside another and choose what the nesting stands for (composition, aggregation,
54
- assignment, realization or specialization). It goes into the model, and the nesting shows it.
55
- - **Add from text**: paste a list of names, from a document or a spreadsheet's columns, and get an element for
56
- each.
57
- - **Copy and paste** within a model and between models, **Duplicate**, and **Generate View For** an element and
58
- what it relates to.
59
- - **Several models open at once**, a tab each. Each has its own file and its own undo history.
60
- - **Undo for everything**, one history per model as in Archi: edits on any view, and adding, renaming and deleting
61
- views. Undoing an edit made on another view takes you to that view.
62
- - **Specializations**, custom viewpoints, label expressions (`${name}` and `{name}`), and properties with types.
63
-
64
- ### Editing
65
-
66
- - **Align, distribute and match size**, to the shape you selected last, as in Archi; **automatic layouts** (grid,
67
- circle, tree, force-directed, by layer) and **Nest its parts inside**, following composition and aggregation.
68
- - **Properties of several shapes at once**: colours and text style, the elements' type and specialization, and a
69
- property to set on all of them.
70
- - **Format painter**: copy one shape's look onto others.
71
- - **Colour by** layer, type, specialization or any property (a heat map, e.g. by lifecycle: invest, maintain,
72
- retire), with a legend; or a legend of the element types on the view.
73
- - **Find and replace** across names, documentation and property values, with match case, whole words and
74
- regular expressions; **transform names** (Title Case, split camelCase, ...) and **rename a property** across the
75
- model; **fit a shape to its text**.
76
- - **Groups and locks on any view**, multi-select, a marquee, Archi's tabbed groups, bendpoints, pinned line ends,
77
- and orthogonal, curved or straight routing.
78
-
79
- ### Understanding and sharing a model
80
-
81
- - 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
82
- diagram too.
83
- - An **analysis panel** for the selected element: which views it's on, and its incoming and outgoing relationships.
84
- - **Check model** finds relationships the rules don't allow, likely duplicates (by their words, so "System of
85
- Order Management" matches "order-management system"), unused elements and relationships, empty views, nested
86
- elements with no relationship, and unprintable characters. **Merge…** makes duplicates one element, keeping
87
- every relationship and appearance on a view.
88
- - **Derived relationships**, worked out and shown as dotted lines.
89
- - **Roadmaps**: generate a view of work packages, plateaus or anything with start and end dates, as bars under
90
- the months.
91
- - An **HTML report** in one self-contained file: a tree, search, a page per element, relationship and view, and
92
- diagrams whose elements link to their pages.
93
- - **Images**: export PNG or SVG, or copy to the clipboard.
94
-
95
- ### Beyond Archi
96
-
97
- It runs in the browser and embeds in other apps. It also has:
98
-
99
- - ArchiMate 4 types alongside 3.2;
100
- - derived relationships without scripts;
101
- - invalid relationships shown as you choose (highlight, tooltip or hidden), per view, per model or for the tool;
102
- - groups and locks on every view, not just canvases;
103
- - a canvas template library shared across models;
104
- - two drawing backends, SVG and Canvas.
105
-
106
- ---
107
-
108
- ## The diagram editor
109
-
110
- The ArchiMate modeller is built on a general diagram editor, and every editing feature above is part of that
111
- editor rather than of ArchiMate: align, format painter, properties of several shapes, find and replace, copy and
112
- paste, groups and locks, undo, HTML report, image export, several models at once. The diagram editor gives you all
113
- of them for its own palettes:
114
-
115
- - basic shapes
116
- - flowchart and BPMN
117
- - swimlanes
118
- - UML: class, sequence, activity, state machine, use case, component, deployment
119
- - entity-relationship
120
- - data flow
121
- - network
122
- - org chart
123
-
124
- Each model can hold several diagrams, with line styles inherited from the diagram, then the model, then the tool.
125
-
126
- ![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)
127
-
128
- ## The chart library
129
-
130
- The engine underneath draws 24 chart types: bar, line, area, pie, scatter, bubble, heatmap, candlestick,
131
- 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
132
- draws graph and railroad diagrams, all to SVG or Canvas. `test/charts.html` is the full gallery, and
133
- `examples/csv-chart-builder.html` builds a chart from a CSV file without code.
134
-
135
- ![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)
136
-
137
- ![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)
138
-
139
- ---
140
-
141
- ## Put it in your own page
142
-
143
- ```bash
144
- npm install @peter.prib/renderengine
145
- ```
146
-
147
- The package is the ES module source and the built bundles:
148
-
149
- - `import { ArchimateModel, RenderEngine } from '@peter.prib/renderengine'`: the engine and the models (this also
150
- imports under Node).
151
- - `import '@peter.prib/renderengine/workspace'`: the workbench shell and its parts (browser only).
152
- - `@peter.prib/renderengine/dist/renderengine-workspace.umd.js`: the same as one classic script.
153
-
154
- The modeller is a part in the `<ws-workspace>` workbench shell. One script tag and a JSON spec is the whole host
155
- page:
156
-
157
- ```html
158
- <script src="dist/renderengine-workspace.umd.js"></script>
159
- <script>
160
- const { el, registerBuiltinParts, ArchimateCanvasPart } = RenderEngineWorkspace;
161
- const ws = document.body.appendChild(el({ tag: 'ws-workspace', attrs: { label: 'Modeller' } }));
162
- registerBuiltinParts(ws);
163
- ws.registerPart(ArchimateCanvasPart);
164
- ws.addParts([{
165
- id: 'models', type: 'models', editorType: 'archimate-canvas', // several models, a tab each
166
- models: [{
167
- id: 'shop', name: 'Shop',
168
- elements: [{ id: 'c', name: 'Customer', type: 'business-actor' }, { id: 'o', name: 'Order', type: 'business-process' }],
169
- relationships: [{ source: 'c', target: 'o', kind: 'assignment' }],
170
- views: [{ id: 'v', name: 'Main', elementIds: ['c', 'o'], layout: { c: { x: 100, y: 100 }, o: { x: 320, y: 100 } } }],
171
- }],
172
- }]);
173
- ws.registerPerspective('Modelling', { type: 'part', partId: 'models' });
174
- ws.activatePerspective('Modelling');
175
- </script>
176
- ```
177
-
178
- Use `editorType: 'diagram-editor'` with `DiagramEditorPart` for the diagram editor. The model is a plain JavaScript
179
- API (`ArchimateModel`, `DiagramModel`), so you can also build, check, search, report on and export models with no
180
- UI at all.
181
-
182
- ---
183
-
184
- ## Documentation
185
-
186
- | Document | What it covers |
187
- |---|---|
188
- | `REFERENCE.md` | The API: chart methods and options, the editors, models, commands, file formats |
189
- | `WORKSPACE_ARCHITECTURE.md` | The `<ws-workspace>` shell: parts, layout, context bus, work area |
190
- | `ARCHITECTURE.md` | Module layout and the chart-type catalog |
191
- | `LLM_ARCHIMATE_GUIDE.md` | Generating valid ArchiMate model data, with a prompt template |
192
- | `tasks.md` | What's still to come |
193
-
194
- ## Build and test
195
-
196
- ```bash
197
- npm install # dev tools only: Rollup
198
- npm run build # dist/renderengine.umd.js and dist/renderengine-workspace.umd.js
199
- npm test # Node's built-in test runner, no browser needed
200
- npm run screenshots # this README's pictures, from the example pages (headless Chrome)
201
- ```
202
-
203
- There are two bundles:
204
-
205
- - `renderengine.umd.js` (global `RenderEngine`): the engine.
206
- - `renderengine-workspace.umd.js` (global `RenderEngineWorkspace`): the workbench shell and its parts, plus the
207
- whole engine API, so one script tag is enough.
208
-
209
- The source is plain ES modules. `src/index.js` imports under Node, which is how the tests run.
210
-
211
- ## Licence
212
-
213
- MIT. Contributions welcome.
1
+ # RenderEngine
2
+
3
+ **An ArchiMate modeller, a diagram editor and a chart library that run in any browser tab, with no install and no
4
+ 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. Or put the same editor in your own app: it's a JavaScript library and a set of workbench parts,
8
+ not a desktop application.
9
+
10
+ ![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)
11
+
12
+ ---
13
+
14
+ ## Try it
15
+
16
+ ```bash
17
+ git clone https://gitlab.com/peter.prib/renderengine.git
18
+ cd renderengine
19
+ npm start # the ArchiMate modeller
20
+ npm run diagram # the diagram editor (flowcharts, UML and more)
21
+ npm run datamodel # a data model at each level, in each notation
22
+ ```
23
+
24
+ No server is needed, and nothing needs installing first, because the built bundles are in `dist/`. You can also
25
+ open the pages directly:
26
+
27
+ - `examples/archimate.html`: the ArchiMate modeller
28
+ - `examples/diagram-editor.html`: the diagram editor
29
+ - `examples/data-model.html`: a data model (conceptual, logical, physical; Chen, Crow's Foot, UML)
30
+
31
+ All work in current Chrome, Edge, Firefox and Safari. Save writes back to the file you opened in Chrome and Edge;
32
+ other browsers download the file instead.
33
+
34
+ ---
35
+
36
+ ## The ArchiMate modeller
37
+
38
+ ### Works with Archi
39
+
40
+ - **Open and save Archi files** (`.archimate`, and archives that include pictures). Save writes back to the file you
41
+ opened; Save As picks a new one. Unsaved changes are marked (•), and the page asks before you leave or close them.
42
+ - **Kept in the browser, backed up to the cloud.** Every model is kept in the browser as you edit it, and those open
43
+ reopen next time, with no file saved. File ▸ This browser backs them all up to a folder you choose once: pick one
44
+ that OneDrive, Google Drive or Dropbox syncs and the backups reach the cloud (each named with the date and time,
45
+ plus one under its plain name); browsers that cannot write to a folder download them instead.
46
+ - **Import a spreadsheet** into the open model: choose the name, type, id, documentation, property and "related
47
+ to" columns; existing elements are updated, not duplicated (Archi's elements.csv imports as it is).
48
+ - **draw.io export**: every view a page, in draw.io's ArchiMate shapes, with the elements' properties.
49
+ - **Open Group Exchange Format** import and export, the standard way into Sparx, BiZZdesign and other tools.
50
+ Checked with Archi 5.8, which validates and opens the files.
51
+ - **Every element Archi receives is a valid ArchiMate 3.2 class.** A type Archi lacks is written as its nearest
52
+ 3.2 type, and its own type is kept so it comes back on the next import.
53
+ - **Canvases, sketches, notes, groups and Archi's canvas templates** come through import and export.
54
+
55
+ ### Modelling
56
+
57
+ - A **palette** of every element type, grouped by layer and limited by the view's viewpoint.
58
+ - **Connecting two elements offers only the relationship kinds the ArchiMate rules allow** between them.
59
+ - **Nesting**: drop an element inside another and choose what the nesting stands for (composition, aggregation,
60
+ assignment, realization or specialization). It goes into the model, and the nesting shows it.
61
+ - **Add from text**: paste a list of names, from a document or a spreadsheet's columns, and get an element for
62
+ each.
63
+ - **Copy and paste** within a model and between models, **Duplicate**, and **Generate View For** an element and
64
+ what it relates to.
65
+ - **Several models open at once**, a tab each. Each has its own file and its own undo history.
66
+ - **Undo for everything**, one history per model as in Archi: edits on any view, and adding, renaming and deleting
67
+ views. Undoing an edit made on another view takes you to that view.
68
+ - **Specializations**, custom viewpoints, label expressions (`${name}` and `{name}`), and properties with types.
69
+
70
+ ### Editing
71
+
72
+ - **Align, distribute and match size**, to the shape you selected last, as in Archi; **automatic layouts** (grid,
73
+ circle, tree, force-directed, by layer) and **Nest its parts inside**, following composition and aggregation.
74
+ - **Properties of several shapes at once**: colours and text style, the elements' type and specialization, and a
75
+ property to set on all of them.
76
+ - **Format painter**: copy one shape's look onto others.
77
+ - **Colour by** layer, type, specialization or any property (a heat map, e.g. by lifecycle: invest, maintain,
78
+ retire), with a legend; or a legend of the element types on the view.
79
+ - **Find and replace** across names, documentation and property values, with match case, whole words and
80
+ regular expressions; **transform names** (Title Case, split camelCase, ...) and **rename a property** across the
81
+ model; **fit a shape to its text**.
82
+ - **Groups and locks on any view**, multi-select, a marquee, Archi's tabbed groups, bendpoints, pinned line ends,
83
+ and orthogonal, curved or straight routing.
84
+
85
+ ### Understanding and sharing a model
86
+
87
+ - 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
88
+ diagram too.
89
+ - An **analysis panel** for the selected element: which views it's on, and its incoming and outgoing relationships.
90
+ - **Check model** finds relationships the rules don't allow, likely duplicates (by their words, so "System of
91
+ Order Management" matches "order-management system"), unused elements and relationships, empty views, nested
92
+ elements with no relationship, and unprintable characters. **Merge…** makes duplicates one element, keeping
93
+ every relationship and appearance on a view.
94
+ - **Derived relationships**, worked out and shown as dotted lines.
95
+ - **Roadmaps**: generate a view of work packages, plateaus or anything with start and end dates, as bars under
96
+ the months.
97
+ - An **HTML report** in one self-contained file: a tree, search, a page per element, relationship and view, and
98
+ diagrams whose elements link to their pages.
99
+ - **Images**: export PNG or SVG, or copy to the clipboard.
100
+
101
+ ### Beyond Archi
102
+
103
+ It runs in the browser and embeds in other apps. It also has:
104
+
105
+ - ArchiMate 4 types alongside 3.2;
106
+ - derived relationships without scripts;
107
+ - invalid relationships shown as you choose (highlight, tooltip or hidden), per view, per model or for the tool;
108
+ - groups and locks on every view, not just canvases;
109
+ - a canvas template library shared across models;
110
+ - two drawing backends, SVG and Canvas.
111
+
112
+ ---
113
+
114
+ ## The diagram editor
115
+
116
+ The ArchiMate modeller is built on a general diagram editor, and every editing feature above is part of that
117
+ editor rather than of ArchiMate: align, format painter, properties of several shapes, find and replace, copy and
118
+ paste, groups and locks, undo, HTML report, image export, several models at once. The diagram editor gives you all
119
+ of them for its own palettes:
120
+
121
+ - basic shapes
122
+ - flowchart and BPMN
123
+ - swimlanes
124
+ - UML: class, sequence, activity, state machine, use case, component, deployment
125
+ - entity-relationship
126
+ - data flow
127
+ - network
128
+ - org chart
129
+
130
+ Each model can hold several diagrams, with line styles inherited from the diagram, then the model, then the tool.
131
+
132
+ ![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)
133
+
134
+ ## The chart library
135
+
136
+ The engine underneath draws 24 chart types: bar, line, area, pie, scatter, bubble, heatmap, candlestick,
137
+ 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
138
+ draws graph and railroad diagrams, all to SVG or Canvas. `test/charts.html` is the full gallery, and
139
+ `examples/csv-chart-builder.html` builds a chart from a CSV file without code.
140
+
141
+ ![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)
142
+
143
+ ![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)
144
+
145
+ ---
146
+
147
+ ## Put it in your own page
148
+
149
+ ```bash
150
+ npm install @peter.prib/renderengine
151
+ ```
152
+
153
+ The package is the ES module source and the built bundles:
154
+
155
+ - `import { ArchimateModel, RenderEngine } from '@peter.prib/renderengine'`: the engine and the models (this also
156
+ imports under Node).
157
+ - `import '@peter.prib/renderengine/workspace'`: the workbench shell and its parts (browser only).
158
+ - `@peter.prib/renderengine/dist/renderengine-workspace.umd.js`: the same as one classic script.
159
+
160
+ The modeller is a part in the `<ws-workspace>` workbench shell. One script tag and a JSON spec is the whole host
161
+ page:
162
+
163
+ ```html
164
+ <script src="dist/renderengine-workspace.umd.js"></script>
165
+ <script>
166
+ const { el, registerBuiltinParts, ArchimateCanvasPart } = RenderEngineWorkspace;
167
+ const ws = document.body.appendChild(el({ tag: 'ws-workspace', attrs: { label: 'Modeller' } }));
168
+ registerBuiltinParts(ws);
169
+ ws.registerPart(ArchimateCanvasPart);
170
+ ws.addParts([{
171
+ id: 'models', type: 'models', editorType: 'archimate-canvas', // several models, a tab each
172
+ models: [{
173
+ id: 'shop', name: 'Shop',
174
+ elements: [{ id: 'c', name: 'Customer', type: 'business-actor' }, { id: 'o', name: 'Order', type: 'business-process' }],
175
+ relationships: [{ source: 'c', target: 'o', kind: 'assignment' }],
176
+ views: [{ id: 'v', name: 'Main', elementIds: ['c', 'o'], layout: { c: { x: 100, y: 100 }, o: { x: 320, y: 100 } } }],
177
+ }],
178
+ }]);
179
+ ws.registerPerspective('Modelling', { type: 'part', partId: 'models' });
180
+ ws.activatePerspective('Modelling');
181
+ </script>
182
+ ```
183
+
184
+ Use `editorType: 'diagram-editor'` with `DiagramEditorPart` for the diagram editor. The model is a plain JavaScript
185
+ API (`ArchimateModel`, `DiagramModel`), so you can also build, check, search, report on and export models with no
186
+ UI at all.
187
+
188
+ ---
189
+
190
+ ## Documentation
191
+
192
+ | Document | What it covers |
193
+ |---|---|
194
+ | `REFERENCE.md` | The API: chart methods and options, the editors, models, commands, file formats |
195
+ | `WORKSPACE_ARCHITECTURE.md` | The `<ws-workspace>` shell: parts, layout, context bus, work area |
196
+ | `ARCHITECTURE.md` | Module layout and the chart-type catalog |
197
+ | `LLM_ARCHIMATE_GUIDE.md` | Generating valid ArchiMate model data, with a prompt template |
198
+ | `tasks.md` | What's still to come |
199
+
200
+ ## Build and test
201
+
202
+ ```bash
203
+ npm install # dev tools only: Rollup
204
+ npm run build # dist/renderengine.umd.js and dist/renderengine-workspace.umd.js
205
+ npm test # Node's built-in test runner, no browser needed
206
+ npm run screenshots # this README's pictures, from the example pages (headless Chrome)
207
+ ```
208
+
209
+ There are two bundles:
210
+
211
+ - `renderengine.umd.js` (global `RenderEngine`): the engine.
212
+ - `renderengine-workspace.umd.js` (global `RenderEngineWorkspace`): the workbench shell and its parts, plus the
213
+ whole engine API, so one script tag is enough.
214
+
215
+ The source is plain ES modules. `src/index.js` imports under Node, which is how the tests run.
216
+
217
+ ## Licence
218
+
219
+ MIT. Contributions welcome.