semiotic 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CLAUDE.md +227 -27
  2. package/README.md +43 -11
  3. package/ai/examples.md +358 -18
  4. package/ai/schema.json +64 -2
  5. package/ai/system-prompt.md +50 -12
  6. package/dist/components/Legend.d.ts +7 -1
  7. package/dist/components/charts/geo/ChoroplethMap.d.ts +53 -0
  8. package/dist/components/charts/geo/DistanceCartogram.d.ts +90 -0
  9. package/dist/components/charts/geo/FlowMap.d.ts +83 -0
  10. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +67 -0
  11. package/dist/components/charts/geo/index.d.ts +8 -0
  12. package/dist/components/charts/index.d.ts +2 -0
  13. package/dist/components/charts/network/ChordDiagram.d.ts +6 -5
  14. package/dist/components/charts/network/CirclePack.d.ts +2 -2
  15. package/dist/components/charts/network/ForceDirectedGraph.d.ts +9 -7
  16. package/dist/components/charts/network/OrbitDiagram.d.ts +21 -20
  17. package/dist/components/charts/network/SankeyDiagram.d.ts +6 -5
  18. package/dist/components/charts/network/TreeDiagram.d.ts +2 -2
  19. package/dist/components/charts/network/Treemap.d.ts +2 -2
  20. package/dist/components/charts/ordinal/BarChart.d.ts +7 -5
  21. package/dist/components/charts/ordinal/BoxPlot.d.ts +8 -6
  22. package/dist/components/charts/ordinal/DonutChart.d.ts +8 -6
  23. package/dist/components/charts/ordinal/DotPlot.d.ts +8 -6
  24. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +7 -5
  25. package/dist/components/charts/ordinal/Histogram.d.ts +8 -5
  26. package/dist/components/charts/ordinal/PieChart.d.ts +8 -6
  27. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +2 -0
  28. package/dist/components/charts/ordinal/StackedBarChart.d.ts +7 -5
  29. package/dist/components/charts/ordinal/SwarmPlot.d.ts +8 -6
  30. package/dist/components/charts/ordinal/ViolinPlot.d.ts +8 -5
  31. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +24 -6
  32. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +28 -7
  33. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +23 -5
  34. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +24 -6
  35. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +23 -5
  36. package/dist/components/charts/shared/colorUtils.d.ts +5 -0
  37. package/dist/components/charts/shared/hooks.d.ts +13 -1
  38. package/dist/components/charts/shared/legendUtils.d.ts +2 -3
  39. package/dist/components/charts/shared/statisticalOverlays.d.ts +1 -2
  40. package/dist/components/charts/shared/statisticalOverlaysLazy.d.ts +10 -0
  41. package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
  42. package/dist/components/charts/shared/types.d.ts +10 -4
  43. package/dist/components/charts/shared/useChartSetup.d.ts +112 -0
  44. package/dist/components/charts/shared/useStreamingLegend.d.ts +65 -0
  45. package/dist/components/charts/xy/AreaChart.d.ts +11 -6
  46. package/dist/components/charts/xy/BubbleChart.d.ts +11 -6
  47. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +7 -6
  48. package/dist/components/charts/xy/Heatmap.d.ts +16 -5
  49. package/dist/components/charts/xy/LineChart.d.ts +21 -5
  50. package/dist/components/charts/xy/MinimapChart.d.ts +3 -0
  51. package/dist/components/charts/xy/QuadrantChart.d.ts +120 -0
  52. package/dist/components/charts/xy/Scatterplot.d.ts +9 -6
  53. package/dist/components/charts/xy/StackedAreaChart.d.ts +11 -6
  54. package/dist/components/geo/mergeData.d.ts +18 -0
  55. package/dist/components/geo/referenceGeography.d.ts +10 -0
  56. package/dist/components/geo/useReferenceAreas.d.ts +13 -0
  57. package/dist/components/realtime/RingBuffer.d.ts +1 -0
  58. package/dist/components/realtime/types.d.ts +17 -0
  59. package/dist/components/semiotic-data.d.ts +1 -0
  60. package/dist/components/semiotic-geo.d.ts +16 -0
  61. package/dist/components/semiotic-server.d.ts +1 -1
  62. package/dist/components/semiotic-xy.d.ts +1 -0
  63. package/dist/components/semiotic.d.ts +4 -4
  64. package/dist/components/server/renderToStaticSVG.d.ts +4 -2
  65. package/dist/components/stream/AccessibleDataTable.d.ts +50 -0
  66. package/dist/components/stream/CanvasHitTester.d.ts +8 -2
  67. package/dist/components/stream/DataSourceAdapter.d.ts +33 -4
  68. package/dist/components/stream/GeoCanvasHitTester.d.ts +19 -0
  69. package/dist/components/stream/GeoParticlePool.d.ts +46 -0
  70. package/dist/components/stream/GeoPipelineStore.d.ts +81 -0
  71. package/dist/components/stream/GeoTileRenderer.d.ts +31 -0
  72. package/dist/components/stream/NetworkPipelineStore.d.ts +16 -4
  73. package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -1
  74. package/dist/components/stream/OrdinalPipelineStore.d.ts +8 -4
  75. package/dist/components/stream/OrdinalSVGOverlay.d.ts +23 -1
  76. package/dist/components/stream/PipelineStore.d.ts +57 -5
  77. package/dist/components/stream/SVGOverlay.d.ts +28 -1
  78. package/dist/components/stream/SceneGraph.d.ts +7 -3
  79. package/dist/components/stream/SceneToSVG.d.ts +2 -0
  80. package/dist/components/stream/StreamGeoFrame.d.ts +4 -0
  81. package/dist/components/stream/accessorUtils.d.ts +1 -0
  82. package/dist/components/stream/canvasSetup.d.ts +26 -0
  83. package/dist/components/stream/geoTypes.d.ts +186 -0
  84. package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +0 -7
  85. package/dist/components/stream/layouts/index.d.ts +2 -1
  86. package/dist/components/stream/layouts/orbitLayoutPlugin.d.ts +2 -0
  87. package/dist/components/stream/legendRenderer.d.ts +33 -0
  88. package/dist/components/stream/networkTypes.d.ts +49 -1
  89. package/dist/components/stream/ordinalTypes.d.ts +10 -0
  90. package/dist/components/stream/pipelineTransitionUtils.d.ts +42 -0
  91. package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +9 -0
  92. package/dist/components/stream/renderers/heatmapCanvasRenderer.d.ts +2 -1
  93. package/dist/components/stream/renderers/lineCanvasRenderer.d.ts +1 -0
  94. package/dist/components/stream/renderers/renderPulse.d.ts +50 -0
  95. package/dist/components/stream/types.d.ts +77 -3
  96. package/dist/components/types/legendTypes.d.ts +27 -3
  97. package/dist/geo.min.js +1 -0
  98. package/dist/geo.module.min.js +1 -0
  99. package/dist/network.min.js +1 -1
  100. package/dist/network.module.min.js +1 -1
  101. package/dist/ordinal.min.js +1 -1
  102. package/dist/ordinal.module.min.js +1 -1
  103. package/dist/realtime.min.js +1 -1
  104. package/dist/realtime.module.min.js +1 -1
  105. package/dist/semiotic-ai.min.js +1 -1
  106. package/dist/semiotic-ai.module.min.js +1 -1
  107. package/dist/semiotic-data.d.ts +1 -0
  108. package/dist/semiotic-data.min.js +1 -1
  109. package/dist/semiotic-data.module.min.js +1 -1
  110. package/dist/semiotic-geo.d.ts +16 -0
  111. package/dist/semiotic-server.d.ts +1 -1
  112. package/dist/semiotic-xy.d.ts +1 -0
  113. package/dist/semiotic.d.ts +4 -4
  114. package/dist/semiotic.min.js +1 -1
  115. package/dist/semiotic.module.min.js +1 -1
  116. package/dist/server.min.js +1 -1
  117. package/dist/server.module.min.js +1 -1
  118. package/dist/test-utils/canvasMock.d.ts +3 -0
  119. package/dist/xy.min.js +1 -1
  120. package/dist/xy.module.min.js +1 -1
  121. package/package.json +29 -7
  122. package/dist/test/canvasMock.d.ts +0 -2
