semiotic 3.4.0 → 3.4.1

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 (187) hide show
  1. package/CLAUDE.md +16 -3
  2. package/ai/schema.json +42 -1
  3. package/ai/system-prompt.md +4 -0
  4. package/dist/components/Annotation.d.ts +42 -2
  5. package/dist/components/CategoryColors.d.ts +1 -1
  6. package/dist/components/ChartGrid.d.ts +1 -1
  7. package/dist/components/ContextLayout.d.ts +1 -1
  8. package/dist/components/DataSummaryContext.d.ts +1 -1
  9. package/dist/components/DetailsPanel.d.ts +3 -2
  10. package/dist/components/Legend.d.ts +2 -3
  11. package/dist/components/LinkedCharts.d.ts +1 -1
  12. package/dist/components/ThemeProvider.d.ts +1 -1
  13. package/dist/components/Tooltip/FlippingTooltip.d.ts +1 -1
  14. package/dist/components/Tooltip/Tooltip.d.ts +4 -3
  15. package/dist/components/charts/geo/ChoroplethMap.d.ts +4 -4
  16. package/dist/components/charts/geo/DistanceCartogram.d.ts +5 -4
  17. package/dist/components/charts/geo/FlowMap.d.ts +4 -4
  18. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +4 -3
  19. package/dist/components/charts/index.d.ts +2 -0
  20. package/dist/components/charts/network/ChordDiagram.d.ts +4 -3
  21. package/dist/components/charts/network/CirclePack.d.ts +3 -3
  22. package/dist/components/charts/network/ForceDirectedGraph.d.ts +3 -2
  23. package/dist/components/charts/network/OrbitDiagram.d.ts +6 -5
  24. package/dist/components/charts/network/SankeyDiagram.d.ts +4 -3
  25. package/dist/components/charts/network/TreeDiagram.d.ts +3 -3
  26. package/dist/components/charts/network/Treemap.d.ts +3 -3
  27. package/dist/components/charts/ordinal/BarChart.d.ts +24 -4
  28. package/dist/components/charts/ordinal/BoxPlot.d.ts +4 -3
  29. package/dist/components/charts/ordinal/DonutChart.d.ts +4 -3
  30. package/dist/components/charts/ordinal/DotPlot.d.ts +4 -3
  31. package/dist/components/charts/ordinal/FunnelChart.d.ts +4 -3
  32. package/dist/components/charts/ordinal/GaugeChart.d.ts +2 -1
  33. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +4 -3
  34. package/dist/components/charts/ordinal/Histogram.d.ts +4 -3
  35. package/dist/components/charts/ordinal/LikertChart.d.ts +4 -3
  36. package/dist/components/charts/ordinal/PieChart.d.ts +4 -3
  37. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +4 -3
  38. package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
  39. package/dist/components/charts/ordinal/SwarmPlot.d.ts +4 -3
  40. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -3
  41. package/dist/components/charts/ordinal/ViolinPlot.d.ts +4 -3
  42. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +7 -6
  43. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +10 -7
  44. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +9 -6
  45. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +7 -6
  46. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +9 -6
  47. package/dist/components/charts/shared/ChartError.d.ts +1 -2
  48. package/dist/components/charts/shared/annotationResolvers.d.ts +4 -3
  49. package/dist/components/charts/shared/annotationRules.d.ts +2 -1
  50. package/dist/components/charts/shared/colorUtils.d.ts +4 -3
  51. package/dist/components/charts/shared/datumTypes.d.ts +20 -0
  52. package/dist/components/charts/shared/diagnoseConfig.d.ts +2 -7
  53. package/dist/components/charts/shared/formatUtils.d.ts +4 -2
  54. package/dist/components/charts/shared/hooks.d.ts +27 -23
  55. package/dist/components/charts/shared/legendUtils.d.ts +3 -2
  56. package/dist/components/charts/shared/mergeShapeStyle.d.ts +43 -0
  57. package/dist/components/charts/shared/networkUtils.d.ts +7 -6
  58. package/dist/components/charts/shared/selectionUtils.d.ts +5 -4
  59. package/dist/components/charts/shared/statisticalOverlays.d.ts +14 -26
  60. package/dist/components/charts/shared/statisticalOverlaysLazy.d.ts +2 -2
  61. package/dist/components/charts/shared/statsTooltip.d.ts +3 -2
  62. package/dist/components/charts/shared/tooltipUtils.d.ts +7 -6
  63. package/dist/components/charts/shared/types.d.ts +22 -13
  64. package/dist/components/charts/shared/useChartSetup.d.ts +7 -6
  65. package/dist/components/charts/shared/useLikertAggregation.d.ts +18 -7
  66. package/dist/components/charts/shared/useOrdinalStreaming.d.ts +3 -2
  67. package/dist/components/charts/shared/useStreamingLegend.d.ts +2 -1
  68. package/dist/components/charts/shared/validateChartData.d.ts +2 -1
  69. package/dist/components/charts/shared/validateProps.d.ts +2 -8
  70. package/dist/components/charts/shared/withChartWrapper.d.ts +1 -1
  71. package/dist/components/charts/xy/AreaChart.d.ts +4 -3
  72. package/dist/components/charts/xy/BubbleChart.d.ts +4 -3
  73. package/dist/components/charts/xy/CandlestickChart.d.ts +47 -0
  74. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -3
  75. package/dist/components/charts/xy/Heatmap.d.ts +12 -7
  76. package/dist/components/charts/xy/LineChart.d.ts +4 -3
  77. package/dist/components/charts/xy/MinimapChart.d.ts +4 -4
  78. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +5 -4
  79. package/dist/components/charts/xy/QuadrantChart.d.ts +4 -3
  80. package/dist/components/charts/xy/Scatterplot.d.ts +4 -3
  81. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +3 -3
  82. package/dist/components/charts/xy/StackedAreaChart.d.ts +4 -3
  83. package/dist/components/data/transforms.d.ts +8 -7
  84. package/dist/components/export/chartConfig.d.ts +4 -3
  85. package/dist/components/geo/mergeData.d.ts +2 -1
  86. package/dist/components/realtime/BinAccumulator.d.ts +3 -2
  87. package/dist/components/realtime/renderers/types.d.ts +2 -1
  88. package/dist/components/realtime/renderers/waterfallRenderer.d.ts +2 -1
  89. package/dist/components/realtime/types.d.ts +20 -16
  90. package/dist/components/semiotic-themes.d.ts +2 -1
  91. package/dist/components/semiotic-xy.d.ts +2 -0
  92. package/dist/components/semiotic.d.ts +3 -3
  93. package/dist/components/server/animatedGif.d.ts +4 -18
  94. package/dist/components/server/renderToStaticSVG.d.ts +5 -4
  95. package/dist/components/server/serverChartConfigs.d.ts +2 -10
  96. package/dist/components/server/staticAnnotations.d.ts +2 -1
  97. package/dist/components/server/staticLegend.d.ts +2 -1
  98. package/dist/components/store/ObservationStore.d.ts +4 -3
  99. package/dist/components/store/SelectionStore.d.ts +3 -8
  100. package/dist/components/store/ThemeStore.d.ts +32 -4
  101. package/dist/components/store/TooltipStore.d.ts +1 -1
  102. package/dist/components/store/useSelection.d.ts +6 -5
  103. package/dist/components/stream/AccessibleDataTable.d.ts +5 -5
  104. package/dist/components/stream/CanvasHitTester.d.ts +2 -1
  105. package/dist/components/stream/DataSourceAdapter.d.ts +2 -1
  106. package/dist/components/stream/FocusRing.d.ts +1 -2
  107. package/dist/components/stream/GeoParticlePool.d.ts +2 -1
  108. package/dist/components/stream/GeoPipelineStore.d.ts +7 -6
  109. package/dist/components/stream/MarginalGraphics.d.ts +1 -2
  110. package/dist/components/stream/NetworkPipelineStore.d.ts +3 -2
  111. package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -4
  112. package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -19
  113. package/dist/components/stream/OrdinalPipelineStore.d.ts +6 -5
  114. package/dist/components/stream/OrdinalSVGOverlay.d.ts +6 -5
  115. package/dist/components/stream/PipelineStore.d.ts +63 -28
  116. package/dist/components/stream/SVGOverlay.d.ts +10 -10
  117. package/dist/components/stream/SceneGraph.d.ts +6 -5
  118. package/dist/components/stream/StreamGeoFrame.d.ts +2 -1
  119. package/dist/components/stream/StreamNetworkFrame.d.ts +2 -1
  120. package/dist/components/stream/StreamOrdinalFrame.d.ts +2 -1
  121. package/dist/components/stream/StreamXYFrame.d.ts +2 -1
  122. package/dist/components/stream/XYBrushOverlay.d.ts +1 -21
  123. package/dist/components/stream/devDataAccessWarning.d.ts +2 -11
  124. package/dist/components/stream/geoTypes.d.ts +25 -18
  125. package/dist/components/stream/hoverUtils.d.ts +2 -1
  126. package/dist/components/stream/layouts/hierarchySceneBuilders.d.ts +4 -3
  127. package/dist/components/stream/layouts/hierarchyUtils.d.ts +4 -3
  128. package/dist/components/stream/networkTypes.d.ts +33 -28
  129. package/dist/components/stream/ordinalSceneBuilders/barFunnelScene.d.ts +1 -1
  130. package/dist/components/stream/ordinalSceneBuilders/barScene.d.ts +2 -2
  131. package/dist/components/stream/ordinalSceneBuilders/connectorScene.d.ts +1 -1
  132. package/dist/components/stream/ordinalSceneBuilders/pointScene.d.ts +2 -2
  133. package/dist/components/stream/ordinalSceneBuilders/statisticalScene.d.ts +4 -4
  134. package/dist/components/stream/ordinalSceneBuilders/swimlaneScene.d.ts +1 -1
  135. package/dist/components/stream/ordinalSceneBuilders/timelineScene.d.ts +1 -1
  136. package/dist/components/stream/ordinalSceneBuilders/types.d.ts +9 -8
  137. package/dist/components/stream/ordinalTypes.d.ts +54 -22
  138. package/dist/components/stream/pipelineDecay.d.ts +2 -1
  139. package/dist/components/stream/pipelinePulse.d.ts +2 -1
  140. package/dist/components/stream/pipelineTransitions.d.ts +16 -4
  141. package/dist/components/stream/renderers/colorUtils.d.ts +20 -0
  142. package/dist/components/stream/types.d.ts +45 -8
  143. package/dist/components/stream/xySceneBuilders/areaScene.d.ts +3 -2
  144. package/dist/components/stream/xySceneBuilders/barScene.d.ts +2 -1
  145. package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +2 -1
  146. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +2 -1
  147. package/dist/components/stream/xySceneBuilders/emitPointNodes.d.ts +3 -2
  148. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +2 -1
  149. package/dist/components/stream/xySceneBuilders/lineScene.d.ts +2 -1
  150. package/dist/components/stream/xySceneBuilders/mixedScene.d.ts +2 -1
  151. package/dist/components/stream/xySceneBuilders/pointScene.d.ts +2 -1
  152. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +2 -1
  153. package/dist/components/stream/xySceneBuilders/types.d.ts +35 -26
  154. package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +2 -1
  155. package/dist/components/types/marginType.d.ts +15 -0
  156. package/dist/geo.min.js +1 -1
  157. package/dist/geo.module.min.js +1 -1
  158. package/dist/network.min.js +1 -1
  159. package/dist/network.module.min.js +1 -1
  160. package/dist/ordinal.min.js +1 -1
  161. package/dist/ordinal.module.min.js +1 -1
  162. package/dist/realtime.min.js +1 -1
  163. package/dist/realtime.module.min.js +1 -1
  164. package/dist/semiotic-ai.min.js +1 -1
  165. package/dist/semiotic-ai.module.min.js +1 -1
  166. package/dist/semiotic-statisticalOverlays-Ckd_jM8z.js +1 -0
  167. package/dist/semiotic-themes.d.ts +2 -1
  168. package/dist/semiotic-themes.min.js +1 -1
  169. package/dist/semiotic-themes.module.min.js +1 -1
  170. package/dist/semiotic-utils.min.js +1 -1
  171. package/dist/semiotic-utils.module.min.js +1 -1
  172. package/dist/semiotic-xy.d.ts +2 -0
  173. package/dist/semiotic.d.ts +3 -3
  174. package/dist/semiotic.min.js +1 -1
  175. package/dist/semiotic.module.min.js +1 -1
  176. package/dist/server.min.js +1 -1
  177. package/dist/server.module.min.js +1 -1
  178. package/dist/test-utils/canvasMock.d.ts +10 -2
  179. package/dist/xy.min.js +1 -1
  180. package/dist/xy.module.min.js +1 -1
  181. package/package.json +38 -31
  182. package/dist/components/types/annotationTypes.d.ts +0 -145
  183. package/dist/components/types/generalTypes.d.ts +0 -241
  184. package/dist/components/types/interactionTypes.d.ts +0 -72
  185. package/dist/components/types/networkTypes.d.ts +0 -174
  186. package/dist/components/types/ordinalTypes.d.ts +0 -112
  187. package/dist/semiotic-statisticalOverlays-DGX_WWc5.js +0 -1
