@arqlet/contracts 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +146 -2
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -49,6 +49,13 @@ export type Bus = { id: string, edges: Array<string>,
49
49
  */
50
50
  label?: string, };
51
51
 
52
+ /**
53
+ * Provisional: the children that `communities` leaves out of Louvain, so that one hub does not pull a whole container
54
+ * into one community: those with at least `min_links` links in their container (by edge weight, as Louvain counts them)
55
+ * and those named in `nodes`. A hub stays a direct child of its container. Ids the graph lacks are ignored.
56
+ */
57
+ export type CommunityHubs = { minLinks?: number, nodes?: Array<string>, };
58
+
52
59
  export type ConfigSet = { schemaVersion: number, id: string, layout: LayoutConfig, routing: RoutingConfig,
53
60
  /**
54
61
  * Display preference. Absent means the config set leaves the current display unchanged.
@@ -193,12 +200,34 @@ defaultRouting?: "straight" | "orthogonal" | "roundedOrthogonal" | "polyline" |
193
200
  */
194
201
  buses?: Array<Bus>, };
195
202
 
203
+ /**
204
+ * Provisional: the nodes within some hops of nodes of a graph (`overviewNeighbourhood`), without a view.
205
+ */
206
+ export type GraphNeighbourhood = { nodes: Array<string>, edges: Array<string>, hops: { [key in string]: number }, };
207
+
208
+ /**
209
+ * Provisional: a change of the source graph of a view (`patch`): nodes and edges to add, and nodes (each with what it
210
+ * holds and its edges) and edges to remove. Removals apply first.
211
+ */
212
+ export type GraphPatch = { nodes?: Array<Node>, edges?: Array<Edge>, removeNodes?: Array<string>, removeEdges?: Array<string>, };
213
+
214
+ /**
215
+ * Provisional: the paths between two nodes of a graph (`overviewTrace`), without a view: the overview's viewer maps them
216
+ * to its discs. `reversed`: no path from `from` to `to`, the paths are those back; `length` is null without a path.
217
+ */
218
+ export type GraphTrace = { found: boolean, reversed: boolean, length: number | null, nodes: Array<string>, edges: Array<string>, };
219
+
196
220
  /**
197
221
  * What a view hides (provisional, view state set by the `filter` operation): nodes of these kinds, these nodes (each with
198
222
  * everything below it) and edges of these kinds. The layout keeps their room, so what stays keeps its place; the scene
199
223
  * leaves them out, and an edge that stands for collapsed content counts only the edges still shown.
200
224
  */
201
- export type Hidden = { nodeKinds?: Array<string>, nodes?: Array<string>, edgeKinds?: Array<string>, };
225
+ export type Hidden = { nodeKinds?: Array<string>, nodes?: Array<string>, edgeKinds?: Array<string>,
226
+ /**
227
+ * Lay the view out again without what is hidden, so that the rest closes up (positions change); off: the hidden keep
228
+ * their room and nothing else moves. Omitted when off.
229
+ */
230
+ compact?: boolean, };
202
231
 
203
232
  export type HybridCriterion = "compact" | "endToEnd";
204
233
 
@@ -326,6 +355,14 @@ strictClearance?: boolean,
326
355
  * decides between them. Omitted when off, so the default output does not change.
327
356
  */
328
357
  componentPacking?: boolean,
358
+ /**
359
+ * Experimental: the weakly connected components of a container's children (a lone child is one) keep their own
360
+ * arrangement and are packed as boxes in rows towards an aspect ratio (`aspect`, width over height, default 1),
361
+ * largest first, instead of all sharing the ranks of one long drawing. Orders the components in blocks as
362
+ * `component_packing` does. Not for circle containers, containers with a pinned child, or flattened areas. Omitted
363
+ * when off, so the default output does not change.
364
+ */
365
+ packComponents?: PackComponents,
329
366
  /**
330
367
  * Experimental: the children of a layered area that have no edge to another child (a file of unrelated functions)
331
368
  * are spread over the ranks as a grid instead of all standing in the first rank, one long column. They fill the
@@ -333,6 +370,57 @@ componentPacking?: boolean,
333
370
  * Omitted when off, so the default output does not change.
334
371
  */
335
372
  isolatedGrid?: boolean,
