semiotic 3.8.3 → 3.8.4

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 (163) hide show
  1. package/CLAUDE.md +9 -9
  2. package/README.md +40 -39
  3. package/ai/examples.md +1 -1
  4. package/ai/schema.json +2726 -300
  5. package/ai/surface-manifest.json +1 -1
  6. package/ai/system-prompt.md +1 -1
  7. package/dist/chunk-chunk-2JGJ5GUG.module.min.js +0 -1
  8. package/dist/chunk-chunk-3ILKBVVQ.module.min.js +1 -0
  9. package/dist/{chunk-chunk-XQYVEKEJ.module.min.js → chunk-chunk-6TPGFL7M.module.min.js} +1 -1
  10. package/dist/{chunk-chunk-VVCA3DB7.module.min.js → chunk-chunk-7ALTGHK6.module.min.js} +1 -1
  11. package/dist/chunk-chunk-7KZJUTKP.module.min.js +2 -0
  12. package/dist/chunk-chunk-7RYBCTK5.module.min.js +1 -0
  13. package/dist/chunk-chunk-ACLDBMRH.module.min.js +2 -0
  14. package/dist/{chunk-chunk-AZJUDQRM.module.min.js → chunk-chunk-AQPQN2HH.module.min.js} +1 -1
  15. package/dist/chunk-chunk-ASKSE5F5.module.min.js +1 -0
  16. package/dist/chunk-chunk-AVBI6GDT.module.min.js +1 -0
  17. package/dist/chunk-chunk-B3DRZPBK.module.min.js +2 -0
  18. package/dist/chunk-chunk-BFHUYEOS.module.min.js +2 -0
  19. package/dist/chunk-chunk-C4YA6TDR.module.min.js +1 -0
  20. package/dist/chunk-chunk-C57LR3YG.module.min.js +1 -0
  21. package/dist/chunk-chunk-F5V4UIE6.module.min.js +2 -0
  22. package/dist/chunk-chunk-F7WFPD4O.module.min.js +2 -0
  23. package/dist/{chunk-chunk-SANERMIZ.module.min.js → chunk-chunk-FBGHXL72.module.min.js} +1 -1
  24. package/dist/chunk-chunk-FP44FHFO.module.min.js +2 -0
  25. package/dist/chunk-chunk-HKXUAEPJ.module.min.js +2 -0
  26. package/dist/chunk-chunk-ICEXPNDC.module.min.js +2 -0
  27. package/dist/chunk-chunk-IY7RYD4S.module.min.js +1 -0
  28. package/dist/{chunk-chunk-7FW6EGLP.module.min.js → chunk-chunk-JDXT6ORT.module.min.js} +1 -1
  29. package/dist/chunk-chunk-JMVEIZXP.module.min.js +1 -0
  30. package/dist/chunk-chunk-KHCOJMGK.module.min.js +1 -0
  31. package/dist/{chunk-chunk-OQTLSTGI.module.min.js → chunk-chunk-KQ546MKE.module.min.js} +1 -1
  32. package/dist/chunk-chunk-LQBSXO7K.module.min.js +2 -0
  33. package/dist/chunk-chunk-LRIFN2HK.module.min.js +1 -0
  34. package/dist/chunk-chunk-MFHF4J2Z.module.min.js +1 -0
  35. package/dist/{chunk-chunk-JNCHKRIR.module.min.js → chunk-chunk-N6VKKF3A.module.min.js} +1 -1
  36. package/dist/chunk-chunk-NEVE562N.module.min.js +1 -0
  37. package/dist/chunk-chunk-NKZ75IM5.module.min.js +2 -0
  38. package/dist/chunk-chunk-PLIDPQNG.module.min.js +2 -0
  39. package/dist/{chunk-chunk-FYY2ACNJ.module.min.js → chunk-chunk-PRDGLMJT.module.min.js} +1 -1
  40. package/dist/chunk-chunk-QGZGZI4X.module.min.js +1 -0
  41. package/dist/chunk-chunk-RP7WTID5.module.min.js +1 -0
  42. package/dist/chunk-chunk-S7KLNUO6.module.min.js +1 -0
  43. package/dist/chunk-chunk-SR4ZXOWR.module.min.js +2 -0
  44. package/dist/chunk-chunk-ZOAQDIJO.module.min.js +1 -0
  45. package/dist/chunk-minimapBrushOverlay-JU57U7NM.module.min.js +2 -0
  46. package/dist/chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js +2 -0
  47. package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +1 -0
  48. package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +1 -0
  49. package/dist/components/ChartContainer.d.ts +2 -2
  50. package/dist/components/ai/chartCapabilityTypes.d.ts +5 -0
  51. package/dist/components/charts/geo/ChoroplethMap.d.ts +2 -0
  52. package/dist/components/charts/geo/DistanceCartogram.d.ts +7 -3
  53. package/dist/components/charts/geo/FlowMap.d.ts +4 -0
  54. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +3 -1
  55. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +6 -1
  56. package/dist/components/charts/physics/GaltonBoardChart.d.ts +6 -1
  57. package/dist/components/charts/physics/gauntletChartProps.d.ts +7 -1
  58. package/dist/components/charts/physics/gauntletChrome.d.ts +2 -1
  59. package/dist/components/charts/physics/gauntletPhysics.d.ts +19 -4
  60. package/dist/components/charts/physics/gauntletRuntime.d.ts +3 -0
  61. package/dist/components/charts/physics/physicsHocUtils.d.ts +12 -0
  62. package/dist/components/charts/shared/chartMode.d.ts +8 -0
  63. package/dist/components/charts/shared/chartSpecCore.d.ts +2 -2
  64. package/dist/components/charts/shared/hatchPattern.d.ts +8 -3
  65. package/dist/components/charts/shared/lineSeriesSsr.d.ts +55 -0
  66. package/dist/components/charts/shared/types.d.ts +2 -2
  67. package/dist/components/charts/shared/validateProps.d.ts +1 -1
  68. package/dist/components/charts/xy/AreaChart.d.ts +10 -0
  69. package/dist/components/charts/xy/minimapBrushOverlay.d.ts +17 -0
  70. package/dist/components/charts/xy/minimapBrushOverlayLazy.d.ts +4 -0
  71. package/dist/components/charts/xy/scatterplotMatrixBrushOverlay.d.ts +8 -0
  72. package/dist/components/charts/xy/scatterplotMatrixBrushOverlayLazy.d.ts +3 -0
  73. package/dist/components/realtime/types.d.ts +5 -0
  74. package/dist/components/recipes/gridObservatory.d.ts +176 -0
  75. package/dist/components/recipes/recipeChrome.d.ts +24 -0
  76. package/dist/components/recipes/sequenceLayout.d.ts +139 -0
  77. package/dist/components/semiotic-recipes-core.d.ts +6 -2
  78. package/dist/components/server/staticAnnotations.d.ts +3 -1
  79. package/dist/components/stream/SceneToSVG.d.ts +6 -6
  80. package/dist/components/stream/SceneToSVGOrdinal.d.ts +12 -0
  81. package/dist/components/stream/networkFramePaint.d.ts +2 -0
  82. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +18 -2
  83. package/dist/components/stream/physics/physicsBodyCanvas.d.ts +7 -0
  84. package/dist/components/stream/physics/physicsPipelineEviction.d.ts +15 -0
  85. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +1 -1
  86. package/dist/components/stream/physics/physicsPipelineQuiescence.d.ts +20 -0
  87. package/dist/components/stream/sceneToSVGShared.d.ts +30 -1
  88. package/dist/components/stream/types.d.ts +4 -0
  89. package/dist/components/stream/useHydration.d.ts +7 -1
  90. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +1 -1
  91. package/dist/forceLayoutWorker.js +1 -1
  92. package/dist/geo.min.js +1 -1
  93. package/dist/geo.module.min.js +1 -1
  94. package/dist/network.min.js +1 -1
  95. package/dist/network.module.min.js +1 -1
  96. package/dist/ordinal.min.js +1 -1
  97. package/dist/ordinal.module.min.js +1 -1
  98. package/dist/physics.min.js +1 -1
  99. package/dist/physics.module.min.js +1 -1
  100. package/dist/physicsWorker.js +1 -1
  101. package/dist/realtime.min.js +1 -1
  102. package/dist/realtime.module.min.js +1 -1
  103. package/dist/rough.min.js +1 -1
  104. package/dist/rough.module.min.js +1 -1
  105. package/dist/semiotic-ai-core.min.js +1 -1
  106. package/dist/semiotic-ai-core.module.min.js +1 -1
  107. package/dist/semiotic-ai.min.js +1 -1
  108. package/dist/semiotic-ai.module.min.js +1 -1
  109. package/dist/semiotic-experimental.min.js +1 -1
  110. package/dist/semiotic-experimental.module.min.js +1 -1
  111. package/dist/semiotic-realtime-core.min.js +1 -1
  112. package/dist/semiotic-realtime-core.module.min.js +1 -1
  113. package/dist/semiotic-recipes-core.d.ts +6 -2
  114. package/dist/semiotic-recipes-core.min.js +1 -1
  115. package/dist/semiotic-recipes-core.module.min.js +1 -1
  116. package/dist/semiotic-recipes.min.js +1 -1
  117. package/dist/semiotic-recipes.module.min.js +1 -1
  118. package/dist/semiotic-server-edge.min.js +1 -1
  119. package/dist/semiotic-server-edge.module.min.js +1 -1
  120. package/dist/semiotic-server-node.min.js +1 -1
  121. package/dist/semiotic-server-node.module.min.js +1 -1
  122. package/dist/semiotic-utils-core.min.js +1 -1
  123. package/dist/semiotic-utils-core.module.min.js +1 -1
  124. package/dist/semiotic-utils.min.js +1 -1
  125. package/dist/semiotic-utils.module.min.js +1 -1
  126. package/dist/semiotic-value.module.min.js +1 -1
  127. package/dist/semiotic.min.js +1 -1
  128. package/dist/semiotic.module.min.js +1 -1
  129. package/dist/server.min.js +1 -1
  130. package/dist/server.module.min.js +1 -1
  131. package/dist/xy.min.js +1 -1
  132. package/dist/xy.module.min.js +1 -1
  133. package/package.json +3 -2
  134. package/dist/chunk-chunk-255KDHW5.module.min.js +0 -1
  135. package/dist/chunk-chunk-2CCFBTQC.module.min.js +0 -2
  136. package/dist/chunk-chunk-2RXP3FS3.module.min.js +0 -1
  137. package/dist/chunk-chunk-2WVCH4PL.module.min.js +0 -1
  138. package/dist/chunk-chunk-4TMZXLCR.module.min.js +0 -1
  139. package/dist/chunk-chunk-5APBQXZA.module.min.js +0 -1
  140. package/dist/chunk-chunk-6HSGDMTA.module.min.js +0 -2
  141. package/dist/chunk-chunk-7OEOSCBP.module.min.js +0 -1
  142. package/dist/chunk-chunk-A63CTACR.module.min.js +0 -2
  143. package/dist/chunk-chunk-B6V35LMY.module.min.js +0 -2
  144. package/dist/chunk-chunk-BOSVL645.module.min.js +0 -2
  145. package/dist/chunk-chunk-CP3EN6KZ.module.min.js +0 -1
  146. package/dist/chunk-chunk-F25UA5HT.module.min.js +0 -1
  147. package/dist/chunk-chunk-FRIO6MCV.module.min.js +0 -1
  148. package/dist/chunk-chunk-GWSWSPXN.module.min.js +0 -1
  149. package/dist/chunk-chunk-I6C3KR5H.module.min.js +0 -2
  150. package/dist/chunk-chunk-IP2UE74X.module.min.js +0 -1
  151. package/dist/chunk-chunk-J3ELI22J.module.min.js +0 -1
  152. package/dist/chunk-chunk-J5RL6GXU.module.min.js +0 -2
  153. package/dist/chunk-chunk-L3H6DQCR.module.min.js +0 -2
  154. package/dist/chunk-chunk-M337NY6L.module.min.js +0 -1
  155. package/dist/chunk-chunk-M7VYYHCE.module.min.js +0 -2
  156. package/dist/chunk-chunk-MC35ILYP.module.min.js +0 -2
  157. package/dist/chunk-chunk-N72SWNBV.module.min.js +0 -1
  158. package/dist/chunk-chunk-OBQRFTIL.module.min.js +0 -2
  159. package/dist/chunk-chunk-QRIBHZYW.module.min.js +0 -1
  160. package/dist/chunk-chunk-SA3D43RA.module.min.js +0 -2
  161. package/dist/chunk-chunk-UHSZEB74.module.min.js +0 -1
  162. package/dist/chunk-chunk-Y6AXCRVO.module.min.js +0 -1
  163. package/dist/chunk-chunk-ZCNBUZPL.module.min.js +0 -2
