@arqlet/contracts 0.9.0 → 0.10.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 +182 -13
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -365,7 +365,7 @@ by: string,
365
365
  */
366
366
  values?: Array<string>,
367
367
  /**
368
- * How the criterion's groups are rendered where it owns nodes. `lanes` is accepted and reported as not yet applied
368
+ * How the criterion's groups are rendered where it owns nodes. `lanes` of the first criterion are bands across the flow of the top level (M4a); elsewhere it is accepted and reported as not yet applied
369
369
  * (ADR 0022, M4); its groups are drawn as containers until then.
370
370
  */
371
371
  as?: GroupingRendering,
@@ -387,6 +387,11 @@ consider?: Array<string>, };
387
387
  */
388
388
  export type GroupingRendering = "containers" | "lanes";
389
389
 
390
+ /**
391
+ * Provisional (ADR 0022 M3b): a membership group a layout holds together (`Snapshot::held_groups`).
392
+ */
393
+ export type HeldGroup = { dimension: string, group: string, };
394
+
390
395
  /**
391
396
  * What a view hides (provisional, view state set by the `filter` operation): nodes of these kinds, these nodes (each with
392
397
  * everything below it) and edges of these kinds. The layout keeps their room, so what stays keeps its place; the scene
@@ -399,6 +404,25 @@ export type Hidden = { nodeKinds?: Array<string>, nodes?: Array<string>, edgeKin
399
404
  */
400
405
  compact?: boolean, };
401
406
 
407
+ /**
408
+ * Provisional (ADR 0022 M3b): the cost of all held groups together. Edges against the flow are counted, not limited: a
409
+ * group held around a node between its members turns an edge back.
410
+ */
411
+ export type HoldingCost = { crossingsBefore: number, crossings: number, bendsBefore: number, bends: number, againstFlowBefore: number, againstFlow: number, };
412
+
413
+ /**
414
+ * Provisional (ADR 0022 M3b): what `LayoutOptions::hold_memberships` did besides `Snapshot::held_groups`.
415
+ */
416
+ export type HoldingReport = {
417
+ /**
418
+ * The soft groups with at least two shown members that are neither held nor whole without holding.
419
+ */
420
+ released: Array<ReleasedGroup>,
421
+ /**
422
+ * The drawing without holding against this one. Only after a complete layout: an edit has nothing to compare with.
423
+ */
424
+ cost?: HoldingCost, };
425
+
402
426
  /**
403
427
  * Provisional: an edge drawn as a reference to a hub (`Snapshot::hub_refs`): the edge, its kind, the node it is drawn at,
404
428
  * the hub, and whether it runs from the node to the hub (`outgoing`) or from the hub to the node.
@@ -608,6 +632,12 @@ groupingPriority?: Array<GroupingCriterion>,
608
632
  * convex hull. A criterion of `groupingPriority` may override it (M1).
609
633
  */
610
634
  membershipHull?: HullShape,
635
+ /**
636
+ * Provisional (ADR 0022 M3b): hold the soft membership groups whose shown members have one container in the view
637
+ * together there, each where the cost in crossings and bends stays in a budget that halves with the rank. The held
638
+ * group is drawn as its hull; its members keep their container. Off by default (omitted).
639
+ */
640
+ holdMemberships?: boolean,
611
641
  /**
612
642
  * Provisional, computed by the layout with `hubRefs`: the room the references' stubs and names take between two ranks
613
643
  * (added to the layer spacing), kept with the snapshot so that every later operation spaces alike. 0 (omitted): none.
@@ -692,6 +722,23 @@ organicIterations?: number | null,
692
722
  * than the default leaves a route room to leave a node that faces a neighbour.
693
723
  */
694
724
  organicGap?: number | null,
725
+ /**
726
+ * Provisional (#203): the repair of the default router, when the grid of the whole view is over its bound, searches a
727
+ * sparse grid of the whole view first, with a cost per bend: a line only in a gap between box edges that offers a way
728
+ * no neighbouring gap offers, which still holds a way whenever the rectangles leave one wider than a rounding error.
729
+ * Without it such a route is searched only on grids around it, and one without a way there keeps its shape through the
730
+ * boxes. Views within the bound are drawn as without the option. Omitted when off.
731
+ */
732
+ sparseRepairGrid?: boolean,
733
+ /**
734
+ * Experimental (ADR 0016, amendment *Pins in single pass*, steps P1 and P2): under single pass, and in the
735
+ * hierarchical pipeline it falls back to, a pinned node (leaf or container) of an area that flows left to right or top
736
+ * to bottom is a constraint of the arrangement: the pin chooses its rank and its order there and holds its place
737
+ * across the flow, and along the flow it stands in its rank's band (the difference is reported in the layout
738
+ * diagnostics). Without it, and when any pin of the view is another one (in an area of another strategy or of a
739
+ * reversed flow), the pins are handled as before and take the view off that pipeline. Omitted when off.
740
+ */
741
+ pinsInSinglePass?: boolean,
695
742
  /**
696
743
  * Experimental minimum-displacement overlap constraints for organic placement and repair. Off by default.
697
744
  */