@@ -1,9 +1,11 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
+ import type { LegendPosition } from "../shared/hooks";
3
4
  import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
+ import type { RealtimeFrameHandle } from "../../realtime/types";
5
7
  export interface HistogramProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
6
- data: TDatum[];
8
+ data?: TDatum[];
7
9
  categoryAccessor?: ChartAccessor<TDatum, string>;
8
10
  valueAccessor?: ChartAccessor<TDatum, number>;
9
11
  bins?: number;
@@ -17,11 +19,12 @@ export interface HistogramProps<TDatum extends Record<string, any> = Record<stri
17
19
  enableHover?: boolean;
18
20
  showGrid?: boolean;
19
21
  showLegend?: boolean;
22
+ legendPosition?: LegendPosition;
20
23
  tooltip?: TooltipProp;
21
24
  annotations?: Record<string, any>[];
22
25
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
23
26
  }
24
- export declare function Histogram<TDatum extends Record<string, any> = Record<string, any>>(props: HistogramProps<TDatum>): React.JSX.Element;
25
- export declare namespace Histogram {
26
- var displayName: string;
27
- }
27
+ export declare const Histogram: {
28
+ <TDatum extends Record<string, any> = Record<string, any>>(props: HistogramProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
29
+ displayName?: string;
30
+ };
@@ -1,10 +1,11 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
- import type { LegendInteractionMode } from "../shared/hooks";
3
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
4
  import type { BaseChartProps, ChartAccessor } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
+ import type { RealtimeFrameHandle } from "../../realtime/types";
6
7
  export interface PieChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
7
- data: TDatum[];
8
+ data?: TDatum[];
8
9
  categoryAccessor?: ChartAccessor<TDatum, string>;
9
10
  valueAccessor?: ChartAccessor<TDatum, number>;
10
11
  colorBy?: ChartAccessor<TDatum, string>;
@@ -14,11 +15,12 @@ export interface PieChartProps<TDatum extends Record<string, any> = Record<strin
14
15
  enableHover?: boolean;
15
16
  showLegend?: boolean;
16
17
  legendInteraction?: LegendInteractionMode;
18
+ legendPosition?: LegendPosition;
17
19
  tooltip?: TooltipProp;
18
20
  annotations?: Record<string, any>[];
19
21
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
20
22
  }
