@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.
- package/README.md +219 -213
- package/REFERENCE.md +272 -6
- package/dist/renderengine-workspace.umd.js +11980 -7421
- package/dist/renderengine.umd.js +8991 -5784
- package/examples/archimate.html +68 -66
- package/examples/data-model.html +534 -0
- package/package.json +70 -68
- package/src/bian.js +182 -0
- package/src/charting/CheckboxTreeSelector.js +373 -304
- package/src/charting/DiagramEditor.js +53 -32
- package/src/charting/DiagramTypeRegistry.js +13 -3
- package/src/charting/ModelCheckDialog.js +63 -0
- package/src/charting/ModelChecker.js +26 -0
- package/src/charting/ViewTabStrip.js +94 -81
- package/src/charting/archimate/ArchimateCanvasEditor.js +825 -815
- package/src/charting/archimate/ArchimateElementTemplate.js +208 -195
- package/src/charting/datamodel/BianLandscapeReader.js +185 -0
- package/src/charting/datamodel/BianSemanticApiReader.js +183 -0
- package/src/charting/datamodel/DataModel.js +645 -0
- package/src/charting/datamodel/DataModelChecker.js +92 -0
- package/src/charting/datamodel/DataModelCompared.js +127 -0
- package/src/charting/datamodel/DataModelContext.js +108 -0
- package/src/charting/datamodel/DataModelFileFormat.js +33 -0
- package/src/charting/datamodel/DataModelPerspective.js +129 -0
- package/src/charting/datamodel/DataType.js +108 -0
- package/src/charting/datamodel/EnumerationType.js +51 -0
- package/src/charting/datamodel/LevelMapping.js +38 -0
- package/src/charting/datamodel/LevelSchema.js +41 -0
- package/src/charting/datamodel/ServiceDomain.js +177 -0
- package/src/charting/datamodel/ServiceLandscape.js +104 -0
- package/src/charting/datamodel/StructuredType.js +63 -0
- package/src/charting/datamodel/index.js +15 -0
- package/src/charting/diagramModel/MergeModelCommand.js +43 -37
- package/src/charting/diagramModel/OpenViewList.js +75 -0
- package/src/charting/diagramModel/ViewSetChecker.js +22 -34
- package/src/charting/diagrams/DataModelDiagram.js +160 -86
- package/src/charting/diagrams/DataModelRelationshipStrategy.js +94 -38
- package/src/charting/diagrams/EdgeGeometry.js +578 -553
- package/src/charting/diagrams/GraphDiagram.js +11 -1
- package/src/charting/diagrams/NodeGeometry.js +169 -158
- package/src/charting/diagrams/nesting.js +31 -0
- package/src/charting/glyphs/PersonGlyph.js +24 -23
- package/src/charting/modelTree/ModelTree.js +202 -164
- package/src/charting/modelTree/ModelTreePanel.js +36 -3
- package/src/charting/modelTree/TreeViewMode.js +131 -110
- package/src/charting/modelTree/modes/FlatTreeMode.js +32 -46
- package/src/charting/modelTree/modes/LayerGroupedTreeMode.js +47 -62
- package/src/charting/modelTree/modes/TypeGroupedTreeMode.js +46 -60
- package/src/datamodel.js +132 -122
- package/src/diagramCatalog.js +35 -30
- package/src/index.js +2666 -2659
- package/src/workspace/EditorShell.js +166 -67
- package/src/workspace/PanelLayout.js +56 -0
- package/src/workspace/index.js +1 -0
- package/src/workspace/layout/TabsNode.js +205 -191
- package/src/workspace/parts/ArchimateCanvasPart.js +10 -9
- package/src/workspace/parts/ChartPart.js +6 -1
- package/src/workspace/parts/DataModelPart.js +544 -0
- package/src/workspace/parts/DiagramEditorPart.js +2 -8
- package/src/workspace/parts/EditorPart.js +461 -407
- package/src/workspace/parts/ModelFile.js +216 -187
- package/src/workspace/parts/ModelsPart.js +483 -192
- package/src/workspace/storage/BackupFolder.js +145 -0
- package/src/workspace/storage/KeyValueStore.js +92 -0
- package/src/workspace/storage/ModelLibrary.js +65 -0
- package/src/workspace/workArea.js +417 -413
- 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
|
-

|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- `examples/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- **
|
|
41
|
-
|
|
42
|
-
- **
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
- **
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
- **
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- **
|
|
67
|
-
|
|
68
|
-
- **
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- **
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- **
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
+

|
|
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
|
+

|
|
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
|
+

|
|
142
|
+
|
|
143
|
+

|
|
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.
|