@@ -7,7 +7,7 @@ import type { PhysicsQueuedSpawn } from "../../stream/physics/PhysicsPipelineSto
7
7
  import type { Datum } from "../shared/datumTypes";
8
8
  import type { BaseChartProps, ChartAccessor } from "../shared/types";
9
9
  import type { PhysicsProcessBodyGroup } from "./physicsProcessPrimitives";
10
- import type { PhysicsHocFrameProps, PhysicsSharedChartProps, TooltipProp } from "./physicsHocUtils";
10
+ import type { PhysicsHocFrameProps, PhysicsRerunMS, PhysicsSharedChartProps, TooltipProp } from "./physicsHocUtils";
11
11
  import type { GauntletEvent, GauntletGate, GauntletLayout, GauntletProjectPlacement, GauntletProjectState, GauntletPropertyDefinition } from "./gauntletTypes";
12
12
  export interface GauntletChartProps<TDatum extends Datum = Datum> extends Omit<BaseChartProps, "margin">, PhysicsSharedChartProps {
13
13
  data?: TDatum[];
@@ -43,6 +43,12 @@ export interface GauntletChartProps<TDatum extends Datum = Datum> extends Omit<B
43
43
  positiveProperties: Map<string, GauntletPropertyDefinition>;
44
44
  }) => string;