@@ -1272,7 +1319,25 @@ links: Array<number>,
1272
1319
  * Provisional: every node of shape `busLine` as a line instead of a disc (a viewer draws the line and its taps, not
1273
1320
  * the node's disc). Omitted when there is none.
1274
1321
  */
1275
- busLines?: Array<OverviewBusLine>, stats: OverviewStats, };
1322
+ busLines?: Array<OverviewBusLine>, stats: OverviewStats,
1323
+ /**
1324
+ * Provisional, for a request with `edgeData`: the edge kinds in order of first use.
1325
+ */
1326
+ edgeKinds?: Array<string>,
1327
+ /**
1328
+ * Provisional, for a request with `edgeData`: each edge's kind as an index into `edgeKinds`; entry `k` belongs to
1329
+ * the edge `edges[2k]` to `edges[2k + 1]`.
1330
+ */
1331
+ edgeKind?: number[],
1332
+ /**
1333
+ * Provisional, for a request with `edgeData`: how many edges each edge stands for (`Edge::weight`), indexed as
1334
+ * `edgeKind`. Omitted when every edge counts 1.
1335
+ */
1336
+ edgeWeight?: number[],
1337
+ /**
1338
+ * Provisional, for a request with `start.nodes`: what became of the earlier places.
1339
+ */
1340
+ continuation?: OverviewContinuation, };
1276
1341
 
1277
1342
  /**
1278
1343
  * Provisional: a bus of the overview drawn as a line (`Overview::bus_lines`): the bus node's index, the line from
@@ -1301,6 +1366,25 @@ auto?: boolean,
1301
1366
  */
1302
1367
  levelOfDetail?: LevelOfDetail, };
1303
1368
 
1369
+ /**
1370
+ * Provisional: what became of the places given by node id (`OverviewStart::nodes`).
1371
+ */
1372
+ export type OverviewContinuation = {
1373
+ /**
1374
+ * Nodes of the graph that continued from their entry. Clusters the overview added are not counted.
1375
+ */
1376
+ continued: number,
1377
+ /**
1378
+ * Nodes of the graph placed anew: without an entry, in a container without one, or in another container than the
1379
+ * one the entry lay in.
1380
+ */
1381
+ anew: number,
1382
+ /**
1383
+ * Ids of entries that name no node of the overview (removed nodes), in id order. Ids of clusters the overview
1384
+ * added (`community:…`) that are gone are not listed.
1385
+ */
1386
+ ignored: Array<string>, };
1387
+
1304
1388
  /**
1305
1389
  * Provisional (ADR 0018, addendum; ADR 0015): the user's decisions in the cluster overview as one value, by node id.
1306
1390
  * The first step of the order user, rules, zoom; it always holds.
@@ -1352,10 +1436,21 @@ groups?: { [key in string]: Array<string> },
1352
1436
  */
1353
1437
  hubs?: CommunityHubs, };
1354
1438
 
1439
+ /**
1440
+ * Provisional: the disc of a node in an earlier overview (its `x`, `y` and `r`), and what held it.
1441
+ */
1442
+ export type OverviewPlace = { x: number, y: number, r: number,
1443
+ /**
1444
+ * The id of its parent in that overview (`ids[parent[i]]`), a node of the graph or an added cluster; left out at
1445
+ * the top level. Where given, it says what held the node instead of the discs, which cannot tell it for a cluster
1446
+ * the host set smaller than its content (`radii`). A parent that names nothing counts as left out.
1447
+ */
1448
+ parent?: string, };
1449
+
1355
1450
  /**
1356
1451
  * Provisional (sessions): the part of an overview that changes while the clusters stay the same, answered for a request
1357
- * with `positionsOnly` laid out on the clusters of the session's last overview. The host keeps ids, labels, parents,
1358
- * kinds, edges and links from that answer.
1452
+ * with `positionsOnly` laid out on the clusters of the session's last overview, with the same `edgeData`. The host keeps
1453
+ * ids, labels, parents, kinds, edges (with their data) and links from that answer.
1359
1454
  */
