@arqlet/contracts 0.1.0 → 0.3.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 +94 -1
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  // Generated by crates/contracts (ts-rs) and bundled by tools/npm-prepack.mjs. Do not edit by hand.
2
2
 
3
+ /**
4
+ * The edges one aggregated edge stands for, by direction (see `LayoutOptions::aggregate_weights`).
5
+ */
6
+ export type AggregateWeight = { forward: number, backward: number, };
7
+
3
8
  /**
4
9
  * Provisional annotation shape; the annotation model of section 5 is not implemented yet.
5
10
  */
@@ -48,7 +53,11 @@ export type ConfigSet = { schemaVersion: number, id: string, layout: LayoutConfi
48
53
  /**
49
54
  * Display preference. Absent means the config set leaves the current display unchanged.
50
55
  */
51
- appearance?: AppearanceConfig | null, };
56
+ appearance?: AppearanceConfig | null,
57
+ /**
58
+ * Provisional (ADR 0018): how the cluster overview shows the data's clusters. Absent: no rules.
59
+ */
60
+ overview?: OverviewConfig | null, };
52
61
 
53
62
  /**
54
63
  * The authored size of one container, per axis (ADR 0010). Each axis is content, a minimum or a fixed size.
@@ -180,6 +189,19 @@ buses?: Array<Bus>, };
180
189
 
181
190
  export type HybridCriterion = "compact" | "endToEnd";
182
191
 
192
+ /**
193
+ * Which containers an import shows collapsed (`LayoutOptions::initial_collapse`).
194
+ */
195
+ export type InitialCollapse = {
196
+ /**
197
+ * Containers at this depth or deeper (the top level is 0).
198
+ */
199
+ depth?: number | null,
200
+ /**
201
+ * Containers of these kinds.
202
+ */
203
+ kinds?: Array<string>, };
204
+
183
205
  export type Integrity = {
184
206
  /**
185
207
  * SHA-256 of the canonical JSON of the document without the `integrity` member.
@@ -304,6 +326,13 @@ strictClearance?: boolean,
304
326
  * decides between them. Omitted when off, so the default output does not change.
305
327
  */
306
328
  componentPacking?: boolean,
329
+ /**
330
+ * Experimental: the children of a layered area that have no edge to another child (a file of unrelated functions)
331
+ * are spread over the ranks as a grid instead of all standing in the first rank, one long column. They fill the
332
+ * ranks the connected children use, and more when there are many of them, so the grid comes out about square.
333
+ * Omitted when off, so the default output does not change.
334
+ */
335
+ isolatedGrid?: boolean,
307
336
  /**
308
337
  * How edges are drawn: orthogonal routes (the default, omitted) or straight segments between the port positions.
309
338
  * Straight routing never bends: an edge that would cross a foreign node is reported as a routing issue.
@@ -393,6 +422,32 @@ orderSeed?: number,
393
422
  * 0 (the default, omitted) lays out every node.
394
423
  */
395
424
  visibleNodeBudget?: number,
425
+ /**
426
+ * Provisional: containers with more children than this (the root included) are divided into communities of their
427
+ * children, found from the edges between them (the cluster overview's Louvain), shown as containers of kind
428
+ * `community`, collapsed at first and opened with `toggle`. They exist only in the view: the source graph is
429
+ * unchanged. 0 (the default, omitted) adds none.
430
+ */
431
+ communities?: number,
432
+ /**
433
+ * Provisional: groups given by the data or its domain, by node id: the path of groups the node belongs to inside its
434
+ * container (`["ECU A", "X1"]`). They become containers of kind `group` in the view only, nested along the path,
435
+ * before `communities` divides what is still large. Ids the graph does not have are ignored (a mapping may cover more
436
+ * than the imported view). Omitted when empty.
437
+ */
438
+ groups?: { [key in string]: Array<string> },
439
+ /**
440
+ * Provisional: which containers an import shows collapsed: those at `depth` or deeper (0: every one; the top level is
441
+ * depth 0) and those of the `kinds` listed. Unset (the default, omitted): none, except the containers that
442
+ * `communities` and `groups` add, which start collapsed.
443
+ */
444
+ initialCollapse?: InitialCollapse | null,
445
+ /**
446
+ * Provisional (view state, set by `reveal`): containers shown in part. The children listed for a container are shown;
447
+ * the others are gathered in a collapsed container `rest:<id>` of kind `rest` ("+N more"), which a `toggle` dissolves.
448
+ * Omitted when empty.
449
+ */
450
+ partial?: { [key in string]: Array<string> },
396
451
  /**
397
452
  * Experimental (plan section 4a, global layering, iteration 2; needs `layered_construction`): in a layered area with a
398
453
  * fixed flow, an expanded child container of the same flow axis takes part with its children in the area's ranks, as
@@ -414,6 +469,13 @@ simplexRanks?: boolean,
414
469
  * content (inside out), so that expanding it moves the outer picture little. Omitted when empty.
415
470
  */
416
471
  collapsedSizes?: { [key in string]: NodeSize },
472
+ /**
473
+ * Provisional (derived by the runtime with `communities`, not set by a user): what an edge that stands for collapsed
474
+ * content represents, by edge id: the edges between its two visible ends in its own direction (`forward`) and in the
475
+ * other (`backward`). The route takes `forward` as its weight; the scene reports `backward` as `backWeight`, so a
476
+ * renderer can draw both directions on one route. Omitted when empty.
477
+ */
478
+ aggregateWeights?: { [key in string]: AggregateWeight },
417
479
  /**
418
480
  * Optional limit on the drawing's larger extent, in units. Not a constraint the search enforces: when the result
419
481
  * spans more, a routing issue reports it (the search is not extent-aware, so this proves nothing about feasibility).
@@ -628,6 +690,26 @@ after: string | null, };
628
690
  */
629
691
  export type Orientation = "lr" | "rl" | "tb" | "bt";
630
692
 
693
+ /**
694
+ * Provisional (ADR 0018, addendum): the rules of the data for the cluster overview, the second step of the order
695
+ * user, rules, zoom.
696
+ */
697
+ export type OverviewConfig = {
698
+ /**
699
+ * The representation by node kind.
700
+ */
701
+ rules?: { [key in string]: Representation },
702
+ /**
703
+ * Whether the zoom decides what neither the user nor a rule decided. Absent: yes.
704
+ */
705
+ auto?: boolean, };
706
+
707
+ /**
708
+ * Provisional (ADR 0018, addendum; ADR 0015): the user's decisions in the cluster overview as one value, by node id.
709
+ * The first step of the order user, rules, zoom; it always holds.
710
+ */
711
+ export type OverviewIntent = { decisions?: { [key in string]: Representation }, };
712
+
631
713
  export type PlacedLabel = { id: string, kind: string, text: string, bounds: Rect, };
632
714
 
633
715
  export type Point = { x: number, y: number, };
@@ -740,6 +822,11 @@ hardViolations: number,
740
822
  */
741
823
  pendingRoutes: number, payloadHash: string, inputHash: string, metrics: Metrics, };
742
824
 
825
+ /**
826
+ * Provisional (ADR 0018, addendum): how a container of the cluster overview is shown.
827
+ */
828
+ export type Representation = "collapsed" | "organic" | "structured";
829
+
743
830
  export type ResolvedPort = { id: string, nodeId: string, edgeId: string, endpoint: string, side: PortSide, position: Point, explicit: boolean, };
744
831
 
745
832
  export type Route = { id: string, points: Array<Point>,
@@ -837,6 +924,12 @@ export type SceneRoute = { id: string,
837
924
  * The edge's kind: for a relationship, its type (the verb), drawn as the route's label.
838
925
  */
839
926
  kind?: string, source: string, target: string, points: Array<Point>, weight: number,
927
+ /**
928
+ * Provisional (communities): the route stands for collapsed content in both directions; this many edges run the
929
+ * other way (from `target` to `source`), `weight` in its own. Present only on such routes, 0 when every one of them
930
+ * runs one way; a renderer draws an arrow at the start too when it is above 0.
931
+ */
932
+ backWeight?: number | null,
840
933
  /**
841
934
  * True when the engine reported a structured conflict for this route.
842
935
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arqlet/contracts",
3
- "version": "0.1.0",
3
+ "version": "0.3.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",