semiotic 3.8.7 → 3.8.8

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 (206) hide show
  1. package/CLAUDE.md +2 -2
  2. package/README.md +56 -46
  3. package/ai/dist/mcp-server.js +28 -2
  4. package/ai/schema.json +124 -4
  5. package/ai/surface-manifest.json +1 -1
  6. package/ai/system-prompt.md +1 -1
  7. package/dist/{chunk-chartContainerDataAudit-JDSVSKGM.module.min.js → chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js} +1 -1
  8. package/dist/chunk-chunk-2B3AIKUZ.module.min.js +2 -0
  9. package/dist/chunk-chunk-2NVFEB7P.module.min.js +2 -0
  10. package/dist/chunk-chunk-3GCILWPB.module.min.js +2 -0
  11. package/dist/chunk-chunk-46KRGJQP.module.min.js +1 -0
  12. package/dist/{chunk-chunk-5SD6BHVW.module.min.js → chunk-chunk-4MLLQUGW.module.min.js} +1 -1
  13. package/dist/chunk-chunk-57RBPDBQ.module.min.js +2 -0
  14. package/dist/chunk-chunk-5VVNW5AZ.module.min.js +1 -0
  15. package/dist/chunk-chunk-66PCWJUG.module.min.js +1 -0
  16. package/dist/chunk-chunk-7LE56WAE.module.min.js +2 -0
  17. package/dist/chunk-chunk-7T25U75Z.module.min.js +2 -0
  18. package/dist/chunk-chunk-AF53TBSN.module.min.js +2 -0
  19. package/dist/chunk-chunk-BTZYH2IE.module.min.js +1 -0
  20. package/dist/chunk-chunk-BWV55BZK.module.min.js +2 -0
  21. package/dist/{chunk-chunk-FRO4TRXK.module.min.js → chunk-chunk-BZNOAHJV.module.min.js} +1 -1
  22. package/dist/chunk-chunk-CD6PVVS3.module.min.js +2 -0
  23. package/dist/chunk-chunk-DTSNLGRK.module.min.js +2 -0
  24. package/dist/{chunk-chunk-BNGBEY7N.module.min.js → chunk-chunk-FC3NZWYR.module.min.js} +1 -1
  25. package/dist/chunk-chunk-FEPXDKJP.module.min.js +1 -0
  26. package/dist/chunk-chunk-FJ76HWQZ.module.min.js +1 -0
  27. package/dist/chunk-chunk-FRGBMTZR.module.min.js +1 -0
  28. package/dist/chunk-chunk-G75OPF5N.module.min.js +2 -0
  29. package/dist/{chunk-chunk-NH4MEAKP.module.min.js → chunk-chunk-H5IFO6CU.module.min.js} +1 -1
  30. package/dist/chunk-chunk-HADHLMY5.module.min.js +1 -0
  31. package/dist/chunk-chunk-HBFA4NN6.module.min.js +1 -0
  32. package/dist/chunk-chunk-HCNDE26Q.module.min.js +2 -0
  33. package/dist/chunk-chunk-JJ4BSUYL.module.min.js +2 -0
  34. package/dist/chunk-chunk-JRHXQGEV.module.min.js +2 -0
  35. package/dist/chunk-chunk-L6FFYGYS.module.min.js +1 -0
  36. package/dist/{chunk-chunk-Z2AJERX5.module.min.js → chunk-chunk-LJDH3WV3.module.min.js} +1 -1
  37. package/dist/chunk-chunk-LSJUXBMF.module.min.js +1 -0
  38. package/dist/chunk-chunk-N3Q33XCB.module.min.js +2 -0
  39. package/dist/chunk-chunk-NWIGA3UK.module.min.js +1 -0
  40. package/dist/chunk-chunk-OG3TTJGJ.module.min.js +2 -0
  41. package/dist/{chunk-chunk-XEVJDUTH.module.min.js → chunk-chunk-OZK46A5U.module.min.js} +1 -1
  42. package/dist/chunk-chunk-PMR47KRY.module.min.js +2 -0
  43. package/dist/chunk-chunk-QQJNG23C.module.min.js +2 -0
  44. package/dist/{chunk-chunk-LG7YKJAK.module.min.js → chunk-chunk-RGJ6TKAH.module.min.js} +1 -1
  45. package/dist/{chunk-chunk-JWXLNZSM.module.min.js → chunk-chunk-SFLUSZ73.module.min.js} +1 -1
  46. package/dist/chunk-chunk-TCMHJWFJ.module.min.js +1 -0
  47. package/dist/{chunk-chunk-LVHDZAT3.module.min.js → chunk-chunk-UEZ6SHW5.module.min.js} +1 -1
  48. package/dist/chunk-chunk-VUWYT7DY.module.min.js +2 -0
  49. package/dist/{chunk-chunk-OI7R7EJB.module.min.js → chunk-chunk-W5HWGQMD.module.min.js} +1 -1
  50. package/dist/chunk-chunk-WFHZHWT7.module.min.js +1 -0
  51. package/dist/chunk-chunk-WGROBM3I.module.min.js +2 -0
  52. package/dist/{chunk-chunk-GU2EJIDJ.module.min.js → chunk-chunk-WSDJFBKX.module.min.js} +1 -1
  53. package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +2 -0
  54. package/dist/components/charts/index.d.ts +2 -2
  55. package/dist/components/charts/network/ProcessSankey.d.ts +105 -74
  56. package/dist/components/charts/network/processSankey/accessors.d.ts +7 -0
  57. package/dist/components/charts/network/processSankey/algorithm.d.ts +14 -193
  58. package/dist/components/charts/network/processSankey/axisChrome.d.ts +31 -0
  59. package/dist/components/charts/network/processSankey/bandPaths.d.ts +45 -0
  60. package/dist/components/charts/network/processSankey/buildScenes.d.ts +41 -3
  61. package/dist/components/charts/network/processSankey/fixtures.d.ts +17 -0
  62. package/dist/components/charts/network/processSankey/frameMargins.d.ts +11 -0
  63. package/dist/components/charts/network/processSankey/groupBonding.d.ts +13 -0
  64. package/dist/components/charts/network/processSankey/inventoryAtTime.d.ts +41 -0
  65. package/dist/components/charts/network/processSankey/labelPlacement.d.ts +34 -0
  66. package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +47 -0
  67. package/dist/components/charts/network/processSankey/layoutOrchestrator.d.ts +44 -0
  68. package/dist/components/charts/network/processSankey/layoutQualityProduct.d.ts +27 -0
  69. package/dist/components/charts/network/processSankey/massSimulation.d.ts +16 -0
  70. package/dist/components/charts/network/processSankey/ordering.d.ts +55 -0
  71. package/dist/components/charts/network/processSankey/orderingBond.d.ts +33 -0
  72. package/dist/components/charts/network/processSankey/orientation.d.ts +5 -0
  73. package/dist/components/charts/network/processSankey/packing.d.ts +8 -0
  74. package/dist/components/charts/network/processSankey/packingCache.d.ts +23 -0
  75. package/dist/components/charts/network/processSankey/processSankeyLayoutAsync.d.ts +27 -0
  76. package/dist/components/charts/network/processSankey/processSankeyLayoutWorkerClient.d.ts +72 -0
  77. package/dist/components/charts/network/processSankey/processSankeyTooltip.d.ts +26 -0
  78. package/dist/components/charts/network/processSankey/processSankeyTypes.d.ts +163 -0
  79. package/dist/components/charts/network/processSankey/ribbonInputs.d.ts +26 -2
  80. package/dist/components/charts/network/processSankey/ribbonRunway.d.ts +45 -0
  81. package/dist/components/charts/network/processSankey/streamingLayout.d.ts +23 -0
  82. package/dist/components/charts/network/processSankey/time.d.ts +11 -0
  83. package/dist/components/charts/network/processSankey/useProcessSankeyPush.d.ts +29 -0
  84. package/dist/components/charts/network/processSankey/useProcessSankeyScenes.d.ts +26 -0
  85. package/dist/components/charts/network/processSankey/validation.d.ts +33 -0
  86. package/dist/components/charts/shared/chartFamilySets.d.ts +1 -0
  87. package/dist/components/charts/shared/formatUtils.d.ts +12 -1
  88. package/dist/components/charts/shared/hatchFill.d.ts +2 -0
  89. package/dist/components/charts/shared/hooks.d.ts +1 -1
  90. package/dist/components/charts/shared/leastSquaresRegression.d.ts +31 -0
  91. package/dist/components/charts/shared/styleRules.d.ts +5 -1
  92. package/dist/components/charts/shared/useChartLegend.d.ts +6 -0
  93. package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
  94. package/dist/components/charts/shared/validateProps.d.ts +2 -2
  95. package/dist/components/charts/shared/withChartWrapper.d.ts +0 -6
  96. package/dist/components/data/numericFieldProfiler.d.ts +2 -0
  97. package/dist/components/recipes/layout1d.d.ts +68 -0
  98. package/dist/components/semiotic-network.d.ts +2 -2
  99. package/dist/components/semiotic-recipes-core.d.ts +2 -0
  100. package/dist/components/semiotic.d.ts +2 -0
  101. package/dist/components/server/staticSVGChrome.d.ts +2 -1
  102. package/dist/components/store/createStore.d.ts +2 -0
  103. package/dist/components/stream/OrdinalPipelineStore.d.ts +3 -0
  104. package/dist/components/stream/PipelineStore.d.ts +5 -0
  105. package/dist/components/stream/accessorUtils.d.ts +21 -0
  106. package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -2
  107. package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +3 -8
  108. package/dist/components/stream/layouts/index.d.ts +1 -1
  109. package/dist/components/stream/moduleWorkerSession.d.ts +67 -0
  110. package/dist/components/stream/networkTypes.d.ts +2 -0
  111. package/dist/components/stream/ordinalSceneBuilders/sceneBuilderMap.d.ts +2 -1
  112. package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
  113. package/dist/components/stream/pipelineIntroCancellation.d.ts +6 -0
  114. package/dist/components/stream/pipelineTransitions.d.ts +15 -1
  115. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +16 -4
  116. package/dist/components/stream/renderers/symbolCanvasRenderer.d.ts +4 -0
  117. package/dist/components/stream/symbolPath.d.ts +8 -0
  118. package/dist/components/stream/types.d.ts +2 -0
  119. package/dist/components/stream/useCanvasFrameHost.d.ts +6 -0
  120. package/dist/components/stream/useSemanticFrameInteractions.d.ts +12 -3
  121. package/dist/components/stream/xyFrameAxisTypes.d.ts +4 -0
  122. package/dist/forceLayoutWorker.js +1 -1
  123. package/dist/geo.min.js +1 -1
  124. package/dist/geo.module.min.js +1 -1
  125. package/dist/network.min.js +1 -1
  126. package/dist/network.module.min.js +1 -1
  127. package/dist/ordinal.min.js +1 -1
  128. package/dist/ordinal.module.min.js +1 -1
  129. package/dist/physics.min.js +1 -1
  130. package/dist/physics.module.min.js +1 -1
  131. package/dist/physicsWorker.js +1 -1
  132. package/dist/processSankeyLayoutWorker.js +1 -0
  133. package/dist/realtime.min.js +1 -1
  134. package/dist/realtime.module.min.js +1 -1
  135. package/dist/semiotic-ai-core.min.js +1 -1
  136. package/dist/semiotic-ai-core.module.min.js +1 -1
  137. package/dist/semiotic-ai.min.js +1 -1
  138. package/dist/semiotic-ai.module.min.js +1 -1
  139. package/dist/semiotic-experimental-vacp.min.js +1 -1
  140. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  141. package/dist/semiotic-experimental.min.js +1 -1
  142. package/dist/semiotic-experimental.module.min.js +1 -1
  143. package/dist/semiotic-network.d.ts +2 -2
  144. package/dist/semiotic-realtime-core.min.js +1 -1
  145. package/dist/semiotic-realtime-core.module.min.js +1 -1
  146. package/dist/semiotic-recipes-core.d.ts +2 -0
  147. package/dist/semiotic-recipes-core.min.js +1 -1
  148. package/dist/semiotic-recipes-core.module.min.js +1 -1
  149. package/dist/semiotic-recipes.min.js +1 -1
  150. package/dist/semiotic-recipes.module.min.js +1 -1
  151. package/dist/semiotic-server-edge.min.js +1 -1
  152. package/dist/semiotic-server-edge.module.min.js +1 -1
  153. package/dist/semiotic-server-node.min.js +1 -1
  154. package/dist/semiotic-server-node.module.min.js +1 -1
  155. package/dist/semiotic-themes-core.module.min.js +1 -1
  156. package/dist/semiotic-themes-react.module.min.js +1 -1
  157. package/dist/semiotic-themes.module.min.js +1 -1
  158. package/dist/semiotic-utils-core.min.js +1 -1
  159. package/dist/semiotic-utils-core.module.min.js +1 -1
  160. package/dist/semiotic-utils-react.module.min.js +1 -1
  161. package/dist/semiotic-utils.min.js +1 -1
  162. package/dist/semiotic-utils.module.min.js +1 -1
  163. package/dist/semiotic-value.min.js +1 -1
  164. package/dist/semiotic-value.module.min.js +1 -1
  165. package/dist/semiotic.d.ts +2 -0
  166. package/dist/semiotic.min.js +1 -1
  167. package/dist/semiotic.module.min.js +1 -1
  168. package/dist/server.min.js +1 -1
  169. package/dist/server.module.min.js +1 -1
  170. package/dist/xy.min.js +1 -1
  171. package/dist/xy.module.min.js +1 -1
  172. package/package.json +4 -3
  173. package/dist/chunk-chunk-2YAZHXL4.module.min.js +0 -2
  174. package/dist/chunk-chunk-3NGIKFD6.module.min.js +0 -1
  175. package/dist/chunk-chunk-7TTBHSAG.module.min.js +0 -2
  176. package/dist/chunk-chunk-7ZDJSYKI.module.min.js +0 -2
  177. package/dist/chunk-chunk-BGHPD3RA.module.min.js +0 -1
  178. package/dist/chunk-chunk-BMRZ2SPU.module.min.js +0 -2
  179. package/dist/chunk-chunk-C7APLVQD.module.min.js +0 -2
  180. package/dist/chunk-chunk-DGWFBOGB.module.min.js +0 -1
  181. package/dist/chunk-chunk-DIVE2DRA.module.min.js +0 -2
  182. package/dist/chunk-chunk-DSNGDNJY.module.min.js +0 -1
  183. package/dist/chunk-chunk-FBUNUIPV.module.min.js +0 -2
  184. package/dist/chunk-chunk-G7QVPZUD.module.min.js +0 -2
  185. package/dist/chunk-chunk-GBPYV4FP.module.min.js +0 -2
  186. package/dist/chunk-chunk-KXAFCCDB.module.min.js +0 -2
  187. package/dist/chunk-chunk-LWITSR2O.module.min.js +0 -2
  188. package/dist/chunk-chunk-MX35T6RX.module.min.js +0 -2
  189. package/dist/chunk-chunk-NJETWX42.module.min.js +0 -2
  190. package/dist/chunk-chunk-NW25WGLS.module.min.js +0 -2
  191. package/dist/chunk-chunk-ONMLEXHR.module.min.js +0 -2
  192. package/dist/chunk-chunk-OY66GCE6.module.min.js +0 -1
  193. package/dist/chunk-chunk-PRDGLMJT.module.min.js +0 -2
  194. package/dist/chunk-chunk-PZFT457G.module.min.js +0 -1
  195. package/dist/chunk-chunk-Q3WW6JGR.module.min.js +0 -1
  196. package/dist/chunk-chunk-Q6XKQTOQ.module.min.js +0 -1
  197. package/dist/chunk-chunk-RJRM2E6P.module.min.js +0 -1
  198. package/dist/chunk-chunk-RPL7WYXI.module.min.js +0 -1
  199. package/dist/chunk-chunk-V3OAKG32.module.min.js +0 -1
  200. package/dist/chunk-chunk-WCX6U47H.module.min.js +0 -2
  201. package/dist/chunk-chunk-WLOIUMWG.module.min.js +0 -2
  202. package/dist/chunk-chunk-XEGXX4F7.module.min.js +0 -1
  203. package/dist/chunk-chunk-XFRBLXYM.module.min.js +0 -1
  204. package/dist/chunk-chunk-ZXYDYAB7.module.min.js +0 -2
  205. package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +0 -2
  206. package/dist/components/stream/renderers/networkSymbolRenderer.d.ts +0 -2
