@arqlet/contracts 0.7.0 → 0.9.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/dist/index.d.ts +397 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,12 @@ severity?: string | null, };
|
|
|
21
21
|
/**
|
|
22
22
|
* Renderer settings never change graph topology or explicit port contracts.
|
|
23
23
|
*/
|
|
24
|
-
export type AppearanceConfig = { showPorts: boolean,
|
|
24
|
+
export type AppearanceConfig = { showPorts: boolean,
|
|
25
|
+
/**
|
|
26
|
+
* Provisional: bridges (line hops) where two routes cross: the route drawn later passes over the other in a small
|
|
27
|
+
* half circle; drawn by every renderer from the scene's points. Off by default (omitted).
|
|
28
|
+
*/
|
|
29
|
+
bridges?: boolean, };
|
|
25
30
|
|
|
26
31
|
/**
|
|
27
32
|
* One entry of the bounded archive of measured candidates at a publication (metadata only; the snapshot is not kept).
|
|
@@ -42,7 +47,13 @@ export type Bundling = "none" | "complete";
|
|
|
42
47
|
* An explicit bus (`Graph::buses`): edges drawn with one shared trunk. The edges that share an end (all one source,
|
|
43
48
|
* or all one target) leave (enter) that node by one port and share the way to where they branch off.
|
|
44
49
|
*/
|
|
45
|
-
export type Bus = { id: string,
|
|
50
|
+
export type Bus = { id: string,
|
|
51
|
+
/**
|
|
52
|
+
* The member edges of a bus drawn on shared routes. Optional in input (`[]`); a bus with `taps` is a shared medium
|
|
53
|
+
* whatever its input `edges` hold: they are dropped at the import (`Graph::taps_as_media`, #145), and the view fills
|
|
54
|
+
* them with the lines it draws.
|
|
55
|
+
*/
|
|
56
|
+
edges?: Array<string>,
|
|
46
57
|
/**
|
|
47
58
|
* What the bus is called in the drawing ("CAN 500 kbit/s"). Placed like an edge label when the options give its size
|
|
48
59
|
* under `edge_labels["bus:<id>"]`; omitted when none.
|
|
@@ -167,6 +178,30 @@ sizePins?: { [key in string]: SizePin },
|
|
|
167
178
|
*/
|
|
168
179
|
labels?: { [key in string]: Point }, };
|
|
169
180
|
|
|
181
|
+
/**
|
|
182
|
+
* Provisional (view details): the answer of `details` (besides `ok`) for a node or an edge: what the engine knows about it
|
|
183
|
+
* and the host cannot see in the scene (the groups above it, what a collapsed box holds, the edges a drawn line stands
|
|
184
|
+
* for). Domain attributes stay with the host, which looks them up by id. Read only.
|
|
185
|
+
*/
|
|
186
|
+
export type DetailsAnswer = {
|
|
187
|
+
/**
|
|
188
|
+
* The node asked for (`nodeId`).
|
|
189
|
+
*/
|
|
190
|
+
node?: NodeDetails,
|
|
191
|
+
/**
|
|
192
|
+
* The edge of the source graph asked for (`edgeId` naming one).
|
|
193
|
+
*/
|
|
194
|
+
edge?: EdgeDetails,
|
|
195
|
+
/**
|
|
196
|
+
* The drawn line asked for (`edgeId` naming a route), or the one that carries the edge asked for.
|
|
197
|
+
*/
|
|
198
|
+
route?: LineDetails,
|
|
199
|
+
/**
|
|
200
|
+
* Provisional (ADR 0023, R1): the revision of the session's content the properties were read at; omitted without
|
|
201
|
+
* content.
|
|
202
|
+
*/
|
|
203
|
+
contentRevision?: bigint, };
|
|
204
|
+
|
|
170
205
|
export type Edge = { id: string, kind: string, source: string, target: string | null,
|
|
171
206
|
/**
|
|
172
207
|
* Provisional: how many edges this edge stands for (a pre-aggregated relation), at least 1; 1 when left out. It
|
|
@@ -175,6 +210,19 @@ export type Edge = { id: string, kind: string, source: string, target: string |
|
|
|
175
210
|
*/
|
|
176
211
|
weight?: number, };
|
|
177
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Provisional: an edge of the source graph (`details`).
|
|
215
|
+
*/
|
|
216
|
+
export type EdgeDetails = { id: string, kind: string, source: string, target: string | null,
|
|
217
|
+
/**
|
|
218
|
+
* The drawn line that carries it, or null when the view does not show it (an end hidden, both ends in one box).
|
|
219
|
+
*/
|
|
220
|
+
route: string | null,
|
|
221
|
+
/**
|
|
222
|
+
* Provisional (ADR 0023, R1): the edge's properties from the session's content; omitted when it has none.
|
|
223
|
+
*/
|
|
224
|
+
properties?: Record<string, unknown>, };
|
|
225
|
+
|
|
178
226
|
export type EdgePorts = { edgeId: string, sourcePort: string | null, targetPort: string | null, };
|
|
179
227
|
|
|
180
228
|
/**
|
|
@@ -210,6 +258,27 @@ preview?: boolean,
|
|
|
210
258
|
*/
|
|
211
259
|
settle?: Settle | null, };
|
|
212
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Provisional (search): the answer of `find` (besides `ok`): the nodes of the source graph whose label or id contains the
|
|
263
|
+
* query (ignoring case), best first: an exact match, then a prefix, then a word start, then anywhere; equal ones by label
|
|
264
|
+
* and id. At most `limit` matches; `total` counts them all.
|
|
265
|
+
*/
|
|
266
|
+
export type FindAnswer = { matches: Array<FindMatch>, total: number,
|
|
267
|
+
/**
|
|
268
|
+
* Provisional (ADR 0023, R1): with `key`, the revision of the session's content that was searched.
|
|
269
|
+
*/
|
|
270
|
+
contentRevision?: bigint, };
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Provisional: a node `find` found, with the containers above it (outermost first) and the visible box that shows it
|
|
274
|
+
* (itself, the collapsed container it is in, or null when the view hides it), so that a host can `reveal` it.
|
|
275
|
+
*/
|
|
276
|
+
export type FindMatch = { id: string, label: string, kind: string, parents: Array<string>, shownAs: string | null,
|
|
277
|
+
/**
|
|
278
|
+
* Provisional (ADR 0023, R1): with `key`, the value of that property that matched.
|
|
279
|
+
*/
|
|
280
|
+
value?: unknown, };
|
|
281
|
+
|
|
213
282
|
export type GeometryIssue = { kind: string, nodeIds: Array<string>, message: string, };
|
|
214
283
|
|
|
215
284
|
/**
|
|
@@ -236,7 +305,7 @@ origin?: Point | null, };
|
|
|
236
305
|
* A graph: the canonical data of a view. Direction and layout strategy are two constraints, each set for the root and for
|
|
237
306
|
* containers and inherited by containers that declare nothing (docs/adr/0003-container-direction-constraints.md).
|
|
238
307
|
*/
|
|
239
|
-
export type Graph = { defaultDirection?: "lr" | "rl" | "tb" | "bt" | "auto" | Array<"lr" | "rl" | "tb" | "bt">, containerDirections?: { [key in string]: "lr" | "rl" | "tb" | "bt" | "auto" | Array<"lr" | "rl" | "tb" | "bt"> }, defaultStrategy?: "none" | "tree" | "radial" | "auto" | Array<"none" | "tree" | "radial">, containerStrategies?: { [key in string]: "none" | "tree" | "radial" | "auto" | Array<"none" | "tree" | "radial"> },
|
|
308
|
+
export type Graph = { defaultDirection?: "lr" | "rl" | "tb" | "bt" | "auto" | Array<"lr" | "rl" | "tb" | "bt">, containerDirections?: { [key in string]: "lr" | "rl" | "tb" | "bt" | "auto" | Array<"lr" | "rl" | "tb" | "bt"> }, defaultStrategy?: "none" | "tree" | "radial" | "octilinear" | "auto" | Array<"none" | "tree" | "radial" | "octilinear">, containerStrategies?: { [key in string]: "none" | "tree" | "radial" | "octilinear" | "auto" | Array<"none" | "tree" | "radial" | "octilinear"> },
|
|
240
309
|
/**
|
|
241
310
|
* The edge routing of the root and its containers (docs/adr/0005-routing-constraints.md).
|
|
242
311
|
*/
|
|
@@ -245,7 +314,13 @@ defaultRouting?: "straight" | "orthogonal" | "roundedOrthogonal" | "polyline" |
|
|
|
245
314
|
* Provisional: explicit buses (ADR 0005): each groups edges drawn on one shared trunk with branches. Membership is never
|
|
246
315
|
* inferred. Omitted when empty, so earlier documents and drawings do not change.
|
|
247
316
|
*/
|
|
248
|
-
buses?: Array<Bus>,
|
|
317
|
+
buses?: Array<Bus>,
|
|
318
|
+
/**
|
|
319
|
+
* Provisional (ADR 0022): memberships across the hierarchy — the groupings a node belongs to besides its container,
|
|
320
|
+
* by dimension. Never inferred, and never a second containment tree. Omitted when empty, so earlier documents and
|
|
321
|
+
* drawings do not change.
|
|
322
|
+
*/
|
|
323
|
+
memberships?: Memberships, };
|
|
249
324
|
|
|
250
325
|
/**
|
|
251
326
|
* Provisional: the nodes within some hops of nodes of a graph (`overviewNeighbourhood`), without a view.
|
|
@@ -256,7 +331,19 @@ export type GraphNeighbourhood = { nodes: Array<string>, edges: Array<string>, h
|
|
|
256
331
|
* Provisional: a change of the source graph of a view (`patch`): nodes and edges to add, and nodes (each with what it
|
|
257
332
|
* holds and its edges) and edges to remove. Removals apply first.
|
|
258
333
|
*/
|
|
259
|
-
export type GraphPatch = { nodes?: Array<Node>, edges?: Array<Edge>, removeNodes?: Array<string>, removeEdges?: Array<string>,
|
|
334
|
+
export type GraphPatch = { nodes?: Array<Node>, edges?: Array<Edge>, removeNodes?: Array<string>, removeEdges?: Array<string>,
|
|
335
|
+
/**
|
|
336
|
+
* Provisional (ADR 0022 §5b): dimensions and groups to add or replace, as `nodes` and `edges` add: a dimension of the
|
|
337
|
+
* same id takes the groups given (a group of the same id replaced, a new one appended) and a label if one is given; a
|
|
338
|
+
* new dimension is appended. Applied after `removeMemberships`. Member ids the graph does not have are kept and
|
|
339
|
+
* counted, as anywhere.
|
|
340
|
+
*/
|
|
341
|
+
memberships?: Memberships,
|
|
342
|
+
/**
|
|
343
|
+
* Provisional (ADR 0022 §5b): whole dimensions, or groups within one (with the groups nested in them), to remove;
|
|
344
|
+
* applied first. Unknown ones are refused.
|
|
345
|
+
*/
|
|
346
|
+
removeMemberships?: Array<MembershipRemoval>, };
|
|
260
347
|
|
|
261
348
|
/**
|
|
262
349
|
* Provisional: the paths between two nodes of a graph (`overviewTrace`), without a view: the overview's viewer maps them
|
|
@@ -264,6 +351,42 @@ export type GraphPatch = { nodes?: Array<Node>, edges?: Array<Edge>, removeNodes
|
|
|
264
351
|
*/
|
|
265
352
|
export type GraphTrace = { found: boolean, reversed: boolean, length: number | null, nodes: Array<string>, edges: Array<string>, };
|
|
266
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Provisional (ADR 0022 §2): one criterion of `LayoutOptions::grouping_priority`.
|
|
356
|
+
*/
|
|
357
|
+
export type GroupingCriterion = {
|
|
358
|
+
/**
|
|
359
|
+
* `parent` (containment from `parentId`) or the id of a declared membership dimension.
|
|
360
|
+
*/
|
|
361
|
+
by: string,
|
|
362
|
+
/**
|
|
363
|
+
* The value priority of a dimension: when a node is in several of its groups that are not one path, the first of
|
|
364
|
+
* these that holds it owns it. Unlisted groups follow in their declared order. Not allowed on `parent`.
|
|
365
|
+
*/
|
|
366
|
+
values?: Array<string>,
|
|
367
|
+
/**
|
|
368
|
+
* How the criterion's groups are rendered where it owns nodes. `lanes` is accepted and reported as not yet applied
|
|
369
|
+
* (ADR 0022, M4); its groups are drawn as containers until then.
|
|
370
|
+
*/
|
|
371
|
+
as?: GroupingRendering,
|
|
372
|
+
/**
|
|
373
|
+
* The shape of this criterion's hulls where it holds nodes softly; `LayoutOptions::membership_hull` without it.
|
|
374
|
+
*/
|
|
375
|
+
hull?: HullShape,
|
|
376
|
+
/**
|
|
377
|
+
* The groups of a dimension this criterion considers; empty (the default) considers them all. Considered groups take
|
|
378
|
+
* part in everything the criterion does — they own nodes as containers, are held softly in the layout (M3) and are
|
|
379
|
+
* drawn — and a member of a nested group belongs to the deepest considered group on its path. A group not considered
|
|
380
|
+
* takes part in none of it, so the nodes it would own fall to the next criterion. Not allowed on `parent`. Lets a
|
|
381
|
+
* view work with one document among hundreds (ADR 0022 §2).
|
|
382
|
+
*/
|
|
383
|
+
consider?: Array<string>, };
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Provisional (ADR 0022 §3): how an owning criterion's groups are drawn.
|
|
387
|
+
*/
|
|
388
|
+
export type GroupingRendering = "containers" | "lanes";
|
|
389
|
+
|
|
267
390
|
/**
|
|
268
391
|
* What a view hides (provisional, view state set by the `filter` operation): nodes of these kinds, these nodes (each with
|
|
269
392
|
* everything below it) and edges of these kinds. The layout keeps their room, so what stays keeps its place; the scene
|
|
@@ -282,6 +405,11 @@ compact?: boolean, };
|
|
|
282
405
|
*/
|
|
283
406
|
export type HubRef = { edge: string, kind: string, node: string, hub: string, outgoing: boolean, };
|
|
284
407
|
|
|
408
|
+
/**
|
|
409
|
+
* Provisional (ADR 0022 §3): the outline of a membership hull. Both are comparison geometry, no trigonometry.
|
|
410
|
+
*/
|
|
411
|
+
export type HullShape = "rectangle" | "polygon";
|
|
412
|
+
|
|
285
413
|
export type HybridCriterion = "compact" | "endToEnd";
|
|
286
414
|
|
|
287
415
|
export type Integrity = {
|
|
@@ -300,7 +428,7 @@ export type Intent = { pins: { [key in string]: Point }, containerSizing: { [key
|
|
|
300
428
|
/**
|
|
301
429
|
* The shape of every node that is not the default rectangle.
|
|
302
430
|
*/
|
|
303
|
-
shapes: { [key in string]: NodeShape }, defaultDirection: "lr" | "rl" | "tb" | "bt" | "auto" | Array<"lr" | "rl" | "tb" | "bt">, containerDirections: { [key in string]: "lr" | "rl" | "tb" | "bt" | "auto" | Array<"lr" | "rl" | "tb" | "bt"> }, defaultStrategy: "none" | "tree" | "radial" | "auto" | Array<"none" | "tree" | "radial">, containerStrategies: { [key in string]: "none" | "tree" | "radial" | "auto" | Array<"none" | "tree" | "radial"> }, defaultRouting: "straight" | "orthogonal" | "roundedOrthogonal" | "polyline" | "roundedPolyline" | "octilinear" | "curve" | "bus" | "auto" | Array<"straight" | "orthogonal" | "roundedOrthogonal" | "polyline" | "roundedPolyline" | "octilinear" | "curve" | "bus">, containerRouting: { [key in string]: "straight" | "orthogonal" | "roundedOrthogonal" | "polyline" | "roundedPolyline" | "octilinear" | "curve" | "bus" | "auto" | Array<"straight" | "orthogonal" | "roundedOrthogonal" | "polyline" | "roundedPolyline" | "octilinear" | "curve" | "bus"> },
|
|
431
|
+
shapes: { [key in string]: NodeShape }, defaultDirection: "lr" | "rl" | "tb" | "bt" | "auto" | Array<"lr" | "rl" | "tb" | "bt">, containerDirections: { [key in string]: "lr" | "rl" | "tb" | "bt" | "auto" | Array<"lr" | "rl" | "tb" | "bt"> }, defaultStrategy: "none" | "tree" | "radial" | "octilinear" | "auto" | Array<"none" | "tree" | "radial" | "octilinear">, containerStrategies: { [key in string]: "none" | "tree" | "radial" | "octilinear" | "auto" | Array<"none" | "tree" | "radial" | "octilinear"> }, defaultRouting: "straight" | "orthogonal" | "roundedOrthogonal" | "polyline" | "roundedPolyline" | "octilinear" | "curve" | "bus" | "auto" | Array<"straight" | "orthogonal" | "roundedOrthogonal" | "polyline" | "roundedPolyline" | "octilinear" | "curve" | "bus">, containerRouting: { [key in string]: "straight" | "orthogonal" | "roundedOrthogonal" | "polyline" | "roundedPolyline" | "octilinear" | "curve" | "bus" | "auto" | Array<"straight" | "orthogonal" | "roundedOrthogonal" | "polyline" | "roundedPolyline" | "octilinear" | "curve" | "bus"> },
|
|
304
432
|
/**
|
|
305
433
|
* The ports the graph declares and the edge ends bound to them, which includes those a user placed by hand.
|
|
306
434
|
*/
|
|
@@ -317,7 +445,12 @@ orderHints?: { [key in string]: OrderHint },
|
|
|
317
445
|
* Provisional: the containers shown in part (`LayoutOptions::partial`, set by `reveal`), so that a step back undoes a
|
|
318
446
|
* reveal or a page of `+N more`. Omitted when empty.
|
|
319
447
|
*/
|
|
320
|
-
partial?: { [key in string]: Array<string> },
|
|
448
|
+
partial?: { [key in string]: Array<string> },
|
|
449
|
+
/**
|
|
450
|
+
* Provisional: what the view hides (`LayoutOptions::hidden`, set by `filter`), so that a step back undoes a filter.
|
|
451
|
+
* Omitted when nothing is hidden.
|
|
452
|
+
*/
|
|
453
|
+
hidden?: Hidden, };
|
|
321
454
|
|
|
322
455
|
/**
|
|
323
456
|
* Measured text rectangle. Hosts may supply exact font measurements.
|
|
@@ -462,6 +595,19 @@ hubRefs?: number,
|
|
|
462
595
|
* (as ELK's merged edges). `None` (the default, omitted): one track per edge.
|
|
463
596
|
*/
|
|
464
597
|
sharedTracks?: SharedTracks,
|
|
598
|
+
/**
|
|
599
|
+
* Provisional (ADR 0022 §2): the structures the view shows, ranked. A criterion is the parent hierarchy (`parent`) or
|
|
600
|
+
* a membership dimension; the first criterion that assigns a node owns it in the view (its container), and every
|
|
601
|
+
* later one holds it softly (drawn as hulls). A dimension that is not listed is neither drawn nor read. Empty (the
|
|
602
|
+
* default, omitted) means `[parent]`: today's view, byte-identical. See `grouping::owners`.
|
|
603
|
+
*/
|
|
604
|
+
groupingPriority?: Array<GroupingCriterion>,
|
|
605
|
+
/**
|
|
606
|
+
* Provisional (ADR 0022 §3): the shape of a membership hull. `rectangle` (the default, omitted) draws the padded
|
|
607
|
+
* bounding box of the group's boxes, which looks like a container and may overlap one; `polygon` draws the padded
|
|
608
|
+
* convex hull. A criterion of `groupingPriority` may override it (M1).
|
|
609
|
+
*/
|
|
610
|
+
membershipHull?: HullShape,
|
|
465
611
|
/**
|
|
466
612
|
* Provisional, computed by the layout with `hubRefs`: the room the references' stubs and names take between two ranks
|
|
467
613
|
* (added to the layer spacing), kept with the snapshot so that every later operation spaces alike. 0 (omitted): none.
|
|
@@ -540,6 +686,12 @@ forceDirected?: boolean,
|
|
|
540
686
|
* Iteration budget of the organic (stress) placement. Omitted when unset; the default is 300.
|
|
541
687
|
*/
|
|
542
688
|
organicIterations?: number | null,
|
|
689
|
+
/**
|
|
690
|
+
* Provisional (#156): the gap between two boxes of an organic area, in layout units. Omitted when unset; the default
|
|
691
|
+
* is 24. A route between two boxes needs the router's clearance on both sides and a stub at its port, so a gap wider
|
|
692
|
+
* than the default leaves a route room to leave a node that faces a neighbour.
|
|
693
|
+
*/
|
|
694
|
+
organicGap?: number | null,
|
|
543
695
|
/**
|
|
544
696
|
* Experimental minimum-displacement overlap constraints for organic placement and repair. Off by default.
|
|
545
697
|
*/
|
|
@@ -809,7 +961,7 @@ orderHints?: { [key in string]: OrderHint }, };
|
|
|
809
961
|
* `shortest` choose an orientation per area; `tree` places a tree or forest along the area's direction; `radial` places a
|
|
810
962
|
* tree or forest on rings. Compatible with the values `hybrid` and `shortest` of earlier graphs.
|
|
811
963
|
*/
|
|
812
|
-
export type LayoutStrategy = "none" | "shortest" | "tree" | "radial" | "organic";
|
|
964
|
+
export type LayoutStrategy = "none" | "shortest" | "tree" | "radial" | "organic" | "octilinear";
|
|
813
965
|
|
|
814
966
|
/**
|
|
815
967
|
* The level of detail (provisional): which containers a view shows collapsed at first, by depth and by kind; opening
|
|
@@ -837,12 +989,74 @@ nodes?: number | null,
|
|
|
837
989
|
*/
|
|
838
990
|
edges?: number | null, };
|
|
839
991
|
|
|
992
|
+
/**
|
|
993
|
+
* Provisional: a drawn line (`details`): its visible ends, its shape, and the edges of the source graph it stands for in
|
|
994
|
+
* its own direction (`edges`) and in the other (`opposite`), at most `limit` ids each (the counts are complete).
|
|
995
|
+
*/
|
|
996
|
+
export type LineDetails = { id: string, kind: string, source: string, target: string, length: number, bends: number,
|
|
997
|
+
/**
|
|
998
|
+
* Edges drawn along it (one unless it leads a bundle).
|
|
999
|
+
*/
|
|
1000
|
+
weight: number,
|
|
1001
|
+
/**
|
|
1002
|
+
* The line it is bundled into, or null.
|
|
1003
|
+
*/
|
|
1004
|
+
bundleOf: string | null,
|
|
1005
|
+
/**
|
|
1006
|
+
* The lines bundled into it.
|
|
1007
|
+
*/
|
|
1008
|
+
bundled: Array<string>, edges: Array<string>, edgeCount: number, opposite: Array<string>, oppositeCount: number, };
|
|
1009
|
+
|
|
840
1010
|
/**
|
|
841
1011
|
* A geometry observation for one element: the realized outline and the revision of the measurement. The revision rises with
|
|
842
1012
|
* every new measurement of that element, so that an old one is recognised when it arrives late.
|
|
843
1013
|
*/
|
|
844
1014
|
export type Measurement = { contour: Contour, geometryRevision: bigint, };
|
|
845
1015
|
|
|
1016
|
+
/**
|
|
1017
|
+
* Provisional (ADR 0022): one dimension of memberships (`zone`, `team`, `layer`, …) with its groups in the order they
|
|
1018
|
+
* are declared. That order is the lane order, the legend order and the iteration order of everything derived from it.
|
|
1019
|
+
*/
|
|
1020
|
+
export type MembershipDimension = { id: string,
|
|
1021
|
+
/**
|
|
1022
|
+
* What the dimension is called in the drawing. The engine does not read it; it is carried to the viewer.
|
|
1023
|
+
*/
|
|
1024
|
+
label?: string, groups?: Array<MembershipGroup>, };
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* Provisional (ADR 0022): one group of a dimension. `members` are node ids; an id the graph does not have is ignored
|
|
1028
|
+
* and counted, not an error, because a host mapping may cover more than the imported view.
|
|
1029
|
+
*/
|
|
1030
|
+
export type MembershipGroup = { id: string,
|
|
1031
|
+
/**
|
|
1032
|
+
* What the group is called in the drawing; its id where this is empty.
|
|
1033
|
+
*/
|
|
1034
|
+
label?: string,
|
|
1035
|
+
/**
|
|
1036
|
+
* Nests this group inside another group of the same dimension, so membership here implies membership there: a group
|
|
1037
|
+
* covers its own members and those of every group below it, and a parent does not list them again. An overlay
|
|
1038
|
+
* therefore draws a sub-zone inside its zone.
|
|
1039
|
+
*/
|
|
1040
|
+
parent?: string, members?: Array<string>, };
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Provisional (ADR 0022 §5b): a dimension to remove, or with `group` one group of it (and the groups nested in it).
|
|
1044
|
+
*/
|
|
1045
|
+
export type MembershipRemoval = { dimension: string, group?: string, };
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Provisional (ADR 0022): the membership dimensions of a graph. A node has one container (`Node::parent_id`); a
|
|
1049
|
+
* membership says that it also belongs to a zone, a team or a layer, and several of those at once. Memberships are
|
|
1050
|
+
* authored domain data, like `Graph::buses`: the engine never derives them, and they never change the containment tree.
|
|
1051
|
+
* How a dimension is shown is a view option (`LayoutOptions::grouping_priority`), not data. Omitted when empty, so a
|
|
1052
|
+
* graph without memberships serializes exactly as before.
|
|
1053
|
+
*/
|
|
1054
|
+
export type Memberships = {
|
|
1055
|
+
/**
|
|
1056
|
+
* The dimensions in the order they are declared, which is the order everything derived uses.
|
|
1057
|
+
*/
|
|
1058
|
+
dimensions?: Array<MembershipDimension>, };
|
|
1059
|
+
|
|
846
1060
|
export type Metrics = { version: number, nodes: number, edges: number, width: number, height: number, area: number,
|
|
847
1061
|
/**
|
|
848
1062
|
* Overlapping node pairs under the same parent.
|
|
@@ -921,6 +1135,60 @@ export type Node = { id: string, kind: string, label: string, parentId: string |
|
|
|
921
1135
|
*/
|
|
922
1136
|
shape?: NodeShape, };
|
|
923
1137
|
|
|
1138
|
+
/**
|
|
1139
|
+
* Provisional: a node of the source graph in the current view (`details`).
|
|
1140
|
+
*/
|
|
1141
|
+
export type NodeDetails = { id: string, kind: string, label: string,
|
|
1142
|
+
/**
|
|
1143
|
+
* The containers above it, outermost first.
|
|
1144
|
+
*/
|
|
1145
|
+
parents: Array<string>,
|
|
1146
|
+
/**
|
|
1147
|
+
* The visible box that shows it: itself, the collapsed container it is in, or null when the view hides it (a filter,
|
|
1148
|
+
* outside the view).
|
|
1149
|
+
*/
|
|
1150
|
+
shownAs: string | null,
|
|
1151
|
+
/**
|
|
1152
|
+
* That box's bounds in the scene's (absolute) coordinates, or null.
|
|
1153
|
+
*/
|
|
1154
|
+
bounds: { x: number, y: number, width: number, height: number } | null, collapsed: boolean,
|
|
1155
|
+
/**
|
|
1156
|
+
* Its direct children and all nodes inside it, in the source graph.
|
|
1157
|
+
*/
|
|
1158
|
+
children: number, descendants: number,
|
|
1159
|
+
/**
|
|
1160
|
+
* Edges of the source graph that end and start at the node itself (a self-loop counts in both).
|
|
1161
|
+
*/
|
|
1162
|
+
incoming: number, outgoing: number,
|
|
1163
|
+
/**
|
|
1164
|
+
* Provisional (ADR 0023, R1): the node's properties from the session's content; omitted when it has none.
|
|
1165
|
+
*/
|
|
1166
|
+
properties?: Record<string, unknown>,
|
|
1167
|
+
/**
|
|
1168
|
+
* Provisional (ADR 0022 §7): the node's groups per criterion of a non-default `groupingPriority`, in the order of
|
|
1169
|
+
* the ranks: the one that owns it (`owner`) and those that hold it softly. Kept apart from `parents`, which is the
|
|
1170
|
+
* containment of the source. Omitted when empty — always under the default priority — so a typed host built before
|
|
1171
|
+
* it keeps deserializing the answer.
|
|
1172
|
+
*/
|
|
1173
|
+
groupings?: Array<NodeGrouping>, };
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* Provisional (ADR 0022 §7): one group of a node under one criterion of the grouping priority (`NodeDetails::groupings`).
|
|
1177
|
+
*/
|
|
1178
|
+
export type NodeGrouping = {
|
|
1179
|
+
/**
|
|
1180
|
+
* The criterion: `parent` or a dimension id.
|
|
1181
|
+
*/
|
|
1182
|
+
by: string,
|
|
1183
|
+
/**
|
|
1184
|
+
* The group: a container id for `parent`, a group id for a dimension.
|
|
1185
|
+
*/
|
|
1186
|
+
group: string,
|
|
1187
|
+
/**
|
|
1188
|
+
* Whether this group owns the node in the view (its container), rather than holding it softly.
|
|
1189
|
+
*/
|
|
1190
|
+
owner: boolean, };
|
|
1191
|
+
|
|
924
1192
|
/**
|
|
925
1193
|
* The outline of a leaf node (docs/...: step 1 of the shape support). Containers use the same names later.
|
|
926
1194
|
*/
|
|
@@ -1343,6 +1611,22 @@ busLines?: Array<SceneBusLine>,
|
|
|
1343
1611
|
* Provisional (`hubRefs`): edges of hubs drawn as stubs at their other end, named after the hub. Omitted when none.
|
|
1344
1612
|
*/
|
|
1345
1613
|
hubRefs?: Array<SceneHubRef>,
|
|
1614
|
+
/**
|
|
1615
|
+
* Provisional (ADR 0022, the soft criteria of `groupingPriority`): a hull per membership group, to be drawn behind the
|
|
1616
|
+
* nodes. In the declared order of the dimensions and of their groups. Omitted when there is none, so every drawing
|
|
1617
|
+
* without the option is unchanged.
|
|
1618
|
+
*/
|
|
1619
|
+
membershipHulls?: Array<SceneHull>,
|
|
1620
|
+
/**
|
|
1621
|
+
* Provisional (ADR 0022 §5): one entry per dimension the options name, with its counts and one summary line.
|
|
1622
|
+
* Omitted when there is none.
|
|
1623
|
+
*/
|
|
1624
|
+
membershipReport?: Array<SceneMembershipReport>,
|
|
1625
|
+
/**
|
|
1626
|
+
* Provisional (ADR 0022 §3, M2b): the members of the soft groups that fell into too many pieces to be drawn as hulls,
|
|
1627
|
+
* marked one by one instead (a colour or a badge on the box, no polygon). Omitted when there is none.
|
|
1628
|
+
*/
|
|
1629
|
+
membershipMarks?: Array<SceneMark>,
|
|
1346
1630
|
/**
|
|
1347
1631
|
* Extent of everything drawn, with a 30-unit margin. May start at negative coordinates.
|
|
1348
1632
|
*/
|
|
@@ -1374,6 +1658,111 @@ nodes: Array<string>, routes: Array<string>, reason: string, };
|
|
|
1374
1658
|
*/
|
|
1375
1659
|
export type SceneHubRef = { edge: string, node: string, hub: string, outgoing: boolean, text: string, points: Array<Point>, label: Rect, };
|
|
1376
1660
|
|
|
1661
|
+
/**
|
|
1662
|
+
* Provisional (ADR 0022, first slice): the hull of one membership group, drawn behind the nodes. `points` is a closed
|
|
1663
|
+
* polygon (the last point joins the first) and is empty for no group: a group whose members the view does not show is
|
|
1664
|
+
* left out instead. The hull is **not an obstacle**: the router never saw it, and routes may cross it.
|
|
1665
|
+
*/
|
|
1666
|
+
export type SceneHull = {
|
|
1667
|
+
/**
|
|
1668
|
+
* The dimension this group belongs to, and its label for a legend.
|
|
1669
|
+
*/
|
|
1670
|
+
dimension: string, dimensionLabel: string, group: string,
|
|
1671
|
+
/**
|
|
1672
|
+
* What to write on the hull: the group's label, or its id where it has none.
|
|
1673
|
+
*/
|
|
1674
|
+
label: string, points: Array<Point>,
|
|
1675
|
+
/**
|
|
1676
|
+
* The boxes the hull was built from: a member's own box, or the box that stands for it (a collapsed container).
|
|
1677
|
+
*/
|
|
1678
|
+
boxes: Array<string>,
|
|
1679
|
+
/**
|
|
1680
|
+
* Leaf boxes inside the hull that are not members of the group. The honest cost of drawing a hull around nodes the
|
|
1681
|
+
* layout kept apart, and one of the two numbers a later default depends on (ADR 0022 §6). Empty once a group is split
|
|
1682
|
+
* (M2b): a group is split exactly so that no piece encloses a foreign box.
|
|
1683
|
+
*/
|
|
1684
|
+
intruders: Array<string>,
|
|
1685
|
+
/**
|
|
1686
|
+
* Provisional (ADR 0022 §3, M2b): this hull is piece `piece` (from 0) of `pieces` of its group. A group whose whole
|
|
1687
|
+
* hull would enclose a foreign box is drawn in pieces — one per owner, then by distance within an owner.
|
|
1688
|
+
*/
|
|
1689
|
+
piece: number, pieces: number, };
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* Provisional (ADR 0022 §3, M2b): one member of a marked group — the box to mark, and the group it belongs to.
|
|
1693
|
+
*/
|
|
1694
|
+
export type SceneMark = { dimension: string, dimensionLabel: string, group: string,
|
|
1695
|
+
/**
|
|
1696
|
+
* What to write in the mark's tooltip or legend: the group's label, or its id where it has none.
|
|
1697
|
+
*/
|
|
1698
|
+
label: string,
|
|
1699
|
+
/**
|
|
1700
|
+
* The box that carries the mark: the member's own box, or the box that stands for it.
|
|
1701
|
+
*/
|
|
1702
|
+
node: string, };
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* Provisional (ADR 0022 §5): what one membership dimension did in this drawing. Typed, because one line of text per
|
|
1706
|
+
* group would be thousands of lines on a real graph; `summary` is the single line a host can simply print.
|
|
1707
|
+
*/
|
|
1708
|
+
export type SceneMembershipReport = { dimension: string,
|
|
1709
|
+
/**
|
|
1710
|
+
* The mode the options asked for (`overlay`, `hierarchy`, `lanes`).
|
|
1711
|
+
*/
|
|
1712
|
+
mode: string,
|
|
1713
|
+
/**
|
|
1714
|
+
* Whether this drawing applied it. `hierarchy` and `lanes` are accepted and not yet applied (ADR 0022, M1 and M4).
|
|
1715
|
+
*/
|
|
1716
|
+
applied: boolean,
|
|
1717
|
+
/**
|
|
1718
|
+
* Groups the dimension declares, and how many of them were drawn.
|
|
1719
|
+
*/
|
|
1720
|
+
groups: number, drawn: number,
|
|
1721
|
+
/**
|
|
1722
|
+
* Leaf boxes inside a hull they do not belong to, summed over the dimension's groups.
|
|
1723
|
+
*/
|
|
1724
|
+
intruders: number,
|
|
1725
|
+
/**
|
|
1726
|
+
* Pairs of this dimension's hulls that overlap. Hulls of *different* dimensions are expected to overlap — that is
|
|
1727
|
+
* what cutting across each other means — so only pairs within one dimension are counted.
|
|
1728
|
+
*/
|
|
1729
|
+
overlappingPairs: number,
|
|
1730
|
+
/**
|
|
1731
|
+
* Member ids the source graph does not have. Information, not a conflict (ADR 0022 §1).
|
|
1732
|
+
*/
|
|
1733
|
+
unknownMembers: number,
|
|
1734
|
+
/**
|
|
1735
|
+
* Members the view does not show and for which no box stands in (filtered out, or outside the view).
|
|
1736
|
+
*/
|
|
1737
|
+
hiddenMembers: number,
|
|
1738
|
+
/**
|
|
1739
|
+
* Nodes this criterion owns: it is the first that assigns them (ADR 0022 §2, rule 1).
|
|
1740
|
+
*/
|
|
1741
|
+
owned: number,
|
|
1742
|
+
/**
|
|
1743
|
+
* Of those, the nodes in several of its groups that are not one path: the value order chose (rule 2).
|
|
1744
|
+
*/
|
|
1745
|
+
multipleOwners: number,
|
|
1746
|
+
/**
|
|
1747
|
+
* Nodes no listed criterion assigns (rule 3), placed at the root. Counted on the first criterion's entry only.
|
|
1748
|
+
*/
|
|
1749
|
+
unassigned: number,
|
|
1750
|
+
/**
|
|
1751
|
+
* Provisional (ADR 0022 §3, M2b): groups drawn in more than one piece (`grouping-split`), and groups drawn as marks
|
|
1752
|
+
* because they fell into more pieces than `MARKS_ABOVE_PIECES` (`grouping-marked`).
|
|
1753
|
+
*/
|
|
1754
|
+
split: number, marked: number,
|
|
1755
|
+
/**
|
|
1756
|
+
* The foreign leaf boxes the groups' hulls would enclose if each group were drawn whole, as the first slice drew them.
|
|
1757
|
+
* Kept beside `intruders` for one version: splitting lowers `intruders` by construction, which is not a layout gain.
|
|
1758
|
+
*/
|
|
1759
|
+
intrudersWhole: number,
|
|
1760
|
+
/**
|
|
1761
|
+
* Groups the view still draws as a box that lost some members to another criterion: only those members are drawn,
|
|
1762
|
+
* joined to the box where that encloses nothing foreign (ADR 0022 §3). The box shows the rest.
|
|
1763
|
+
*/
|
|
1764
|
+
keptBox: number, summary: string, };
|
|
1765
|
+
|
|
1377
1766
|
export type SceneNode = {
|
|
1378
1767
|
/**
|
|
1379
1768
|
* Absolute bounds in scene coordinates.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arqlet/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "TypeScript types of Arqlet's engine contracts (Snapshot, Scene, ConfigSet, LayoutOptions, ...), generated from the Rust types. Types only; provisional.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graph",
|