45
45
  paused?: boolean;
46
+ /**
47
+ * Replay the full compound simulation this many milliseconds after it
48
+ * settles. Omit or pass `null` for a single run; `0` replays on the next
49
+ * timer turn.
50
+ */
51
+ rerunMS?: PhysicsRerunMS;
46
52
  projectPlacement?: (project: GauntletProjectState<TDatum>, index: number, layout: GauntletLayout) => Partial<GauntletProjectPlacement>;
47
53
  showChrome?: boolean;
48
54
  /**
@@ -12,9 +12,10 @@ export declare function defaultGauntletTooltipContent(hover: PhysicsHoverData):
12
12
  export declare function drawGauntletBody(ctx: CanvasRenderingContext2D, body: PhysicsBodyState, style: Style): void;
13
13
  export declare function resolveCanvasColor(ctx: CanvasRenderingContext2D, value: Style[keyof Style] | undefined, fallback: string): string;
14
14
  export declare function drawTethers(ctx: CanvasRenderingContext2D, bodies: PhysicsBodyState[]): void;
15
- export declare function GauntletChrome({ layout, states }: {
15
+ export declare function GauntletChrome({ layout, states, compact }: {
16
16
  layout: GauntletLayout;
17
17
  states: readonly GauntletProjectState[];
18
+ compact?: boolean;
18
19
  }): React.JSX.Element;
19
20
  export declare function gauntletSemanticItem(body: PhysicsBodyState): false | {
20
21
  label: string;
@@ -10,7 +10,7 @@ export { CORE_KIND, POSITIVE_KIND, NEGATIVE_KIND } from "./gauntletTypes";
10
10
  export type { GauntletAccessors, GauntletBodyDatum, GauntletCoreBodyFn, GauntletEffect, GauntletEvent, GauntletEventContext, GauntletEventLogItem, GauntletGate, GauntletLayout, GauntletNegativeReplacementOptions, GauntletPopSpec, GauntletProjectPlacement, GauntletProjectPlacementFn, GauntletProjectState, GauntletPropertyDefinition, GauntletPropertyForceContext, GauntletPropertyWorkPlan, GauntletPropertyWorkPlanOptions, GauntletViabilityFn } from "./gauntletTypes";
11
11
  export declare const DEFAULT_WIDTH = 900;
12
12
  export declare const DEFAULT_HEIGHT = 520;
13
- export declare function gauntletWallColliders(layout: Pick<GauntletLayout, "width" | "floorY">): NonNullable<PhysicsPipelineConfig["colliders"]>;
13
+ export declare function gauntletWallColliders(layout: Pick<GauntletLayout, "width" | "floorY"> & Partial<Pick<GauntletLayout, "height">>): NonNullable<PhysicsPipelineConfig["colliders"]>;
14
14
  export declare function readAccessor<TDatum extends Datum, TValue>(datum: TDatum, index: number, accessor: ChartAccessor<TDatum, TValue> | undefined, fallback: TValue): TValue;
15
15
  export declare function propertyLabel(property: GauntletPropertyDefinition | undefined): string;
16
16
  export declare function projectCoreId(projectId: string): string;
@@ -23,19 +23,34 @@ export declare const GAUNTLET_WALL: {
23
23
  readonly rightInset: 30;
24
24
  readonly thickness: 8;
25
25
  };
26
+ type GauntletWallLayout = Pick<GauntletLayout, "width" | "floorY"> & Partial<Pick<GauntletLayout, "height">>;
27
+ /** Scale the authored gauntlet corridor into context and sparkline boxes. */
28
+ export declare function resolveGauntletWall(layout: GauntletWallLayout): {
29
+ readonly left: 28;
30
+ readonly top: 76;
31
+ readonly rightInset: 30;
32
+ readonly thickness: 8;
33
+ } | {
34
+ left: number;
35
+ top: number;
36
+ rightInset: number;
37
+ thickness: number;
38
+ };
39
+ /** Scale default body/orbit geometry while preserving authored full-size values. */
40
+ export declare function gauntletSpatialScale(layout: GauntletWallLayout): number;
26
41
  /**
27
42
  * Keep body centers inside the playable gauntlet corridor so satellite
28
43
  * property particles never spawn or settle outside the left/right walls
29
44
  * (the "stuck on the left" regression for Homes on Main Street).
30
45
  */
