structured-context-map-views 0.6.1 → 0.7.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/README.md +1 -1
- package/dist/{ParameterControls-A1HJWyt9.js → ParameterControls-Be05VST0.js} +505 -188
- package/dist/ParameterControls-Be05VST0.js.map +1 -0
- package/dist/artifact.html +70 -1
- package/dist/artifact.js +2 -2
- package/dist/artifact.js.map +1 -1
- package/dist/cli.js +12 -6
- package/dist/cli.js.map +1 -1
- package/dist/{definition-Cp1CCigh.js → definition-SjmROmJC.js} +308 -188
- package/dist/definition-SjmROmJC.js.map +1 -0
- package/dist/html.js +19 -0
- package/dist/html.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/node-ctbuxC-s.js +74 -0
- package/dist/node-ctbuxC-s.js.map +1 -0
- package/dist/node.js +2 -2
- package/dist/page.html +94 -25
- package/dist/{projection-C-dATsdO.js → projection-DKNLziP0.js} +282 -124
- package/dist/projection-DKNLziP0.js.map +1 -0
- package/dist/read-definitions-DFcOXatz.js +51 -0
- package/dist/read-definitions-DFcOXatz.js.map +1 -0
- package/dist/styles.css +69 -0
- package/dist/types/artifact/load.d.ts +1 -1
- package/dist/types/{layouts/EdgeOverlay.d.ts → components/ConnectorOverlay.d.ts} +6 -15
- package/dist/types/components/GraphLayout.d.ts +8 -0
- package/dist/types/components/LandscapeLayout.d.ts +9 -0
- package/dist/types/{layouts → components}/MapView.d.ts +4 -1
- package/dist/types/components/NeighbourhoodLayout.d.ts +7 -0
- package/dist/types/{layouts/NodeCard.d.ts → components/NodeComponent.d.ts} +1 -1
- package/dist/types/components/TreeLayout.d.ts +6 -0
- package/dist/types/{layouts → components}/XYLayout.d.ts +3 -3
- package/dist/types/{layouts → components}/annotations-context.d.ts +1 -1
- package/dist/types/components/layout.d.ts +22 -0
- package/dist/types/core/annotations.d.ts +2 -3
- package/dist/types/core/definition.d.ts +664 -30
- package/dist/types/core/layouts/graph/schema.d.ts +24 -0
- package/dist/types/core/layouts/helpers.d.ts +42 -0
- package/dist/types/core/layouts/landscape/projection.d.ts +75 -0
- package/dist/types/core/layouts/landscape/schema.d.ts +223 -0
- package/dist/types/core/layouts/neighbourhood/projection.d.ts +26 -0
- package/dist/types/core/layouts/neighbourhood/schema.d.ts +51 -0
- package/dist/types/core/layouts/schemas.d.ts +427 -0
- package/dist/types/core/{tree.d.ts → layouts/tree/projection.d.ts} +9 -11
- package/dist/types/core/layouts/xy/projection.d.ts +32 -0
- package/dist/types/core/{format/xy-layout.d.ts → layouts/xy/schema.d.ts} +2 -0
- package/dist/types/core/{format → schema}/definition-schema.d.ts +22 -12
- package/dist/types/core/{snapshot.d.ts → space-snapshot.d.ts} +1 -4
- package/dist/types/index.d.ts +6 -9
- package/dist/types/node/html.d.ts +6 -0
- package/dist/types/node/index.d.ts +7 -30
- package/dist/types/node/page.d.ts +1 -1
- package/dist/types/node/read-definitions.d.ts +17 -0
- package/dist/types/node/snapshot.d.ts +1 -1
- package/dist/types/viewer/Viewer.d.ts +5 -5
- package/package.json +10 -4
- package/dist/ParameterControls-A1HJWyt9.js.map +0 -1
- package/dist/definition-Cp1CCigh.js.map +0 -1
- package/dist/node-aizYAYlq.js +0 -130
- package/dist/node-aizYAYlq.js.map +0 -1
- package/dist/projection-C-dATsdO.js.map +0 -1
- package/dist/types/core/format/index.d.ts +0 -450
- package/dist/types/core/format/landscape-layout.d.ts +0 -102
- package/dist/types/core/graph.d.ts +0 -16
- package/dist/types/core/landscape.d.ts +0 -44
- package/dist/types/core/occurrence.d.ts +0 -11
- package/dist/types/core/xy.d.ts +0 -43
- package/dist/types/layouts/LandscapeLayout.d.ts +0 -8
- package/dist/types/layouts/TreeLayout.d.ts +0 -16
- /package/dist/types/{layouts → components}/ParameterControls.d.ts +0 -0
- /package/dist/types/{layouts → components}/ParameterInputs.d.ts +0 -0
- /package/dist/types/{layouts → components}/useParameterControls.d.ts +0 -0
- /package/dist/types/core/{format/tree-layout.d.ts → layouts/tree/schema.d.ts} +0 -0
- /package/dist/types/core/{format → schema}/param-ref.d.ts +0 -0
- /package/dist/types/core/{format → schema}/schema-url.d.ts +0 -0
- /package/dist/types/core/{format → schema}/settings.d.ts +0 -0
|
@@ -45,7 +45,7 @@ function filterAnnotations(index, level, sources) {
|
|
|
45
45
|
return filtered;
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region src/core/
|
|
48
|
+
//#region src/core/layouts/helpers.ts
|
|
49
49
|
var NONE = [];
|
|
50
50
|
/**
|
|
51
51
|
* Edges to a node's parents, in the order the node declares them. A graph narrowed by a filter keeps
|
|
@@ -66,8 +66,17 @@ function edgesWithin(graph) {
|
|
|
66
66
|
function isHierarchyEdge(edge, hierarchy) {
|
|
67
67
|
return hierarchy !== void 0 && edge.kind === "hierarchy" && edge.hierarchy === hierarchy.name;
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
/** Spread connectors joining the same pair of occurrences (in either direction) into lanes around 0. */
|
|
70
|
+
function assignLanes(connectors) {
|
|
71
|
+
const byPair = /* @__PURE__ */ new Map();
|
|
72
|
+
for (const connector of connectors) {
|
|
73
|
+
const pair = [connector.from, connector.to].sort().join("\n");
|
|
74
|
+
byPair.set(pair, [...byPair.get(pair) ?? [], connector]);
|
|
75
|
+
}
|
|
76
|
+
for (const group of byPair.values()) group.forEach((connector, i) => {
|
|
77
|
+
connector.lane = i - (group.length - 1) / 2;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
71
80
|
/**
|
|
72
81
|
* Path-based key for one occurrence of a node: region, then the steps from the outermost
|
|
73
82
|
* container down to the node. Unique within a map view even when a node appears several times.
|
|
@@ -77,101 +86,28 @@ function occurrenceKey(regionId, path) {
|
|
|
77
86
|
return JSON.stringify([regionId, ...path]);
|
|
78
87
|
}
|
|
79
88
|
//#endregion
|
|
80
|
-
//#region src/core/
|
|
89
|
+
//#region src/core/layouts/landscape/projection.ts
|
|
81
90
|
/**
|
|
82
|
-
* Lay a space out as
|
|
83
|
-
*
|
|
84
|
-
* Roots are root-type nodes with no hierarchy parent. Traversal is depth-first in space order,
|
|
85
|
-
* so a node's primary occurrence is under the parent reached first. Under its other parents a
|
|
86
|
-
* node is either repeated without its subtree (`repeat`), or left out and linked by a cross-edge
|
|
87
|
-
* (`cross-edge`). Either way traversal stops there, which also keeps cycles from recursing.
|
|
88
|
-
*/
|
|
89
|
-
function buildTree(graph, regionId, dag = "repeat") {
|
|
90
|
-
const { hierarchy } = graph;
|
|
91
|
-
const levelTypes = new Set(hierarchy?.levels.map((level) => level.type));
|
|
92
|
-
const rootType = hierarchy?.levels[0]?.type;
|
|
93
|
-
const primary = /* @__PURE__ */ new Map();
|
|
94
|
-
const pendingCross = [];
|
|
95
|
-
const hierarchyParents = (title) => parentEdges(graph, title).filter((edge) => isHierarchyEdge(edge, hierarchy));
|
|
96
|
-
const visit = (node, path) => {
|
|
97
|
-
const nodePath = [...path, node.id];
|
|
98
|
-
const key = occurrenceKey(regionId, nodePath);
|
|
99
|
-
primary.set(node.id, key);
|
|
100
|
-
const childTitles = new Set(childEdges(graph, node.id).filter((edge) => isHierarchyEdge(edge, hierarchy)).map((edge) => edge.child));
|
|
101
|
-
const children = [];
|
|
102
|
-
for (const title of childTitles) {
|
|
103
|
-
const child = graph.nodes.get(title);
|
|
104
|
-
const repeatOf = primary.get(title);
|
|
105
|
-
if (repeatOf === void 0) children.push(visit(child, nodePath));
|
|
106
|
-
else if (dag === "repeat") children.push({
|
|
107
|
-
key: occurrenceKey(regionId, [...nodePath, title]),
|
|
108
|
-
node: child,
|
|
109
|
-
children: [],
|
|
110
|
-
repeatOf
|
|
111
|
-
});
|
|
112
|
-
else pendingCross.push({
|
|
113
|
-
from: key,
|
|
114
|
-
child: title
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
key,
|
|
119
|
-
node,
|
|
120
|
-
children
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
const levelNodes = [...graph.nodes.values()].filter((node) => levelTypes.has(node.resolvedType));
|
|
124
|
-
const unparented = levelNodes.filter((node) => hierarchyParents(node.id).length === 0);
|
|
125
|
-
const roots = unparented.filter((node) => node.resolvedType === rootType).map((node) => visit(node, []));
|
|
126
|
-
const orphans = unparented.filter((node) => node.resolvedType !== rootType).map((node) => visit(node, []));
|
|
127
|
-
for (const node of levelNodes) if (!primary.has(node.id)) orphans.push(visit(node, []));
|
|
128
|
-
return {
|
|
129
|
-
roots,
|
|
130
|
-
orphans,
|
|
131
|
-
primary,
|
|
132
|
-
crossLinks: pendingCross.map(({ from, child }) => ({
|
|
133
|
-
from,
|
|
134
|
-
to: primary.get(child),
|
|
135
|
-
kind: "cross"
|
|
136
|
-
}))
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
/** Parent → child pairs of occurrence keys: one per rendered parent-child link, then cross-links. */
|
|
140
|
-
function treeLinks(tree) {
|
|
141
|
-
const links = [];
|
|
142
|
-
const walk = (occurrence) => {
|
|
143
|
-
for (const child of occurrence.children) {
|
|
144
|
-
links.push({
|
|
145
|
-
from: occurrence.key,
|
|
146
|
-
to: child.key,
|
|
147
|
-
kind: "tree"
|
|
148
|
-
});
|
|
149
|
-
walk(child);
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
for (const root of [...tree.roots, ...tree.orphans]) walk(root);
|
|
153
|
-
return [...links, ...tree.crossLinks];
|
|
154
|
-
}
|
|
155
|
-
//#endregion
|
|
156
|
-
//#region src/core/landscape.ts
|
|
157
|
-
/**
|
|
158
|
-
* Lay a space out as nested containers following the layout's grouping levels.
|
|
91
|
+
* Lay a space out as strips of nested containers following each strip's grouping levels.
|
|
159
92
|
*
|
|
160
93
|
* Adjacent node levels are joined by any edge between their types, in either direction, or only
|
|
161
94
|
* edges from `edge.field`. A `via` chain joins them through the skipped types. A field level
|
|
162
95
|
* splits the next node level by that field's values. A node reached from several containers
|
|
163
96
|
* appears in each, in full: the levels are finite, so repeating contents can't recurse.
|
|
97
|
+
*
|
|
98
|
+
* A dimension divides a strip into cells. A strip's first level is joined to a dimension's node the
|
|
99
|
+
* way a level is joined to the node level above, so `via` applies there too.
|
|
164
100
|
*/
|
|
165
101
|
function buildLandscape(graph, regionId, layout) {
|
|
166
|
-
const levels = layout.group;
|
|
167
102
|
const order = new Map([...graph.nodes.keys()].map((title, i) => [title, i]));
|
|
168
103
|
const first = /* @__PURE__ */ new Map();
|
|
169
|
-
const occurrenceFor = (candidate, levelIdx, path) => {
|
|
104
|
+
const occurrenceFor = (strip, candidate, levelIdx, path) => {
|
|
170
105
|
const { node } = candidate;
|
|
171
106
|
const nodePath = [...path, node.id];
|
|
172
107
|
const key = occurrenceKey(regionId, nodePath);
|
|
173
108
|
const repeatOf = first.get(node.id);
|
|
174
109
|
if (repeatOf === void 0) first.set(node.id, key);
|
|
110
|
+
strip.placed.add(node.id);
|
|
175
111
|
return {
|
|
176
112
|
key,
|
|
177
113
|
level: levelIdx,
|
|
@@ -181,15 +117,15 @@ function buildLandscape(graph, regionId, layout) {
|
|
|
181
117
|
},
|
|
182
118
|
via: candidate.via,
|
|
183
119
|
...repeatOf !== void 0 && { repeatOf },
|
|
184
|
-
children: place(levelIdx + 1, node, [], nodePath)
|
|
120
|
+
children: place(strip, levelIdx + 1, node, [], nodePath)
|
|
185
121
|
};
|
|
186
122
|
};
|
|
187
|
-
/** Occurrences for level `levelIdx` inside `anchor`, the nearest enclosing node. */
|
|
188
|
-
const place = (levelIdx, anchor, filters, path) => {
|
|
189
|
-
const level = levels[levelIdx];
|
|
123
|
+
/** Occurrences for level `levelIdx` of a strip inside `anchor`, the nearest enclosing node. */
|
|
124
|
+
const place = (strip, levelIdx, anchor, filters, path) => {
|
|
125
|
+
const level = strip.levels[levelIdx];
|
|
190
126
|
if (level === void 0) return [];
|
|
191
|
-
if (isTypeLevel(level)) return candidates(level, anchor, filters).map((c) => occurrenceFor(c, levelIdx, path));
|
|
192
|
-
const nodeLevel = levels.slice(levelIdx).find(isTypeLevel);
|
|
127
|
+
if (isTypeLevel(level)) return candidates(level, anchor, filters).map((c) => occurrenceFor(strip, c, levelIdx, path));
|
|
128
|
+
const nodeLevel = strip.levels.slice(levelIdx).find(isTypeLevel);
|
|
193
129
|
return distinctValues(candidates(nodeLevel, anchor, filters).map((c) => c.node), level.field).map((value) => {
|
|
194
130
|
const valuePath = [...path, [level.field, value]];
|
|
195
131
|
return {
|
|
@@ -201,19 +137,31 @@ function buildLandscape(graph, regionId, layout) {
|
|
|
201
137
|
value
|
|
202
138
|
},
|
|
203
139
|
via: [],
|
|
204
|
-
children: place(levelIdx + 1, anchor, [...filters, {
|
|
140
|
+
children: place(strip, levelIdx + 1, anchor, [...filters, {
|
|
205
141
|
field: level.field,
|
|
206
142
|
value
|
|
207
143
|
}], valuePath)
|
|
208
144
|
};
|
|
209
145
|
});
|
|
210
146
|
};
|
|
211
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Nodes of a type level joined to `anchor` and matching the filters. With no anchor they are all
|
|
149
|
+
* of the type at the top, or, under dimension nodes, those joined to every one of them.
|
|
150
|
+
*/
|
|
212
151
|
const candidates = (level, anchor, filters) => {
|
|
213
|
-
|
|
152
|
+
const nodeFilters = filters.filter((f) => "node" in f);
|
|
153
|
+
let reached;
|
|
154
|
+
if (anchor !== void 0) reached = walkChain(anchor, level.via ?? [], level.type, level.edge?.field);
|
|
155
|
+
else if (nodeFilters.length === 0) reached = ofType(level.type).map((node) => ({
|
|
214
156
|
node,
|
|
215
157
|
via: []
|
|
216
|
-
}))
|
|
158
|
+
}));
|
|
159
|
+
else {
|
|
160
|
+
const [head, ...rest] = nodeFilters.map((f) => walkChain(f.node, level.via ?? [], level.type, f.edge ?? level.edge?.field));
|
|
161
|
+
reached = head.filter((c) => rest.every((others) => others.some((o) => o.node.id === c.node.id)));
|
|
162
|
+
}
|
|
163
|
+
const values = filters.filter((f) => "field" in f);
|
|
164
|
+
return reached.filter(({ node }) => values.every((f) => valuesOf(node, f.field).includes(f.value)));
|
|
217
165
|
};
|
|
218
166
|
const ofType = (type) => [...graph.nodes.values()].filter((node) => node.resolvedType === type);
|
|
219
167
|
/** Neighbours of a node with the given type, across edges in either direction, in space order. */
|
|
@@ -250,18 +198,86 @@ function buildLandscape(graph, regionId, layout) {
|
|
|
250
198
|
}
|
|
251
199
|
return [...byTitle.values()].sort((a, b) => order.get(a.node.id) - order.get(b.node.id));
|
|
252
200
|
};
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
201
|
+
/**
|
|
202
|
+
* A dimension's groups, worked out once. A type dimension lists every node of its type, so it can
|
|
203
|
+
* show a group that holds nothing. A field dimension takes the values the nodes of `drawn` (the
|
|
204
|
+
* types of the first node level of each strip it divides) have, so a value no node has is not a group.
|
|
205
|
+
* A node with no value, or joined to no node of the dimension, is in none of its groups; it
|
|
206
|
+
* is shown as ungrouped, the same for both kinds.
|
|
207
|
+
* PROTOTYPE: groups come in space order. A field's declared domain, or an `order` field, would give
|
|
208
|
+
* the order authors expect and let a field dimension show empty groups too.
|
|
209
|
+
*/
|
|
210
|
+
const dimensionGroups = (dimension, drawn, prefix) => {
|
|
211
|
+
if ("type" in dimension) return ofType(dimension.type).map((node) => ({
|
|
212
|
+
group: {
|
|
213
|
+
key: occurrenceKey(regionId, [...prefix, node.id]),
|
|
214
|
+
item: {
|
|
215
|
+
kind: "node",
|
|
216
|
+
node
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
filter: {
|
|
220
|
+
node,
|
|
221
|
+
edge: dimension.edge?.field
|
|
222
|
+
},
|
|
223
|
+
segment: node.id
|
|
224
|
+
}));
|
|
225
|
+
const { field } = dimension;
|
|
226
|
+
return distinctValues(drawn.flatMap(ofType), field).filter((v) => v !== null).map((value) => ({
|
|
227
|
+
group: {
|
|
228
|
+
key: occurrenceKey(regionId, [...prefix, [field, value]]),
|
|
229
|
+
item: {
|
|
230
|
+
kind: "value",
|
|
231
|
+
field,
|
|
232
|
+
value
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
filter: {
|
|
236
|
+
field,
|
|
237
|
+
value
|
|
238
|
+
},
|
|
239
|
+
segment: [field, value]
|
|
240
|
+
}));
|
|
241
|
+
};
|
|
242
|
+
const firstNodeType = (strip) => strip.group.find(isTypeLevel).type;
|
|
243
|
+
/** Nodes of the strip's levels that no container or cell reached get their own contents, like tree orphans. */
|
|
244
|
+
const orphans = (strip, hasDimension, path) => {
|
|
245
|
+
const ungrouped = [];
|
|
246
|
+
strip.levels.forEach((level, levelIdx) => {
|
|
247
|
+
if (levelIdx === 0 && !hasDimension || !isTypeLevel(level)) return;
|
|
248
|
+
for (const node of ofType(level.type)) if (!strip.placed.has(node.id)) ungrouped.push(occurrenceFor(strip, {
|
|
249
|
+
node,
|
|
250
|
+
via: []
|
|
251
|
+
}, levelIdx, [...path, null]));
|
|
252
|
+
});
|
|
253
|
+
return ungrouped;
|
|
254
|
+
};
|
|
255
|
+
const layoutGroups = layout.dimension ? dimensionGroups(layout.dimension, [...new Set(layout.strips.map(firstNodeType))], []) : void 0;
|
|
256
|
+
const strips = layout.strips.map((strip, s) => {
|
|
257
|
+
const context = {
|
|
258
|
+
levels: strip.group,
|
|
259
|
+
placed: /* @__PURE__ */ new Set()
|
|
260
|
+
};
|
|
261
|
+
const stripPath = layout.strips.length > 1 ? [s] : [];
|
|
262
|
+
const own = strip.dimension ? dimensionGroups(strip.dimension, [firstNodeType(strip)], stripPath) : void 0;
|
|
263
|
+
const cells = (layoutGroups ?? [void 0]).flatMap((a, i) => (own ?? [void 0]).map((b, j) => {
|
|
264
|
+
const along = [a, b].filter((d) => d !== void 0);
|
|
265
|
+
const path = [...stripPath, ...along.map((d) => d.segment)];
|
|
266
|
+
return {
|
|
267
|
+
key: occurrenceKey(regionId, path),
|
|
268
|
+
at: [i, j],
|
|
269
|
+
children: place(context, 0, void 0, along.map((d) => d.filter), path)
|
|
270
|
+
};
|
|
271
|
+
}));
|
|
272
|
+
return {
|
|
273
|
+
...own && { dimension: own.map((d) => d.group) },
|
|
274
|
+
cells,
|
|
275
|
+
ungrouped: strip.showUngrouped ? orphans(context, layoutGroups !== void 0 || own !== void 0, stripPath) : []
|
|
276
|
+
};
|
|
261
277
|
});
|
|
262
278
|
return {
|
|
263
|
-
|
|
264
|
-
|
|
279
|
+
...layoutGroups && { dimension: layoutGroups.map((d) => d.group) },
|
|
280
|
+
strips
|
|
265
281
|
};
|
|
266
282
|
}
|
|
267
283
|
function isTypeLevel(level) {
|
|
@@ -279,11 +295,165 @@ function distinctValues(nodes, field) {
|
|
|
279
295
|
const present = [...values].filter((v) => v !== null);
|
|
280
296
|
return values.has(null) ? [...present, null] : present;
|
|
281
297
|
}
|
|
282
|
-
|
|
283
|
-
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region src/core/layouts/neighbourhood/projection.ts
|
|
300
|
+
var ORDER = [
|
|
301
|
+
"above",
|
|
302
|
+
"below",
|
|
303
|
+
"left",
|
|
304
|
+
"right"
|
|
305
|
+
];
|
|
306
|
+
/**
|
|
307
|
+
* The focus and its neighbours placed by role. Without a usable `focusId`, the focus is the
|
|
308
|
+
* first hierarchy root, else the first node.
|
|
309
|
+
*/
|
|
310
|
+
function buildNeighbourhood(graph, regionId, layout, focusId) {
|
|
311
|
+
const roles = {
|
|
312
|
+
above: [],
|
|
313
|
+
below: [],
|
|
314
|
+
left: [],
|
|
315
|
+
right: []
|
|
316
|
+
};
|
|
317
|
+
const node = focusId && graph.nodes.get(focusId) || graph.hierarchyRoots[0] || graph.nodes.values().next().value;
|
|
318
|
+
if (!node) return {
|
|
319
|
+
focus: void 0,
|
|
320
|
+
roles,
|
|
321
|
+
siblings: [],
|
|
322
|
+
connectors: []
|
|
323
|
+
};
|
|
324
|
+
const focus = {
|
|
325
|
+
key: occurrenceKey(regionId, [node.id]),
|
|
326
|
+
node
|
|
327
|
+
};
|
|
328
|
+
const roleOf = (edge, direction) => {
|
|
329
|
+
const listed = ORDER.find((role) => layout[role].includes(edge.field));
|
|
330
|
+
if (listed) return listed;
|
|
331
|
+
if (graph.hierarchy && !isHierarchyEdge(edge, graph.hierarchy)) return "left";
|
|
332
|
+
return direction === "parent" ? "above" : "below";
|
|
333
|
+
};
|
|
334
|
+
const best = /* @__PURE__ */ new Map();
|
|
335
|
+
const connectors = [];
|
|
336
|
+
const neighbour = (edge, direction) => {
|
|
337
|
+
const id = edge[direction];
|
|
338
|
+
const { field } = edge;
|
|
339
|
+
if (id === node.id || !graph.nodes.has(id)) return;
|
|
340
|
+
const role = roleOf(edge, direction);
|
|
341
|
+
const current = best.get(id);
|
|
342
|
+
if (!current || ORDER.indexOf(role) < ORDER.indexOf(current)) best.set(id, role);
|
|
343
|
+
const key = occurrenceKey(regionId, [node.id, id]);
|
|
344
|
+
connectors.push(direction === "parent" ? {
|
|
345
|
+
from: key,
|
|
346
|
+
to: focus.key,
|
|
347
|
+
field
|
|
348
|
+
} : {
|
|
349
|
+
from: focus.key,
|
|
350
|
+
to: key,
|
|
351
|
+
field
|
|
352
|
+
});
|
|
353
|
+
};
|
|
354
|
+
for (const edge of parentEdges(graph, node.id)) neighbour(edge, "parent");
|
|
355
|
+
for (const edge of childEdges(graph, node.id)) neighbour(edge, "child");
|
|
356
|
+
const occurrence = (other) => ({
|
|
357
|
+
key: occurrenceKey(regionId, [node.id, other.id]),
|
|
358
|
+
node: other
|
|
359
|
+
});
|
|
360
|
+
for (const [id, role] of best) roles[role].push(occurrence(graph.nodes.get(id)));
|
|
361
|
+
const hierarchyParents = parentEdges(graph, node.id).filter((edge) => isHierarchyEdge(edge, graph.hierarchy));
|
|
362
|
+
const sameLevel = graph.hierarchyRoots.includes(node) ? graph.hierarchyRoots.filter((root) => root.resolvedType === node.resolvedType) : hierarchyParents.flatMap((edge) => childEdges(graph, edge.parent)).filter((edge) => isHierarchyEdge(edge, graph.hierarchy)).map((edge) => graph.nodes.get(edge.child));
|
|
363
|
+
const siblings = [...new Set(sameLevel)].filter((other) => other !== node && !best.has(other.id)).map(occurrence);
|
|
364
|
+
assignLanes(connectors);
|
|
365
|
+
return {
|
|
366
|
+
focus,
|
|
367
|
+
roles,
|
|
368
|
+
siblings,
|
|
369
|
+
connectors
|
|
370
|
+
};
|
|
284
371
|
}
|
|
285
372
|
//#endregion
|
|
286
|
-
//#region src/core/
|
|
373
|
+
//#region src/core/layouts/tree/projection.ts
|
|
374
|
+
/**
|
|
375
|
+
* Lay a space out as a tree over its hierarchy.
|
|
376
|
+
*
|
|
377
|
+
* Roots are root-type nodes with no hierarchy parent. Traversal is depth-first in space order,
|
|
378
|
+
* so a node's primary occurrence is under the parent reached first. Under its other parents a
|
|
379
|
+
* node is either repeated without its subtree (`repeat`), or left out and linked by a cross-edge
|
|
380
|
+
* (`cross-edge`). Either way traversal stops there, which also keeps cycles from recursing.
|
|
381
|
+
*/
|
|
382
|
+
function buildTree(graph, regionId, dag = "repeat") {
|
|
383
|
+
const { hierarchy } = graph;
|
|
384
|
+
const levelTypes = new Set(hierarchy?.levels.map((level) => level.type));
|
|
385
|
+
const rootType = hierarchy?.levels[0]?.type;
|
|
386
|
+
const primary = /* @__PURE__ */ new Map();
|
|
387
|
+
const pendingCross = [];
|
|
388
|
+
const hierarchyParents = (title) => parentEdges(graph, title).filter((edge) => isHierarchyEdge(edge, hierarchy));
|
|
389
|
+
const visit = (node, path) => {
|
|
390
|
+
const nodePath = [...path, node.id];
|
|
391
|
+
const key = occurrenceKey(regionId, nodePath);
|
|
392
|
+
primary.set(node.id, key);
|
|
393
|
+
const childFields = /* @__PURE__ */ new Map();
|
|
394
|
+
for (const edge of childEdges(graph, node.id)) if (isHierarchyEdge(edge, hierarchy) && !childFields.has(edge.child)) childFields.set(edge.child, edge.field);
|
|
395
|
+
const children = [];
|
|
396
|
+
for (const [title, field] of childFields) {
|
|
397
|
+
const child = graph.nodes.get(title);
|
|
398
|
+
const repeatOf = primary.get(title);
|
|
399
|
+
if (repeatOf === void 0) children.push({
|
|
400
|
+
...visit(child, nodePath),
|
|
401
|
+
field
|
|
402
|
+
});
|
|
403
|
+
else if (dag === "repeat") children.push({
|
|
404
|
+
key: occurrenceKey(regionId, [...nodePath, title]),
|
|
405
|
+
node: child,
|
|
406
|
+
children: [],
|
|
407
|
+
repeatOf,
|
|
408
|
+
field
|
|
409
|
+
});
|
|
410
|
+
else pendingCross.push({
|
|
411
|
+
from: key,
|
|
412
|
+
child: title,
|
|
413
|
+
field
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
return {
|
|
417
|
+
key,
|
|
418
|
+
node,
|
|
419
|
+
children
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
const levelNodes = [...graph.nodes.values()].filter((node) => levelTypes.has(node.resolvedType));
|
|
423
|
+
const unparented = levelNodes.filter((node) => hierarchyParents(node.id).length === 0);
|
|
424
|
+
const roots = unparented.filter((node) => node.resolvedType === rootType).map((node) => visit(node, []));
|
|
425
|
+
const orphans = unparented.filter((node) => node.resolvedType !== rootType).map((node) => visit(node, []));
|
|
426
|
+
for (const node of levelNodes) if (!primary.has(node.id)) orphans.push(visit(node, []));
|
|
427
|
+
return {
|
|
428
|
+
roots,
|
|
429
|
+
orphans,
|
|
430
|
+
primary,
|
|
431
|
+
crossConnectors: pendingCross.map(({ from, child, field }) => ({
|
|
432
|
+
from,
|
|
433
|
+
to: primary.get(child),
|
|
434
|
+
field,
|
|
435
|
+
dashed: true
|
|
436
|
+
}))
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
/** Parent → child pairs of occurrence keys: one per rendered parent-child connector, then cross-edge connectors. */
|
|
440
|
+
function treeConnectors(tree) {
|
|
441
|
+
const connectors = [];
|
|
442
|
+
const walk = (occurrence) => {
|
|
443
|
+
for (const child of occurrence.children) {
|
|
444
|
+
connectors.push({
|
|
445
|
+
from: occurrence.key,
|
|
446
|
+
to: child.key,
|
|
447
|
+
field: child.field
|
|
448
|
+
});
|
|
449
|
+
walk(child);
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
for (const root of [...tree.roots, ...tree.orphans]) walk(root);
|
|
453
|
+
return [...connectors, ...tree.crossConnectors];
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/core/layouts/xy/projection.ts
|
|
287
457
|
/**
|
|
288
458
|
* Position nodes by two numeric fields. Every node of a plotted type appears once: on the plot
|
|
289
459
|
* when both its values are numbers inside the axes' domains, otherwise in `unplaced` with the
|
|
@@ -318,18 +488,17 @@ function buildXYPlot(graph, regionId, layout) {
|
|
|
318
488
|
}
|
|
319
489
|
const keys = new Map(points.map((p) => [p.node.id, p.key]));
|
|
320
490
|
const fields = new Set(layout.edgeFields);
|
|
321
|
-
const
|
|
491
|
+
const connectors = edgesWithin(graph).filter((e) => keys.has(e.parent) && keys.has(e.child) && (fields.size === 0 || fields.has(e.field))).map((e) => ({
|
|
322
492
|
from: keys.get(e.parent),
|
|
323
493
|
to: keys.get(e.child),
|
|
324
494
|
field: e.field,
|
|
325
|
-
|
|
326
|
-
lane: 0
|
|
495
|
+
dashed: !isHierarchyEdge(e, graph.hierarchy)
|
|
327
496
|
}));
|
|
328
|
-
assignLanes(
|
|
497
|
+
assignLanes(connectors);
|
|
329
498
|
return {
|
|
330
499
|
points,
|
|
331
500
|
unplaced,
|
|
332
|
-
|
|
501
|
+
connectors,
|
|
333
502
|
domains
|
|
334
503
|
};
|
|
335
504
|
}
|
|
@@ -354,18 +523,7 @@ function position(node, axis, [min, max]) {
|
|
|
354
523
|
const t = (value - min) / (max - min);
|
|
355
524
|
return axis.direction === "descending" ? 1 - t : t;
|
|
356
525
|
}
|
|
357
|
-
/** Spread links joining the same pair of nodes (in either direction) into lanes around 0. */
|
|
358
|
-
function assignLanes(links) {
|
|
359
|
-
const byPair = /* @__PURE__ */ new Map();
|
|
360
|
-
for (const link of links) {
|
|
361
|
-
const pair = [link.from, link.to].sort().join("\n");
|
|
362
|
-
byPair.set(pair, [...byPair.get(pair) ?? [], link]);
|
|
363
|
-
}
|
|
364
|
-
for (const group of byPair.values()) group.forEach((link, i) => {
|
|
365
|
-
link.lane = i - (group.length - 1) / 2;
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
526
|
//#endregion
|
|
369
|
-
export {
|
|
527
|
+
export { buildLandscape as a, isHierarchyEdge as c, filterAnnotations as d, worstSeverity as f, buildNeighbourhood as i, occurrenceKey as l, buildTree as n, assignLanes as o, treeConnectors as r, edgesWithin as s, buildXYPlot as t, annotationsFrom as u };
|
|
370
528
|
|
|
371
|
-
//# sourceMappingURL=projection-
|
|
529
|
+
//# sourceMappingURL=projection-DKNLziP0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection-DKNLziP0.js","names":[],"sources":["../src/core/annotations.ts","../src/core/layouts/helpers.ts","../src/core/layouts/landscape/projection.ts","../src/core/layouts/neighbourhood/projection.ts","../src/core/layouts/tree/projection.ts","../src/core/layouts/xy/projection.ts"],"sourcesContent":["import type { RuleSeverity, SpaceGraph, ValidationResult } from 'structured-context/api';\nimport type { NodeId, SourceLocation, ValidationIssueKind } from 'structured-context/types';\n\n/** structured-context's severity. */\nexport type Severity = RuleSeverity;\n\n/** structured-context's issue `kind`. */\nexport type AnnotationSource = ValidationIssueKind;\n\n/** One validation result attached to a node. */\nexport type NodeAnnotation = {\n severity: Severity;\n source: AnnotationSource;\n message: string;\n /** The violated rule, for `rule` results. */\n ruleId?: string;\n};\n\n/** A validation result with no node on the map to attach to. */\nexport type UnattachedAnnotation = NodeAnnotation & {\n nodeId?: NodeId;\n location?: SourceLocation;\n};\n\n/** Annotations by the id of the node they apply to. */\nexport type AnnotationIndex = ReadonlyMap<NodeId, readonly NodeAnnotation[]>;\n\ntype Issue = ValidationResult['issues'][number];\n\n/** A `ValidationResult`, or the output of `sctx validate --json`. */\nexport type ValidationInput = {\n issues: ReadonlyArray<Pick<Issue, 'kind' | 'severity' | 'message' | 'nodeId' | 'source'> & { ruleId?: string }>;\n};\n\n/** Attach validation issues to the nodes of `graph`. Issues whose node isn't in the graph are `unattached`. */\nexport function annotationsFrom(\n input: ValidationInput,\n graph: SpaceGraph,\n): { annotations: AnnotationIndex; unattached: UnattachedAnnotation[] } {\n const annotations = new Map<NodeId, NodeAnnotation[]>();\n const unattached: UnattachedAnnotation[] = [];\n\n for (const { kind, severity, message, nodeId, source, ruleId } of input.issues) {\n const annotation: NodeAnnotation = {\n severity,\n source: kind,\n message,\n ...(kind === 'rule' && ruleId !== undefined && { ruleId }),\n };\n if (nodeId !== undefined && graph.nodes.has(nodeId)) {\n annotations.set(nodeId, [...(annotations.get(nodeId) ?? []), annotation]);\n } else {\n unattached.push({\n ...annotation,\n ...(nodeId !== undefined && { nodeId }),\n ...(source !== undefined && { location: source }),\n });\n }\n }\n return { annotations, unattached };\n}\n\nconst RANK: Record<Severity, number> = { error: 0, warning: 1, info: 2 };\n\n/** The most serious severity among annotations, or undefined if there are none. */\nexport function worstSeverity(annotations: readonly NodeAnnotation[]): Severity | undefined {\n return annotations.reduce<Severity | undefined>(\n (worst, { severity }) => (worst === undefined || RANK[severity] < RANK[worst] ? severity : worst),\n undefined,\n );\n}\n\n/**\n * The annotations a map view shows: those at `level` or more serious, from `sources`. `off` shows none.\n * Nodes left with no annotations are dropped from the index.\n */\nexport function filterAnnotations(\n index: AnnotationIndex,\n level: Severity | 'off',\n sources: readonly AnnotationSource[],\n): AnnotationIndex {\n if (level === 'off') return new Map();\n const filtered = new Map<NodeId, readonly NodeAnnotation[]>();\n for (const [id, annotations] of index) {\n const kept = annotations.filter((a) => RANK[a.severity] <= RANK[level] && sources.includes(a.source));\n if (kept.length > 0) filtered.set(id, kept);\n }\n return filtered;\n}\n","import type { Hierarchy, SpaceGraph } from 'structured-context/api';\nimport type { NodeId } from 'structured-context/types';\n\n/** A directed parent → child edge of a space graph, carrying the metadata of the reference it came from. */\nexport type Edge = SpaceGraph['parentEdges'] extends ReadonlyMap<string, readonly (infer E)[]> ? E : never;\n\nconst NONE: readonly Edge[] = [];\n\n/**\n * Edges to a node's parents, in the order the node declares them. A graph narrowed by a filter keeps\n * edges to parents outside it; those are left out.\n */\nexport function parentEdges(graph: SpaceGraph, id: NodeId): readonly Edge[] {\n return (graph.parentEdges.get(id) ?? NONE).filter((edge) => graph.nodes.has(edge.parent));\n}\n\n/** Edges to a node's children, in graph order of the children. */\nexport function childEdges(graph: SpaceGraph, id: NodeId): readonly Edge[] {\n return graph.childEdges.get(id) ?? NONE;\n}\n\n/** Every edge whose parent and child are both in the graph. */\nexport function edgesWithin(graph: SpaceGraph): Edge[] {\n return [...graph.nodes.keys()].flatMap((id) => parentEdges(graph, id));\n}\n\n/** Whether an edge belongs to the given hierarchy (as opposed to a relationship or another hierarchy). */\nexport function isHierarchyEdge(edge: Edge, hierarchy: Hierarchy | undefined): boolean {\n return hierarchy !== undefined && edge.kind === 'hierarchy' && edge.hierarchy === hierarchy.name;\n}\n\n/**\n * A connector between two occurrences, by key, in the direction of the edge it draws.\n * `field` is the field the edge is declared in. `lane` separates connectors joining the same two\n * occurrences: 0 when there's one, otherwise centred around 0 (e.g. -0.5 and 0.5).\n * `dashed` marks a connector that is secondary to the layout's structure.\n */\nexport type Connector = { from: string; to: string; field?: string; lane?: number; dashed?: boolean };\n\n/** Spread connectors joining the same pair of occurrences (in either direction) into lanes around 0. */\nexport function assignLanes(connectors: Connector[]) {\n const byPair = new Map<string, Connector[]>();\n for (const connector of connectors) {\n const pair = [connector.from, connector.to].sort().join('\\n');\n byPair.set(pair, [...(byPair.get(pair) ?? []), connector]);\n }\n for (const group of byPair.values()) {\n group.forEach((connector, i) => {\n connector.lane = i - (group.length - 1) / 2;\n });\n }\n}\n\n/**\n * One step of an occurrence path: a node title, a `[field, value]` group, `null` for the ungrouped\n * area, or a number for a part of the layout picked by position. Each kind encodes differently in\n * JSON, so none can collide with another.\n */\nexport type PathSegment = string | readonly [field: string, value: string | null] | null | number;\n\n/**\n * Path-based key for one occurrence of a node: region, then the steps from the outermost\n * container down to the node. Unique within a map view even when a node appears several times.\n * Hosts can render several map views at once, so layouts scope keys to the map view instance.\n */\nexport function occurrenceKey(regionId: string, path: readonly PathSegment[]): string {\n return JSON.stringify([regionId, ...path]);\n}\n","import type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport type { LayoutConfig } from '../../definition';\nimport { childEdges, occurrenceKey, type PathSegment, parentEdges } from '../helpers';\n\n/** One rendered container or node in a landscape. */\nexport type LandscapeOccurrence = {\n /** Path-based key, unique within the map view (see {@link occurrenceKey}). */\n key: string;\n /** Index of the grouping level this occurrence belongs to, within its strip. */\n level: number;\n /** A node, or a field value common to the nodes inside (`null`: the field is empty). */\n item: { kind: 'node'; node: SpaceNode } | { kind: 'value'; field: string; value: string | null };\n /** Nodes on the `via` chain that joined this node to the node level above, one entry per skipped type. */\n via: ViaStep[];\n /** Key of the node's first occurrence when this is a repeat. Repeats are rendered in full. */\n repeatOf?: string;\n children: LandscapeOccurrence[];\n};\n\ntype ViaStep = { type: string; nodes: SpaceNode[] };\n\n/** A group of a dimension: a node of the dimension's type, or a value of its field. It holds nothing itself. */\nexport type LandscapeGroup = Pick<LandscapeOccurrence, 'key' | 'item'>;\n\ntype LandscapeStrip = {\n /** The strip's own dimension, dividing it further. */\n dimension?: LandscapeGroup[];\n /**\n * A cell for every group of the layout's dimension paired with every group of the strip's own, the\n * layout's varying slowest. A strip with no dimension has one cell.\n */\n cells: LandscapeCell[];\n /**\n * Nodes of the strip's levels that no cell or container reached (e.g. an Activity with no\n * Outcome when grouping by Outcomes), each with its own contents. Empty when the strip hides them.\n */\n ungrouped: LandscapeOccurrence[];\n};\n\n/** What the strip's grouping levels place among the nodes that belong to one group of each dimension. */\ntype LandscapeCell = {\n /** Path-based key of the strip and its group or pair of groups. */\n key: string;\n /** Indexes of its groups in the layout's dimension and in the strip's own; 0 where there is none. */\n at: [layout: number, strip: number];\n children: LandscapeOccurrence[];\n};\n\n/**\n * The layout as strips divided into cells. A dimension's groups are worked out once, so every cell\n * exists, empty or not. Which axis a dimension runs along is the component's choice. A plain\n * landscape is one strip with one cell and no dimension: the cell holds its top-level containers.\n */\nexport type Landscape = {\n /** The layout's dimension: its groups divide every strip alike, so the strips line up. */\n dimension?: LandscapeGroup[];\n /** The strips, in order. */\n strips: LandscapeStrip[];\n};\n\ntype Candidate = { node: SpaceNode; via: ViaStep[] };\ntype ValueFilter = { field: string; value: string | null };\ntype NodeFilter = { node: SpaceNode; edge?: string };\n/** Keeps the nodes with a field value, or the nodes joined to a node (across edges from `edge`, if set). */\ntype Filter = ValueFilter | NodeFilter;\n\n/**\n * Lay a space out as strips of nested containers following each strip's grouping levels.\n *\n * Adjacent node levels are joined by any edge between their types, in either direction, or only\n * edges from `edge.field`. A `via` chain joins them through the skipped types. A field level\n * splits the next node level by that field's values. A node reached from several containers\n * appears in each, in full: the levels are finite, so repeating contents can't recurse.\n *\n * A dimension divides a strip into cells. A strip's first level is joined to a dimension's node the\n * way a level is joined to the node level above, so `via` applies there too.\n */\nexport function buildLandscape(graph: SpaceGraph, regionId: string, layout: LayoutConfig<'landscape'>): Landscape {\n const order = new Map([...graph.nodes.keys()].map((title, i) => [title, i]));\n // The first occurrence of each node, across strips, for marking repeats.\n const first = new Map<string, string>();\n\n const occurrenceFor = (\n strip: StripContext,\n candidate: Candidate,\n levelIdx: number,\n path: readonly PathSegment[],\n ): LandscapeOccurrence => {\n const { node } = candidate;\n const nodePath = [...path, node.id];\n const key = occurrenceKey(regionId, nodePath);\n const repeatOf = first.get(node.id);\n if (repeatOf === undefined) first.set(node.id, key);\n strip.placed.add(node.id);\n return {\n key,\n level: levelIdx,\n item: { kind: 'node', node },\n via: candidate.via,\n ...(repeatOf !== undefined && { repeatOf }),\n children: place(strip, levelIdx + 1, node, [], nodePath),\n };\n };\n\n /** Occurrences for level `levelIdx` of a strip inside `anchor`, the nearest enclosing node. */\n const place = (\n strip: StripContext,\n levelIdx: number,\n anchor: SpaceNode | undefined,\n filters: readonly Filter[],\n path: readonly PathSegment[],\n ): LandscapeOccurrence[] => {\n const level = strip.levels[levelIdx];\n if (level === undefined) return [];\n if (isTypeLevel(level)) {\n return candidates(level, anchor, filters).map((c) => occurrenceFor(strip, c, levelIdx, path));\n }\n\n const nodeLevel = strip.levels.slice(levelIdx).find(isTypeLevel)!;\n const values = distinctValues(\n candidates(nodeLevel, anchor, filters).map((c) => c.node),\n level.field,\n );\n return values.map((value) => {\n const valuePath = [...path, [level.field, value] as const];\n return {\n key: occurrenceKey(regionId, valuePath),\n level: levelIdx,\n item: { kind: 'value', field: level.field, value },\n via: [],\n children: place(strip, levelIdx + 1, anchor, [...filters, { field: level.field, value }], valuePath),\n };\n });\n };\n\n /**\n * Nodes of a type level joined to `anchor` and matching the filters. With no anchor they are all\n * of the type at the top, or, under dimension nodes, those joined to every one of them.\n */\n const candidates = (level: TypeLevel, anchor: SpaceNode | undefined, filters: readonly Filter[]): Candidate[] => {\n const nodeFilters = filters.filter((f): f is NodeFilter => 'node' in f);\n let reached: Candidate[];\n if (anchor !== undefined) {\n reached = walkChain(anchor, level.via ?? [], level.type, level.edge?.field);\n } else if (nodeFilters.length === 0) {\n reached = ofType(level.type).map((node) => ({ node, via: [] }));\n } else {\n // PROTOTYPE: a dimension's `edge` applies to the last hop of a `via` chain, like a level's own,\n // and the skipped nodes shown for `intermediate: breadcrumb` come from the layout dimension only.\n const [head, ...rest] = nodeFilters.map((f) =>\n walkChain(f.node, level.via ?? [], level.type, f.edge ?? level.edge?.field),\n );\n reached = head!.filter((c) => rest.every((others) => others.some((o) => o.node.id === c.node.id)));\n }\n const values = filters.filter((f): f is ValueFilter => 'field' in f);\n return reached.filter(({ node }) => values.every((f) => valuesOf(node, f.field).includes(f.value)));\n };\n\n const ofType = (type: string) => [...graph.nodes.values()].filter((node) => node.resolvedType === type);\n\n /** Neighbours of a node with the given type, across edges in either direction, in space order. */\n const neighbours = (title: SpaceNode['id'], type: string, field: string | undefined): SpaceNode[] => {\n const titles = new Set([\n ...childEdges(graph, title)\n .filter((e) => field === undefined || e.field === field)\n .map((e) => e.child),\n ...parentEdges(graph, title)\n .filter((e) => field === undefined || e.field === field)\n .map((e) => e.parent),\n ]);\n return [...titles]\n .map((t) => graph.nodes.get(t)!)\n .filter((node) => node.resolvedType === type)\n .sort((a, b) => order.get(a.id)! - order.get(b.id)!);\n };\n\n /**\n * Follow edges from `anchor` through each `via` type to `target`, keeping the skipped nodes on\n * the way to each target node. Several chains to one target merge into one candidate.\n */\n const walkChain = (anchor: SpaceNode, via: readonly string[], target: string, field: string | undefined) => {\n let frontier = [{ node: anchor, trail: [] as SpaceNode[] }];\n for (const type of via) {\n frontier = frontier.flatMap(({ node, trail }) =>\n neighbours(node.id, type, undefined).map((next) => ({ node: next, trail: [...trail, next] })),\n );\n }\n const byTitle = new Map<string, Candidate>();\n for (const { node, trail } of frontier) {\n for (const next of neighbours(node.id, target, field)) {\n const candidate = byTitle.get(next.id) ?? { node: next, via: via.map((type) => ({ type, nodes: [] })) };\n trail.forEach((skipped, i) => {\n const step = candidate.via[i]!;\n if (!step.nodes.includes(skipped)) step.nodes.push(skipped);\n });\n byTitle.set(next.id, candidate);\n }\n }\n return [...byTitle.values()].sort((a, b) => order.get(a.node.id)! - order.get(b.node.id)!);\n };\n\n /**\n * A dimension's groups, worked out once. A type dimension lists every node of its type, so it can\n * show a group that holds nothing. A field dimension takes the values the nodes of `drawn` (the\n * types of the first node level of each strip it divides) have, so a value no node has is not a group.\n * A node with no value, or joined to no node of the dimension, is in none of its groups; it\n * is shown as ungrouped, the same for both kinds.\n * PROTOTYPE: groups come in space order. A field's declared domain, or an `order` field, would give\n * the order authors expect and let a field dimension show empty groups too.\n */\n const dimensionGroups = (\n dimension: Dimension,\n drawn: readonly string[],\n prefix: readonly PathSegment[],\n ): { group: LandscapeGroup; filter: Filter; segment: PathSegment }[] => {\n if ('type' in dimension) {\n return ofType(dimension.type).map((node) => ({\n group: { key: occurrenceKey(regionId, [...prefix, node.id]), item: { kind: 'node', node } },\n filter: { node, edge: dimension.edge?.field },\n segment: node.id,\n }));\n }\n const { field } = dimension;\n const nodes = drawn.flatMap(ofType);\n return distinctValues(nodes, field)\n .filter((v) => v !== null)\n .map((value) => ({\n group: { key: occurrenceKey(regionId, [...prefix, [field, value]]), item: { kind: 'value', field, value } },\n filter: { field, value },\n segment: [field, value],\n }));\n };\n\n const firstNodeType = (strip: Strip) => strip.group.find(isTypeLevel)!.type;\n\n /** Nodes of the strip's levels that no container or cell reached get their own contents, like tree orphans. */\n const orphans = (strip: StripContext, hasDimension: boolean, path: readonly PathSegment[]) => {\n const ungrouped: LandscapeOccurrence[] = [];\n strip.levels.forEach((level, levelIdx) => {\n // The first level has no container above it unless a dimension divides the strip.\n if ((levelIdx === 0 && !hasDimension) || !isTypeLevel(level)) return;\n for (const node of ofType(level.type)) {\n if (!strip.placed.has(node.id)) {\n ungrouped.push(occurrenceFor(strip, { node, via: [] }, levelIdx, [...path, null]));\n }\n }\n });\n return ungrouped;\n };\n\n const layoutGroups = layout.dimension\n ? dimensionGroups(layout.dimension, [...new Set(layout.strips.map(firstNodeType))], [])\n : undefined;\n const strips = layout.strips.map((strip, s): LandscapeStrip => {\n const context: StripContext = { levels: strip.group, placed: new Set() };\n // Keys name the strip only where several could share a path; a lone strip keeps the shorter key.\n const stripPath: PathSegment[] = layout.strips.length > 1 ? [s] : [];\n const own = strip.dimension ? dimensionGroups(strip.dimension, [firstNodeType(strip)], stripPath) : undefined;\n const cells = (layoutGroups ?? [undefined]).flatMap((a, i) =>\n (own ?? [undefined]).map((b, j): LandscapeCell => {\n const along = [a, b].filter((d) => d !== undefined);\n const path = [...stripPath, ...along.map((d) => d.segment)];\n return {\n key: occurrenceKey(regionId, path),\n at: [i, j],\n children: place(\n context,\n 0,\n undefined,\n along.map((d) => d.filter),\n path,\n ),\n };\n }),\n );\n return {\n ...(own && { dimension: own.map((d) => d.group) }),\n cells,\n ungrouped: strip.showUngrouped\n ? orphans(context, layoutGroups !== undefined || own !== undefined, stripPath)\n : [],\n };\n });\n\n return { ...(layoutGroups && { dimension: layoutGroups.map((d) => d.group) }), strips };\n}\n\n/** A strip being placed: its levels, and the nodes it has drawn so far. */\ntype StripContext = { levels: readonly GroupLevel[]; placed: Set<string> };\ntype Strip = LayoutConfig<'landscape'>['strips'][number];\ntype GroupLevel = Strip['group'][number];\ntype TypeLevel = Extract<GroupLevel, { type: string }>;\ntype Dimension = NonNullable<LayoutConfig<'landscape'>['dimension']>;\n\nfunction isTypeLevel(level: GroupLevel): level is TypeLevel {\n return 'type' in level;\n}\n\n/** A field's values as group labels: strings, an entry per array item, `null` when empty. */\nfunction valuesOf(node: SpaceNode, field: string): (string | null)[] {\n const raw = node.schemaData[field];\n const list = (Array.isArray(raw) ? raw : [raw]).filter((v) => v !== undefined && v !== null && v !== '');\n return list.length === 0 ? [null] : list.map((v) => (typeof v === 'object' ? JSON.stringify(v) : String(v)));\n}\n\n/** Distinct values in first-seen order, with the empty group last. */\nfunction distinctValues(nodes: SpaceNode[], field: string): (string | null)[] {\n const values = new Set(nodes.flatMap((node) => valuesOf(node, field)));\n const present = [...values].filter((v): v is string => v !== null);\n return values.has(null) ? [...present, null] : present;\n}\n","import type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport type { LayoutConfig } from '../../definition';\nimport {\n assignLanes,\n type Connector,\n childEdges,\n type Edge,\n isHierarchyEdge,\n occurrenceKey,\n parentEdges,\n} from '../helpers';\n\ntype NeighbourhoodRole = 'above' | 'below' | 'left' | 'right';\n\n/** One occurrence in a neighbourhood. A neighbour is placed once, however many fields join it to the focus. */\nexport type Neighbour = { key: string; node: SpaceNode };\n\nexport type Neighbourhood = {\n /** `undefined` when the graph has no nodes. */\n focus: Neighbour | undefined;\n roles: Record<NeighbourhoodRole, Neighbour[]>;\n /**\n * The nodes that share a hierarchy parent with the focus or, for a hierarchy root, the other\n * roots of its type. No edge joins them to the focus, so they have no connector.\n */\n siblings: Neighbour[];\n connectors: Connector[];\n};\n\nconst ORDER: readonly NeighbourhoodRole[] = ['above', 'below', 'left', 'right'];\n\n/**\n * The focus and its neighbours placed by role. Without a usable `focusId`, the focus is the\n * first hierarchy root, else the first node.\n */\nexport function buildNeighbourhood(\n graph: SpaceGraph,\n regionId: string,\n layout: LayoutConfig<'neighbourhood'>,\n focusId?: SpaceNode['id'],\n): Neighbourhood {\n const roles: Neighbourhood['roles'] = { above: [], below: [], left: [], right: [] };\n const node = (focusId && graph.nodes.get(focusId)) || graph.hierarchyRoots[0] || graph.nodes.values().next().value;\n if (!node) return { focus: undefined, roles, siblings: [], connectors: [] };\n const focus = { key: occurrenceKey(regionId, [node.id]), node };\n\n // A field a role lists goes there. Otherwise the hierarchy runs down the page and relationships\n // sit to the left; with no hierarchy, every edge runs down the page.\n const roleOf = (edge: Edge, direction: 'parent' | 'child'): NeighbourhoodRole => {\n const listed = ORDER.find((role) => layout[role].includes(edge.field));\n if (listed) return listed;\n if (graph.hierarchy && !isHierarchyEdge(edge, graph.hierarchy)) return 'left';\n return direction === 'parent' ? 'above' : 'below';\n };\n\n const best = new Map<SpaceNode['id'], NeighbourhoodRole>();\n const connectors: Connector[] = [];\n const neighbour = (edge: Edge, direction: 'parent' | 'child') => {\n const id = edge[direction];\n const { field } = edge;\n if (id === node.id || !graph.nodes.has(id)) return;\n const role = roleOf(edge, direction);\n const current = best.get(id);\n if (!current || ORDER.indexOf(role) < ORDER.indexOf(current)) best.set(id, role);\n const key = occurrenceKey(regionId, [node.id, id]);\n connectors.push(direction === 'parent' ? { from: key, to: focus.key, field } : { from: focus.key, to: key, field });\n };\n for (const edge of parentEdges(graph, node.id)) neighbour(edge, 'parent');\n for (const edge of childEdges(graph, node.id)) neighbour(edge, 'child');\n\n const occurrence = (other: SpaceNode) => ({ key: occurrenceKey(regionId, [node.id, other.id]), node: other });\n for (const [id, role] of best) roles[role].push(occurrence(graph.nodes.get(id)!));\n const hierarchyParents = parentEdges(graph, node.id).filter((edge) => isHierarchyEdge(edge, graph.hierarchy));\n const sameLevel = graph.hierarchyRoots.includes(node)\n ? graph.hierarchyRoots.filter((root) => root.resolvedType === node.resolvedType)\n : hierarchyParents\n .flatMap((edge) => childEdges(graph, edge.parent))\n .filter((edge) => isHierarchyEdge(edge, graph.hierarchy))\n .map((edge) => graph.nodes.get(edge.child)!);\n const siblings = [...new Set(sameLevel)].filter((other) => other !== node && !best.has(other.id)).map(occurrence);\n assignLanes(connectors);\n return { focus, roles, siblings, connectors };\n}\n","import type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport type { LayoutConfig } from '../../definition';\nimport { type Connector, childEdges, isHierarchyEdge, occurrenceKey, parentEdges } from '../helpers';\n\n/** One rendered appearance of a node in a tree. */\nexport type TreeOccurrence = {\n /** Path-based key, unique within the map view (see {@link occurrenceKey}). */\n key: string;\n node: SpaceNode;\n children: TreeOccurrence[];\n /**\n * Key of the node's primary occurrence when this is a repeat. A node with several parents\n * appears under each of them, but its subtree is only rendered at its first occurrence.\n */\n repeatOf?: string;\n /** The field the parent declares this node through (the edge's label); unset for roots. */\n field?: string;\n};\n\nexport type Tree = {\n roots: TreeOccurrence[];\n /**\n * Hierarchy-typed nodes not reachable from a root, rendered as extra roots: nodes with no\n * hierarchy parent in the space, then entry points into otherwise unreachable cycles.\n */\n orphans: TreeOccurrence[];\n /** Key of each node's primary (first, fully rendered) occurrence. */\n primary: ReadonlyMap<string, string>;\n /**\n * In cross-edge mode, connectors from a node's other parents to its primary occurrence, which\n * replace repeat occurrences. Empty in repeat mode.\n */\n crossConnectors: Connector[];\n};\n\n/**\n * Lay a space out as a tree over its hierarchy.\n *\n * Roots are root-type nodes with no hierarchy parent. Traversal is depth-first in space order,\n * so a node's primary occurrence is under the parent reached first. Under its other parents a\n * node is either repeated without its subtree (`repeat`), or left out and linked by a cross-edge\n * (`cross-edge`). Either way traversal stops there, which also keeps cycles from recursing.\n */\nexport function buildTree(graph: SpaceGraph, regionId: string, dag: LayoutConfig<'tree'>['dag'] = 'repeat'): Tree {\n const { hierarchy } = graph;\n const levelTypes = new Set(hierarchy?.levels.map((level) => level.type));\n const rootType = hierarchy?.levels[0]?.type;\n const primary = new Map<string, string>();\n // Parent occurrence → child title, resolved to the child's primary occurrence afterwards.\n const pendingCross: { from: string; child: string; field: string }[] = [];\n\n const hierarchyParents = (title: SpaceNode['id']) =>\n parentEdges(graph, title).filter((edge) => isHierarchyEdge(edge, hierarchy));\n\n const visit = (node: SpaceNode, path: readonly string[]): TreeOccurrence => {\n const nodePath = [...path, node.id];\n const key = occurrenceKey(regionId, nodePath);\n primary.set(node.id, key);\n // A child can reference the same parent through more than one field; it occurs once, under the first.\n const childFields = new Map<SpaceNode['id'], string>();\n for (const edge of childEdges(graph, node.id)) {\n if (isHierarchyEdge(edge, hierarchy) && !childFields.has(edge.child)) childFields.set(edge.child, edge.field);\n }\n const children: TreeOccurrence[] = [];\n for (const [title, field] of childFields) {\n const child = graph.nodes.get(title)!;\n const repeatOf = primary.get(title);\n if (repeatOf === undefined) children.push({ ...visit(child, nodePath), field });\n else if (dag === 'repeat')\n children.push({\n key: occurrenceKey(regionId, [...nodePath, title]),\n node: child,\n children: [],\n repeatOf,\n field,\n });\n else pendingCross.push({ from: key, child: title, field });\n }\n return { key, node, children };\n };\n\n const levelNodes = [...graph.nodes.values()].filter((node) => levelTypes.has(node.resolvedType));\n const unparented = levelNodes.filter((node) => hierarchyParents(node.id).length === 0);\n const roots = unparented.filter((node) => node.resolvedType === rootType).map((node) => visit(node, []));\n const orphans = unparented.filter((node) => node.resolvedType !== rootType).map((node) => visit(node, []));\n // Nodes only reachable through a cycle have a parent but no path from a root. Rather than\n // drop them, enter each such cycle at its first node in space order.\n for (const node of levelNodes) {\n if (!primary.has(node.id)) orphans.push(visit(node, []));\n }\n\n const crossConnectors = pendingCross.map(({ from, child, field }) => ({\n from,\n to: primary.get(child)!,\n field,\n dashed: true,\n }));\n return { roots, orphans, primary, crossConnectors };\n}\n\n/** Parent → child pairs of occurrence keys: one per rendered parent-child connector, then cross-edge connectors. */\nexport function treeConnectors(tree: Tree): Connector[] {\n const connectors: Connector[] = [];\n const walk = (occurrence: TreeOccurrence) => {\n for (const child of occurrence.children) {\n connectors.push({ from: occurrence.key, to: child.key, field: child.field });\n walk(child);\n }\n };\n for (const root of [...tree.roots, ...tree.orphans]) walk(root);\n return [...connectors, ...tree.crossConnectors];\n}\n","import type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport type { LayoutConfig } from '../../definition';\nimport { assignLanes, type Connector, edgesWithin, isHierarchyEdge, occurrenceKey } from '../helpers';\n\ntype XYPlot = {\n /** `x` and `y` run from 0 to 1 across the plot, left to right and bottom to top. */\n points: { key: string; node: SpaceNode; x: number; y: number }[];\n /** Nodes of a plotted type that couldn't be placed, with the reason per axis. */\n unplaced: { key: string; node: SpaceNode; reasons: string[] }[];\n /** Relationship edges are dashed, to tell them from the hierarchy. */\n connectors: Connector[];\n /** Each axis's [min, max]; `direction` says which end is drawn where. */\n domains: { x: readonly [number, number]; y: readonly [number, number] };\n};\n\n/**\n * Position nodes by two numeric fields. Every node of a plotted type appears once: on the plot\n * when both its values are numbers inside the axes' domains, otherwise in `unplaced` with the\n * reason. Positions are normalised; layouts decide the plot's size.\n */\nexport function buildXYPlot(graph: SpaceGraph, regionId: string, layout: LayoutConfig<'xy'>): XYPlot {\n const { x, y } = layout;\n const nodes = [...graph.nodes.values()];\n const types = new Set(\n layout.types.length > 0\n ? layout.types\n : nodes\n .filter((n) => isNumber(n.schemaData[x.field]) || isNumber(n.schemaData[y.field]))\n .map((n) => n.resolvedType),\n );\n const plotted = nodes.filter((n) => types.has(n.resolvedType));\n\n const domains = {\n x: domainOf(x, plotted),\n y: domainOf(y, plotted),\n };\n\n const points: XYPlot['points'] = [];\n const unplaced: XYPlot['unplaced'] = [];\n for (const node of plotted) {\n const key = occurrenceKey(regionId, [node.id]);\n const px = position(node, x, domains.x);\n const py = position(node, y, domains.y);\n if (typeof px === 'number' && typeof py === 'number') points.push({ key, node, x: px, y: py });\n else unplaced.push({ key, node, reasons: [px, py].filter((r): r is string => typeof r === 'string') });\n }\n\n const keys = new Map<string, string>(points.map((p) => [p.node.id, p.key]));\n const fields = new Set(layout.edgeFields);\n const connectors: Connector[] = edgesWithin(graph)\n .filter((e) => keys.has(e.parent) && keys.has(e.child) && (fields.size === 0 || fields.has(e.field)))\n .map((e) => ({\n from: keys.get(e.parent)!,\n to: keys.get(e.child)!,\n field: e.field,\n dashed: !isHierarchyEdge(e, graph.hierarchy),\n }));\n assignLanes(connectors);\n\n return { points, unplaced, connectors, domains };\n}\n\nfunction isNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value);\n}\n\n/** The axis's fixed domain, or the range of plotted values (widened when they're all equal). */\nfunction domainOf(axis: LayoutConfig<'xy'>['x'], nodes: readonly SpaceNode[]): readonly [number, number] {\n if (Array.isArray(axis.domain)) return [axis.domain[0]!, axis.domain[1]!];\n const values = nodes.map((n) => n.schemaData[axis.field]).filter(isNumber);\n if (values.length === 0) return [0, 1];\n const min = Math.min(...values);\n const max = Math.max(...values);\n return min === max ? [min - 1, max + 1] : [min, max];\n}\n\n/** The node's normalised position on the axis, or why it has none. */\nfunction position(\n node: SpaceNode,\n axis: LayoutConfig<'xy'>['x'],\n [min, max]: readonly [number, number],\n): number | string {\n const value = node.schemaData[axis.field];\n if (value === undefined || value === null) return `no ${axis.field}`;\n if (!isNumber(value)) return `${axis.field} is not a number`;\n if (value < min || value > max) return `${axis.field} ${value} is outside ${min}–${max}`;\n const t = (value - min) / (max - min);\n return axis.direction === 'descending' ? 1 - t : t;\n}\n"],"mappings":";;AAmCA,SAAgB,gBACd,OACA,OACsE;CACtE,MAAM,8BAAc,IAAI,IAA8B;CACtD,MAAM,aAAqC,CAAC;CAE5C,KAAK,MAAM,EAAE,MAAM,UAAU,SAAS,QAAQ,QAAQ,YAAY,MAAM,QAAQ;EAC9E,MAAM,aAA6B;GACjC;GACA,QAAQ;GACR;GACA,GAAI,SAAS,UAAU,WAAW,KAAA,KAAa,EAAE,OAAO;EAC1D;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