@@ -5,7 +5,8 @@ import type { ReactNode } from "react";
5
5
  import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
6
  import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
7
7
  import type { OnObservationCallback } from "../../store/ObservationStore";
8
- export interface RealtimeLineChartProps<TDatum extends Record<string, any> = Record<string, any>> {
8
+ import type { Datum } from "../shared/datumTypes";
9
+ export interface RealtimeLineChartProps<TDatum extends Datum = Datum> {
9
10
  /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
10
11
  mode?: ChartMode;
11
12
  /** Chart dimensions as [width, height] */
@@ -32,7 +33,7 @@ export interface RealtimeLineChartProps<TDatum extends Record<string, any> = Rec
32
33
  /** Ring buffer capacity */
33
34
  windowSize?: number;
34
35
  /** Controlled data array */
35
- data?: Record<string, any>[];
36
+ data?: Datum[];
36
37
  /** Time value accessor */
37
38
  timeAccessor?: ChartAccessor<TDatum, number>;
38
39
  /** Value accessor */
@@ -49,6 +50,8 @@ export interface RealtimeLineChartProps<TDatum extends Record<string, any> = Rec
49
50
  strokeWidth?: number;
50
51
  /** Dash pattern (e.g. "4,2") */
51
52
  strokeDasharray?: string;
53
+ /** Uniform line opacity (0–1). Pairs with `stroke` / `strokeWidth` for the designer-facing primitive vocabulary. */
54
+ opacity?: number;
52
55
  /** Show canvas-drawn axes */
53
56
  showAxes?: boolean;
54
57
  /** Background fill color */
@@ -60,9 +63,9 @@ export interface RealtimeLineChartProps<TDatum extends Record<string, any> = Rec
60
63
  /** Callback on hover */
61
64
  onHover?: (d: HoverData | null) => void;
62
65
  /** Annotation objects */
63
- annotations?: Record<string, any>[];
66
+ annotations?: Datum[];
64
67
  /** SVG annotation render function */
65
- svgAnnotationRules?: (annotation: Record<string, any>, index: number, context: AnnotationContext) => ReactNode;
68
+ svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
66
69
  /** Custom formatter for time axis ticks */
67
70
  tickFormatTime?: (value: number) => string;
68
71
  /** Custom formatter for value axis ticks */
@@ -97,7 +100,7 @@ export interface RealtimeLineChartProps<TDatum extends Record<string, any> = Rec
97
100
  /** Legend interaction mode */
98
101
  legendInteraction?: LegendInteractionMode;
99
102
  /** ID accessor for remove()/update() on the push API */
100
- pointIdAccessor?: string | ((d: any) => string);
103
+ pointIdAccessor?: string | ((d: Datum) => string);
101
104
  }
102
105
  /**
103
106
  * RealtimeLineChart - Simplified wrapper for streaming line charts.
@@ -119,6 +122,6 @@ export interface RealtimeLineChartProps<TDatum extends Record<string, any> = Rec
119
122
  * ```
120
123
  */
121
124
  export declare const RealtimeLineChart: {
122
- <TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeLineChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
125
+ <TDatum extends Datum = Datum>(props: RealtimeLineChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
123
126
  displayName?: string;
124
127
  };
@@ -5,7 +5,8 @@ import type { ReactNode } from "react";
5
5
  import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
6
  import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
7
7
  import type { OnObservationCallback } from "../../store/ObservationStore";
8
- export interface RealtimeSwarmChartProps<TDatum extends Record<string, any> = Record<string, any>> {
8
+ import type { Datum } from "../shared/datumTypes";
9
+ export interface RealtimeSwarmChartProps<TDatum extends Datum = Datum> {
9
10
  /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
10
11
  mode?: ChartMode;
11
12
  /** Chart dimensions as [width, height] */
@@ -32,7 +33,7 @@ export interface RealtimeSwarmChartProps<TDatum extends Record<string, any> = Re
32
33
  /** Ring buffer capacity */
33
34
  windowSize?: number;
34
35
  /** Controlled data array */
35
- data?: Record<string, any>[];
36
+ data?: Datum[];
36
37
  /** Time value accessor */
37
38
  timeAccessor?: ChartAccessor<TDatum, number>;
38
39
  /** Value accessor */
@@ -68,9 +69,9 @@ export interface RealtimeSwarmChartProps<TDatum extends Record<string, any> = Re
68
69
  /** Callback on hover */
69
70
  onHover?: (d: HoverData | null) => void;
70
71
  /** Annotation objects (including threshold coloring) */
71
- annotations?: Record<string, any>[];
72
+ annotations?: Datum[];
72
73
  /** SVG annotation render function */
73
- svgAnnotationRules?: (annotation: Record<string, any>, index: number, context: AnnotationContext) => ReactNode;
74
+ svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
74
75
  /** Custom formatter for time axis ticks */
75
76
  tickFormatTime?: (value: number) => string;
76
77
  /** Custom formatter for value axis ticks */
@@ -97,7 +98,7 @@ export interface RealtimeSwarmChartProps<TDatum extends Record<string, any> = Re
97
98
  /** Legend interaction mode */
98
99
  legendInteraction?: LegendInteractionMode;
99
100
  /** ID accessor for remove()/update() on the push API */
100
- pointIdAccessor?: string | ((d: any) => string);
101
+ pointIdAccessor?: string | ((d: Datum) => string);
101
102
  }
102
103
  /**
103
104
  * RealtimeSwarmChart - Simplified wrapper for streaming dot/swarm charts.
@@ -121,6 +122,6 @@ export interface RealtimeSwarmChartProps<TDatum extends Record<string, any> = Re
121
122
  * ```
122
123
  */
123
124
  export declare const RealtimeSwarmChart: {
124
- <TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeSwarmChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
125
+ <TDatum extends Datum = Datum>(props: RealtimeSwarmChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
125
126
  displayName?: string;
126
127
  };
@@ -5,7 +5,8 @@ import type { ReactNode } from "react";
5
5
  import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
6
  import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
7
7
  import type { OnObservationCallback } from "../../store/ObservationStore";
8
- export interface RealtimeWaterfallChartProps<TDatum extends Record<string, any> = Record<string, any>> {
8
+ import type { Datum } from "../shared/datumTypes";
9
+ export interface RealtimeWaterfallChartProps<TDatum extends Datum = Datum> {
9
10
  /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
10
11
  mode?: ChartMode;
11
12
  /** Chart dimensions as [width, height] */
@@ -32,7 +33,7 @@ export interface RealtimeWaterfallChartProps<TDatum extends Record<string, any>
32
33
  /** Ring buffer capacity */
33
34
  windowSize?: number;
34
35
  /** Controlled data array */
35
- data?: Record<string, any>[];
36
+ data?: Datum[];
36
37
  /** Time value accessor */
37
38
  timeAccessor?: ChartAccessor<TDatum, number>;
38
39
  /** Value accessor (positive = gain, negative = loss) */
@@ -57,6 +58,8 @@ export interface RealtimeWaterfallChartProps<TDatum extends Record<string, any>
57
58
  stroke?: string;
58
59
  /** Bar stroke width */
59
60
  strokeWidth?: number;
61
+ /** Uniform bar opacity (0–1). */
62
+ opacity?: number;
60
63
  /** Show canvas-drawn axes */
61
64
  showAxes?: boolean;
62
65
  /** Background fill color */
@@ -68,9 +71,9 @@ export interface RealtimeWaterfallChartProps<TDatum extends Record<string, any>
68
71
  /** Callback on hover */
69
72
  onHover?: (d: HoverData | null) => void;
70
73
  /** Annotation objects */
71
- annotations?: Record<string, any>[];
74
+ annotations?: Datum[];
72
75
  /** SVG annotation render function */
73
- svgAnnotationRules?: (annotation: Record<string, any>, index: number, context: AnnotationContext) => ReactNode;
76
+ svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
74
77
  /** Custom formatter for time axis ticks */
75
78
  tickFormatTime?: (value: number) => string;
76
79
  /** Custom formatter for value axis ticks */
@@ -97,7 +100,7 @@ export interface RealtimeWaterfallChartProps<TDatum extends Record<string, any>
97
100
  /** Legend interaction mode */
98
101
  legendInteraction?: LegendInteractionMode;
99
102
  /** ID accessor for remove()/update() on the push API */
100
- pointIdAccessor?: string | ((d: any) => string);
103
+ pointIdAccessor?: string | ((d: Datum) => string);
101
104
  }
102
105
  /**
103
106
  * RealtimeWaterfallChart - Simplified wrapper for streaming waterfall charts.
@@ -118,6 +121,6 @@ export interface RealtimeWaterfallChartProps<TDatum extends Record<string, any>
118
121
  * ```
119
122
  */
120
123
  export declare const RealtimeWaterfallChart: {
121
- <TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeWaterfallChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
124
+ <TDatum extends Datum = Datum>(props: RealtimeWaterfallChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
122
125
  displayName?: string;
123
126
  };
@@ -1,4 +1,3 @@
1
- import * as React from "react";
2
1
  export interface ChartErrorProps {
3
2
  /** Component name for the error message */
4
3
  componentName: string;
@@ -18,4 +17,4 @@ export interface ChartErrorProps {
18
17
  * Designed to be obvious in development but not alarming in production —
19
18
  * uses muted colors that adapt to light/dark backgrounds.
20
19
  */
21
- export default function ChartError({ componentName, message, diagnosticHint, width, height, }: ChartErrorProps): React.JSX.Element;
20
+ export default function ChartError({ componentName, message, diagnosticHint, width, height, }: ChartErrorProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import type { Datum } from "./datumTypes";
1
2
  /**
2
3
  * Coordinate resolution helpers for annotations.
3
4
  *
@@ -9,15 +10,15 @@
9
10
  * Consumed by: annotationRules.tsx (all annotation type renderers)
10
11
  */
11
12
  import type { AnnotationContext } from "../../realtime/types";
12
- export declare function resolveX(ann: Record<string, any>, context: AnnotationContext): number | null;
13
- export declare function resolveY(ann: Record<string, any>, context: AnnotationContext): number | null;
13
+ export declare function resolveX(ann: Datum, context: AnnotationContext): number | null;
14
+ export declare function resolveY(ann: Datum, context: AnnotationContext): number | null;
14
15
  /**
15
16
  * Resolve annotation position respecting anchor mode.
16
17
  * - "fixed" (default): resolve from annotation's own fields
17
18
  * - "latest": resolve from the most recent datum in the buffer
18
19
  * - "sticky": resolve from annotation fields; if not found, use cached position
19
20
  */
20
- export declare function resolveAnchoredPosition(ann: Record<string, any>, index: number, context: AnnotationContext): {
21
+ export declare function resolveAnchoredPosition(ann: Datum, index: number, context: AnnotationContext): {
21
22
  x: number;
22
23
  y: number;
23
24
  } | null;
@@ -1,3 +1,4 @@
1
1
  import * as React from "react";
2
2
  import type { AnnotationContext } from "../../realtime/types";
3
- export declare function createDefaultAnnotationRules(frameType: "xy" | "ordinal" | "network"): (annotation: Record<string, any>, index: number, context: AnnotationContext) => React.ReactNode | null;
3
+ import type { Datum } from "./datumTypes";
4
+ export declare function createDefaultAnnotationRules(_frameType: "xy" | "ordinal" | "network"): (annotation: Datum, index: number, context: AnnotationContext) => React.ReactNode | null;
@@ -1,4 +1,5 @@
1
1
  import { interpolateBlues, interpolateReds, interpolateGreens, interpolateOranges, interpolatePurples, interpolateViridis, interpolatePlasma } from "d3-scale-chromatic";
2
+ import type { Datum } from "./datumTypes";
2
3
  /**
3
4
  * Predefined color schemes
4
5
  */
@@ -45,7 +46,7 @@ export declare const DEPTH_PALETTE_COLORS: string[];
45
46
  * getColor({value: 10}, d => d.value > 5 ? 'red' : 'blue')
46
47
  * ```
47
48
  */
48
- export declare function getColor(dataPoint: any, colorBy: string | ((d: any) => string), colorScale?: (v: any) => string): string;
49
+ export declare function getColor(dataPoint: any, colorBy: string | ((d: Datum) => string), colorScale?: (v: any) => string): string;
49
50
  /**
50
51
  * Creates a color scale function from data
51
52
  *
@@ -60,7 +61,7 @@ export declare function getColor(dataPoint: any, colorBy: string | ((d: any) =>
60
61
  * const color = colorScale('A') // Returns color for category 'A'
61
62
  * ```
62
63
  */
63
- export declare function createColorScale(data: Array<Record<string, any>>, colorBy: string, scheme?: string | string[]): (v: string) => string;
64
+ export declare function createColorScale(data: Array<Datum>, colorBy: string, scheme?: string | string[]): (v: string) => string;
64
65
  /**
65
66
  * Generates a size function based on sizeBy configuration
66
67
  *
@@ -70,4 +71,4 @@ export declare function createColorScale(data: Array<Record<string, any>>, color
70
71
  * @param domain - Optional domain for scaling [minValue, maxValue]
71
72
  * @returns Size value
72
73
  */
73
- export declare function getSize(dataPoint: any, sizeBy: string | ((d: any) => number), sizeRange?: [number, number], domain?: [number, number]): number;
74
+ export declare function getSize(dataPoint: any, sizeBy: string | ((d: Datum) => number), sizeRange?: [number, number], domain?: [number, number]): number;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `Datum` — the canonical "user-supplied chart data row" type.
3
+ *
4
+ * A charting library cannot know the shape of the user's data ahead of time.
5
+ * This alias names that intent: "an object whose field types we do not know
6
+ * until the user plugs in a concrete generic." Every HOC threads a
7
+ * `<TDatum extends Datum = Datum>` generic so accessors can autocomplete
8
+ * user field names when a concrete type is supplied, while still accepting
9
+ * arbitrary data otherwise.
10
+ *
11
+ * Why `any` (and not `unknown`) on the value side: the library and user code
12
+ * both do unguarded field access (`d.x`, `d[accessor]`, `...d` spreads). With
13
+ * `unknown`, each access would require a narrowing step that adds no runtime
14
+ * safety (the data is still dynamically shaped at runtime) but imposes
15
+ * ergonomic cost on every user accessor function and every internal pass
16
+ * that augments rows. The `any` in this specific alias is the single,
17
+ * documented, library-wide allowance; it's the "clear and established
18
+ * reason" referenced by the lint policy for `@typescript-eslint/no-explicit-any`.
19
+ */
20
+ export type Datum = Record<string, any>;
@@ -1,9 +1,4 @@
1
- /**
2
- * diagnoseConfig — anti-pattern detector for Semiotic chart configurations.
3
- *
4
- * Catches common failure modes that produce blank charts or runtime errors,
5
- * returning actionable fix instructions for each issue found.
6
- */
1
+ import type { Datum } from "./datumTypes";
7
2
  export interface Diagnosis {
8
3
  severity: "error" | "warning";
9
4
  code: string;
@@ -20,4 +15,4 @@ export interface DiagnosisResult {
20
15
  * Returns actionable diagnoses with severity, code, message, and fix instruction.
21
16
  * Runs validateProps internally — validation errors are included as diagnoses.
22
17
  */
23
- export declare function diagnoseConfig(componentName: string, props: Record<string, any>): DiagnosisResult;
18
+ export declare function diagnoseConfig(componentName: string, props: Datum): DiagnosisResult;
@@ -1,3 +1,5 @@
1
+ import * as React from "react";
2
+ import type { Datum } from "./datumTypes";
1
3
  /**
2
4
  * Format number with specified format string
3
5
  *
@@ -38,7 +40,7 @@ export declare function formatAxis(type?: "number" | "date" | "percent" | "curre
38
40
  decimals?: number;
39
41
  format?: string;
40
42
  currency?: string;
41
- }): (d: any) => string;
43
+ }): (d: number | string | Date) => string;
42
44
  /**
43
45
  * Creates a tooltip content generator
44
46
  *
@@ -56,7 +58,7 @@ export declare function formatAxis(type?: "number" | "date" | "percent" | "curre
56
58
  * )
57
59
  * ```
58
60
  */
59
- export declare function createTooltip(fields: string[], formatters?: Record<string, (v: any) => string>, labels?: Record<string, string>): (d: any) => JSX.Element;
61
+ export declare function createTooltip(fields: string[], formatters?: Record<string, (v: any) => string>, labels?: Record<string, string>): (d: Datum) => React.JSX.Element;
60
62
  /**
61
63
  * Formats large numbers with K/M/B suffixes
62
64
  *
@@ -2,8 +2,9 @@ import { createLegend } from "./legendUtils";
2
2
  import type { SelectionHookResult } from "./selectionUtils";
3
3
  import type { OnObservationCallback } from "../../store/ObservationStore";
4
4
  import type { Accessor, SelectionConfig, LinkedHoverProp, ChartMode } from "./types";
5
- import type { MarginType } from "../../types/generalTypes";
5
+ import type { MarginType, PartialMargin } from "../../types/marginType";
6
6
  import type { TransitionConfig } from "../../stream/types";
7
+ import type { Datum } from "./datumTypes";
7
8
  /**
8
9
  * Default fill color used when no colorBy is specified
9
10
  */
@@ -13,6 +14,17 @@ export declare const DEFAULT_COLOR = "#007bff";
13
14
  * the palette is empty. Safe to call outside a ThemeProvider (returns undefined).
14
15
  */
15
16
  export declare function useThemeCategorical(): string[] | undefined;
17
+ /**
18
+ * Return the ambient theme's sequential scheme name (e.g. "blues", "viridis")
19
+ * for magnitude encodings. Safe to call outside a ThemeProvider (returns undefined).
20
+ */
21
+ export declare function useThemeSequential(): string | undefined;
22
+ /**
23
+ * Return the ambient theme's diverging scheme name (e.g. "RdBu", "PiYG")
24
+ * for midpoint encodings (likert, ±deviation). Safe to call outside a
25
+ * ThemeProvider (returns undefined).
26
+ */
27
+ export declare function useThemeDiverging(): string | undefined;
16
28
  /**
17
29
  * Resolve the effective color for a data element when no colorBy is specified.
18
30
  * Priority: color prop > theme categorical > colorScheme > DEFAULT_COLOR.
@@ -23,13 +35,13 @@ export declare function resolveDefaultFill(color: string | undefined, themeCateg
23
35
  * Resolve an accessor (string key or function) into a function.
24
36
  * Used across chart components to normalize `valueAccessor`, `categoryAccessor`, etc.
25
37
  */
26
- export declare function resolveAccessor<T = any>(accessor: string | ((d: Record<string, any>, i?: number) => T)): (d: Record<string, any>) => T;
38
+ export declare function resolveAccessor<T = any>(accessor: string | ((d: Datum, i?: number) => T)): (d: Datum) => T;
27
39
  /**
28
40
  * Hook to create a color scale from data and colorBy configuration.
29
41
  * Returns undefined when colorBy is absent or data is empty (push API mode).
30
42
  * Supports both string and function accessors for colorBy.
31
43
  */
32
- export declare function useColorScale(data: Array<Record<string, any>>, colorBy: string | ((d: any, i?: number) => any) | undefined, colorScheme?: string | string[]): ((v: string) => string) | undefined;
44
+ export declare function useColorScale(data: Array<Datum>, colorBy: string | ((d: any, i?: number) => any) | undefined, colorScheme?: string | string[]): ((v: string) => string) | undefined;
33
45
  /**
34
46
  * Hook to sort data by a value accessor.
35
47
  * Used by BarChart and DotPlot.
@@ -43,7 +55,7 @@ export declare function useColorScale(data: Array<Record<string, any>>, colorBy:
43
55
  * makes no sense (it would call the comparator with row objects instead
44
56
  * of strings), so we decline to sort in both cases.
45
57
  */
46
- export declare function useSortedData(data: Array<Record<string, any>>, sort: boolean | "asc" | "desc" | "auto" | ((a: string, b: string) => number), valueAccessor: Accessor<number>): Array<Record<string, any>>;
58
+ export declare function useSortedData(data: Array<Datum>, sort: boolean | "asc" | "desc" | "auto" | ((a: string, b: string) => number), valueAccessor: Accessor<number>): Array<Datum>;
47
59
  /**
48
60
  * Hook to set up selection and linked hover for a chart component.
49
61
  * Consolidates normalizeLinkedHover, useSelection, useLinkedHover,
@@ -52,7 +64,7 @@ export declare function useSortedData(data: Array<Record<string, any>>, sort: bo
52
64
  * @param unwrapData - Deprecated / no-op. Hover data is always unwrapped
53
65
  * (stream frames wrap the raw datum in { data, time, value, x, y }).
54
66
  */
55
- export declare function useChartSelection({ selection, linkedHover, fallbackFields, unwrapData, onObservation, chartType, chartId, onClick, hoverHighlight, colorByField, }: {
67
+ export declare function useChartSelection({ selection, linkedHover, fallbackFields, unwrapData: _unwrapData, onObservation, chartType, chartId, onClick, hoverHighlight, colorByField, }: {
56
68
  selection?: SelectionConfig;
57
69
  linkedHover?: LinkedHoverProp;
58
70
  fallbackFields?: string[];
@@ -69,8 +81,8 @@ export declare function useChartSelection({ selection, linkedHover, fallbackFiel
69
81
  }): {
70
82
  activeSelectionHook: SelectionHookResult | null;
71
83
  hoverSelectionHook: SelectionHookResult | null;
72
- customHoverBehavior: (d: Record<string, any> | null) => void;
73
- customClickBehavior: (d: Record<string, any> | null) => void;
84
+ customHoverBehavior: (d: Datum | null) => void;
85
+ customClickBehavior: (d: Datum | null) => void;
74
86
  /** Stable ID for this chart instance, used to suppress linked crosshair on source chart */
75
87
  crosshairSourceId: string;
76
88
  };
@@ -89,27 +101,17 @@ export declare function getCrosshairProps(linkedHover: unknown, crosshairSourceI
89
101
  */
90
102
  export type LegendPosition = "right" | "left" | "top" | "bottom";
91
103
  export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, legendPosition, userMargin, defaults, categories, }: {
92
- data: Array<Record<string, any>>;
104
+ data: Array<Datum>;
93
105
  colorBy: Accessor<string> | undefined;
94
106
  colorScale: ((v: string) => string) | undefined;
95
107
  showLegend: boolean | undefined;
96
108
  legendPosition?: LegendPosition;
97
- userMargin: MarginType | undefined;
98
- defaults?: {
99
- top: number;
100
- bottom: number;
101
- left: number;
102
- right: number;
103
- };
109
+ userMargin: PartialMargin | undefined;
110
+ defaults?: MarginType;
104
111
  categories?: string[];
105
112
  }): {
106
113
  legend: ReturnType<typeof createLegend> | undefined;
107
- margin: {
108
- top: number;
109
- bottom: number;
110
- left: number;
111
- right: number;
112
- };
114
+ margin: MarginType;
113
115
  legendPosition: LegendPosition;
114
116
  };
115
117
  export type LegendInteractionMode = "highlight" | "isolate" | "none";
@@ -125,7 +127,7 @@ export interface LegendInteractionState {
125
127
  /** Selection predicate that dims non-matching data — use with wrapStyleWithSelection */
126
128
  legendSelectionHook: {
127
129
  isActive: boolean;
128
- predicate: (d: Record<string, any>) => boolean;
130
+ predicate: (d: Datum) => boolean;
129
131
  } | null;
130
132
  }
131
133
  /**
@@ -137,7 +139,7 @@ export interface LegendInteractionState {
137
139
  * `DEFAULT_SELECTION_OPACITY` fallback.
138
140
  * - "isolate": click toggles category visibility; click all to reset
139
141
  */
140
- export declare function useLegendInteraction(mode: LegendInteractionMode | undefined, colorBy: string | ((d: any) => string) | undefined, allCategories: string[]): LegendInteractionState;
142
+ export declare function useLegendInteraction(mode: LegendInteractionMode | undefined, colorBy: string | ((d: Datum) => string) | undefined, allCategories: string[]): LegendInteractionState;
141
143
  interface ChartModeInput {
142
144
  width?: number;
143
145
  height?: number;
@@ -182,6 +184,8 @@ interface ChartModeResult {
182
184
  left: number;
183
185
  right: number;
184
186
  };
187
+ /** True when mode is context or sparkline — the "hide interactive chrome" union. */
188
+ compactMode: boolean;
185
189
  }
186
190
  /**
187
191
  * Resolve chart display mode into concrete prop defaults.
@@ -1,5 +1,6 @@
1
1
  import type { Accessor } from "./types";
2
2
  import type { LegendItem } from "../../types/legendTypes";
3
+ import type { Datum } from "./datumTypes";
3
4
  /**
4
5
  * Create a legend configuration for HOC components
5
6
  *
@@ -12,10 +13,10 @@ import type { LegendItem } from "../../types/legendTypes";
12
13
  * @returns Legend configuration object for Semiotic frames
13
14
  */
14
15
  export declare function createLegend({ data, colorBy, colorScale, getColor, strokeColor, strokeWidth, categories }: {
15
- data: Array<Record<string, any>>;
16
+ data: Array<Datum>;
16
17
  colorBy: Accessor<string>;
17
18
  colorScale?: ((v: string) => string);
18
- getColor: (d: Record<string, any>, accessor: Accessor<string>, scale?: ((v: string) => string)) => string;
19
+ getColor: (d: Datum, accessor: Accessor<string>, scale?: ((v: string) => string)) => string;
19
20
  strokeColor?: string;
20
21
  strokeWidth?: number;
21
22
  categories?: string[];
@@ -0,0 +1,43 @@
1
+ import type { Datum } from "./datumTypes";
2
+ /**
3
+ * mergeShapeStyle — overlay top-level primitive styling props on a style function.
4
+ *
5
+ * Phase B of the primitive-theming plan introduces three first-class props
6
+ * on every shape-drawing chart: `stroke`, `strokeWidth`, `opacity` (joining
7
+ * `color`, which was already there). They're resolved at the HOC layer via
8
+ * this helper so the merge order — and precedence — lands in exactly one
9
+ * place for every chart type.
10
+ *
11
+ * Precedence (highest wins):
12
+ * 1. Top-level primitive prop (this helper's `overrides` parameter)
13
+ * 2. User-supplied `frameProps.*Style` return value
14
+ * 3. HOC base style (categorical color resolution, theme fallback, etc.)
15
+ *
16
+ * The "top-level wins over function return" rule is deliberate: explicit >
17
+ * generic. A user writing `<BarChart stroke="red" />` expects red strokes,
18
+ * even if they also pass `frameProps.pieceStyle = d => ({ stroke: "blue" })`
19
+ * for per-datum customization. The top-level prop is the broad stroke, the
20
+ * per-datum function handles the exceptions.
21
+ *
22
+ * When no overrides are set, returns the input function unchanged so
23
+ * `useMemo` chains upstream preserve referential equality.
24
+ */
25
+ export interface PrimitiveStyleOverrides {
26
+ stroke?: string;
27
+ strokeWidth?: number;
28
+ opacity?: number;
29
+ }
30
+ type StyleFnArg = (...args: any[]) => Datum;
31
+ /** Returns true when at least one override key has a non-undefined value. */
32
+ export declare function hasPrimitiveOverrides(overrides: PrimitiveStyleOverrides): boolean;
33
+ /**
34
+ * Overlay `overrides` on the output of `styleFn`. Returns a new style
35
+ * function that calls the underlying one (if present) and merges the
36
+ * override fields last, so top-level props win.
37
+ *
38
+ * When `overrides` has no fields set, returns `styleFn` unchanged — this
39
+ * keeps the memoization-stable identity path hot for the common case
40
+ * where a designer has set nothing.
41
+ */
42
+ export declare function mergeShapeStyle<F extends StyleFnArg>(styleFn: F | undefined, overrides: PrimitiveStyleOverrides): F;
43
+ export {};
@@ -1,31 +1,32 @@
1
+ import type { Datum } from "./datumTypes";
1
2
  import type { Accessor } from "./types";
2
3
  /**
3
4
  * Flatten a hierarchical data structure into an array of all nodes
4
5
  * by recursively traversing children.
5
6
  */
6
- export declare function flattenHierarchy(data: Record<string, any> | null, childrenAccessor: string | ((d: any) => any[])): Array<Record<string, any>>;
7
+ export declare function flattenHierarchy(data: Datum | null, childrenAccessor: string | ((d: Datum) => any[])): Array<Datum>;
7
8
  /**
8
9
  * Infer nodes from edges when a nodes array is not provided.
9
10
  * Extracts unique source/target IDs and returns `{ id }` objects.
10
11
  * Returns the provided nodes array if it's non-empty.
11
12
  */
12
- export declare function inferNodesFromEdges(nodes: any[] | undefined, edges: any[], sourceAccessor: string | ((d: any) => string), targetAccessor: string | ((d: any) => string)): Array<{
13
+ export declare function inferNodesFromEdges(nodes: any[] | undefined, edges: any[], sourceAccessor: string | ((d: Datum) => string), targetAccessor: string | ((d: Datum) => string)): Array<{
13
14
  id: string;
14
15
  }>;
15
16
  /**
16
17
  * Convert a valueAccessor prop into a hierarchy sum function.
17
18
  * Used by TreeDiagram, Treemap, and CirclePack for d3-hierarchy's `.sum()`.
18
19
  */
19
- export declare function resolveHierarchySum(valueAccessor: string | ((d: any) => number)): (d: Record<string, any>) => number;
20
+ export declare function resolveHierarchySum(valueAccessor: string | ((d: Datum) => number)): (d: Datum) => number;
20
21
  /**
21
22
  * Create an edge style function for Sankey/Chord edge coloring.
22
23
  * Handles edgeColorBy = "source" | "target" | "gradient" | function.
23
24
  */
24
25
  export declare function createEdgeStyleFn({ edgeColorBy, colorBy, colorScale, nodeStyleFn, edgeOpacity, baseStyle, }: {
25
- edgeColorBy: "source" | "target" | "gradient" | ((d: any) => string);
26
+ edgeColorBy: "source" | "target" | "gradient" | ((d: Datum) => string);
26
27
  colorBy: Accessor<string> | undefined;
27
28
  colorScale: ((v: string) => string) | undefined;
28
- nodeStyleFn: (d: any, index?: number) => Record<string, any>;
29
+ nodeStyleFn: (d: any, index?: number) => Datum;
29
30
  edgeOpacity: number;
30
31
  baseStyle?: Record<string, string | number>;
31
- }): (d: Record<string, any>) => Record<string, any>;
32
+ }): (d: Datum) => Datum;
@@ -1,3 +1,4 @@
1
+ import type { Datum } from "./datumTypes";
1
2
  /**
2
3
  * Selection integration utilities for HOC charts.
3
4
  *
@@ -41,12 +42,12 @@ export declare function normalizeLinkedBrush(prop: string | {
41
42
  } | undefined): NormalizedLinkedBrush | null;
42
43
  export interface SelectionHookResult {
43
44
  isActive: boolean;
44
- predicate: (datum: Record<string, any>) => boolean;
45
+ predicate: (datum: Datum) => boolean;
45
46
  }
46
47
  export interface SelectionStyleConfig {
47
48
  unselectedOpacity?: number;
48
- unselectedStyle?: Record<string, any>;
49
- selectedStyle?: Record<string, any>;
49
+ unselectedStyle?: Datum;
50
+ selectedStyle?: Datum;
50
51
  }
51
52
  /**
52
53
  * Library fallback opacity for unselected (dimmed) elements.
@@ -65,4 +66,4 @@ export declare const DEFAULT_SELECTION_OPACITY = 0.5;
65
66
  * 1. `config.unselectedOpacity` (explicit, usually per-chart or theme-merged)
66
67
  * 2. `DEFAULT_SELECTION_OPACITY`
67
68
  */
68
- export declare function wrapStyleWithSelection(baseStyleFn: (d: Record<string, any>) => Record<string, any>, selectionHook: SelectionHookResult | null, config?: SelectionStyleConfig): (d: Record<string, any>) => Record<string, any>;
69
+ export declare function wrapStyleWithSelection(baseStyleFn: (d: Datum) => Datum, selectionHook: SelectionHookResult | null, config?: SelectionStyleConfig): (d: Datum) => Datum;
@@ -1,16 +1,4 @@
1
- /**
2
- * Statistical overlay processing for LineChart.
3
- *
4
- * Two modes:
5
- * **Auto mode** — provide `trainEnd` + optional `steps`/`confidence`.
6
- * The module computes regression, generates forecast points, and builds
7
- * annotations (envelope, anomaly band, boundary line).
8
- *
9
- * **Pre-computed mode** — provide field accessors (`isTraining`, `isForecast`,
10
- * `isAnomaly`, `upperBounds`, `lowerBounds`). The module reads segment/bounds
11
- * from the data and generates annotations without any statistical computation.
12
- * Use this when bounds come from an external ML model.
13
- */
1
+ import type { Datum } from "./datumTypes";
14
2
  export interface AnomalyConfig {
15
3
  /** Standard deviation multiplier for anomaly bounds. Default: 2 */
16
4
  threshold?: number;
@@ -39,15 +27,15 @@ export interface ForecastConfig {
39
27
  /** Confidence level for prediction interval (0-1). Default: 0.95 */
40
28
  confidence?: number;
41
29
  /** Field or function marking training data points */
42
- isTraining?: string | ((d: Record<string, any>) => boolean);
30
+ isTraining?: string | ((d: Datum) => boolean);
43
31
  /** Field or function marking forecast data points */
44
- isForecast?: string | ((d: Record<string, any>) => boolean);
32
+ isForecast?: string | ((d: Datum) => boolean);
45
33
  /** Field or function marking anomalous data points */
46
- isAnomaly?: string | ((d: Record<string, any>) => boolean);
34
+ isAnomaly?: string | ((d: Datum) => boolean);
47
35
  /** Field or function for upper envelope bound per data point */
48
- upperBounds?: string | ((d: Record<string, any>) => number);
36
+ upperBounds?: string | ((d: Datum) => number);
49
37
  /** Field or function for lower envelope bound per data point */
50
- lowerBounds?: string | ((d: Record<string, any>) => number);
38
+ lowerBounds?: string | ((d: Datum) => number);
51
39
  /** Color for forecast line and envelope. Default: "#6366f1" */
52
40
  color?: string;
53
41
  /** Envelope fill opacity. Default: 0.15 */
@@ -82,19 +70,19 @@ export interface ForecastConfig {
82
70
  * - `string`: fixed color (default: "#ef4444")
83
71
  * - `(datum) => string`: per-datum color function
84
72
  */
85
- anomalyColor?: string | ((datum: Record<string, any>) => string);
73
+ anomalyColor?: string | ((datum: Datum) => string);
86
74
  /**
87
75
  * Outlier dot radius.
88
76
  * - `number`: fixed radius (default: 6)
89
77
  * - `(datum) => number`: per-datum radius function (e.g. for count-based sizing)
90
78
  */
91
- anomalyRadius?: number | ((datum: Record<string, any>) => number);
79
+ anomalyRadius?: number | ((datum: Datum) => number);
92
80
  /**
93
81
  * Full style override for anomaly dots.
94
82
  * When provided as a function, receives the datum and should return a CSS style object.
95
83
  * Overrides `anomalyColor` when provided.
96
84
  */
97
- anomalyStyle?: Record<string, any> | ((datum: Record<string, any>) => Record<string, any>);
85
+ anomalyStyle?: Datum | ((datum: Datum) => Datum);
98
86
  /**
99
87
  * Internal: field name used to group data into separate lines (e.g. "metricLabel").
100
88
  * When set, boundary point duplication only bridges within the same group,
@@ -109,11 +97,11 @@ export interface ForecastConfig {
109
97
  /** Internal segment marker added to each datum */
110
98
  export declare const SEGMENT_FIELD: "__forecastSegment";
111
99
  export type SegmentType = "training" | "training-base" | "observed" | "forecast";
112
- export declare function buildAnomalyAnnotations(config: AnomalyConfig): Record<string, any>[];
100
+ export declare function buildAnomalyAnnotations(config: AnomalyConfig): Datum[];
113
101
  export interface ForecastResult {
114
- processedData: Record<string, any>[];
115
- annotations: Record<string, any>[];
102
+ processedData: Datum[];
103
+ annotations: Datum[];
116
104
  }
117
- export declare function buildForecast(data: Record<string, any>[], xAccessor: string, yAccessor: string, forecastConfig: ForecastConfig, anomalyConfig?: AnomalyConfig): ForecastResult;
105
+ export declare function buildForecast(data: Datum[], xAccessor: string, yAccessor: string, forecastConfig: ForecastConfig, anomalyConfig?: AnomalyConfig): ForecastResult;
118
106
  export { darkenColor, lightenColor } from "./colorManipulation";
119
- export declare function createSegmentLineStyle(baseStyle: (d: Record<string, any>) => Record<string, any>, forecastConfig: ForecastConfig): (d: Record<string, any>) => Record<string, any>;
107
+ export declare function createSegmentLineStyle(baseStyle: (d: Datum) => Datum, forecastConfig: ForecastConfig): (d: Datum) => Datum;