Diagram Model Reference
Diagram
Section titled “Diagram”A diagram is a visual view of model elements.
| Field | Type | Description |
|---|---|---|
| name | String | Display name |
| description | String | Optional description |
| parentId | Reference | Parent element (for child diagrams) or parent package |
| projectId | Reference | Project scope |
| notationPackageId | Reference | The M2 metamodel providing notation |
| viewport | Object | Pan and zoom state |
| showStereotypes | Boolean | Whether stereotypes are visible |
| audit | Object | Timestamps |
Viewport
Section titled “Viewport”| Field | Type | Description |
|---|---|---|
| panX | Number | Horizontal pan offset |
| panY | Number | Vertical pan offset |
| zoom | Number | Zoom level (1.0 = 100%) |
DiagramNode
Section titled “DiagramNode”A visual representation of an element on a diagram.
| Field | Type | Description |
|---|---|---|
| diagramId | Reference | The diagram this node belongs to |
| elementId | Reference | The model element being displayed |
| x | Number | Horizontal position (pixels) |
| y | Number | Vertical position (pixels) |
| width | Number | Node width (pixels) |
| height | Number | Node height (pixels) |
Nested Nodes
Section titled “Nested Nodes”When a node is nested inside a parent node, its position is relative to the parent. The parent auto-resizes to contain all children.
Formatting Overrides
Section titled “Formatting Overrides”Nodes can carry per-diagram formatting overrides (fill colour, border colour, border width) that take precedence over the M2 notation defaults.
DiagramEdge
Section titled “DiagramEdge”A visual representation of a relationship on a diagram.
| Field | Type | Description |
|---|---|---|
| diagramId | Reference | The diagram this edge belongs to |
| sourceNodeId | Reference | The source DiagramNode |
| targetNodeId | Reference | The target DiagramNode |
| relationshipId | Reference | The model relationship (optional for unlabeled edges) |
| label | String | Optional display label |
| waypoints | Array | Manual bend points |
Waypoints
Section titled “Waypoints”Waypoints are manually placed bend points that control edge routing.
| Field | Type | Description |
|---|---|---|
| x | Number | Horizontal position |
| y | Number | Vertical position |
Waypoints are stored as an ordered array. The edge routes from the source node through each waypoint in order to the target node.
Diagram Lifecycle
Section titled “Diagram Lifecycle”- Creation — diagrams are created in a package or as a child of an element
- Editing — node positions, edge waypoints, and formatting are modified on the Canvas
- Save — explicit save (Ctrl+S) persists layout changes. Model changes (element creation, property edits) are saved automatically.
- Undo/Redo — layout changes within a diagram can be undone and redone until saved