31
- export declare function clampGauntletPoint(x: number, y: number, radius: number, layout: Pick<GauntletLayout, "width" | "floorY">): {
46
+ export declare function clampGauntletPoint(x: number, y: number, radius: number, layout: GauntletWallLayout): {
32
47
  x: number;
33
48
  y: number;
34
49
  };
35
50
  export declare function buildLayout(size: [number, number], gates: readonly GauntletGate[] | undefined, crashOffset: number): GauntletLayout;
36
51
  export declare function defaultPlacement(layout: GauntletLayout): Required<GauntletProjectPlacement>;
37
52
  export declare function resolvePlacement<TDatum extends Datum>(project: GauntletProjectState<TDatum>, index: number, layout: GauntletLayout, projectPlacement: GauntletProjectPlacementFn<TDatum> | undefined): Required<GauntletProjectPlacement>;
38
- export declare function featureSlot(ids: readonly string[], id: string): {
53
+ export declare function featureSlot(ids: readonly string[], id: string, spatialScale?: number): {
39
54
  angle: number;
40
55
  index: number;
41
56
  radius: number;
@@ -68,4 +83,4 @@ export declare function buildGauntletPhysics<TDatum extends Datum = Datum>(optio
68
83
  initialSpawns: PhysicsQueuedSpawn[];
69
84
  layout: GauntletLayout;
70
85
  };
71
- export declare function buildNegativeSpawn<TDatum extends Datum>(project: GauntletProjectState<TDatum>, property: GauntletPropertyDefinition, index: number, x: number, y: number, layout: Pick<GauntletLayout, "width" | "floorY">, spawnAt?: number): PhysicsQueuedSpawn;
86
+ export declare function buildNegativeSpawn<TDatum extends Datum>(project: GauntletProjectState<TDatum>, property: GauntletPropertyDefinition, index: number, x: number, y: number, layout: GauntletWallLayout, spawnAt?: number): PhysicsQueuedSpawn;
@@ -34,7 +34,10 @@ export declare function spawnBodiesForGauntletEffect<TDatum extends Datum>(optio
34
34
  color?: string;
35
35
  durationMs?: number;
36
36
  radius?: number;
37
+ scale?: number;
37
38
  }) => unknown;
39
+ /** Uniform pop-burst scale (see StreamPhysicsPopOptions.scale). */
40
+ popScale?: number;
38
41
  }): void;