1360
1455
  export type OverviewPositions = { schemaVersion: number,
1361
1456
  /**
@@ -1365,7 +1460,11 @@ positionsOnly: boolean, representation: OverviewRepresentation, x: Array<number>
1365
1460
  /**
1366
1461
  * The bus lines move with the nodes (`Overview::bus_lines`). Omitted when there is none.
1367
1462
  */
1368
- busLines?: Array<OverviewBusLine>, stats: OverviewStats, };
1463
+ busLines?: Array<OverviewBusLine>, stats: OverviewStats,
1464
+ /**
1465
+ * For a request with `start.nodes` (`Overview::continuation`).
1466
+ */
1467
+ continuation?: OverviewContinuation, };
1369
1468
 
1370
1469
  /**
1371
1470
  * Provisional (ADR 0018, addendum): the representation values of an overview request, as the engine checked them.
@@ -1399,19 +1498,36 @@ export type OverviewRequest = { graph?: Graph, options?: OverviewLayoutOptions,
1399
1498
  radii?: { [key in string]: number }, start?: OverviewStart,
1400
1499
  /**
1401
1500
  * Provisional (sessions): answer only what moves (`OverviewPositions`) when the clusters are those of the session's
1402
- * last overview; otherwise the whole overview.
1501
+ * last overview and `edgeData` is as it was there; otherwise the whole overview.
1403
1502
  */
1404
1503
  positionsOnly?: boolean,
1504
+ /**
1505
+ * Provisional: answer each edge's kind and weight too (`Overview::edge_kinds`, `edge_kind`, `edge_weight`), for a
1506
+ * host that does not have the graph.
1507
+ */
1508
+ edgeData?: boolean,
1405
1509
  /**
1406
1510
  * Worker threads (native only); the answer is the same for any number.
1407
1511
  */
1408
1512
  threads?: number, };
1409
1513
 
1410
1514
  /**
1411
- * Provisional: where an overview continues from. Positions (`x`, `y`, `r`) of a previous overview of the same
1412
- * clusters, or none in a session (its last overview); `settle` lets the changed containers settle again.
1515
+ * Provisional: where an overview continues from. Positions of a previous overview, either `x`, `y`, `r` by node index
1516
+ * (the same clusters) or `nodes` by node id (also a changed graph), or neither in a session (its last overview);
1517
+ * `settle` lets the changed containers settle again.
1518
+ */
1519
+ export type OverviewStart = { x?: Array<number>, y?: Array<number>, r?: Array<number>,
1520
+ /**
1521
+ * Provisional: the places of an earlier overview by node id, added clusters included, for the overview of a graph
1522
+ * that may have changed: those clusters continue with their ids. Not with `x`, `y` or `r`. A later request without
1523
+ * a session continues the answer by id again.
1413
1524
  */
1414
- export type OverviewStart = { x?: Array<number>, y?: Array<number>, r?: Array<number>, settle?: boolean, };
1525
+ nodes?: { [key in string]: OverviewPlace }, settle?: boolean,
1526
+ /**
1527
+ * Provisional: nodes the user moved, by id, to their new centres: each one's container settles around it. Needs
1528
+ * earlier places (`x`, `y`, `r`, `nodes`, or a session's), and with `nodes` an earlier place of that node.
1529
+ */
1530
+ moved?: { [key in string]: Point }, };
1415
1531
 
1416
1532
  /**
1417
1533
  * Provisional: the counts of an overview.
@@ -1518,6 +1634,16 @@ inputHash: string, baseline: Snapshot, curated: CuratedScene, annotations: Array
1518
1634
  */
1519
1635
  export type ReferenceInput = { graph: Graph, collapsedIds: Array<string>, options: LayoutOptions, };
1520
1636
 
1637
+ /**
1638
+ * Provisional (ADR 0022 M3b): why a group is not held.
1639
+ */
1640
+ export type ReleaseReason = "acrossContainers" | "fixedPlace" | "overlapsHeld" | "refused" | "notWhole" | "breaksOther" | "violation" | "budget" | "trials" | "edit" | "buses";
1641
+
1642
+ /**
1643
+ * Provisional (ADR 0022 M3b): a group the layout does not hold.
1644
+ */
1645
+ export type ReleasedGroup = { dimension: string, group: string, reason: ReleaseReason, };
1646
+
1521
1647
  /**
1522
1648
  * The outcome of validating a document that passed structural checks.
1523
1649
  */