@@ -1,10 +1,14 @@
1
1
  import * as React from "react";
2
+ import type { ProcessSankeyOrientation } from "./processSankey/orientation";
3
+ import type { ProcessSankeyLayoutExecution } from "./processSankey/processSankeyLayoutWorkerClient";
4
+ import { type ProcessSankeyTimeLike } from "./processSankey/time";
5
+ import type { StyleRule } from "../shared/styleRules";
2
6
  import type { Datum } from "../shared/datumTypes";
3
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
7
+ import type { BaseChartProps, ChartAccessor, SelectionConfig, LinkedHoverProp } from "../shared/types";
4
8
  import type { RealtimeFrameHandle } from "../../realtime/types";
5
9
  import type { StreamNetworkFrameProps, ParticleStyle } from "../../stream/networkTypes";
6
- import { type TooltipProp } from "../../Tooltip/Tooltip";
7
- type TimeLike = number | Date | string;
10
+ import type { TooltipProp } from "../../Tooltip/Tooltip";
11
+ type TimeLike = ProcessSankeyTimeLike;
8
12
  export interface ProcessSankeyTick {
9
13
  date: TimeLike;
10
14
  label: string;
@@ -12,33 +16,20 @@ export interface ProcessSankeyTick {
12
16
  export interface ProcessSankeyProps<TNode extends Datum = Datum, TEdge extends Datum = Datum> extends BaseChartProps {
13
17
  nodes?: TNode[];
14
18
  edges?: TEdge[];
15
- /** [tStart, tEnd] of the chart's x-axis. Required. */
19
+ /** [tStart, tEnd] of the chart's time axis. Required. */
16
20
  domain: [TimeLike, TimeLike];
17
21
  /** Optional axis ticks. Each tick: { date, label }. */
18
22
  axisTicks?: ProcessSankeyTick[];
19
23
  nodeIdAccessor?: ChartAccessor<TNode, string>;
24
+ nodeLabel?: ChartAccessor<TNode, string>;
20
25
  sourceAccessor?: ChartAccessor<TEdge, string>;
21
26
  targetAccessor?: ChartAccessor<TEdge, string>;
22
27
  valueAccessor?: ChartAccessor<TEdge, number>;
23
28
  startTimeAccessor?: ChartAccessor<TEdge, TimeLike>;
24
29
  endTimeAccessor?: ChartAccessor<TEdge, TimeLike>;
25
- /**
26
- * Optional accessor for the per-edge "system in" time — when
27
- * `value` is added to the SOURCE node's mass. Use when the
28
- * source node has an intake event distinct from when this edge
29
- * departs (e.g. a patient is admitted to the ER at 7pm and
30
- * transferred out at 9pm — the ER node carries the patient's
31
- * weight between 7pm and 9pm). Without this, the source node's
32
- * mass is synthesized as a flat baseline and the band reads as
33
- * "always there." Set it and the node band climbs / falls as
34
- * units arrive and depart — a true staircase profile.
35
- */
30
+ /** Optional source-side inventory arrival time (before ribbon departs). */
36
31
  systemInTimeAccessor?: ChartAccessor<TEdge, TimeLike>;
37
- /**
38
- * Optional accessor for the per-edge "system out" time — when
39
- * `value` is removed from the TARGET node's mass. Mirror of
40
- * `systemInTimeAccessor` for the inbound side.
41
- */
32
+ /** Optional target-side inventory departure time (after ribbon arrives). */
42
33
  systemOutTimeAccessor?: ChartAccessor<TEdge, TimeLike>;
43
34
  /**
44
35
  * Accessor for a node's explicit lifetime extent — a `[start, end]`
@@ -46,6 +37,10 @@ export interface ProcessSankeyProps<TNode extends Datum = Datum, TEdge extends D
46
37
  * `min(xExtent[0], earliestEdge)` to `max(xExtent[1], latestEdge)`.
47
38
  */
48
39
  xExtentAccessor?: ChartAccessor<TNode, [TimeLike, TimeLike]>;
40
+ /** Optional node accessor that bonds equal, non-empty values into one
41
+ * contiguous stream-like lane block. Use `"category"` to bond an existing
42
+ * categorical field without coupling grouping to color. */
43
+ groupBy?: ChartAccessor<TNode, string | number>;
49
44
  edgeIdAccessor?: ChartAccessor<TEdge, string>;
50
45
  colorBy?: ChartAccessor<TNode, string>;
51
46
  colorScheme?: string | string[] | Record<string, string>;
@@ -61,18 +56,68 @@ export interface ProcessSankeyProps<TNode extends Datum = Datum, TEdge extends D
61
56
  timeFormat?: (d: number | Date) => string | React.ReactNode;
62
57
  /** Format function for the `value` field. Mirrors `yFormat` on XY charts. */
63
58
  valueFormat?: (d: number) => string | React.ReactNode;
59
+ /** Direction of time. Horizontal (default) reads left-to-right;
60
+ * vertical reads top-to-bottom while lanes occupy the x-axis. */
61
+ orientation?: ProcessSankeyOrientation;
64
62
  pairing?: "value" | "temporal";
65
63
  packing?: "off" | "reuse";
66
64
  laneOrder?: "insertion" | "crossing-min" | "inside-out" | "crossing-min+inside-out";
65
+ /** Maximum pixels per value unit. Set this to keep sparse lanes from
66
+ * inflating until they fill the plot. Unset preserves legacy scaling. */
67
+ maxValueScale?: number;
68
+ /** Vertical coordinate assignment. `"hug"` uses any scale-cap slack to
69
+ * pull connected lane attachments together while preserving order/gaps. */
70
+ lanePlacement?: "stack" | "hug";
71
+ /** How explicit node `xExtent`s size visible bands. `"max"` holds a
72
+ * node's largest instantaneous mass across its extent, for staged Sankeys. */
73
+ nodeSizing?: "temporal" | "max";
74
+ /** Pixel gutter inside a bonded node group. Defaults to `0`, so adjacent
75
+ * band silhouettes touch without overlapping. */
76
+ groupPadding?: number;
67
77
  ribbonLane?: "source" | "target" | "both";
78
+ /**
79
+ * Minimum rendered run along the time axis for **source-only feeder**
80
+ * ribbons (not a general minimum ribbon length). A number is a pixel
81
+ * minimum; `"auto"` adapts to lateral lane distance. Only source-only
82
+ * feeders with proven xExtent/systemInTime runway are affected.
83
+ * Authored event times and mass accounting remain unchanged.
84
+ * Default `0` preserves exact temporal endpoints.
85
+ */
86
+ ribbonMinRun?: number | "auto";
68
87
  lifetimeMode?: "full" | "half";
69
88
  showLaneRails?: boolean;
70
89
  showQualityReadout?: boolean;
71
- /** Render the per-band node id label at the band's left edge.
72
- * Default `true`. Set `false` for dense layouts where labels
73
- * would overlap, or when the legend already names every band. */
74
- showLabels?: boolean;
75
- edgeOpacity?: number;
90
+ /** Render the per-band node id label at the band's opening edge.
91
+ * Default `true`. Set `false` for dense layouts, or `"auto"` for a
92
+ * density-budgeted subset shared by CSR/SSR. */
93
+ showLabels?: boolean | "auto";
94
+ /**
95
+ * Author priority for `showLabels="auto"`. Higher values survive density
96
+ * shedding first. Field name or function over the raw node datum.
97
+ * Shed labels reappear under selection without a layout recompute.
98
+ */
99
+ labelPriorityAccessor?: string | ((d: TNode) => number);
100
+ /** Optional hard cap on visible auto labels (after the area budget). */
101
+ maxLabels?: number;
102
+ /**
103
+ * Which datum shape selection / linkedHover predicates receive.
104
+ * `"raw"` (default) unwraps author records from the scene payload so field
105
+ * matchers work without knowing ProcessSankey's `{ __kind, data, id }` shape.
106
+ * `"scene"` keeps the full payload for tooling that needs `__kind`.
107
+ */
108
+ selectionDatum?: "raw" | "scene";
109
+ /** A shared opacity, or a per-edge opacity resolver for confidence-aware flows. */
110
+ edgeOpacity?: number | ((edge: TEdge) => number);
111
+ /** Declarative threshold-aware styling for node bands (raw node datum). */
112
+ styleRules?: StyleRule[];
113
+ /** Layout execution: auto (cost threshold), worker, or sync. SSR always sync. */
114
+ layoutExecution?: ProcessSankeyLayoutExecution;
115
+ /** Override auto worker cost threshold (see estimateProcessSankeyLayoutCost). */
116
+ layoutWorkerThreshold?: number;
117
+ /** Content while worker layout is pending. `false` suppresses. */
118
+ layoutLoadingContent?: React.ReactNode | false;
119
+ /** Called when worker/async layout changes state. */
120
+ onLayoutStateChange?: (state: "pending" | "ready" | "error") => void;
76
121
  /** Tooltip content. `false` disables, `true` uses the default,
77
122
  * or pass a `Tooltip(...)` / custom function for full control. */
78
123
  tooltip?: TooltipProp;
@@ -81,6 +126,8 @@ export interface ProcessSankeyProps<TNode extends Datum = Datum, TEdge extends D
81
126
  x: number;
82
127
  y: number;
83
128
  }) => void;
129
+ selection?: SelectionConfig;
130
+ linkedHover?: LinkedHoverProp;
84
131
  showParticles?: boolean;
85
132
  /** Style config for the particle overlay — same shape
86
133
  * StreamNetworkFrame consumes from SankeyDiagram. Defaults
@@ -91,69 +138,53 @@ export interface ProcessSankeyProps<TNode extends Datum = Datum, TEdge extends D
91
138
  frameProps?: Partial<Omit<StreamNetworkFrameProps, "nodes" | "edges" | "chartType" | "size" | "customNetworkLayout" | "layoutConfig">>;
92
139
  }
93
140
  /**
94
- * ProcessSankey — temporal flow between nodes with an actual time x-axis.
95
- *
96
- * Built on top of `StreamNetworkFrame` via the `customNetworkLayout`
97
- * escape hatch. Bands and ribbons emit as `bezier` scene-edges; the
98
- * Frame handles canvas painting, hit testing, accessibility, theme
99
- * cascade, and the push API.
100
- *
101
- * **Differs from SankeyDiagram in three ways:**
141
+ * ProcessSankey draws timed process flow as lane bands and ribbons on a real time axis.
102
142
  *
103
- * 1. **Edges carry time.** Each edge has `startTime` / `endTime`.
104
- * 2. **Nodes have lifetimes, not ranks.** A node's vertical lane spans
105
- * `min(xExtent[0], earliestEdge)` to `max(xExtent[1], latestEdge)`.
106
- * 3. **Static-graph cycles are valid** as long as edges move forward in time.
143
+ * Prefer this over {@link SankeyDiagram} when edges carry `startTime`/`endTime`
144
+ * and node lifetime matters (optional `xExtent`). Static graph cycles are fine
145
+ * as long as edges move forward in time. Layout path: normalize → scenes
146
+ * (sync or worker) → frame + shared chrome.
107
147
  *
108
148
  * @example
109
149
  * ```tsx
110
- * // Static fixture: pre-built nodes + timed edges, categorical colors.
150
+ * // Operational hospital handoffs (horizontal time)
111
151
  * <ProcessSankey
152
+ * domain={[0, 48]}
112
153
  * nodes={[
113
- * { id: "Alice", category: "Person", xExtent: ["2026-01-06", "2026-01-06"] },
114
- * { id: "Bob", category: "Person", xExtent: ["2026-02-01", "2026-02-01"] },
115
- * { id: "Eng", category: "Team" },
116
- * { id: "Release", category: "Milestone", xExtent: ["2026-04-15", "2026-05-30"] },
154
+ * { id: "ER", xExtent: [0, 48] },
155
+ * { id: "ICU", xExtent: [4, 48] },
156
+ * { id: "Ward", xExtent: [12, 48] },
117
157
  * ]}
118
158
  * edges={[
119
- * { id: "alice-eng", source: "Alice", target: "Eng", value: 8,
120
- * startTime: "2026-01-20", endTime: "2026-02-10" },
121
- * { id: "bob-eng", source: "Bob", target: "Eng", value: 5,
122
- * startTime: "2026-02-15", endTime: "2026-03-15" },
123
- * { id: "eng-rel", source: "Eng", target: "Release", value: 13,
124
- * startTime: "2026-04-15", endTime: "2026-05-15" },
159
+ * { id: "e1", source: "ER", target: "ICU", value: 12, startTime: 2, endTime: 6 },
160
+ * { id: "e2", source: "ICU", target: "Ward", value: 8, startTime: 14, endTime: 20 },
125
161
  * ]}
126
- * domain={["2026-01-01", "2026-05-31"]}
127
- * colorBy="category"
128
- * showLegend
162
+ * packing="reuse"
163
+ * laneOrder="crossing-min+inside-out"
164
+ * showLabels
129
165
  * />
130
166
  * ```
131
167
  *
132
168
  * @example
133
169
  * ```tsx
134
- * // Push mode: omit `edges`, mutate via the ref. Same chart shape, but
135
- * // edges arrive over time. Particles depict throughput.
136
- * const ref = useRef<RealtimeFrameHandle>(null)
137
- *
138
- * useEffect(() => {
139
- * const id = setInterval(() => {
140
- * ref.current?.push({
141
- * source: "API", target: "DB", value: Math.random() * 10,
142
- * startTime: Date.now(), endTime: Date.now() + 1500,
143
- * })
144
- * }, 800)
145
- * return () => clearInterval(id)
146
- * }, [])
147
- *
148
- * return (
149
- * <ProcessSankey
150
- * ref={ref}
151
- * domain={[t0, t0 + 60_000]}
152
- * showParticles
153
- * colorBy="category"
154
- * showLegend
155
- * />
156
- * )
170
+ * // History river (vertical time, hug placement, style rules)
171
+ * <ProcessSankey
172
+ * domain={[1763, 2025]}
173
+ * orientation="vertical"
174
+ * nodes={institutions}
175
+ * edges={jurisdictionEvents}
176
+ * nodeLabel="shortLabel"
177
+ * colorBy="category"
178
+ * groupBy="group"
179
+ * systemInTimeAccessor="systemInTime"
180
+ * systemOutTimeAccessor="systemOutTime"
181
+ * packing="reuse"
182
+ * laneOrder="crossing-min+inside-out"
183
+ * lanePlacement="hug"
184
+ * ribbonMinRun="auto"
185
+ * lifetimeMode="full"
186
+ * showLabels="auto"
187
+ * />
157
188
  * ```
158
189
  */
159
190
  export declare const ProcessSankey: {
@@ -0,0 +1,7 @@
1
+ /**
2
+ * ChartAccessor evaluation for ProcessSankey normalize / push / tooltip paths.
3
+ */
4
+ import type { Datum } from "../../shared/datumTypes";
5
+ import type { ChartAccessor } from "../../shared/types";
6
+ /** Read a string-or-function accessor against a datum. */
7
+ export declare function readChartAccessor<T extends Datum, V>(accessor: ChartAccessor<T, V>, d: T): V;
@@ -1,193 +1,14 @@
1
- export interface ProcessSankeyNode {
2
- id: string;
3
- /** Optional explicit lifetime bound [start, end]. Lifetime is
4
- * `min(xExtent[0], earliestEdge)` to `max(xExtent[1], latestEdge)`. */
5
- xExtent?: [number, number];
6
- }
7
- export interface ProcessSankeyEdge {
8
- id: string;
9
- source: string;
10
- target: string;
11
- value: number;
12
- startTime: number;
13
- endTime: number;
14
- /** Optional: time at which this unit of mass actually "arrived" at
15
- * the SOURCE node (e.g., the hospital admit time for an ER patient
16
- * whose transfer to ICU happens later at `startTime`). Purely a
17
- * rendering hint — the layout/mass profile is unchanged. The
18
- * renderer cuts a rectangular slot out of the source node's band
19
- * from the node's left edge up to the scaled `systemInTime`, with
20
- * height equal to this edge's ribbon thickness. Edges without
21
- * `systemInTime` are drawn as-is. Result: a staircase profile on
22
- * the source side as units enter the system one by one.
23
- * Default: undefined. */
24
- systemInTime?: number;
25
- /** Optional: time at which this unit of mass leaves the TARGET node
26
- * (e.g., the discharge time for a patient who arrived at the ward
27
- * at `endTime`). Symmetric to `systemInTime`: the renderer cuts a
28
- * rectangular slot out of the target node's band from the scaled
29
- * `systemOutTime` to the node's right edge, with height equal to
30
- * this edge's ribbon thickness. Layout/mass profile unchanged.
31
- * Default: undefined. */
32
- systemOutTime?: number;
33
- }
34
- export interface ProcessSankeyIssue {
35
- kind: string;
36
- id?: string;
37
- source?: string;
38
- target?: string;
39
- endpoint?: string;
40
- nodeId?: string;
41
- }
42
- export interface ProcessSankeySample {
43
- t: number;
44
- topMass: number;
45
- botMass: number;
46
- }
47
- export type AttachmentSide = "top" | "bot";
48
- export type AttachmentKind = "in" | "out";
49
- export interface ProcessSankeyAttachment {
50
- side: AttachmentSide;
51
- time: number;
52
- sideMassBefore: number;
53
- sideMassAfter: number;
54
- kind: AttachmentKind;
55
- value: number;
56
- }
57
- export interface ProcessSankeyNodeData {
58
- samples: ProcessSankeySample[];
59
- peak: number;
60
- topPeak: number;
61
- botPeak: number;
62
- localAttachments: Map<string, ProcessSankeyAttachment>;
63
- }
64
- export interface ProcessSankeySlotPeak {
65
- topPeak: number;
66
- botPeak: number;
67
- }
68
- export interface ProcessSankeySlotOccupant {
69
- id: string;
70
- end: number;
71
- }
72
- export interface ProcessSankeySlot {
73
- peak: ProcessSankeySlotPeak;
74
- occupants: ProcessSankeySlotOccupant[];
75
- }
76
- export interface ProcessSankeyLaneLifetime {
77
- start: number | null;
78
- end: number | null;
79
- }
80
- export interface ProcessSankeySideRecord {
81
- sourceSide?: AttachmentSide;
82
- targetSide?: AttachmentSide;
83
- }
84
- export interface ProcessSankeyLayout {
85
- nodeData: Record<string, ProcessSankeyNodeData>;
86
- sides: Map<string, ProcessSankeySideRecord>;
87
- valueScale: number;
88
- padding: number;
89
- compressedPadding: boolean;
90
- centerlines: Record<string, number>;
91
- laneLifetime: Record<string, ProcessSankeyLaneLifetime>;
92
- slots: ProcessSankeySlot[];
93
- slotByNode: Record<string, number>;
94
- crossingsBefore: number | null;
95
- crossingsAfter: number | null;
96
- lengthBefore: number | null;
97
- lengthAfter: number | null;
98
- }
99
- export interface ProcessSankeyOptions {
100
- plotH: number;
101
- pairing?: "value" | "temporal";
102
- packing?: "off" | "reuse";
103
- laneOrder?: "insertion" | "crossing-min" | "inside-out" | "crossing-min+inside-out";
104
- lifetimeMode?: "full" | "half";
105
- }
106
- export interface ProcessSankeyEdgeIndex {
107
- incoming: Record<string, ProcessSankeyEdge[]>;
108
- outgoing: Record<string, ProcessSankeyEdge[]>;
109
- }
110
- type Domain = [number, number] | null | undefined;
111
- export declare function validateProcessSankey(nodes: ProcessSankeyNode[], edges: ProcessSankeyEdge[], domain: [number, number]): ProcessSankeyIssue[];
112
- export declare function formatProcessSankeyIssue(issue: ProcessSankeyIssue): string;
113
- export declare function buildEdgeIndex(nodes: ProcessSankeyNode[], edges: ProcessSankeyEdge[]): ProcessSankeyEdgeIndex;
114
- export declare function assignSides(nodes: ProcessSankeyNode[], edges: ProcessSankeyEdge[], edgeIndex: ProcessSankeyEdgeIndex, pairing?: "value" | "temporal"): Map<string, ProcessSankeySideRecord>;
115
- export declare function computeNode(node: ProcessSankeyNode, edgeIndex: ProcessSankeyEdgeIndex, sides: Map<string, ProcessSankeySideRecord>): ProcessSankeyNodeData;
116
- export declare function clampTime(t: number, domain: Domain): number;
117
- export declare function clampSamples(samples: ProcessSankeySample[], domain: Domain): ProcessSankeySample[];
118
- export declare function attachmentYRange(att: ProcessSankeyAttachment, cl: number, S: number): [number, number];
119
- export declare function buildBandPath(samples: ProcessSankeySample[], cl: number, S: number, xScale: (t: number) => number, domain: Domain): string | null;
120
- /**
121
- * One 20-px gradient stub at an attachment with `systemInTime` /
122
- * `systemOutTime`. Rendered as its own bezier scene-edge with a
123
- * horizontal gradient, painted underneath the band. The band
124
- * paints with `fill: none` whenever any stubs are present, so the
125
- * stub gradients are the only colored regions inside the band's
126
- * outline.
127
- */
128
- export interface BandGradientStub {
129
- /** Rect path (M-L-L-L-Z). */
130
- pathD: string;
131
- /** Gradient extent in screen pixels. */
132
- x0: number;
133
- x1: number;
134
- /** Color stops — 0 = transparent end, 1 = band-color end. */
135
- from: 0 | 1;
136
- to: 0 | 1;
137
- }
138
- /**
139
- * Build the per-edge 20-px gradient stubs that visualize
140
- * `systemInTime` / `systemOutTime` on a node band. Each stub is
141
- * a rect on the edge's attachment slot, painted with a horizontal
142
- * gradient that fades the band color in (or out) over 20 screen
143
- * pixels and saturates through the rest of the rect.
144
- *
145
- * The rect is clipped to the band's outline bounds (so cutouts don't
146
- * spill outside the node shape), but the gradient extent stays at
147
- * its natural `[xSysIn - FADE_PX, xSysIn]` / `[xSysOut, xSysOut + FADE_PX]`
148
- * range. The canvas renderer uses pad-mode clamping for color stops
149
- * outside the rect, so a stub whose fade region falls past the band's
150
- * edge still paints solid band-color where it's visible — instead of
151
- * collapsing to a degenerate gradient that the renderer would clamp
152
- * to transparent.
153
- *
154
- * Pure rendering hint — layout/mass-profile unchanged. Returns an
155
- * empty array when the node has no qualifying edges.
156
- */
157
- export declare function buildBandCutoutsForNode(nodeId: string, edges: ProcessSankeyEdge[], layout: ProcessSankeyLayout, xScale: (t: number) => number, domain: Domain): BandGradientStub[];
158
- type SlotByNode = Record<string, number>;
159
- export declare function countCrossings(slotByNode: SlotByNode, edges: ProcessSankeyEdge[]): number;
160
- export declare function totalEdgeLength(slotByNode: SlotByNode, edges: ProcessSankeyEdge[]): number;
161
- interface LaneLayoutOptions {
162
- plotH: number;
163
- padding: number;
164
- valueScale: number;
165
- packing?: "off" | "reuse";
166
- laneOrder?: "insertion" | "crossing-min" | "inside-out" | "crossing-min+inside-out";
167
- lifetimeMode?: "full" | "half";
168
- }
169
- interface LaneLayoutResult {
170
- effectiveSlotsHeight: number;
171
- centerlines: Record<string, number>;
172
- laneLifetime: Record<string, ProcessSankeyLaneLifetime>;
173
- slots: ProcessSankeySlot[];
174
- slotByNode: SlotByNode;
175
- slotCenter: number[];
176
- crossingsBefore: number | null;
177
- crossingsAfter: number | null;
178
- lengthBefore: number | null;
179
- lengthAfter: number | null;
180
- }
181
- export declare function computeLaneLayout(nodes: ProcessSankeyNode[], edges: ProcessSankeyEdge[], nodeData: Record<string, ProcessSankeyNodeData>, edgeIndex: ProcessSankeyEdgeIndex, opts: LaneLayoutOptions): LaneLayoutResult;
182
- /**
183
- * Compute the full Process Sankey layout for a given dataset and
184
- * configuration. Pure function, no side effects.
185
- *
186
- * The chart's time domain isn't a layout opt — domain handling lives
187
- * in the geometry helpers (`buildBandPath`, `buildRibbonGeometry`,
188
- * `clampSamples`) which receive an `xScale` and a domain pair from
189
- * the caller. The layout itself is timeless apart from the per-node
190
- * sample/event timestamps.
191
- */
192
- export declare function computeProcessSankeyLayout(nodes: ProcessSankeyNode[], edges: ProcessSankeyEdge[], opts: ProcessSankeyOptions): ProcessSankeyLayout;
193
- export {};
1
+ export type { ProcessSankeyNode, ProcessSankeyEdge, ProcessSankeyIssueSeverity, ProcessSankeyIssue, ProcessSankeySample, AttachmentSide, AttachmentKind, ProcessSankeyAttachment, ProcessSankeyNodeData, ProcessSankeySlotPeak, ProcessSankeySlotOccupant, ProcessSankeySlot, ProcessSankeyLaneLifetime, ProcessSankeySideRecord, ProcessSankeyLayout, ProcessSankeyLayoutQuality, ProcessSankeyRibbonLane, ProcessSankeyNodeSizing, ProcessSankeyOptions, ProcessSankeyEdgeIndex, } from "./processSankeyTypes";
2
+ export { processSankeyIssueSeverity, partitionProcessSankeyIssues, validateProcessSankey, formatProcessSankeyIssue, resolveProcessSankeyValidationPolicy, applyProcessSankeyValidationPolicy, PROCESS_SANKEY_VALIDATION_POLICY, } from "./validation";
3
+ export type { ProcessSankeyUsageMode, ProcessSankeyValidationPolicy, } from "./validation";
4
+ export { buildEdgeIndex, assignSides, computeNode, assignSameSlotHandoffSides, collectEndpointPositions, hasResolvableAttachmentTies, rebalanceOutgoingSides, } from "./massSimulation";
5
+ export type { ProcessSankeyEndpointPositions } from "./massSimulation";
6
+ export { clampTime, clampSamples, attachmentYRange, buildBandPath, buildBandCutoutsForNode, } from "./bandPaths";
7
+ export type { BandGradientStub } from "./bandPaths";
8
+ export { computeLaneLayout, computeProcessSankeyLayout } from "./layoutOrchestrator";
9
+ export { countCrossings, totalEdgeLength } from "./ordering";
10
+ export { diagnoseProcessSankeyLayout, diagnoseProcessSankeyProps, explainProcessSankeyLayout, PROCESS_SANKEY_QUALITY_THRESHOLDS, } from "./layoutQualityProduct";
11
+ export { inventoryAtTime } from "./inventoryAtTime";
12
+ export type { InventoryEdge, InventoryAtTimeOptions } from "./inventoryAtTime";
13
+ export { toProcessSankeyTime } from "./time";
14
+ export type { ProcessSankeyTimeLike } from "./time";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Shared ProcessSankey background chrome (time axis, grid, quality readout,
3
+ * optional lane rails). Used by the client HOC and the SSR config so both
4
+ * paths paint identical theme-token chrome.
5
+ */
6
+ import * as React from "react";
7
+ import type { ProcessSankeyLayout } from "./algorithm";
8
+ import type { ProcessSankeyOrientation } from "./orientation";
9
+ import type { ProcessSankeyNormalizedNode } from "./buildScenes";
10
+ export interface ProcessSankeyTickInput {
11
+ date: number | Date | string;
12
+ label?: string | React.ReactNode;
13
+ }
14
+ export interface BuildProcessSankeyBackgroundGraphicsInput {
15
+ layout: ProcessSankeyLayout;
16
+ nodes: readonly ProcessSankeyNormalizedNode[];
17
+ orientation: ProcessSankeyOrientation;
18
+ plotW: number;
19
+ plotH: number;
20
+ timelineExtent: number;
21
+ axisTicks: readonly ProcessSankeyTickInput[];
22
+ showQualityReadout?: boolean;
23
+ showLaneRails?: boolean;
24
+ /** Non-fatal validation messages for the quality readout (M6). */
25
+ warnings?: readonly string[];
26
+ timeFormat?: (d: Date) => string | React.ReactNode;
27
+ colorOf?: (id: string, idx: number) => string;
28
+ toTime: (value: number | Date | string | undefined | null) => number;
29
+ xScale: (t: number) => number;
30
+ }
31
+ export declare function buildProcessSankeyBackgroundGraphics(input: BuildProcessSankeyBackgroundGraphicsInput): React.ReactElement;
@@ -0,0 +1,45 @@
1
+ import type { ProcessSankeyAttachment, ProcessSankeyEdge, ProcessSankeyLayout, ProcessSankeySample } from "./processSankeyTypes";
2
+ type Domain = [number, number] | null | undefined;
3
+ export declare function clampTime(t: number, domain: Domain): number;
4
+ export declare function clampSamples(samples: readonly ProcessSankeySample[], domain: Domain): ProcessSankeySample[];
5
+ export declare function attachmentYRange(att: ProcessSankeyAttachment, cl: number, S: number): [number, number];
6
+ export declare function buildBandPath(samples: readonly ProcessSankeySample[], cl: number, S: number, xScale: (t: number) => number, domain: Domain): string | null;
7
+ /**
8
+ * One 20-px gradient stub at an attachment with `systemInTime` /
9
+ * `systemOutTime`. Rendered as its own bezier scene-edge with a
10
+ * horizontal gradient, painted underneath the band. The band
11
+ * paints with `fill: none` whenever any stubs are present, so the
12
+ * stub gradients are the only colored regions inside the band's
13
+ * outline.
14
+ */
15
+ export interface BandGradientStub {
16
+ /** Rect path (M-L-L-L-Z). */
17
+ pathD: string;
18
+ /** Gradient extent in screen pixels. */
19
+ x0: number;
20
+ x1: number;
21
+ /** Color stops — 0 = transparent end, 1 = band-color end. */
22
+ from: 0 | 1;
23
+ to: 0 | 1;
24
+ }
25
+ /**
26
+ * Build the per-edge 20-px gradient stubs that visualize
27
+ * `systemInTime` / `systemOutTime` on a node band. Each stub is
28
+ * a rect on the edge's attachment slot, painted with a horizontal
29
+ * gradient that fades the band color in (or out) over 20 screen
30
+ * pixels and saturates through the rest of the rect.
31
+ *
32
+ * The rect is clipped to the band's outline bounds (so cutouts don't
33
+ * spill outside the node shape), but the gradient extent stays at
34
+ * its natural range. In-domain entrances use
35
+ * `[xSysIn - FADE_PX, xSysIn]`; entrances known to predate the visible
36
+ * domain use `[domainStart, domainStart + FADE_PX]` so they blur inward
37
+ * rather than completing their fade offscreen. Exits use
38
+ * `[xSysOut, xSysOut + FADE_PX]`. The canvas renderer uses pad-mode
39
+ * clamping for color stops outside the rect.
40
+ *
41
+ * Pure rendering hint — layout/mass-profile unchanged. Returns an
42
+ * empty array when the node has no qualifying edges.
43
+ */
44
+ export declare function buildBandCutoutsForNode(nodeId: string, edges: ProcessSankeyEdge[], layout: ProcessSankeyLayout, xScale: (t: number) => number, domain: Domain, visualDepartureByEdge?: ReadonlyMap<string, number>): BandGradientStub[];
45
+ export {};
@@ -2,12 +2,16 @@ import { scaleTime } from "d3-scale";
2
2
  import { type ProcessSankeyOptions, type ProcessSankeyLayout, type ProcessSankeyIssue } from "./algorithm";
3
3
  import type { ProcessSankeyLayoutConfig } from "./streamingLayout";
4
4
  import type { Datum } from "../../shared/datumTypes";
5
+ import { type ProcessSankeyOrientation } from "./orientation";
6
+ import { type StyleRule } from "../../shared/styleRules";
5
7
  export interface ProcessSankeyNormalizedNode {
6
8
  id: string;
9
+ label?: string;
10
+ group?: string;
7
11
  xExtent?: [number, number];
8
12
  __raw?: Datum;
9
13
  }
10
- export interface ProcessSankeyNormalizedEdge {
14
+ export interface ProcessSankeyNormalizedEdge extends Datum {
11
15
  id: string;
12
16
  source: string;
13
17
  target: string;
@@ -28,17 +32,51 @@ export interface BuildScenesInput {
28
32
  domain: [number, number];
29
33
  plotW: number;
30
34
  plotH: number;
35
+ orientation?: ProcessSankeyOrientation;
31
36
  ribbonLane: "source" | "target" | "both";
32
- edgeOpacity: number;
37
+ /**
38
+ * Minimum rendered run along the time axis for **source-only feeder**
39
+ * ribbons (not a general minimum ribbon length). A number is a pixel
40
+ * minimum; `"auto"` adapts to lateral lane distance. Only source-only
41
+ * feeders with proven stock/runway are affected.
42
+ */
43
+ ribbonMinRun?: number | "auto";
44
+ /** A shared opacity, or a raw-edge resolver for confidence-aware flows. */
45
+ edgeOpacity: number | ((edge: Datum) => number);
33
46
  /** Resolves a node's color by id+index (lets the caller plug in
34
47
  * the same theme/colorScheme/colorBy resolution the HOC uses). */
35
48
  colorOf: (id: string, idx: number) => string;
36
- layoutOpts: Pick<ProcessSankeyOptions, "pairing" | "packing" | "laneOrder" | "lifetimeMode">;
49
+ layoutOpts: Pick<ProcessSankeyOptions, "pairing" | "packing" | "laneOrder" | "lifetimeMode" | "maxValueScale" | "lanePlacement" | "nodeSizing" | "groupPadding">;
50
+ /** Render node labels: true, false, or density-budgeted `"auto"`. */
51
+ showLabels?: boolean | "auto";
52
+ /**
53
+ * Author priority for `showLabels="auto"`. Higher values survive density
54
+ * shedding first. String field name or function over the raw node datum.
55
+ */
56
+ labelPriorityAccessor?: string | ((d: Datum) => number);
57
+ /** Optional hard cap on visible auto labels (after area budget). */
58
+ maxLabels?: number;
59
+ /**
60
+ * Which datum selection/linkedHover predicates receive.
61
+ * Default `"raw"` unwraps author records from the scene payload.
62
+ */
63
+ selectionDatum?: "raw" | "scene";
64
+ /** Declarative style rules applied to band fills (raw node datum). */
65
+ styleRules?: StyleRule[];
66
+ colorBy?: string | ((d: Datum) => unknown);
67
+ valueAccessor?: string | ((d: Datum) => unknown);
68
+ /**
69
+ * Validation policy mode (M6). `static`/`mcp` hard-fail duplicate ids;
70
+ * `push` warns and strips invalid system times. Default `static`.
71
+ */
72
+ usageMode?: import("./validation").ProcessSankeyUsageMode;
37
73
  }
38
74
  export interface BuildScenesResult {
39
75
  layout: ProcessSankeyLayout | null;
40
76
  layoutConfig: ProcessSankeyLayoutConfig;
41
77
  issues: ProcessSankeyIssue[];
78
+ /** Non-fatal validation issues; layout still runs when only these remain. */
79
+ warnings: ProcessSankeyIssue[];
42
80
  /** Used downstream for tooltips (mass-history) and overlays. */
43
81
  xScale: ReturnType<typeof scaleTime>;
44
82
  }
@@ -0,0 +1,17 @@
1
+ import type { ProcessSankeyEdge, ProcessSankeyNode } from "./algorithm";
2
+ /** Non-temporal topology expressed as scheduled process events, including a
3
+ * later repartition loop. Exercises chains, merge/fan-out, and a static cycle. */
4
+ export declare const processLineageFixture: {
5
+ nodes: ProcessSankeyNode[];
6
+ edges: ProcessSankeyEdge[];
7
+ };
8
+ /** Wide hospital-flow shape with dense lanes and several long transits. */
9
+ export declare const processHospitalFixture: {
10
+ nodes: ProcessSankeyNode[];
11
+ edges: ProcessSankeyEdge[];
12
+ };
13
+ /** Deterministic 60-node/200-edge stress shape for the ordering budget. */
14
+ export declare function processOrderingStressFixture(): {
15
+ nodes: ProcessSankeyNode[];
16
+ edges: ProcessSankeyEdge[];
17
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Reserve vertical frame space only for chrome that is actually rendered.
3
+ * Eight pixels clear the bare axis rule; telemetry needs its two-line
4
+ * readout, and labeled ticks need their 20px baseline plus font descent.
5
+ */
6
+ export declare function resolveProcessSankeyMarginDefaults(hasTitle: boolean, showQualityReadout: boolean, hasAxisTicks: boolean, orientation?: "horizontal" | "vertical"): {
7
+ top: number;
8
+ right: number;
9
+ bottom: number;
10
+ left: number;
11
+ };