373
+ /**
374
+ * ADR 0020, S1-0 and S1-0b: a graph whose areas all flow right to left (`rl`) or bottom to top (`bt`) is laid out
375
+ * with the positive flow, where single pass runs, and mirrored area by area (a container keeps its header at its
376
+ * top); logical edge direction is kept. Not for graphs with pins, label places, explicit ports or buses. On by default
377
+ * since engine 0.5 (S1-4, accepted by measurement); written as `false` when turned off.
378
+ */
379
+ singlePassReversed?: boolean,
380
+ /**
381
+ * ADR 0020, S1-1b: a straight edge that would pass through a node it does not end at is drawn around it instead: its
382
+ * orthogonal route pulled taut around every node it does not end at or lie in, so it stays one segment where nothing
383
+ * is in the way and bends at the blockers' corners elsewhere. On by default since 0.5.0 (S1-4); written as
384
+ * `false` when turned off.
385
+ */
386
+ straightDetours?: boolean,
387
+ /**
388
+ * ADR 0020, S1-2: an edge that leaves a region of another strategy (organic, tree, radial) in a layered parent is
389
+ * routed by the parent to a port on the region's border, on the side its flow uses, and drawn inside the region from
390
+ * that port to its node by the region's routing. Not for graphs with buses or explicit edge ports. On by default since
391
+ * engine 0.5 (S1-4); written as `false` when turned off.
392
+ */
393
+ regionPorts?: boolean,
394
+ /**
395
+ * Experimental (ADR 0020, S1-3): a container with a fixed flow inside an organic or radial area gets border nodes in
396
+ * its own flow, as in a parent of the same axis: its edges to the outside run inside it along its ranks to its border
397
+ * and leave it there, and the area draws them straight from that point. Omitted when off, so the default output does
398
+ * not change.
399
+ */
400
+ regionChildPorts?: boolean,
401
+ /**
402
+ * Single pass: every channel between two ranks is as wide as its tracks need (at least the margin on both sides and a
403
+ * track), narrower than the layer gap where it carries few tracks; the order and the places across the flow are chosen
404
+ * on the layer gap as before. Only in areas with a fixed flow along their parent's axis below fixed flows. On by
405
+ * default since engine 0.5 (no change in crossings or bends on any measured dataset, less area); written as `false`
406
+ * when turned off.
407
+ */
408
+ channelsByDemand?: boolean,
409
+ /**
410
+ * With `straightDetours`, the geometric repair of an organic area that cannot clear every straight line within a
411
+ * bounded budget clears the lines between children of organic areas first and those into its containers within a
412
+ * bounded budget of their own; their detours draw what remains around the nodes in its way. A repair that finishes
413
+ * within the bounded budget is as without the option. On by default since 0.5.0; written as `false` when
414
+ * turned off.
415
+ */
416
+ nestedEdgesByDetour?: boolean,
417
+ /**
418
+ * Experimental: free directions (`auto`) are laid out with their orientations fixed — every free area left to right,
419
+ * and every free area top to bottom — so that single pass constructs the edges between areas (ADR 0017) instead of
420
+ * delegating them, and the drawing with the best published key wins. The snapshot keeps the free directions and the
421
+ * chosen orientations. Omitted when off, so the default output does not change.
422
+ */
423
+ directionsFirst?: boolean,
336
424
  /**
337
425
  * How edges are drawn: orthogonal routes (the default, omitted) or straight segments between the port positions.
338
426
  * Straight routing never bends: an edge that would cross a foreign node is reported as a routing issue.
@@ -446,6 +534,10 @@ levelOfDetail?: LevelOfDetail | null,
446
534
  * Provisional (view state, set by `filter`): what the view hides, keeping the place of the rest. Omitted when empty.
447
535
  */
448
536
  hidden?: Hidden,
537
+ /**
538
+ * Provisional: the children `communities` leaves out of Louvain (hubs). Omitted when empty.
539
+ */
540
+ communityHubs?: CommunityHubs,
449
541
  /**
450
542
  * Provisional (view state, set by `reveal`): containers shown in part. The children listed for a container are shown;
451
543
  * the others are gathered in a collapsed container `rest:<id>` of kind `rest` ("+N more"), which a `toggle` dissolves.
@@ -665,6 +757,12 @@ touches: number,
665
757
  */
666
758
  bends: number, bendsMax: number, bendsMean: number, length: number, lengthMean: number, lengthMax: number, };
667
759
 
