@arqlet/contracts 0.2.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 +64 -0
  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
  */
@@ -184,6 +189,19 @@ buses?: Array<Bus>, };
184
189
 
185
190
  export type HybridCriterion = "compact" | "endToEnd";
186
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
+
187
205
  export type Integrity = {
188
206
  /**
189
207
  * SHA-256 of the canonical JSON of the document without the `integrity` member.
@@ -308,6 +326,13 @@ strictClearance?: boolean,
308
326
  * decides between them. Omitted when off, so the default output does not change.
309
327
  */
310
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,
311
336
  /**
312
337
  * How edges are drawn: orthogonal routes (the default, omitted) or straight segments between the port positions.
313
338
  * Straight routing never bends: an edge that would cross a foreign node is reported as a routing issue.
@@ -397,6 +422,32 @@ orderSeed?: number,
397
422
  * 0 (the default, omitted) lays out every node.
398
423
  */
399
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> },
400
451
  /**
401
452
  * Experimental (plan section 4a, global layering, iteration 2; needs `layered_construction`): in a layered area with a
402
453
  * fixed flow, an expanded child container of the same flow axis takes part with its children in the area's ranks, as
@@ -418,6 +469,13 @@ simplexRanks?: boolean,
418
469
  * content (inside out), so that expanding it moves the outer picture little. Omitted when empty.
419
470
  */
420
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 },
421
479
  /**
422
480
  * Optional limit on the drawing's larger extent, in units. Not a constraint the search enforces: when the result
423
481
  * spans more, a routing issue reports it (the search is not extent-aware, so this proves nothing about feasibility).
@@ -866,6 +924,12 @@ export type SceneRoute = { id: string,
866
924
  * The edge's kind: for a relationship, its type (the verb), drawn as the route's label.
867
925
  */
868
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,
869
933
  /**
870
934
  * True when the engine reported a structured conflict for this route.
871
935
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arqlet/contracts",
3
- "version": "0.2.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",