21
- export declare function PieChart<TDatum extends Record<string, any> = Record<string, any>>(props: PieChartProps<TDatum>): React.JSX.Element;
22
- export declare namespace PieChart {
23
- var displayName: string;
24
- }
23
+ export declare const PieChart: {
24
+ <TDatum extends Record<string, any> = Record<string, any>>(props: PieChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
25
+ displayName?: string;
26
+ };
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
+ import type { LegendPosition } from "../shared/hooks";
3
4
  import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
5
6
  export interface RidgelinePlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -19,6 +20,7 @@ export interface RidgelinePlotProps<TDatum extends Record<string, any> = Record<
19
20
  enableHover?: boolean;
20
21
  showGrid?: boolean;
21
22
  showLegend?: boolean;
23
+ legendPosition?: LegendPosition;
22
24
  tooltip?: TooltipProp;
23
25
  annotations?: Record<string, any>[];
24
26
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
@@ -3,8 +3,9 @@ import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode } from "../shared/hooks";
4
4
  import type { BaseChartProps, ChartAccessor } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
+ import type { RealtimeFrameHandle } from "../../realtime/types";
6
7
  export interface StackedBarChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
7
- data: TDatum[];
8
+ data?: TDatum[];
8
9
  categoryAccessor?: ChartAccessor<TDatum, string>;
9
10
  stackBy: ChartAccessor<TDatum, string>;
10
11
  valueAccessor?: ChartAccessor<TDatum, number>;
@@ -20,11 +21,12 @@ export interface StackedBarChartProps<TDatum extends Record<string, any> = Recor
20
21
  showGrid?: boolean;
21
22
  showLegend?: boolean;
22
23
  legendInteraction?: LegendInteractionMode;
24
+ legendPosition?: "right" | "left" | "top" | "bottom";
23
25
  tooltip?: TooltipProp;
24
26
  annotations?: Record<string, any>[];
25
27
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
26
28
  }
27
- export declare function StackedBarChart<TDatum extends Record<string, any> = Record<string, any>>(props: StackedBarChartProps<TDatum>): React.JSX.Element;
28
- export declare namespace StackedBarChart {
29
- var displayName: string;
30
- }
29
+ export declare const StackedBarChart: {
30
+ <TDatum extends Record<string, any> = Record<string, any>>(props: StackedBarChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
31
+ displayName?: string;
32
+ };
@@ -1,10 +1,11 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
- import type { LegendInteractionMode } from "../shared/hooks";
3
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
4
  import type { BaseChartProps, ChartAccessor } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
+ import type { RealtimeFrameHandle } from "../../realtime/types";
6
7
  export interface SwarmPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
7
- data: TDatum[];
8
+ data?: TDatum[];
8
9
  categoryAccessor?: ChartAccessor<TDatum, string>;
9
10
  valueAccessor?: ChartAccessor<TDatum, number>;
10
11
  orientation?: "vertical" | "horizontal";
@@ -22,11 +23,12 @@ export interface SwarmPlotProps<TDatum extends Record<string, any> = Record<stri
22
23
  showGrid?: boolean;
23
24
  showLegend?: boolean;
24
25
  legendInteraction?: LegendInteractionMode;
26
+ legendPosition?: LegendPosition;
25
27
  tooltip?: TooltipProp;
26
28
  annotations?: Record<string, any>[];
27
29
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
28
30
  }
29
- export declare function SwarmPlot<TDatum extends Record<string, any> = Record<string, any>>(props: SwarmPlotProps<TDatum>): React.JSX.Element;
30
- export declare namespace SwarmPlot {
31
- var displayName: string;
32
- }
31
+ export declare const SwarmPlot: {
32
+ <TDatum extends Record<string, any> = Record<string, any>>(props: SwarmPlotProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
33
+ displayName?: string;
34
+ };
@@ -1,9 +1,11 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
+ import type { LegendPosition } from "../shared/hooks";
3
4
  import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
+ import type { RealtimeFrameHandle } from "../../realtime/types";
5
7
  export interface ViolinPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
6
- data: TDatum[];
8
+ data?: TDatum[];
7
9
  categoryAccessor?: ChartAccessor<TDatum, string>;
8
10
  valueAccessor?: ChartAccessor<TDatum, number>;
9
11
  orientation?: "vertical" | "horizontal";
@@ -19,11 +21,12 @@ export interface ViolinPlotProps<TDatum extends Record<string, any> = Record<str
19
21
  enableHover?: boolean;
20
22
  showGrid?: boolean;
21
23
  showLegend?: boolean;
24
+ legendPosition?: LegendPosition;
22
25
  tooltip?: TooltipProp;
23
26
  annotations?: Record<string, any>[];
24
27
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
25
28
  }
