semiotic 3.8.7 → 3.8.9
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.
- package/CLAUDE.md +6 -5
- package/README.md +58 -48
- package/ai/dist/mcp-server.js +28 -2
- package/ai/schema.json +386 -4
- package/ai/surface-manifest.json +1 -1
- package/ai/system-prompt.md +1 -1
- package/dist/{chunk-chartContainerDataAudit-JDSVSKGM.module.min.js → chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js} +1 -1
- package/dist/chunk-chunk-2B3AIKUZ.module.min.js +2 -0
- package/dist/chunk-chunk-2NVFEB7P.module.min.js +2 -0
- package/dist/chunk-chunk-2X3FJCME.module.min.js +1 -0
- package/dist/{chunk-chunk-LVHDZAT3.module.min.js → chunk-chunk-2ZHHWZQM.module.min.js} +1 -1
- package/dist/chunk-chunk-5VVNW5AZ.module.min.js +1 -0
- package/dist/chunk-chunk-5ZON5NMV.module.min.js +2 -0
- package/dist/chunk-chunk-66PCWJUG.module.min.js +1 -0
- package/dist/chunk-chunk-6S3YGYW7.module.min.js +1 -0
- package/dist/chunk-chunk-7C5EDZ3Z.module.min.js +2 -0
- package/dist/chunk-chunk-A3I4HBD5.module.min.js +1 -0
- package/dist/{chunk-chunk-5SD6BHVW.module.min.js → chunk-chunk-AFQHURLO.module.min.js} +1 -1
- package/dist/chunk-chunk-DDB4TLQG.module.min.js +2 -0
- package/dist/{chunk-chunk-OI7R7EJB.module.min.js → chunk-chunk-DTH3SUOU.module.min.js} +1 -1
- package/dist/chunk-chunk-DTSNLGRK.module.min.js +2 -0
- package/dist/{chunk-chunk-NH4MEAKP.module.min.js → chunk-chunk-DVCWU7MT.module.min.js} +1 -1
- package/dist/chunk-chunk-FEPXDKJP.module.min.js +1 -0
- package/dist/chunk-chunk-FJ76HWQZ.module.min.js +1 -0
- package/dist/chunk-chunk-FSIHAW6L.module.min.js +2 -0
- package/dist/chunk-chunk-G2RGVEYY.module.min.js +2 -0
- package/dist/chunk-chunk-G75OPF5N.module.min.js +2 -0
- package/dist/chunk-chunk-HADHLMY5.module.min.js +1 -0
- package/dist/chunk-chunk-HAJVODLO.module.min.js +2 -0
- package/dist/chunk-chunk-HBFA4NN6.module.min.js +1 -0
- package/dist/{chunk-chunk-FRO4TRXK.module.min.js → chunk-chunk-HIV7AW2V.module.min.js} +1 -1
- package/dist/{chunk-chunk-Z2AJERX5.module.min.js → chunk-chunk-JZAMMSQQ.module.min.js} +1 -1
- package/dist/chunk-chunk-LSJUXBMF.module.min.js +1 -0
- package/dist/chunk-chunk-MXMRXSCI.module.min.js +2 -0
- package/dist/chunk-chunk-MXVBXFKW.module.min.js +2 -0
- package/dist/chunk-chunk-NWIGA3UK.module.min.js +1 -0
- package/dist/chunk-chunk-OFAP623Y.module.min.js +2 -0
- package/dist/{chunk-chunk-JWXLNZSM.module.min.js → chunk-chunk-OHLRAEQZ.module.min.js} +1 -1
- package/dist/{chunk-chunk-XEVJDUTH.module.min.js → chunk-chunk-OZK46A5U.module.min.js} +1 -1
- package/dist/chunk-chunk-PMR47KRY.module.min.js +2 -0
- package/dist/chunk-chunk-PRNXOCYZ.module.min.js +2 -0
- package/dist/chunk-chunk-RLKZVJMQ.module.min.js +2 -0
- package/dist/chunk-chunk-SK2TQMG4.module.min.js +2 -0
- package/dist/chunk-chunk-SKLYXNYW.module.min.js +2 -0
- package/dist/chunk-chunk-TCMHJWFJ.module.min.js +1 -0
- package/dist/chunk-chunk-U4NZCU5T.module.min.js +2 -0
- package/dist/chunk-chunk-VKL6DI43.module.min.js +2 -0
- package/dist/chunk-chunk-W62673ZE.module.min.js +1 -0
- package/dist/chunk-chunk-WFHZHWT7.module.min.js +1 -0
- package/dist/{chunk-chunk-GU2EJIDJ.module.min.js → chunk-chunk-XCC25CZZ.module.min.js} +1 -1
- package/dist/chunk-chunk-XECNOUZY.module.min.js +2 -0
- package/dist/{chunk-chunk-BNGBEY7N.module.min.js → chunk-chunk-XYZDTYAF.module.min.js} +1 -1
- package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +54 -1
- package/dist/components/charts/index.d.ts +2 -2
- package/dist/components/charts/network/ProcessSankey.d.ts +105 -74
- package/dist/components/charts/network/processSankey/accessors.d.ts +7 -0
- package/dist/components/charts/network/processSankey/algorithm.d.ts +14 -193
- package/dist/components/charts/network/processSankey/axisChrome.d.ts +31 -0
- package/dist/components/charts/network/processSankey/bandPaths.d.ts +45 -0
- package/dist/components/charts/network/processSankey/buildScenes.d.ts +41 -3
- package/dist/components/charts/network/processSankey/fixtures.d.ts +17 -0
- package/dist/components/charts/network/processSankey/frameMargins.d.ts +11 -0
- package/dist/components/charts/network/processSankey/groupBonding.d.ts +13 -0
- package/dist/components/charts/network/processSankey/inventoryAtTime.d.ts +41 -0
- package/dist/components/charts/network/processSankey/labelPlacement.d.ts +34 -0
- package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +47 -0
- package/dist/components/charts/network/processSankey/layoutOrchestrator.d.ts +44 -0
- package/dist/components/charts/network/processSankey/layoutQualityProduct.d.ts +27 -0
- package/dist/components/charts/network/processSankey/massSimulation.d.ts +16 -0
- package/dist/components/charts/network/processSankey/ordering.d.ts +55 -0
- package/dist/components/charts/network/processSankey/orderingBond.d.ts +33 -0
- package/dist/components/charts/network/processSankey/orientation.d.ts +5 -0
- package/dist/components/charts/network/processSankey/packing.d.ts +8 -0
- package/dist/components/charts/network/processSankey/packingCache.d.ts +23 -0
- package/dist/components/charts/network/processSankey/processSankeyLayoutAsync.d.ts +27 -0
- package/dist/components/charts/network/processSankey/processSankeyLayoutWorkerClient.d.ts +72 -0
- package/dist/components/charts/network/processSankey/processSankeyTooltip.d.ts +26 -0
- package/dist/components/charts/network/processSankey/processSankeyTypes.d.ts +163 -0
- package/dist/components/charts/network/processSankey/ribbonInputs.d.ts +26 -2
- package/dist/components/charts/network/processSankey/ribbonRunway.d.ts +45 -0
- package/dist/components/charts/network/processSankey/streamingLayout.d.ts +23 -0
- package/dist/components/charts/network/processSankey/time.d.ts +11 -0
- package/dist/components/charts/network/processSankey/useProcessSankeyPush.d.ts +29 -0
- package/dist/components/charts/network/processSankey/useProcessSankeyScenes.d.ts +26 -0
- package/dist/components/charts/network/processSankey/validation.d.ts +33 -0
- package/dist/components/charts/physics/chainReactionTypes.d.ts +1 -0
- package/dist/components/charts/physics/physicsHocUtils.d.ts +1 -1
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +2 -0
- package/dist/components/charts/shared/chartFamilySets.d.ts +1 -0
- package/dist/components/charts/shared/formatUtils.d.ts +45 -3
- package/dist/components/charts/shared/hatchFill.d.ts +2 -0
- package/dist/components/charts/shared/hooks.d.ts +1 -1
- package/dist/components/charts/shared/leastSquaresRegression.d.ts +31 -0
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +1 -0
- package/dist/components/charts/shared/styleRules.d.ts +5 -1
- package/dist/components/charts/shared/types.d.ts +8 -1
- package/dist/components/charts/shared/useChartLegend.d.ts +6 -0
- package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
- package/dist/components/charts/shared/validateProps.d.ts +2 -2
- package/dist/components/charts/shared/withChartWrapper.d.ts +0 -6
- package/dist/components/data/numericFieldProfiler.d.ts +2 -0
- package/dist/components/recipes/layout1d.d.ts +68 -0
- package/dist/components/semiotic-network.d.ts +2 -2
- package/dist/components/semiotic-recipes-core.d.ts +2 -0
- package/dist/components/semiotic-utils-core.d.ts +1 -0
- package/dist/components/semiotic.d.ts +6 -3
- package/dist/components/server/staticSVGChrome.d.ts +2 -1
- package/dist/components/store/createStore.d.ts +2 -0
- package/dist/components/stream/GeoTileRenderer.d.ts +1 -0
- package/dist/components/stream/OrdinalPipelineStore.d.ts +3 -0
- package/dist/components/stream/PipelineStore.d.ts +5 -0
- package/dist/components/stream/accessorUtils.d.ts +21 -0
- package/dist/components/stream/canvasSetup.d.ts +15 -4
- package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -2
- package/dist/components/stream/geoTypes.d.ts +2 -0
- package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +3 -8
- package/dist/components/stream/layouts/index.d.ts +1 -1
- package/dist/components/stream/moduleWorkerSession.d.ts +67 -0
- package/dist/components/stream/networkFramePaint.d.ts +8 -0
- package/dist/components/stream/networkTypes.d.ts +4 -0
- package/dist/components/stream/ordinalSceneBuilders/sceneBuilderMap.d.ts +2 -1
- package/dist/components/stream/ordinalTypes.d.ts +2 -0
- package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +2 -0
- package/dist/components/stream/pipelineConfig.d.ts +2 -0
- package/dist/components/stream/pipelineDomainResolution.d.ts +1 -1
- package/dist/components/stream/pipelineIntroCancellation.d.ts +6 -0
- package/dist/components/stream/pipelineTransitions.d.ts +15 -1
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +16 -4
- package/dist/components/stream/renderers/symbolCanvasRenderer.d.ts +4 -0
- package/dist/components/stream/symbolPath.d.ts +8 -0
- package/dist/components/stream/types.d.ts +10 -1
- package/dist/components/stream/useCanvasFrameHost.d.ts +15 -0
- package/dist/components/stream/useSemanticFrameInteractions.d.ts +12 -3
- package/dist/components/stream/xyFrameAxisTypes.d.ts +9 -0
- package/dist/forceLayoutWorker.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -0
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-network.d.ts +2 -2
- package/dist/semiotic-realtime-core.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +2 -0
- package/dist/semiotic-recipes-core.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.module.min.js +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes-react.module.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +1 -0
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.d.ts +6 -3
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +4 -3
- package/dist/chunk-chunk-2YAZHXL4.module.min.js +0 -2
- package/dist/chunk-chunk-3NGIKFD6.module.min.js +0 -1
- package/dist/chunk-chunk-7TTBHSAG.module.min.js +0 -2
- package/dist/chunk-chunk-7ZDJSYKI.module.min.js +0 -2
- package/dist/chunk-chunk-BGHPD3RA.module.min.js +0 -1
- package/dist/chunk-chunk-BMRZ2SPU.module.min.js +0 -2
- package/dist/chunk-chunk-C7APLVQD.module.min.js +0 -2
- package/dist/chunk-chunk-DGWFBOGB.module.min.js +0 -1
- package/dist/chunk-chunk-DIVE2DRA.module.min.js +0 -2
- package/dist/chunk-chunk-DSNGDNJY.module.min.js +0 -1
- package/dist/chunk-chunk-FBUNUIPV.module.min.js +0 -2
- package/dist/chunk-chunk-G7QVPZUD.module.min.js +0 -2
- package/dist/chunk-chunk-GBPYV4FP.module.min.js +0 -2
- package/dist/chunk-chunk-KXAFCCDB.module.min.js +0 -2
- package/dist/chunk-chunk-LG7YKJAK.module.min.js +0 -2
- package/dist/chunk-chunk-LWITSR2O.module.min.js +0 -2
- package/dist/chunk-chunk-MX35T6RX.module.min.js +0 -2
- package/dist/chunk-chunk-NJETWX42.module.min.js +0 -2
- package/dist/chunk-chunk-NW25WGLS.module.min.js +0 -2
- package/dist/chunk-chunk-ONMLEXHR.module.min.js +0 -2
- package/dist/chunk-chunk-OY66GCE6.module.min.js +0 -1
- package/dist/chunk-chunk-PRDGLMJT.module.min.js +0 -2
- package/dist/chunk-chunk-PZFT457G.module.min.js +0 -1
- package/dist/chunk-chunk-Q3WW6JGR.module.min.js +0 -1
- package/dist/chunk-chunk-Q6XKQTOQ.module.min.js +0 -1
- package/dist/chunk-chunk-RJRM2E6P.module.min.js +0 -1
- package/dist/chunk-chunk-RPL7WYXI.module.min.js +0 -1
- package/dist/chunk-chunk-V3OAKG32.module.min.js +0 -1
- package/dist/chunk-chunk-WCX6U47H.module.min.js +0 -2
- package/dist/chunk-chunk-WLOIUMWG.module.min.js +0 -2
- package/dist/chunk-chunk-XEGXX4F7.module.min.js +0 -1
- package/dist/chunk-chunk-XFRBLXYM.module.min.js +0 -1
- package/dist/chunk-chunk-ZXYDYAB7.module.min.js +0 -2
- package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +0 -2
- 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 {
|
|
7
|
-
type TimeLike =
|
|
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
|
|
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
|
|
72
|
-
* Default `true`. Set `false` for dense layouts
|
|
73
|
-
*
|
|
74
|
-
showLabels?: boolean;
|
|
75
|
-
|
|
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
|
|
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
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
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
|
-
* //
|
|
150
|
+
* // Operational hospital handoffs (horizontal time)
|
|
111
151
|
* <ProcessSankey
|
|
152
|
+
* domain={[0, 48]}
|
|
112
153
|
* nodes={[
|
|
113
|
-
* { id: "
|
|
114
|
-
* { id: "
|
|
115
|
-
* { id: "
|
|
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: "
|
|
120
|
-
*
|
|
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
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
162
|
+
* packing="reuse"
|
|
163
|
+
* laneOrder="crossing-min+inside-out"
|
|
164
|
+
* showLabels
|
|
129
165
|
* />
|
|
130
166
|
* ```
|
|
131
167
|
*
|
|
132
168
|
* @example
|
|
133
169
|
* ```tsx
|
|
134
|
-
* //
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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
|
+
};
|