39
42
  export declare function projectRouteTarget<TDatum extends Datum>(elapsed: number, project: GauntletProjectState<TDatum>, layout: GauntletLayout, placement: Required<GauntletProjectPlacement>, events: readonly GauntletEvent[], gateById: Map<string, GauntletLayout["gates"][number]>, terminalBehavior: "outcome" | "hold-last"): {
40
43
  x: number;
@@ -21,6 +21,18 @@ export type PhysicsSharedChartProps = {
21
21
  };
22
22
  /** Galton / pile sampling mode (orthogonal to ChartMode display modes). */
23
23
  export type PhysicsSimulationMode = "sample" | "mechanical";
24
+ /** Delay between a settled physics run and a fresh seeded replay. */
25
+ export type PhysicsRerunMS = number | null;
26
+ /**
27
+ * Add an optional settle -> delay -> remount loop to a physics HOC.
28
+ *
29
+ * Remounting is intentional: it replays the chart's deterministic seed,
30
+ * initial bodies, and spawn pacing instead of trying to reverse a live store.
31
+ */
32
+ export declare function usePhysicsRerun(config: StreamPhysicsFrameProps["config"], rerunMS: PhysicsRerunMS | undefined, paused: boolean | undefined, onRerun?: () => void): {
33
+ config: StreamPhysicsFrameProps["config"];
34
+ rerunKey: number;
35
+ };
24
36
  /**
25
37
  * Split ChartMode (`primary`/`context`/`sparkline`/`mobile`) from the
26
38
  * Galton/pile `sample`/`mechanical` simulation mode. Accepts legacy
@@ -36,6 +36,8 @@ export interface ChartModeInput {
36
36
  responsiveRules?: ResponsiveRule[];
37
37
  }
38
38
  export interface ChartModeResult {
39
+ /** Effective mode after responsive rules have been applied. */
40
+ mode: ChartMode;
39
41
  width: number;
40
42
  height: number;
41
43
  showAxes: boolean;
@@ -65,3 +67,9 @@ export declare function resolveChartMode(mode: ChartMode | undefined, userProps:
65
67
  width?: number;
66
68
  height?: number;
67
69
  }): ChartModeResult;
70
+ /**
71
+ * Axis-free charts keep their established 10px regular-mode inset while
72
+ * adopting the shared context/sparkline margins. Reading `resolved` here is
73
+ * important: responsive rules may have changed the effective chart mode.
74
+ */
75
+ export declare function resolveAxisFreeMarginDefaults(resolved: Pick<ChartModeResult, "compactMode" | "marginDefaults">): ChartModeResult["marginDefaults"];
@@ -32,7 +32,7 @@
32
32
  * schema.json (and MCP responses) but are dropped from validationMap
33
33
  * (which only reads `type` and `enum`).
34
34
  */
35
- export type PropType = "string" | "number" | "boolean" | "array" | "object" | "function";
35
+ export type PropType = "string" | "number" | "boolean" | "array" | "object" | "function" | "null";
36
36
  export type DataShape = "array" | "object" | "network" | "realtime" | "none";
37
37
  export type ChartCategory = "xy" | "ordinal" | "network" | "geo" | "realtime" | "physics" | "value";
38
38
  /**
@@ -157,7 +157,7 @@ export declare const ORIENTATION_ENUM: readonly ["vertical", "horizontal"];
157
157
  export declare const HORIZONTAL_VERTICAL_ENUM: readonly ["horizontal", "vertical"];
158
158
  export declare const LEGEND_POSITION_ENUM: readonly ["right", "left", "top", "bottom"];
159
159
  export declare const CURVE_ENUM: readonly ["linear", "monotoneX", "monotoneY", "step", "stepAfter", "stepBefore", "basis", "cardinal", "catmullRom"];
160
- export declare const CHART_MODE_ENUM: readonly ["primary", "context", "sparkline"];
160
+ export declare const CHART_MODE_ENUM: readonly ["primary", "context", "sparkline", "mobile"];
161
161
  /**
162
162
  * Compose a chart's full prop set (bags + ownProps) in deterministic order.
163
163
  * ownProps wins on key collision so a chart can override a shared default.
@@ -12,6 +12,7 @@
12
12
  * />
13
13
  * ```
14
14
  */