26
- export declare function ViolinPlot<TDatum extends Record<string, any> = Record<string, any>>(props: ViolinPlotProps<TDatum>): React.JSX.Element;
27
- export declare namespace ViolinPlot {
28
- var displayName: string;
29
- }
29
+ export declare const ViolinPlot: {
30
+ <TDatum extends Record<string, any> = Record<string, any>>(props: ViolinPlotProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
31
+ displayName?: string;
32
+ };
@@ -2,9 +2,10 @@ import * as React from "react";
2
2
  import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext, DecayConfig, PulseConfig, StalenessConfig } from "../../stream/types";
3
3
  import type { RealtimeFrameHandle } from "../../realtime/types";
4
4
  import type { ReactNode } from "react";
5
- import type { ChartMode } from "../shared/types";
5
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
+ import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
6
7
  import type { OnObservationCallback } from "../../store/ObservationStore";
7
- export interface RealtimeHeatmapProps {
8
+ export interface RealtimeHeatmapProps<TDatum extends Record<string, any> = Record<string, any>> {
8
9
  /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
9
10
  mode?: ChartMode;
10
11
  /** Chart dimensions as [width, height] */
@@ -33,11 +34,11 @@ export interface RealtimeHeatmapProps {
33
34
  /** Controlled data array */
34
35
  data?: Record<string, any>[];
35
36
  /** Time/x value accessor */
36
- timeAccessor?: string | ((d: Record<string, any>) => number);
37
+ timeAccessor?: ChartAccessor<TDatum, number>;
37
38
  /** Value/y accessor */
38
- valueAccessor?: string | ((d: Record<string, any>) => number);
39
+ valueAccessor?: ChartAccessor<TDatum, number>;
39
40
  /** Category accessor for colored cells */
40
- categoryAccessor?: string | ((d: Record<string, any>) => string);
41
+ categoryAccessor?: ChartAccessor<TDatum, string>;
41
42
  /** Fixed time domain */
42
43
  timeExtent?: [number, number];
43
44
  /** Fixed value domain */
@@ -81,6 +82,20 @@ export interface RealtimeHeatmapProps {
81
82
  name?: string;
82
83
  fields: string[];
83
84
  };
85
+ /** Consume a named selection — dims unselected elements */
86
+ selection?: SelectionConfig;
87
+ /** Show a loading skeleton placeholder */
88
+ loading?: boolean;
89
+ /** Custom content to render when data is empty. Set to `false` to disable empty state. */
90
+ emptyContent?: ReactNode | false;
91
+ /** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
92
+ emphasis?: "primary" | "secondary";
93
+ /** Show a legend */
94
+ showLegend?: boolean;
95
+ /** Legend position */
96
+ legendPosition?: LegendPosition;
97
+ /** Legend interaction mode */
98
+ legendInteraction?: LegendInteractionMode;
84
99
  }
85
100
  /**
86
101
  * RealtimeHeatmap - Streaming heatmap with 2D grid binning.
@@ -103,4 +118,7 @@ export interface RealtimeHeatmapProps {
103
118
  * />
104
119
  * ```
105
120
  */
106
- export declare const RealtimeHeatmap: React.ForwardRefExoticComponent<RealtimeHeatmapProps & React.RefAttributes<RealtimeFrameHandle>>;
121
+ export declare const RealtimeHeatmap: {
122
+ <TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeHeatmapProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
123
+ displayName?: string;
124
+ };
@@ -2,9 +2,10 @@ import * as React from "react";
2
2
  import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext, DecayConfig, PulseConfig, StalenessConfig, TransitionConfig } from "../../stream/types";
3
3
  import type { RealtimeFrameHandle } from "../../realtime/types";
4
4
  import type { ReactNode } from "react";
5
- import type { ChartMode } from "../shared/types";
5
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
+ import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
6
7
  import type { OnObservationCallback } from "../../store/ObservationStore";
7
- export interface RealtimeTemporalHistogramProps {
8
+ export interface RealtimeTemporalHistogramProps<TDatum extends Record<string, any> = Record<string, any>> {
8
9
  /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
9
10
  mode?: ChartMode;
10
11
  /** Time interval for binning */
@@ -35,9 +36,9 @@ export interface RealtimeTemporalHistogramProps {
35
36
  /** Controlled data array */
36
37
  data?: Record<string, any>[];
37
38
  /** Time value accessor */
38
- timeAccessor?: string | ((d: Record<string, any>) => number);
39
+ timeAccessor?: ChartAccessor<TDatum, number>;
39
40
  /** Value accessor */
40
- valueAccessor?: string | ((d: Record<string, any>) => number);
41
+ valueAccessor?: ChartAccessor<TDatum, number>;
41
42
  /** Fixed time domain */
42
43
  timeExtent?: [number, number];
43
44
  /** Fixed value domain */
@@ -48,7 +49,7 @@ export interface RealtimeTemporalHistogramProps {
48
49
  * Category accessor for stacked bars.
49
50
  * When provided, bars are stacked by category within each bin.
50
51
  */
51
- categoryAccessor?: string | ((d: Record<string, any>) => string);
52
+ categoryAccessor?: ChartAccessor<TDatum, string>;
52
53
  /**
53
54
  * Category-to-color map for stacked bars.
54
55
  * Keys also determine stack order (listed keys first, then alphabetical).
@@ -87,6 +88,8 @@ export interface RealtimeTemporalHistogramProps {
87
88
  name?: string;
88
89
  fields: string[];
89
90
  };
91
+ /** Consume a named selection — dims unselected elements */
92
+ selection?: SelectionConfig;
90
93
  /** Configurable opacity decay for older data */
91
94
  decay?: DecayConfig;
92
95
  /** Flash effect on newly inserted data */
@@ -95,6 +98,18 @@ export interface RealtimeTemporalHistogramProps {
95
98
  staleness?: StalenessConfig;
96
99
  /** Smooth position interpolation on data change */
97
100
  transition?: TransitionConfig;
101
+ /** Show a loading skeleton placeholder */
102
+ loading?: boolean;
103
+ /** Custom content to render when data is empty. Set to `false` to disable empty state. */
104
+ emptyContent?: ReactNode | false;
105
+ /** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
106
+ emphasis?: "primary" | "secondary";
107
+ /** Show a legend */
108
+ showLegend?: boolean;
109
+ /** Legend position */
110
+ legendPosition?: LegendPosition;
111
+ /** Legend interaction mode */
112
+ legendInteraction?: LegendInteractionMode;
98
113
  }
99
114
  /**
100
115
  * RealtimeTemporalHistogram - Streaming temporal histogram.
@@ -126,8 +141,14 @@ export interface RealtimeTemporalHistogramProps {
126
141
  * />
127
142
  * ```
128
143
  */
129
- export declare const RealtimeTemporalHistogram: React.ForwardRefExoticComponent<RealtimeTemporalHistogramProps & React.RefAttributes<RealtimeFrameHandle>>;
144
+ export declare const RealtimeTemporalHistogram: {
145
+ <TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeTemporalHistogramProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
146
+ displayName?: string;
147
+ };
130
148
  /** @deprecated Use RealtimeTemporalHistogram instead */
131
- export declare const RealtimeHistogram: React.ForwardRefExoticComponent<RealtimeTemporalHistogramProps & React.RefAttributes<RealtimeFrameHandle>>;
149
+ export declare const RealtimeHistogram: {
150
+ <TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeTemporalHistogramProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
151
+ displayName?: string;
152
+ };
132
153
  /** @deprecated Use RealtimeTemporalHistogramProps instead */
133
154
  export type RealtimeHistogramProps = RealtimeTemporalHistogramProps;
@@ -2,9 +2,10 @@ import * as React from "react";
2
2
  import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext, DecayConfig, PulseConfig, StalenessConfig, TransitionConfig } from "../../stream/types";
3
3
  import type { RealtimeFrameHandle } from "../../realtime/types";
4
4
  import type { ReactNode } from "react";
5
- import type { ChartMode } from "../shared/types";
5
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
+ import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
6
7
  import type { OnObservationCallback } from "../../store/ObservationStore";
7
- export interface RealtimeLineChartProps {
8
+ export interface RealtimeLineChartProps<TDatum extends Record<string, any> = Record<string, any>> {
8
9
  /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
9
10
  mode?: ChartMode;
10
11
  /** Chart dimensions as [width, height] */
@@ -33,9 +34,9 @@ export interface RealtimeLineChartProps {
33
34
  /** Controlled data array */
34
35
  data?: Record<string, any>[];
35
36
  /** Time value accessor */
36
- timeAccessor?: string | ((d: Record<string, any>) => number);
37
+ timeAccessor?: ChartAccessor<TDatum, number>;
37
38
  /** Value accessor */
38
- valueAccessor?: string | ((d: Record<string, any>) => number);
39
+ valueAccessor?: ChartAccessor<TDatum, number>;
39
40
  /** Fixed time domain */
40
41
  timeExtent?: [number, number];
41
42
  /** Fixed value domain */
@@ -81,6 +82,20 @@ export interface RealtimeLineChartProps {
81
82
  name?: string;
82
83
  fields: string[];
83
84
  };
85
+ /** Consume a named selection — dims unselected elements */
86
+ selection?: SelectionConfig;
87
+ /** Show a loading skeleton placeholder */
88
+ loading?: boolean;
89
+ /** Custom content to render when data is empty. Set to `false` to disable empty state. */
90
+ emptyContent?: ReactNode | false;
91
+ /** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
92
+ emphasis?: "primary" | "secondary";
93
+ /** Show a legend */
94
+ showLegend?: boolean;
95
+ /** Legend position */
96
+ legendPosition?: LegendPosition;
97
+ /** Legend interaction mode */
98
+ legendInteraction?: LegendInteractionMode;
84
99
  }
85
100
  /**
86
101
  * RealtimeLineChart - Simplified wrapper for streaming line charts.
@@ -101,4 +116,7 @@ export interface RealtimeLineChartProps {
101
116
  * />
102
117
  * ```
103
118
  */
104
- export declare const RealtimeLineChart: React.ForwardRefExoticComponent<RealtimeLineChartProps & React.RefAttributes<RealtimeFrameHandle>>;
119
+ export declare const RealtimeLineChart: {
120
+ <TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeLineChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
121
+ displayName?: string;
122
+ };
@@ -2,9 +2,10 @@ import * as React from "react";
2
2
  import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext } from "../../stream/types";
3
3
  import type { RealtimeFrameHandle } from "../../realtime/types";
4
4
  import type { ReactNode } from "react";
5
- import type { ChartMode } from "../shared/types";
5
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
+ import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
6
7
  import type { OnObservationCallback } from "../../store/ObservationStore";
7
- export interface RealtimeSwarmChartProps {
8
+ export interface RealtimeSwarmChartProps<TDatum extends Record<string, any> = Record<string, any>> {
8
9
  /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
9
10
  mode?: ChartMode;
10
11
  /** Chart dimensions as [width, height] */
@@ -33,9 +34,9 @@ export interface RealtimeSwarmChartProps {
33
34
  /** Controlled data array */
34
35
  data?: Record<string, any>[];
35
36
  /** Time value accessor */
36
- timeAccessor?: string | ((d: Record<string, any>) => number);
37
+ timeAccessor?: ChartAccessor<TDatum, number>;
37
38
  /** Value accessor */
38
- valueAccessor?: string | ((d: Record<string, any>) => number);
39
+ valueAccessor?: ChartAccessor<TDatum, number>;
39
40
  /** Fixed time domain */
40
41
  timeExtent?: [number, number];
41
42
  /** Fixed value domain */
@@ -43,7 +44,7 @@ export interface RealtimeSwarmChartProps {
43
44
  /** Extent padding factor */
44
45
  extentPadding?: number;
45
46
  /** Category accessor for color-coding dots */
46
- categoryAccessor?: string | ((d: Record<string, any>) => string);
47
+ categoryAccessor?: ChartAccessor<TDatum, string>;
47
48
  /** Category-to-color map */
48
49
  colors?: Record<string, string>;
49
50
  /** Dot radius */
@@ -81,6 +82,20 @@ export interface RealtimeSwarmChartProps {
81
82
  name?: string;
82
83
  fields: string[];
83
84
  };
85
+ /** Consume a named selection — dims unselected elements */
86
+ selection?: SelectionConfig;
87
+ /** Show a loading skeleton placeholder */
88
+ loading?: boolean;
89
+ /** Custom content to render when data is empty. Set to `false` to disable empty state. */
90
+ emptyContent?: ReactNode | false;
91
+ /** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
92
+ emphasis?: "primary" | "secondary";
93
+ /** Show a legend */
94
+ showLegend?: boolean;
95
+ /** Legend position */
96
+ legendPosition?: LegendPosition;
97
+ /** Legend interaction mode */
98
+ legendInteraction?: LegendInteractionMode;
84
99
  }
85
100
  /**
86
101
  * RealtimeSwarmChart - Simplified wrapper for streaming dot/swarm charts.
@@ -103,4 +118,7 @@ export interface RealtimeSwarmChartProps {
103
118
  * />
104
119
  * ```
105
120
  */
106
- export declare const RealtimeSwarmChart: React.ForwardRefExoticComponent<RealtimeSwarmChartProps & React.RefAttributes<RealtimeFrameHandle>>;
121
+ export declare const RealtimeSwarmChart: {
122
+ <TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeSwarmChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
123
+ displayName?: string;
124
+ };
@@ -2,9 +2,10 @@ import * as React from "react";
2
2
  import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext } from "../../stream/types";
3
3
  import type { RealtimeFrameHandle } from "../../realtime/types";
4
4
  import type { ReactNode } from "react";
5
- import type { ChartMode } from "../shared/types";
5
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
+ import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
6
7
  import type { OnObservationCallback } from "../../store/ObservationStore";
7
- export interface RealtimeWaterfallChartProps {
8
+ export interface RealtimeWaterfallChartProps<TDatum extends Record<string, any> = Record<string, any>> {
8
9
  /** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
9
10
  mode?: ChartMode;
10
11
  /** Chart dimensions as [width, height] */
@@ -33,9 +34,9 @@ export interface RealtimeWaterfallChartProps {
33
34
  /** Controlled data array */
34
35
  data?: Record<string, any>[];
35
36
  /** Time value accessor */
36
- timeAccessor?: string | ((d: Record<string, any>) => number);
37
+ timeAccessor?: ChartAccessor<TDatum, number>;
37
38
  /** Value accessor (positive = gain, negative = loss) */
38
- valueAccessor?: string | ((d: Record<string, any>) => number);
39
+ valueAccessor?: ChartAccessor<TDatum, number>;
39
40
  /** Fixed time domain */
40
41
  timeExtent?: [number, number];
41
42
  /** Fixed value domain */
@@ -81,6 +82,20 @@ export interface RealtimeWaterfallChartProps {
81
82
  name?: string;
82
83
  fields: string[];
83
84
  };
85
+ /** Consume a named selection — dims unselected elements */
86
+ selection?: SelectionConfig;
87
+ /** Show a loading skeleton placeholder */
88
+ loading?: boolean;
89
+ /** Custom content to render when data is empty. Set to `false` to disable empty state. */
90
+ emptyContent?: ReactNode | false;
91
+ /** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
92
+ emphasis?: "primary" | "secondary";
93
+ /** Show a legend */
94
+ showLegend?: boolean;
95
+ /** Legend position */
96
+ legendPosition?: LegendPosition;
97
+ /** Legend interaction mode */
98
+ legendInteraction?: LegendInteractionMode;
84
99
  }
85
100
  /**
86
101
  * RealtimeWaterfallChart - Simplified wrapper for streaming waterfall charts.
@@ -100,4 +115,7 @@ export interface RealtimeWaterfallChartProps {
100
115
  * />
101
116
  * ```
102
117
  */
103
- export declare const RealtimeWaterfallChart: React.ForwardRefExoticComponent<RealtimeWaterfallChartProps & React.RefAttributes<RealtimeFrameHandle>>;
118
+ export declare const RealtimeWaterfallChart: {
119
+ <TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeWaterfallChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
120
+ displayName?: string;
121
+ };
@@ -22,6 +22,11 @@ export declare const DEFAULT_COLORS: readonly string[];
22
22
  * Pastel palette for depth-based hierarchy coloring (Treemap, CirclePack, TreeDiagram).
23
23
  * Index corresponds to hierarchy depth, wraps via modulo.
24
24
  */
25
+ /**
26
+ * Default streaming palette — used by PipelineStore, OrdinalPipelineStore,
27
+ * and useStreamingLegend for consistent colors when no colorScheme is specified.
28
+ */
29
+ export declare const STREAMING_PALETTE: string[];
25
30
  export declare const DEPTH_PALETTE_COLORS: string[];
26
31
  /**
27
32
  * Gets a color for a data point based on the colorBy configuration
@@ -3,6 +3,7 @@ import type { SelectionHookResult } from "./selectionUtils";
3
3
  import type { OnObservationCallback } from "../../store/ObservationStore";
4
4
  import type { Accessor, SelectionConfig, LinkedHoverProp, ChartMode } from "./types";
5
5
  import type { MarginType } from "../../types/generalTypes";
6
+ import type { TransitionConfig } from "../../stream/types";
6
7
  /**
7
8
  * Default fill color used when no colorBy is specified
8
9
  */
@@ -48,11 +49,13 @@ export declare function useChartSelection({ selection, linkedHover, fallbackFiel
48
49
  * Consolidates the shouldShowLegend / createLegend / margin merge / right-margin
49
50
  * expansion pattern that every chart with color encoding repeats.
50
51
  */
51
- export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, userMargin, defaults, }: {
52
+ export type LegendPosition = "right" | "left" | "top" | "bottom";
53
+ export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, legendPosition, userMargin, defaults, }: {
52
54
  data: Array<Record<string, any>>;
53
55
  colorBy: Accessor<string> | undefined;
54
56
  colorScale: ((v: string) => string) | undefined;
55
57
  showLegend: boolean | undefined;
58
+ legendPosition?: LegendPosition;
56
59
  userMargin: MarginType | undefined;
57
60
  defaults?: {
58
61
  top: number;
@@ -68,6 +71,7 @@ export declare function useChartLegendAndMargin({ data, colorBy, colorScale, sho
68
71
  left: number;
69
72
  right: number;
70
73
  };
74
+ legendPosition: LegendPosition;
71
75
  };
72
76
  export type LegendInteractionMode = "highlight" | "isolate" | "none";
73
77
  export interface LegendInteractionState {
@@ -134,4 +138,12 @@ export declare function useChartMode(mode: ChartMode | undefined, userProps: Cha
134
138
  width?: number;
135
139
  height?: number;
136
140
  }): ChartModeResult;
141
+ /**
142
+ * Resolve the `animate` prop into a `TransitionConfig` for Stream Frames.
143
+ * Returns undefined when animate is falsy (no transition).
144
+ */
145
+ export declare function resolveAnimateConfig(animate: boolean | {
146
+ duration?: number;
147
+ easing?: "linear" | "ease-out";
148
+ } | undefined): TransitionConfig | undefined;
137
149
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { Accessor } from "./types";
2
+ import type { LegendItem } from "../../types/legendTypes";
2
3
  /**
3
4
  * Create a legend configuration for HOC components
4
5
  *
@@ -19,9 +20,7 @@ export declare function createLegend({ data, colorBy, colorScale, getColor, stro
19
20
  strokeWidth?: number;
20
21
  }): {
21
22
  legendGroups: {
22
- styleFn: (d: {
23
- color: string;
24
- }) => Record<string, string | number>;
23
+ styleFn: (d: LegendItem) => Record<string, string | number>;
25
24
  type: "fill";
26
25
  items: {
27
26
  label: string;
@@ -67,10 +67,9 @@ export interface ForecastConfig {
67
67
  export declare const SEGMENT_FIELD: "__forecastSegment";
68
68
  export type SegmentType = "training" | "observed" | "forecast";
69
69
  export declare function buildAnomalyAnnotations(config: AnomalyConfig): Record<string, any>[];
70
- interface ForecastResult {
70
+ export interface ForecastResult {
71
71
  processedData: Record<string, any>[];
72
72
  annotations: Record<string, any>[];
73
73
  }
74
74
  export declare function buildForecast(data: Record<string, any>[], xAccessor: string, yAccessor: string, forecastConfig: ForecastConfig, anomalyConfig?: AnomalyConfig): ForecastResult;
75
75
  export declare function createSegmentLineStyle(baseStyle: (d: Record<string, any>) => Record<string, any>, forecastConfig: ForecastConfig): (d: Record<string, any>) => Record<string, any>;
76
- export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Lazy-loaded wrapper for statistical overlays.
3
+ * Only loads the LOESS/forecast logic when forecast or anomaly props are actually used.
4
+ */
5
+ export type { ForecastResult } from "./statisticalOverlays";
6
+ /** Duplicated here to avoid pulling in the heavy statisticalOverlays module at import time */
7
+ export declare const SEGMENT_FIELD: "__forecastSegment";
8
+ export declare function buildForecastLazy(...args: Parameters<typeof import("./statisticalOverlays")["buildForecast"]>): Promise<import("./statisticalOverlays").ForecastResult>;
9
+ export declare function buildAnomalyAnnotationsLazy(...args: Parameters<typeof import("./statisticalOverlays")["buildAnomalyAnnotations"]>): Promise<Record<string, any>[]>;
10
+ export declare function createSegmentLineStyleLazy(...args: Parameters<typeof import("./statisticalOverlays")["createSegmentLineStyle"]>): Promise<(d: Record<string, any>) => Record<string, any>>;
@@ -3,7 +3,7 @@ import type { HoverData } from "../../realtime/types";
3
3
  export interface TooltipFieldConfig {
4
4
  label: string;
5
5
  accessor: string | ((d: any) => any);
6
- role?: "x" | "y" | "color" | "size" | "group" | "value";
6
+ role?: "title" | "x" | "y" | "color" | "size" | "group" | "value";
7
7
  }
8
8
  /**
9
9
  * Extract a display name from an accessor.
@@ -75,6 +75,12 @@ export interface BaseChartProps {
75
75
  emptyContent?: React.ReactNode | false;
76
76
  /** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
77
77
  emphasis?: "primary" | "secondary";
78
+ /** Enable declarative bounded animation (enter/exit/update transitions).
79
+ * `true` uses defaults (300ms ease-out). Object form allows customization. */
80
+ animate?: boolean | {
81
+ duration?: number;
82
+ easing?: "linear" | "ease-out";
83
+ };
78
84
  }
79
85
  /**
80
86
  * Axis configuration props
@@ -103,9 +109,9 @@ export type ChartAccessor<TDatum, T> = (keyof TDatum & string) | ((d: Record<str
103
109
  /**
104
110
  * Color configuration
105
111
  */
106
- export interface ColorConfig {
112
+ export interface ColorConfig<TDatum = Record<string, any>> {
107
113
  /** Field name or function to determine color */
108
- colorBy?: Accessor<string>;
114
+ colorBy?: ChartAccessor<TDatum, string>;
109
115
  /** Color scheme name (e.g., "blues", "category10") */
110
116
  colorScheme?: string;
111
117
  /** Custom color palette */
@@ -114,9 +120,9 @@ export interface ColorConfig {
114
120
  /**
115
121
  * Size configuration
116
122
  */
117
- export interface SizeConfig {
123
+ export interface SizeConfig<TDatum = Record<string, any>> {
118
124
  /** Field name or function to determine size */
119
- sizeBy?: Accessor<number>;
125
+ sizeBy?: ChartAccessor<TDatum, number>;
120
126
  /** Min and max size range */
121
127
  sizeRange?: [number, number];
122
128
  }