760
+ /**
761
+ * Provisional: the answer of `neighbourhood` (besides `ok`): the nodes within some hops of nodes, the edges they were
762
+ * reached by, each node's hops, and what of them the view shows (as for `trace`).
763
+ */
764
+ export type NeighbourhoodAnswer = { nodes: Array<string>, edges: Array<string>, hops: { [key in string]: number }, visible: VisibleParts, distance: { [key in string]: number }, };
765
+
668
766
  export type Node = { id: string, kind: string, label: string, parentId: string | null,
669
767
  /**
670
768
  * The outline of the node. `rect` (the default, omitted) uses its size as it is; `square` and `circle` use the larger
@@ -812,7 +910,22 @@ ticks?: number,
812
910
  /**
813
911
  * Groups the data gives: node id → path of group names.
814
912
  */
815
- groups?: { [key in string]: Array<string> }, };
913
+ groups?: { [key in string]: Array<string> },
914
+ /**
915
+ * Children left out of Louvain (hubs), as `LayoutOptions::community_hubs`.
916
+ */
917
+ hubs?: CommunityHubs, };
918
+
919
+ /**
920
+ * Provisional (sessions): the part of an overview that changes while the clusters stay the same, answered for a request
921
+ * with `positionsOnly` laid out on the clusters of the session's last overview. The host keeps ids, labels, parents,
922
+ * kinds, edges and links from that answer.
923
+ */
924
+ export type OverviewPositions = { schemaVersion: number,
925
+ /**
926
+ * Always true: tells this answer from a whole `Overview`.
927
+ */
928
+ positionsOnly: boolean, representation: OverviewRepresentation, x: Array<number>, y: Array<number>, r: Array<number>, rootRadius: number, stats: OverviewStats, };
816
929
 
817
930
  /**
818
931
  * Provisional (ADR 0018, addendum): the representation values of an overview request, as the engine checked them.
@@ -844,6 +957,11 @@ export type OverviewRequest = { graph?: Graph, options?: OverviewLayoutOptions,
844
957
  * Radii by node id, for clusters a host shows structured.
845
958
  */
846
959
  radii?: { [key in string]: number }, start?: OverviewStart,
960
+ /**
961
+ * Provisional (sessions): answer only what moves (`OverviewPositions`) when the clusters are those of the session's
962
+ * last overview; otherwise the whole overview.
963
+ */
964
+ positionsOnly?: boolean,
847
965
  /**
848
966
  * Worker threads (native only); the answer is the same for any number.
849
967
  */
@@ -860,6 +978,15 @@ export type OverviewStart = { x?: Array<number>, y?: Array<number>, r?: Array<nu
860
978
  */
861
979
  export type OverviewStats = { nodes: number, containers: number, communities: number, levels: number, edges: number, unresolvedEdges: number, overlaps: number, };
862
980
 
981
+ /**
982
+ * Experimental (`LayoutOptions::pack_components`): how the components of a container are packed.
983
+ */
984
+ export type PackComponents = {
985
+ /**
986
+ * The width over the height the packed components aim at (default 1: square).
987
+ */
988
+ aspect?: number, };
989
+
863
990
  export type PlacedLabel = { id: string, kind: string, text: string, bounds: Rect, };
864
991
 
865
992
  export type Point = { x: number, y: number, };
@@ -1220,7 +1347,24 @@ export type StoredChain = { source: string, target: string, dummies?: Array<stri
1220
1347
  */
1221
1348
  export type StoredLink = { source: string, target: string, };
1222
1349
 
1350
+ /**
1351
+ * Provisional: the answer of `trace` (besides `ok`): the nodes and edges on the paths between two nodes of the source
1352
+ * graph, and what of them the view shows. `reversed`: no path from `from` to `to`, the paths are those back; `length`
1353
+ * is null without a path.
1354
+ */
1355
+ export type TraceAnswer = { found: boolean, reversed: boolean, length: number | null, nodes: Array<string>, edges: Array<string>, visible: VisibleParts,
1356
+ /**
1357
+ * Hops of every visible node from the path through the drawn edges (for fading); unreachable nodes are left out.
1358
+ */
1359
+ distance: { [key in string]: number }, };
1360
+
1223
1361
  /**
1224
1362
  * Metrics of the curated geometry, computed by the shared validator.
1225
1363
  */
1226
1364
  export type ValidationRecord = { metrics: Metrics, };
1365
+
1366
+ /**
1367
+ * Provisional: what of some source-graph nodes and edges the current view shows (`trace`, `neighbourhood`): the visible
1368
+ * boxes that hold the nodes, and the routes that carry the edges.
1369
+ */
1370
+ export type VisibleParts = { nodes: Array<string>, routes: Array<string>, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arqlet/contracts",
3
- "version": "0.4.0",
3
+ "version": "0.5.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",