@@ -1627,6 +1753,11 @@ membershipReport?: Array<SceneMembershipReport>,
1627
1753
  * marked one by one instead (a colour or a badge on the box, no polygon). Omitted when there is none.
1628
1754
  */
1629
1755
  membershipMarks?: Array<SceneMark>,
1756
+ /**
1757
+ * Provisional (ADR 0022 M4c): the bands of the first criterion's lanes (`as: lanes`), in their declared order, to be
1758
+ * drawn behind everything else. Omitted when there is none.
1759
+ */
1760
+ membershipLanes?: Array<SceneLane>,
1630
1761
  /**
1631
1762
  * Extent of everything drawn, with a 30-unit margin. May start at negative coordinates.
1632
1763
  */
@@ -1688,6 +1819,26 @@ intruders: Array<string>,
1688
1819
  */
1689
1820
  piece: number, pieces: number, };
1690
1821
 
1822
+ /**
1823
+ * Provisional (ADR 0022 M4c): the band of one lane. It spans the whole drawing along the flow; `vertical` says that the bands
1824
+ * stand side by side across x (the flow runs along y). Bands of neighbouring lanes meet in the middle of the gap between them.
1825
+ */
1826
+ export type SceneLane = { dimension: string, dimensionLabel: string, group: string,
1827
+ /**
1828
+ * What to write on the band: the group's label, or its id where it has none.
1829
+ */
1830
+ label: string, rect: Rect, vertical: boolean,
1831
+ /**
1832
+ * A phase along the flow (the second criterion as lanes, M4b), not a lane across it. Phases have a header strip for their
1833
+ * names on the side where the lanes start.
1834
+ */
1835
+ phase?: boolean,
1836
+ /**
1837
+ * Provisional (ADR 0022 M4d): the container whose children the band divides, for lanes of a later criterion inside every
1838
+ * container. Absent for bands over the whole drawing. A renderer draws such a band above its container's frame.
1839
+ */
1840
+ area?: string, };
1841
+
1691
1842
  /**
1692
1843
  * Provisional (ADR 0022 §3, M2b): one member of a marked group — the box to mark, and the group it belongs to.
1693
1844
  */
@@ -1699,7 +1850,11 @@ label: string,
1699
1850
  /**
1700
1851
  * The box that carries the mark: the member's own box, or the box that stands for it.
1701
1852
  */
1702
- node: string, };
1853
+ node: string,
1854
+ /**
1855
+ * The group's own box, when the view still draws it and this member left it: what the mark points back to.
1856
+ */
1857
+ ownBox?: string, };
1703
1858
 
1704
1859
  /**
1705
1860
  * Provisional (ADR 0022 §5): what one membership dimension did in this drawing. Typed, because one line of text per
@@ -1759,9 +1914,13 @@ split: number, marked: number,
1759
1914
  intrudersWhole: number,
1760
1915
  /**
1761
1916
  * 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.
1917
+ * joined to the box where that is compact and encloses nothing foreign, else marked (ADR 0022 §3). The box shows the rest.
1918
+ */
1919
+ keptBox: number,
1920
+ /**
1921
+ * Provisional (ADR 0022 M3b): groups the layout holds together inside their owner (`LayoutOptions::hold_memberships`).
1763
1922
  */
1764
- keptBox: number, summary: string, };
1923
+ held?: number, summary: string, };
1765
1924
 
1766
1925
  export type SceneNode = {
1767
1926
  /**
@@ -1917,7 +2076,17 @@ gesture?: Gesture | null,
1917
2076
  * (`"<root>"` for the top level), kept so that a later pass reuses the plans of the areas it does not place again.
1918
2077
  * Empty (and omitted) without the option.
1919
2078
  */
1920
- layeredPlans?: { [key in string]: StoredAreaPlan }, };
2079
+ layeredPlans?: { [key in string]: StoredAreaPlan },
2080
+ /**
2081
+ * Provisional (ADR 0022 M3b): the membership groups this layout holds together inside their owner
2082
+ * (`LayoutOptions::hold_memberships`). Omitted when empty.
2083
+ */
2084
+ heldGroups?: Array<HeldGroup>,
2085
+ /**
2086
+ * Provisional (ADR 0022 M3b): which soft groups the layout does not hold and why, and what holding the others costs.
2087
+ * Omitted without `LayoutOptions::hold_memberships`.
2088
+ */
2089
+ holding?: HoldingReport | null, };
1921
2090
 
1922
2091
  export type Status = "draft" | "accepted" | "retired";
1923
2092
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arqlet/contracts",
3
- "version": "0.9.0",
3
+ "version": "0.10.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",