15
+ import type { HatchFill } from "./hatchFill";
15
16
  export interface HatchPatternOptions {
16
17
  /** Background color of the pattern tile */
17
18
  background?: string;
@@ -27,9 +28,13 @@ export interface HatchPatternOptions {
27
28
  /**
28
29
  * Create a repeating diagonal-line hatch pattern for canvas fills.
29
30
  *
30
- * Must be called in a browser environment (needs canvas). Returns null
31
- * in server/test environments where canvas is unavailable.
31
+ * In a browser (canvas available) returns a `CanvasPattern`. In server/test
32
+ * environments where canvas is unavailable — returns the equivalent
33
+ * serializable {@link HatchFill} descriptor instead of `null`, so the same
34
+ * `pieceStyle`/`nodeStyle` renders a hatch through the SVG path rather than
35
+ * collapsing to the solid fallback. Use {@link isHatchFill} to distinguish the
36
+ * two forms; both are valid as a `style.fill`.
32
37
  */
33
38
  export declare function createHatchPattern(options?: HatchPatternOptions,
34
39
  /** Optional target canvas to create the pattern on (for correct DPR scaling) */
35
- targetCtx?: CanvasRenderingContext2D): CanvasPattern | null;
40
+ targetCtx?: CanvasRenderingContext2D): CanvasPattern | HatchFill | null;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Pure LineChart series-feature prep for the SSR / renderChart path.
3
+ *
4
+ * Mirrors the client HOC orchestration of:
5
+ * - `useSeriesFeatures` (forecast / anomaly via `buildForecast`)
6
+ * - gapStrategy (break / interpolate / zero)
7
+ * - directLabel endpoint annotations
8
+ * - segment-aware lineStyle (createSegmentLineStyle)
9
+ *
10
+ * Client uses lazy dynamic import + React state for these; SSR can call
11
+ * the pure statisticalOverlays entry points synchronously.
12
+ */
13
+ import type { Datum } from "./datumTypes";
14
+ import { type AnomalyConfig, type ForecastConfig } from "./statisticalOverlays";
15
+ export interface LineSeriesSsrInput {
16
+ data: unknown;
17
+ xAccessor?: string | ((d: Datum) => unknown);
18
+ yAccessor?: string | ((d: Datum) => unknown);
19
+ lineBy?: string | ((d: Datum) => unknown);
20
+ colorBy?: string | ((d: Datum) => unknown);
21
+ colorScheme?: unknown;
22
+ color?: string;
23
+ forecast?: ForecastConfig;
24
+ anomaly?: AnomalyConfig;
25
+ gapStrategy?: "break" | "interpolate" | "zero";
26
+ directLabel?: boolean | {
27
+ position?: "start" | "end";
28
+ fontSize?: number;
29
+ };
30
+ /** Existing annotations to merge with statistical + direct-label ones. */
31
+ annotations?: Datum[];
32
+ themeCategorical?: string[];
33
+ /** Base lineStyle from buildLineStyle — wrapped with segment styling when forecast is set. */
34
+ baseLineStyle?: (d: Datum, group?: string) => Datum;
35
+ }
36
+ export interface LineSeriesSsrResult {
37
+ data: Datum[];
38
+ xAccessor: string | ((d: Datum) => unknown);
39
+ yAccessor: string | ((d: Datum) => unknown);
40
+ groupAccessor: string | ((d: Datum) => unknown) | undefined;
41
+ colorAccessor: string | ((d: Datum) => unknown) | undefined;
42
+ annotations: Datum[];
43
+ lineStyle?: (d: Datum, group?: string) => Datum;
44
+ yExtent?: [number, number];
45
+ /** Extra right/left margin for direct labels. */
46
+ marginExtra?: {
47
+ left?: number;
48
+ right?: number;
49
+ };
50
+ }
51
+ /**
52
+ * Prepare LineChart props for static SSR: forecast/anomaly data + annotations,
53
+ * gap handling, direct labels, segment lineStyle.
54
+ */
55
+ export declare function prepareLineSeriesForSsr(input: LineSeriesSsrInput): LineSeriesSsrResult;
@@ -43,7 +43,7 @@ export type LinkedBrushProp = string | {
43
43
  yField?: string;
44
44
  };
45
45
  /**
46
- * Chart display mode — controls default chrome, size, and interaction.
46
+ * Chart display mode — controls default decoration, size, and interaction.
47
47
  * User-provided props always override mode defaults.
48
48
  */
49
49
  export type ChartMode = "primary" | "context" | "sparkline" | "mobile";
@@ -98,7 +98,7 @@ export interface ResolvedMobileInteractionConfig {
98
98
  * Base props shared across all chart components
99
99
  */
100
100
  export interface BaseChartProps {
101
- /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
101
+ /** Display mode: "primary" (full decoration), "context" (compact), "sparkline" (inline), or "mobile" (touch-first) */
102
102
  mode?: ChartMode;
103
103
  /** Chart width in pixels. Default: 600 */
104
104
  width?: number;
@@ -5,7 +5,7 @@ export interface ValidationResult {
5
5
  valid: boolean;
6
6
  errors: string[];
7
7
  }
8
- export type PropType = "string" | "number" | "boolean" | "array" | "object" | "function";
8
+ export type PropType = "string" | "number" | "boolean" | "array" | "object" | "function" | "null";
9
9
  export interface PropDef {
10
10
  type: PropType | PropType[];
11
11
  enum?: readonly string[];
@@ -14,6 +14,16 @@ export interface SemanticGradientStop {
14
14
  /** Optional opacity applied to this stop. */
15
15
  opacity?: number;
16
16
  }
17
+ /**
18
+ * Convert value-anchored `semanticGradient` stops (`{ at, color }` on the value
19
+ * scale, 0–100) into the frame's `gradientFill.colorStops` (offset 0 = top).
20
+ * Exported so the server (`renderChart`) config resolves it identically to this
21
+ * HOC — otherwise SSR silently drops `semanticGradient` and paints a flat area.
22
+ */
23
+ export declare function semanticGradientToColorStops(stops: SemanticGradientStop[]): Array<{
24
+ offset: number;
25
+ color: string;
26
+ }>;
17
27
  /**
18
28
  * AreaChart component props
19
29
  */
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import type { StreamScales } from "../../stream/types";
3
+ export interface MinimapBrushOverlayProps {
4
+ width: number;
5
+ height: number;
6
+ margin: {
7
+ top: number;
8
+ right: number;
9
+ bottom: number;
10
+ left: number;
11
+ };
12
+ scales: StreamScales | null;
13
+ brushDirection: "x" | "y";
14
+ extent: [number, number] | null;
15
+ onBrush: (extent: [number, number] | null) => void;
16
+ }
17
+ export declare function MinimapBrushOverlay({ width, height, margin, scales, brushDirection, extent, onBrush, }: MinimapBrushOverlayProps): React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import type { MinimapBrushOverlayProps } from "./minimapBrushOverlay";
3
+ /** Renders nothing until d3-brush module resolves, then mounts the brush. */
4
+ export declare function MinimapBrushOverlayLazy(props: MinimapBrushOverlayProps): React.JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import type { StreamXYFrameHandle } from "../../stream/types";
3
+ export interface ScatterplotMatrixBrushOverlayProps {
4
+ frameRef: React.RefObject<StreamXYFrameHandle | null>;
5
+ cellSize: number;
6
+ onBrush: (extent: [number, number][] | null) => void;
7
+ }
8
+ export declare function ScatterplotMatrixBrushOverlay({ frameRef, cellSize, onBrush, }: ScatterplotMatrixBrushOverlayProps): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ import type { ScatterplotMatrixBrushOverlayProps } from "./scatterplotMatrixBrushOverlay";
3
+ export declare function ScatterplotMatrixBrushOverlayLazy(props: ScatterplotMatrixBrushOverlayProps): React.JSX.Element | null;
@@ -191,6 +191,11 @@ export interface RealtimeFrameHandle {
191
191
  remove(id: string | string[]): Datum[];
192
192
  /** Update data by ID in place. Requires an ID accessor. Returns previous values. */
193
193
  update(id: string | string[], updater: (d: Datum) => Datum): Datum[];
194
+ /**
195
+ * Ordinal-only bounded ingest: replace the buffer while preserving category
196
+ * order and enter/move/exit transitions. XY/network/geo typically omit this.
197
+ */
198
+ replace?(data: Datum[]): void;
194
199
  clear(): void;
195
200
  getData(): Datum[];
196
201
  /** Returns the frame's resolved scales, or null if unavailable.
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Pure grid-operations helpers for multi-series power observatories.
3
+ *
4
+ * These turn balancing-authority hourly rows into the chart-ready series used by
5
+ * StackedAreaChart, DifferenceChart, BigNumber, styleRules factories, and
6
+ * provenanced event annotations. They are domain math — not a React kit — so
7
+ * agents and pages can share the same pipeline.
8
+ *
9
+ * Honesty: {@link reserveMarginPct} is a **readability proxy** from public
10
+ * demand / net-generation (+ optional interchange) series. It is *not* an ISO
11
+ * contingency-reserve product. Label it as such in UI and `describeChart` copy.
12
+ */
13
+ import type { StyleRule } from "../charts/shared/styleRules";
14
+ import type { HatchFill } from "../charts/shared/hatchFill";
15
+ /** Stable fuel keys used across regions when present. */
16
+ export declare const GRID_FUEL_KEYS: readonly ["naturalGas", "coal", "nuclear", "hydro", "wind", "solar", "other"];
17
+ export type GridFuelKey = (typeof GRID_FUEL_KEYS)[number];
18
+ /** Human labels for fuel keys (legend / tooltips). */
19
+ export declare const GRID_FUEL_LABELS: Record<GridFuelKey, string>;
20
+ /**
21
+ * One hour (or finest grain) in one balancing authority.
22
+ * Compatible with the strategy schema in docs/strategy/examples-thegrid.md.
23
+ */
24
+ export type GridHour = {
25
+ t: number;
26
+ ba: string;
27
+ demandMw: number;
28
+ forecastMw?: number;
29
+ netGenMw: number;
30
+ interchangeMw?: number;
31
+ fuels: Partial<Record<GridFuelKey, number>>;
32
+ };
33
+ export type ReserveSnapshot = {
34
+ t: number;
35
+ ba: string;
36
+ /** Rough operational headroom proxy — never claim ISO-grade contingency reserve. */
37
+ reserveMarginPct: number;
38
+ netLoadMw: number;
39
+ demandMw: number;
40
+ netGenMw: number;
41
+ };
42
+ export type ReserveLevels = {
43
+ /** Margin below this % is "tight" / danger. Default 5. */
44
+ tight?: number;
45
+ /** Margin below this % is "watch" / warning. Default 12. */
46
+ watch?: number;
47
+ /** Margin at or above this % is comfortable / success. Default 20. */
48
+ comfortable?: number;
49
+ };
50
+ export type FuelStackRow = {
51
+ t: number;
52
+ fuel: GridFuelKey;
53
+ fuelLabel: string;
54
+ mw: number;
55
+ ba: string;
56
+ };
57
+ export type DemandForecastRow = {
58
+ t: number;
59
+ a: number;
60
+ b: number;
61
+ demandMw: number;
62
+ forecastMw: number;
63
+ errorMw: number;
64
+ ba: string;
65
+ };
66
+ export type OperatingPointSummary = {
67
+ t: number;
68
+ ba: string;
69
+ demandMw: number;
70
+ forecastMw: number | null;
71
+ forecastErrorMw: number | null;
72
+ netGenMw: number;
73
+ reserveMarginPct: number;
74
+ topFuel: GridFuelKey | null;
75
+ topFuelShare: number;
76
+ topFuelMw: number;
77
+ fuelShares: Partial<Record<GridFuelKey, number>>;
78
+ };
79
+ export type GridEventWindow = {
80
+ id: string;
81
+ /** Inclusive start epoch ms. */
82
+ start: number;
83
+ /** Inclusive end epoch ms. */
84
+ end: number;
85
+ label: string;
86
+ /** Optional longer note for callouts. */
87
+ note?: string;
88
+ /** "heat-wave" | "outage" | "demand-spike" | open string. */
89
+ kind?: string;
90
+ /** ISO 8601 duration or ms; default "P7D". */
91
+ ttlHint?: string | number;
92
+ y?: number;
93
+ /** Data y for y-threshold style notes. */
94
+ value?: number;
95
+ };
96
+ /**
97
+ * Stackable long-form fuel series for StackedAreaChart (`areaBy: "fuel"`).
98
+ * Zero / missing fuels are omitted so empty keys do not invent area layers.
99
+ */
100
+ export declare function stackFuelSeries(hours: readonly GridHour[], options?: {
101
+ fuels?: readonly GridFuelKey[];
102
+ includeZero?: boolean;
103
+ }): FuelStackRow[];
104
+ /**
105
+ * DifferenceChart rows: series A = demand, series B = forecast.
106
+ * Hours without a finite forecast are skipped.
107
+ */
108
+ export declare function demandForecastRows(hours: readonly GridHour[]): DemandForecastRow[];
109
+ /**
110
+ * Readability proxy for operational headroom.
111
+ *
112
+ * ```
113
+ * reserveMarginPct = ((supply - demand) / demand) * 100
114
+ * supply = capacityOrNetGen + max(0, -interchange) // imports add supply
115
+ * ```
116
+ *
117
+ * When demand is 0, returns 0. Negative values mean demand exceeds supply.
118
+ *
119
+ * **Not** ISO contingency reserve (spinning + non-spinning + regulation).
120
+ * Document that distinction wherever this number is shown.
121
+ */
122
+ export declare function reserveMarginPct(input: {
123
+ demand: number;
124
+ capacityOrNetGen: number;
125
+ interchange?: number;
126
+ }): number;
127
+ /** Per-hour reserve snapshots derived from {@link GridHour} rows. */
128
+ export declare function reserveSeries(hours: readonly GridHour[]): ReserveSnapshot[];
129
+ /**
130
+ * Declarative `styleRules` for marks whose primary value is reserve margin %.
131
+ * Hatch on the tight band so color is not the only encoding.
132
+ *
133
+ * Works on BarChart / DotPlot (ordinal) and LineChart / Scatterplot when the
134
+ * mark value (or `field: "reserveMarginPct"`) is the margin percent.
135
+ */
136
+ export declare function thresholdBandsForReserve(levels?: ReserveLevels, options?: {
137
+ field?: string;
138
+ /** Override hatch for the tight band. */
139
+ tightHatch?: HatchFill;
140
+ tightFill?: string;
141
+ watchFill?: string;
142
+ comfortableFill?: string;
143
+ }): StyleRule[];
144
+ /**
145
+ * Annotation band descriptors for reserve threshold strips (y-band style).
146
+ * Pair with chart `annotations` — not the same object as styleRules.
147
+ */
148
+ export declare function reserveAnnotationBands(levels?: ReserveLevels): Array<{
149
+ type: "band";
150
+ y0: number;
151
+ y1: number;
152
+ label: string;
153
+ color: string;
154
+ fillOpacity: number;
155
+ emphasis: "secondary";
156
+ }>;
157
+ /** Summarize the operating point at `now` (or the last hour ≤ now). */
158
+ export declare function summarizeOperatingPoint(hours: readonly GridHour[], now?: number): OperatingPointSummary | null;
159
+ /**
160
+ * Convert authored event windows into annotation objects with provenance + lifecycle
161
+ * fields suitable for `applyAnnotationLifecycle`.
162
+ *
163
+ * Returns plain annotation dicts (not React nodes). Callers may pass the array to
164
+ * chart `annotations` after lifecycle treatment.
165
+ */
166
+ export declare function gridEventAnnotations(events: readonly GridEventWindow[], options?: {
167
+ now?: number;
168
+ author?: string;
169
+ source?: string;
170
+ }): Array<Record<string, unknown>>;
171
+ /** Pick the top N tightest-margin hours for a ranked risk strip. */
172
+ export declare function tightestHours(reserves: readonly ReserveSnapshot[], n?: number): ReserveSnapshot[];
173
+ /** Format MW with locale grouping; returns "—" for non-finite. */
174
+ export declare function formatMw(value: number, digits?: number): string;
175
+ /** Format reserve margin percent with sign awareness. */
176
+ export declare function formatReservePct(value: number, digits?: number): string;
@@ -44,6 +44,30 @@ export declare function boundsOf(points: ReadonlyArray<{
44
44
  width: number;
45
45
  height: number;
46
46
  } | null;
47
+ /** Axis-aligned box with a top-left origin (chip, card, scene rect). */
48
+ export interface HullBox {
49
+ x: number;
50
+ y: number;
51
+ width: number;
52
+ height: number;
53
+ }
54
+ export type HullPadding = number | {
55
+ x?: number;
56
+ y?: number;
57
+ };
58
+ /**
59
+ * Axis-aligned hull of discrete mark boxes, with optional padding. Use this when
60
+ * marks are chips/cards with known extents (not just points): the result fully
61
+ * surrounds the marks so a stroke drawn *after* the marks reads as a true
62
+ * enclosure (fill under, stroke over). Returns null for an empty set.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const hull = hullFromBoxes(chips, { x: 12, y: 10 })
67
+ * // overlays: fill rect (under) then marks then stroke-only rect (over)
68
+ * ```
69
+ */
70
+ export declare function hullFromBoxes(boxes: ReadonlyArray<HullBox>, padding?: HullPadding): HullBox | null;
47
71
  export interface BandLabelProps {
48
72
  text: string;
49
73
  x: number;