@opsydyn/foldkit-zloz-elk 0.3.0 → 0.5.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.
- package/CHANGELOG.md +24 -0
- package/README.md +50 -0
- package/dist/index.mjs +74 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- Qualify loose-mode requests through shared core validation with real-engine endpoint-identity tests.
|
|
6
|
+
|
|
7
|
+
- Reserve declared group headings through padding/minimum size, with qualified DOWN compound-minimum normalization and nested/empty group coverage.
|
|
8
|
+
|
|
9
|
+
- Reserve caller-declared composite edge-label bounds in compound layouts and return validated world-coordinate boxes, including custom badges on unlabeled edges.
|
|
10
|
+
|
|
11
|
+
## [0.5.0](https://github.com/opsydyn/fold-kit-experiments/compare/foldkit-zloz-elk-v0.4.0...foldkit-zloz-elk-v0.5.0) (2026-11-15)
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
- **foldkit-zloz-elk:** Synchronize foldkit-zloz versions
|
|
16
|
+
|
|
17
|
+
## [0.4.0](https://github.com/opsydyn/fold-kit-experiments/compare/foldkit-zloz-elk-v0.3.0...foldkit-zloz-elk-v0.4.0) (2026-11-15)
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
- **zloz:** add opt-in ELK descriptor preview layout ([26b4732](https://github.com/opsydyn/fold-kit-experiments/commit/26b47325c4538a6137a20736c49ce793addca61b))
|
|
22
|
+
- **zloz:** measure label bounds with stale-result protection ([b184bde](https://github.com/opsydyn/fold-kit-experiments/commit/b184bdea255264078a2c81127c34fefcb2f949b4))
|
|
23
|
+
- **zloz:** qualify v2 portable adapter boundaries ([e19efa7](https://github.com/opsydyn/fold-kit-experiments/commit/e19efa782bcd22424d62ea545fafa8770120a49c))
|
|
24
|
+
- **zloz:** reserve explicit layout label bounds ([ecc2284](https://github.com/opsydyn/fold-kit-experiments/commit/ecc22846fdf3d69efc29046a183109323eb795e4))
|
|
25
|
+
- **zloz:** reserve group heading layout bounds ([e67a3e1](https://github.com/opsydyn/fold-kit-experiments/commit/e67a3e1f37ab9fa4d25d45543bb61693f99e39c3))
|
|
26
|
+
|
|
3
27
|
## [0.3.0](https://github.com/opsydyn/fold-kit-experiments/compare/foldkit-zloz-elk-v0.2.0...foldkit-zloz-elk-v0.3.0) (2026-11-10)
|
|
4
28
|
|
|
5
29
|
### Miscellaneous Chores
|
package/README.md
CHANGED
|
@@ -67,3 +67,53 @@ real layout plus the optional FoldKit renderer.
|
|
|
67
67
|
|
|
68
68
|
See [publication standards](https://github.com/opsydyn/fold-kit-experiments/blob/main/docs/releases/foldkit-zloz.md) and
|
|
69
69
|
[dependency notices](THIRD-PARTY-NOTICES.md).
|
|
70
|
+
|
|
71
|
+
### Compound preview layouts (unreleased)
|
|
72
|
+
|
|
73
|
+
Configured `direction` and `spacing` now apply to root **and group parent**
|
|
74
|
+
containers. A real-engine regression retains at least the requested inter-layer
|
|
75
|
+
gap for RIGHT and DOWN inside a boundary; nested-boundary routes and custom anchors
|
|
76
|
+
remain tested. This corrects grouped children silently using ELK defaults.
|
|
77
|
+
|
|
78
|
+
For a detached read-only editor, compose `layoutRequest`, `createElkLayout` and
|
|
79
|
+
core's `applyPreviewLayout`; use `applyLayout` for normal undoable editing. The
|
|
80
|
+
workbench opts into ELK on explicit request, with direction controls, logical
|
|
81
|
+
cancellation, geometry-only restoration and preserved source/findings. See
|
|
82
|
+
[qualification](../../apps/zloz-demo/evidence/alchemy-layout.md). Label dimensions
|
|
83
|
+
are not yet supplied to ELK, so this is not a universal label-collision guarantee.
|
|
84
|
+
|
|
85
|
+
### Custom label envelopes (unreleased)
|
|
86
|
+
|
|
87
|
+
Pass `layoutRequest(editor, id, { edgeLabels: [{ id: edgeId, size: { width: 176,
|
|
88
|
+
height: 36 } }] })` to reserve space for a composite label, including badges.
|
|
89
|
+
One envelope per existing edge is supported. ELK returns centered world-coordinate
|
|
90
|
+
boxes in `result.routes[*].label`; core validates and retains them on application.
|
|
91
|
+
Nested layouts use ROOT coordinates for both route points and labels. Unlabeled
|
|
92
|
+
custom content uses a private sizing token inside ELK, without changing graph text.
|
|
93
|
+
Omitting hints preserves the previous geometry-only behavior. Caller-supplied
|
|
94
|
+
engines must return the requested label IDs, dimensions and finite positions.
|
|
95
|
+
Supply sizes matching the actual renderer; arbitrary custom geometry, inaccurate
|
|
96
|
+
bounds and group headers are outside this space-reservation guarantee.
|
|
97
|
+
|
|
98
|
+
For intrinsic custom badges, core's `startLabelMeasurement`,
|
|
99
|
+
`updateLabelMeasurements` and `resolveLabelMeasurements` can supply the explicit
|
|
100
|
+
`edgeLabels` hints. The optional Foldkit view measures HTML border boxes only on
|
|
101
|
+
request. Recheck freshness before both starting ELK and applying its result; ELK
|
|
102
|
+
does not load fonts, inspect DOM or start measurement itself. See the
|
|
103
|
+
[core measured-label guide](../foldkit-zloz/README.md#opt-in-measured-label-bounds-unreleased).
|
|
104
|
+
|
|
105
|
+
### Group heading envelopes (unreleased)
|
|
106
|
+
|
|
107
|
+
Core requests may declare `groupHeaders` with an existing group ID, header `size`,
|
|
108
|
+
`padding: { top, right, bottom, left }` and a `gap` before children. ELK maps these
|
|
109
|
+
to parent padding and a minimum group size, including empty groups and headings
|
|
110
|
+
wider than their content. Core rejects results that violate the reserved area.
|
|
111
|
+
Share the same declaration with C4/DDD `groupHeader` renderer options. Omitted
|
|
112
|
+
hints keep the existing 52/24/24/24 parent padding.
|
|
113
|
+
|
|
114
|
+
The pinned elkjs 0.12.1 adapter corrects transposed minima for nonempty DOWN groups;
|
|
115
|
+
empty groups use physical axes. Wide/tall nested/empty and cross-boundary-edge
|
|
116
|
+
regressions qualify both directions. Requalify the correction when upgrading ELK
|
|
117
|
+
or supplying a worker from another version. No post-layout stretching is used.
|
|
118
|
+
These hints reserve child-node space; they do not guarantee arbitrary route or
|
|
119
|
+
custom-artwork collision avoidance.
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ZlozError, portBoundaryPosition, portPosition,
|
|
1
|
+
import { ZlozError, portBoundaryPosition, portPosition, resolveLayoutGroupHeader, validateLayoutRequest } from "@opsydyn/foldkit-zloz";
|
|
2
2
|
import ELK from "elkjs/lib/elk.bundled.js";
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
/**
|
|
@@ -33,19 +33,44 @@ function createElkLayout(options = {}) {
|
|
|
33
33
|
const spacing = options.spacing ?? 64;
|
|
34
34
|
if (!Number.isFinite(spacing) || spacing <= 0) throw new ZlozError("invalid-layout", "Layout spacing must be positive and finite");
|
|
35
35
|
return async (request) => {
|
|
36
|
-
|
|
36
|
+
validateLayoutRequest(request);
|
|
37
|
+
const labelHints = new Map((request.edgeLabels ?? []).map((label) => [label.id, label]));
|
|
38
|
+
const groupHeaders = new Map((request.groupHeaders ?? []).map((header) => [header.id, header]));
|
|
37
39
|
const nodeIds = new Map(request.graph.nodes.map((node, index) => [node.id, `n:${index}`]));
|
|
38
40
|
const portIds = /* @__PURE__ */ new Map();
|
|
39
41
|
const hasGroups = request.graph.nodes.some((node) => node.kind === "group");
|
|
42
|
+
const layoutOptions = {
|
|
43
|
+
"elk.algorithm": "layered",
|
|
44
|
+
"elk.direction": options.direction ?? "RIGHT",
|
|
45
|
+
"elk.edgeRouting": "ORTHOGONAL",
|
|
46
|
+
"elk.spacing.nodeNode": String(spacing),
|
|
47
|
+
"elk.layered.spacing.nodeNodeBetweenLayers": String(spacing)
|
|
48
|
+
};
|
|
40
49
|
const children = [];
|
|
41
50
|
const elkNodes = new Map(request.graph.nodes.map((node, index) => {
|
|
42
|
-
if (node.kind === "group")
|
|
43
|
-
id
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
if (node.kind === "group") {
|
|
52
|
+
const hint = groupHeaders.get(node.id);
|
|
53
|
+
const header = hint ? resolveLayoutGroupHeader(node, hint) : void 0;
|
|
54
|
+
const groupOptions = {
|
|
55
|
+
...layoutOptions,
|
|
56
|
+
"elk.padding": "[top=52,left=24,bottom=24,right=24]"
|
|
57
|
+
};
|
|
58
|
+
if (header) {
|
|
59
|
+
const p = header.contentPadding;
|
|
60
|
+
groupOptions["elk.padding"] = `[top=${p.top},left=${p.left},bottom=${p.bottom},right=${p.right}]`;
|
|
61
|
+
groupOptions["elk.nodeSize.constraints"] = "MINIMUM_SIZE";
|
|
62
|
+
const transposed = options.direction === "DOWN" && request.graph.nodes.some((child) => child.parentId === node.id);
|
|
63
|
+
const minimum = header.minimumSize;
|
|
64
|
+
groupOptions["elk.nodeSize.minimum"] = transposed ? `(${minimum.height},${minimum.width})` : `(${minimum.width},${minimum.height})`;
|
|
65
|
+
}
|
|
66
|
+
return [node.id, {
|
|
67
|
+
id: `n:${index}`,
|
|
68
|
+
width: node.size.width,
|
|
69
|
+
height: node.size.height,
|
|
70
|
+
children: [],
|
|
71
|
+
layoutOptions: groupOptions
|
|
72
|
+
}];
|
|
73
|
+
}
|
|
49
74
|
const ports = new Map(node.ports.map((port, at) => [port.id, `p:${index}:${at}`]));
|
|
50
75
|
portIds.set(node.id, ports);
|
|
51
76
|
return [node.id, {
|
|
@@ -82,31 +107,44 @@ function createElkLayout(options = {}) {
|
|
|
82
107
|
const graph = {
|
|
83
108
|
id: "graph",
|
|
84
109
|
layoutOptions: {
|
|
85
|
-
|
|
110
|
+
...layoutOptions,
|
|
86
111
|
"elk.hierarchyHandling": hasGroups ? "INCLUDE_CHILDREN" : "SEPARATE_CHILDREN",
|
|
87
112
|
"elk.json.shapeCoords": "ROOT",
|
|
88
|
-
"elk.json.edgeCoords": "ROOT"
|
|
89
|
-
"elk.direction": options.direction ?? "RIGHT",
|
|
90
|
-
"elk.edgeRouting": "ORTHOGONAL",
|
|
91
|
-
"elk.spacing.nodeNode": String(spacing),
|
|
92
|
-
"elk.layered.spacing.nodeNodeBetweenLayers": String(spacing)
|
|
113
|
+
"elk.json.edgeCoords": "ROOT"
|
|
93
114
|
},
|
|
94
115
|
children,
|
|
95
|
-
edges: request.graph.edges.map((edge, index) =>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
116
|
+
edges: request.graph.edges.map((edge, index) => {
|
|
117
|
+
const base = {
|
|
118
|
+
id: `e:${index}`,
|
|
119
|
+
sources: [portIds.get(edge.source.node)?.get(edge.source.port) ?? ""],
|
|
120
|
+
targets: [portIds.get(edge.target.node)?.get(edge.target.port) ?? ""]
|
|
121
|
+
};
|
|
122
|
+
const hint = labelHints.get(edge.id);
|
|
123
|
+
return hint ? {
|
|
124
|
+
...base,
|
|
125
|
+
labels: [{
|
|
126
|
+
id: `l:${index}`,
|
|
127
|
+
text: edge.label?.trim() || "label",
|
|
128
|
+
width: hint.size.width,
|
|
129
|
+
height: hint.size.height,
|
|
130
|
+
layoutOptions: { "elk.edgeLabels.placement": "CENTER" }
|
|
131
|
+
}]
|
|
132
|
+
} : base;
|
|
133
|
+
})
|
|
100
134
|
};
|
|
101
135
|
const result = await (options.elk ?? new ELK()).layout(graph);
|
|
102
136
|
const laidOutNodes = /* @__PURE__ */ new Map();
|
|
103
137
|
const laidOutEdges = /* @__PURE__ */ new Map();
|
|
138
|
+
const laidOutLabels = /* @__PURE__ */ new Map();
|
|
104
139
|
const pending = [result];
|
|
105
140
|
while (pending.length > 0) {
|
|
106
141
|
const node = pending.pop();
|
|
107
142
|
if (!node) break;
|
|
108
143
|
laidOutNodes.set(node.id, node);
|
|
109
|
-
for (const edge of node.edges ?? [])
|
|
144
|
+
for (const edge of node.edges ?? []) {
|
|
145
|
+
laidOutEdges.set(edge.id, edge.sections ?? []);
|
|
146
|
+
laidOutLabels.set(edge.id, edge.labels ?? []);
|
|
147
|
+
}
|
|
110
148
|
for (const child of node.children ?? []) pending.push(child);
|
|
111
149
|
}
|
|
112
150
|
const positions = request.graph.nodes.map((node) => {
|
|
@@ -147,13 +185,27 @@ function createElkLayout(options = {}) {
|
|
|
147
185
|
position: targetPosition
|
|
148
186
|
}, edge.target.port)
|
|
149
187
|
];
|
|
150
|
-
|
|
188
|
+
const route = {
|
|
151
189
|
id: edge.id,
|
|
152
190
|
points: anchored.filter((point, index) => {
|
|
153
191
|
const previous = anchored[index - 1];
|
|
154
192
|
return !previous || previous.x !== point.x || previous.y !== point.y;
|
|
155
193
|
})
|
|
156
194
|
};
|
|
195
|
+
const hint = labelHints.get(edge.id);
|
|
196
|
+
if (!hint) return route;
|
|
197
|
+
const labels = laidOutLabels.get(`e:${index}`) ?? [], label = labels[0];
|
|
198
|
+
if (labels.length !== 1 || !label || label.id !== `l:${index}` || label.x === void 0 || label.y === void 0 || !Number.isFinite(label.x) || !Number.isFinite(label.y) || label.width !== hint.size.width || label.height !== hint.size.height) throw new ZlozError("invalid-layout", `ELK omitted a valid label box for ${edge.id}`);
|
|
199
|
+
return {
|
|
200
|
+
...route,
|
|
201
|
+
label: {
|
|
202
|
+
position: {
|
|
203
|
+
x: label.x + hint.size.width / 2,
|
|
204
|
+
y: label.y + hint.size.height / 2
|
|
205
|
+
},
|
|
206
|
+
size: { ...hint.size }
|
|
207
|
+
}
|
|
208
|
+
};
|
|
157
209
|
});
|
|
158
210
|
return {
|
|
159
211
|
requestId: request.requestId,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Optional ELK layout adapter; the host owns request publication and worker lifetime.\n * @module ELK\n */\nimport {\n ZlozError,\n portPosition,\n portBoundaryPosition,\n validateGraph,\n type EdgeRoute,\n type LayoutEngine,\n} from '@opsydyn/foldkit-zloz';\nimport type { ELK as ElkInstance, ElkNode, ElkEdgeSection } from 'elkjs/lib/elk-api';\nimport ELK from 'elkjs/lib/elk.bundled.js';\n\nexport type ElkLayoutOptions = Readonly<{\n direction?: 'RIGHT' | 'DOWN';\n spacing?: number;\n /** Supply a worker-backed instance when needed; the caller owns its lifetime. */\n elk?: Pick<ElkInstance, 'layout'>;\n}>;\n\nfunction routePoints(sections: readonly ElkEdgeSection[], edgeId: string): EdgeRoute['points'] {\n const byId = new Map(sections.map((section) => [section.id, section]));\n const visited = new Set<string>();\n const points: Array<{ x: number; y: number }> = [];\n let current = sections.find((section) => !section.incomingSections?.length);\n while (current && !visited.has(current.id)) {\n visited.add(current.id);\n const previous = points.at(-1);\n if (\n previous &&\n (Math.abs(previous.x - current.startPoint.x) > 1e-6 ||\n Math.abs(previous.y - current.startPoint.y) > 1e-6)\n )\n break;\n if (!previous) points.push(current.startPoint);\n for (const bend of current.bendPoints ?? []) points.push(bend);\n points.push(current.endPoint);\n const outgoing = current.outgoingSections ?? [];\n if (outgoing.length === 0 && visited.size === sections.length)\n return points.map(({ x, y }) => ({ x, y }));\n const next = outgoing[0];\n if (outgoing.length !== 1 || next === undefined) break;\n current = byId.get(next);\n }\n throw new ZlozError('invalid-layout', `ELK omitted a continuous route for ${edgeId}`);\n}\n\n/** Default invocations use in-process ELK. Caller-supplied worker instances remain caller-owned. */\nexport function createElkLayout(options: ElkLayoutOptions = {}): LayoutEngine {\n const spacing = options.spacing ?? 64;\n if (!Number.isFinite(spacing) || spacing <= 0)\n throw new ZlozError('invalid-layout', 'Layout spacing must be positive and finite');\n return async (request) => {\n validateGraph(request.graph);\n const nodeIds = new Map(request.graph.nodes.map((node, index) => [node.id, `n:${index}`]));\n const portIds = new Map<string, Map<string, string>>();\n const hasGroups = request.graph.nodes.some((node) => node.kind === 'group');\n const children: ElkNode[] = [];\n const elkNodes = new Map(\n request.graph.nodes.map((node, index): [string, ElkNode] => {\n if (node.kind === 'group')\n return [\n node.id,\n {\n id: `n:${index}`,\n width: node.size.width,\n height: node.size.height,\n children: [],\n layoutOptions: { 'elk.padding': '[top=52,left=24,bottom=24,right=24]' },\n },\n ];\n const ports = new Map(node.ports.map((port, at) => [port.id, `p:${index}:${at}`]));\n portIds.set(node.id, ports);\n return [\n node.id,\n {\n id: `n:${index}`,\n width: node.size.width,\n height: node.size.height,\n layoutOptions: { 'elk.portConstraints': 'FIXED_POS' },\n ports: node.ports.map((port) => {\n const point = portBoundaryPosition(node, port.id);\n const side = { left: 'WEST', right: 'EAST', top: 'NORTH', bottom: 'SOUTH' }[\n port.side\n ];\n return {\n id: ports.get(port.id) ?? '',\n width: 0,\n height: 0,\n x: point.x - node.position.x,\n y: point.y - node.position.y,\n layoutOptions: { 'elk.port.side': side },\n };\n }),\n },\n ];\n }),\n );\n for (const node of request.graph.nodes) {\n const elkNode = elkNodes.get(node.id);\n if (!elkNode) throw new ZlozError('invalid-layout', `Missing input elkNode for ${node.id}`);\n const siblings =\n node.parentId === undefined ? children : elkNodes.get(node.parentId)?.children;\n if (!siblings) throw new ZlozError('invalid-layout', `Missing parent elkNode for ${node.id}`);\n siblings.push(elkNode);\n }\n const graph: ElkNode = {\n id: 'graph',\n layoutOptions: {\n 'elk.algorithm': 'layered',\n 'elk.hierarchyHandling': hasGroups ? 'INCLUDE_CHILDREN' : 'SEPARATE_CHILDREN',\n 'elk.json.shapeCoords': 'ROOT',\n 'elk.json.edgeCoords': 'ROOT',\n 'elk.direction': options.direction ?? 'RIGHT',\n 'elk.edgeRouting': 'ORTHOGONAL',\n 'elk.spacing.nodeNode': String(spacing),\n 'elk.layered.spacing.nodeNodeBetweenLayers': String(spacing),\n },\n children,\n edges: request.graph.edges.map((edge, index) => ({\n id: `e:${index}`,\n sources: [portIds.get(edge.source.node)?.get(edge.source.port) ?? ''],\n targets: [portIds.get(edge.target.node)?.get(edge.target.port) ?? ''],\n })),\n };\n const elk = options.elk ?? new ELK();\n const result = await elk.layout(graph);\n const laidOutNodes = new Map<string, ElkNode>();\n const laidOutEdges = new Map<string, ElkEdgeSection[]>();\n const pending = [result];\n while (pending.length > 0) {\n const node = pending.pop();\n if (!node) break;\n laidOutNodes.set(node.id, node);\n for (const edge of node.edges ?? []) laidOutEdges.set(edge.id, edge.sections ?? []);\n for (const child of node.children ?? []) pending.push(child);\n }\n const positions = request.graph.nodes.map((node) => {\n const laidOut = laidOutNodes.get(nodeIds.get(node.id) ?? '');\n if (\n !laidOut ||\n !Number.isFinite(laidOut.x) ||\n !Number.isFinite(laidOut.y) ||\n laidOut.x === undefined ||\n laidOut.y === undefined\n )\n throw new ZlozError('invalid-layout', `ELK omitted position for ${node.id}`);\n const position = { id: node.id, x: laidOut.x, y: laidOut.y };\n if (node.kind !== 'group') return position;\n const { width, height } = laidOut;\n if (\n width === undefined ||\n height === undefined ||\n !Number.isFinite(width) ||\n !Number.isFinite(height) ||\n width <= 0 ||\n height <= 0\n )\n throw new ZlozError('invalid-layout', `ELK returned invalid bounds for ${node.id}`);\n return { ...position, size: { width, height } };\n });\n const routes: EdgeRoute[] = request.graph.edges.map((edge, index) => {\n const sections = laidOutEdges.get(`e:${index}`) ?? [];\n const points = routePoints(sections, edge.id);\n if (!points.every((point) => Number.isFinite(point.x) && Number.isFinite(point.y)))\n throw new ZlozError('invalid-layout', `ELK returned an invalid route for ${edge.id}`);\n const sourceNode = request.graph.nodes.find((node) => node.id === edge.source.node);\n const targetNode = request.graph.nodes.find((node) => node.id === edge.target.node);\n const sourcePosition = positions.find((position) => position.id === edge.source.node);\n const targetPosition = positions.find((position) => position.id === edge.target.node);\n if (!sourceNode || !targetNode || !sourcePosition || !targetPosition)\n throw new ZlozError('invalid-layout', 'Missing routed endpoint');\n const anchored = [\n portPosition({ ...sourceNode, position: sourcePosition }, edge.source.port),\n ...points,\n portPosition({ ...targetNode, position: targetPosition }, edge.target.port),\n ];\n return {\n id: edge.id,\n points: anchored.filter((point, index) => {\n const previous = anchored[index - 1];\n return !previous || previous.x !== point.x || previous.y !== point.y;\n }),\n };\n });\n return { requestId: request.requestId, revision: request.revision, positions, routes };\n };\n}\n"],"mappings":";;;;;;;AAsBA,SAAS,YAAY,UAAqC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C,eACpD,OAAM,IAAI,UAAU,kBAAkB,0BAA0B;GAClE,MAAM,WAAW;IACf,aAAa;KAAE,GAAG;KAAY,UAAU;KAAgB,EAAE,KAAK,OAAO,KAAK;IAC3E,GAAG;IACH,aAAa;KAAE,GAAG;KAAY,UAAU;KAAgB,EAAE,KAAK,OAAO,KAAK;IAC5E;AACD,UAAO;IACL,IAAI,KAAK;IACT,QAAQ,SAAS,QAAQ,OAAO,UAAU;KACxC,MAAM,WAAW,SAAS,QAAQ;AAClC,YAAO,CAAC,YAAY,SAAS,MAAM,MAAM,KAAK,SAAS,MAAM,MAAM;MACnE;IACH;IACD;AACF,SAAO;GAAE,WAAW,QAAQ;GAAW,UAAU,QAAQ;GAAU;GAAW;GAAQ"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Optional ELK layout adapter; the host owns request publication and worker lifetime.\n * @module ELK\n */\nimport {\n ZlozError,\n portPosition,\n portBoundaryPosition,\n validateLayoutRequest,\n resolveLayoutGroupHeader,\n type EdgeRoute,\n type LayoutEngine,\n} from '@opsydyn/foldkit-zloz';\nimport type {\n ELK as ElkInstance,\n ElkNode,\n ElkEdgeSection,\n ElkLabel,\n LayoutOptions as ElkLayoutProperties,\n} from 'elkjs/lib/elk-api';\nimport ELK from 'elkjs/lib/elk.bundled.js';\n\nexport type ElkLayoutOptions = Readonly<{\n direction?: 'RIGHT' | 'DOWN';\n spacing?: number;\n /** Supply a worker-backed instance when needed; the caller owns its lifetime. */\n elk?: Pick<ElkInstance, 'layout'>;\n}>;\n\nfunction routePoints(sections: readonly ElkEdgeSection[], edgeId: string): EdgeRoute['points'] {\n const byId = new Map(sections.map((section) => [section.id, section]));\n const visited = new Set<string>();\n const points: Array<{ x: number; y: number }> = [];\n let current = sections.find((section) => !section.incomingSections?.length);\n while (current && !visited.has(current.id)) {\n visited.add(current.id);\n const previous = points.at(-1);\n if (\n previous &&\n (Math.abs(previous.x - current.startPoint.x) > 1e-6 ||\n Math.abs(previous.y - current.startPoint.y) > 1e-6)\n )\n break;\n if (!previous) points.push(current.startPoint);\n for (const bend of current.bendPoints ?? []) points.push(bend);\n points.push(current.endPoint);\n const outgoing = current.outgoingSections ?? [];\n if (outgoing.length === 0 && visited.size === sections.length)\n return points.map(({ x, y }) => ({ x, y }));\n const next = outgoing[0];\n if (outgoing.length !== 1 || next === undefined) break;\n current = byId.get(next);\n }\n throw new ZlozError('invalid-layout', `ELK omitted a continuous route for ${edgeId}`);\n}\n\n/** Default invocations use in-process ELK. Caller-supplied worker instances remain caller-owned. */\nexport function createElkLayout(options: ElkLayoutOptions = {}): LayoutEngine {\n const spacing = options.spacing ?? 64;\n if (!Number.isFinite(spacing) || spacing <= 0)\n throw new ZlozError('invalid-layout', 'Layout spacing must be positive and finite');\n return async (request) => {\n validateLayoutRequest(request);\n const labelHints = new Map((request.edgeLabels ?? []).map((label) => [label.id, label]));\n const groupHeaders = new Map((request.groupHeaders ?? []).map((header) => [header.id, header]));\n const nodeIds = new Map(request.graph.nodes.map((node, index) => [node.id, `n:${index}`]));\n const portIds = new Map<string, Map<string, string>>();\n const hasGroups = request.graph.nodes.some((node) => node.kind === 'group');\n const layoutOptions = {\n 'elk.algorithm': 'layered',\n 'elk.direction': options.direction ?? 'RIGHT',\n 'elk.edgeRouting': 'ORTHOGONAL',\n 'elk.spacing.nodeNode': String(spacing),\n 'elk.layered.spacing.nodeNodeBetweenLayers': String(spacing),\n } as const;\n const children: ElkNode[] = [];\n const elkNodes = new Map(\n request.graph.nodes.map((node, index): [string, ElkNode] => {\n if (node.kind === 'group') {\n const hint = groupHeaders.get(node.id);\n const header = hint ? resolveLayoutGroupHeader(node, hint) : undefined;\n const groupOptions: ElkLayoutProperties = {\n ...layoutOptions,\n 'elk.padding': '[top=52,left=24,bottom=24,right=24]',\n };\n if (header) {\n const p = header.contentPadding;\n groupOptions['elk.padding'] =\n `[top=${p.top},left=${p.left},bottom=${p.bottom},right=${p.right}]`;\n groupOptions['elk.nodeSize.constraints'] = 'MINIMUM_SIZE';\n // ELK 0.12.1 transposes compound graph minima in DOWN, but leaf/empty group minima remain physical.\n // Keep this correction behind the adapter; nested/empty, wide/tall real-engine regressions qualify upgrades.\n const transposed =\n options.direction === 'DOWN' &&\n request.graph.nodes.some((child) => child.parentId === node.id);\n const minimum = header.minimumSize;\n groupOptions['elk.nodeSize.minimum'] = transposed\n ? `(${minimum.height},${minimum.width})`\n : `(${minimum.width},${minimum.height})`;\n }\n return [\n node.id,\n {\n id: `n:${index}`,\n width: node.size.width,\n height: node.size.height,\n children: [],\n layoutOptions: groupOptions,\n },\n ];\n }\n const ports = new Map(node.ports.map((port, at) => [port.id, `p:${index}:${at}`]));\n portIds.set(node.id, ports);\n return [\n node.id,\n {\n id: `n:${index}`,\n width: node.size.width,\n height: node.size.height,\n layoutOptions: { 'elk.portConstraints': 'FIXED_POS' },\n ports: node.ports.map((port) => {\n const point = portBoundaryPosition(node, port.id);\n const side = { left: 'WEST', right: 'EAST', top: 'NORTH', bottom: 'SOUTH' }[\n port.side\n ];\n return {\n id: ports.get(port.id) ?? '',\n width: 0,\n height: 0,\n x: point.x - node.position.x,\n y: point.y - node.position.y,\n layoutOptions: { 'elk.port.side': side },\n };\n }),\n },\n ];\n }),\n );\n for (const node of request.graph.nodes) {\n const elkNode = elkNodes.get(node.id);\n if (!elkNode) throw new ZlozError('invalid-layout', `Missing input elkNode for ${node.id}`);\n const siblings =\n node.parentId === undefined ? children : elkNodes.get(node.parentId)?.children;\n if (!siblings) throw new ZlozError('invalid-layout', `Missing parent elkNode for ${node.id}`);\n siblings.push(elkNode);\n }\n const graph: ElkNode = {\n id: 'graph',\n layoutOptions: {\n ...layoutOptions,\n 'elk.hierarchyHandling': hasGroups ? 'INCLUDE_CHILDREN' : 'SEPARATE_CHILDREN',\n 'elk.json.shapeCoords': 'ROOT',\n 'elk.json.edgeCoords': 'ROOT',\n },\n children,\n edges: request.graph.edges.map((edge, index) => {\n const base = {\n id: `e:${index}`,\n sources: [portIds.get(edge.source.node)?.get(edge.source.port) ?? ''],\n targets: [portIds.get(edge.target.node)?.get(edge.target.port) ?? ''],\n };\n const hint = labelHints.get(edge.id);\n return hint\n ? {\n ...base,\n labels: [\n {\n id: `l:${index}`,\n text: edge.label?.trim() || 'label',\n width: hint.size.width,\n height: hint.size.height,\n layoutOptions: { 'elk.edgeLabels.placement': 'CENTER' },\n },\n ],\n }\n : base;\n }),\n };\n const elk = options.elk ?? new ELK();\n const result = await elk.layout(graph);\n const laidOutNodes = new Map<string, ElkNode>();\n const laidOutEdges = new Map<string, ElkEdgeSection[]>();\n const laidOutLabels = new Map<string, readonly ElkLabel[]>();\n const pending = [result];\n while (pending.length > 0) {\n const node = pending.pop();\n if (!node) break;\n laidOutNodes.set(node.id, node);\n for (const edge of node.edges ?? []) {\n laidOutEdges.set(edge.id, edge.sections ?? []);\n laidOutLabels.set(edge.id, edge.labels ?? []);\n }\n for (const child of node.children ?? []) pending.push(child);\n }\n const positions = request.graph.nodes.map((node) => {\n const laidOut = laidOutNodes.get(nodeIds.get(node.id) ?? '');\n if (\n !laidOut ||\n !Number.isFinite(laidOut.x) ||\n !Number.isFinite(laidOut.y) ||\n laidOut.x === undefined ||\n laidOut.y === undefined\n )\n throw new ZlozError('invalid-layout', `ELK omitted position for ${node.id}`);\n const position = { id: node.id, x: laidOut.x, y: laidOut.y };\n if (node.kind !== 'group') return position;\n const { width, height } = laidOut;\n if (\n width === undefined ||\n height === undefined ||\n !Number.isFinite(width) ||\n !Number.isFinite(height) ||\n width <= 0 ||\n height <= 0\n )\n throw new ZlozError('invalid-layout', `ELK returned invalid bounds for ${node.id}`);\n return { ...position, size: { width, height } };\n });\n const routes: EdgeRoute[] = request.graph.edges.map((edge, index) => {\n const sections = laidOutEdges.get(`e:${index}`) ?? [];\n const points = routePoints(sections, edge.id);\n if (!points.every((point) => Number.isFinite(point.x) && Number.isFinite(point.y)))\n throw new ZlozError('invalid-layout', `ELK returned an invalid route for ${edge.id}`);\n const sourceNode = request.graph.nodes.find((node) => node.id === edge.source.node);\n const targetNode = request.graph.nodes.find((node) => node.id === edge.target.node);\n const sourcePosition = positions.find((position) => position.id === edge.source.node);\n const targetPosition = positions.find((position) => position.id === edge.target.node);\n if (!sourceNode || !targetNode || !sourcePosition || !targetPosition)\n throw new ZlozError('invalid-layout', 'Missing routed endpoint');\n const anchored = [\n portPosition({ ...sourceNode, position: sourcePosition }, edge.source.port),\n ...points,\n portPosition({ ...targetNode, position: targetPosition }, edge.target.port),\n ];\n const route = {\n id: edge.id,\n points: anchored.filter((point, index) => {\n const previous = anchored[index - 1];\n return !previous || previous.x !== point.x || previous.y !== point.y;\n }),\n };\n const hint = labelHints.get(edge.id);\n if (!hint) return route;\n const labels = laidOutLabels.get(`e:${index}`) ?? [],\n label = labels[0];\n if (\n labels.length !== 1 ||\n !label ||\n label.id !== `l:${index}` ||\n label.x === undefined ||\n label.y === undefined ||\n !Number.isFinite(label.x) ||\n !Number.isFinite(label.y) ||\n label.width !== hint.size.width ||\n label.height !== hint.size.height\n )\n throw new ZlozError('invalid-layout', `ELK omitted a valid label box for ${edge.id}`);\n return {\n ...route,\n label: {\n position: { x: label.x + hint.size.width / 2, y: label.y + hint.size.height / 2 },\n size: { ...hint.size },\n },\n };\n });\n return { requestId: request.requestId, revision: request.revision, positions, routes };\n };\n}\n"],"mappings":";;;;;;;AA6BA,SAAS,YAAY,UAAqC,QAAqC;CAC7F,MAAM,OAAO,IAAI,IAAI,SAAS,KAAK,YAAY,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC;CACtE,MAAM,0BAAU,IAAI,KAAa;CACjC,MAAM,SAA0C,EAAE;CAClD,IAAI,UAAU,SAAS,MAAM,YAAY,CAAC,QAAQ,kBAAkB,OAAO;AAC3E,QAAO,WAAW,CAAC,QAAQ,IAAI,QAAQ,GAAG,EAAE;AAC1C,UAAQ,IAAI,QAAQ,GAAG;EACvB,MAAM,WAAW,OAAO,GAAG,GAAG;AAC9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M,QAAO;GAClB,MAAM,SAAS,cAAc,IAAI,KAAK,QAAQ,IAAI,EAAE,EAClD,QAAQ,OAAO;AACjB,OACE,OAAO,WAAW,KAClB,CAAC,SACD,MAAM,OAAO,KAAK,WAClB,MAAM,MAAM,KAAA,KACZ,MAAM,MAAM,KAAA,KACZ,CAAC,OAAO,SAAS,MAAM,EAAE,IACzB,CAAC,OAAO,SAAS,MAAM,EAAE,IACzB,MAAM,UAAU,KAAK,KAAK,SAC1B,MAAM,WAAW,KAAK,KAAK,OAE3B,OAAM,IAAI,UAAU,kBAAkB,qCAAqC,KAAK,KAAK;AACvF,UAAO;IACL,GAAG;IACH,OAAO;KACL,UAAU;MAAE,GAAG,MAAM,IAAI,KAAK,KAAK,QAAQ;MAAG,GAAG,MAAM,IAAI,KAAK,KAAK,SAAS;MAAG;KACjF,MAAM,EAAE,GAAG,KAAK,MAAM;KACvB;IACF;IACD;AACF,SAAO;GAAE,WAAW,QAAQ;GAAW,UAAU,QAAQ;GAAU;GAAW;GAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opsydyn/foldkit-zloz-elk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Optional ELK layout adapter for Foldkit Zloz.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"diagram",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@arethetypeswrong/cli": "0.18.5",
|
|
56
|
-
"@opsydyn/foldkit-zloz": "0.
|
|
56
|
+
"@opsydyn/foldkit-zloz": "0.5.0",
|
|
57
57
|
"@types/node": "^22.0.0",
|
|
58
58
|
"bun-types": "^1.3.14",
|
|
59
59
|
"publint": "0.3.25",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"typescript": "^6.0.3"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@opsydyn/foldkit-zloz": "0.
|
|
64
|
+
"@opsydyn/foldkit-zloz": "0.5.0"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=22.0.0"
|