semiotic 3.2.0 → 3.2.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 (107) hide show
  1. package/CLAUDE.md +50 -8
  2. package/README.md +11 -11
  3. package/ai/examples.md +91 -0
  4. package/ai/schema.json +223 -9
  5. package/ai/system-prompt.md +12 -4
  6. package/dist/components/ChartContainer.d.ts +2 -0
  7. package/dist/components/DataSummaryContext.d.ts +12 -0
  8. package/dist/components/Tooltip/FlippingTooltip.d.ts +34 -0
  9. package/dist/components/charts/index.d.ts +4 -0
  10. package/dist/components/charts/ordinal/BarChart.d.ts +3 -1
  11. package/dist/components/charts/ordinal/BoxPlot.d.ts +3 -1
  12. package/dist/components/charts/ordinal/DonutChart.d.ts +0 -1
  13. package/dist/components/charts/ordinal/DotPlot.d.ts +3 -1
  14. package/dist/components/charts/ordinal/FunnelChart.d.ts +3 -1
  15. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -1
  16. package/dist/components/charts/ordinal/Histogram.d.ts +16 -2
  17. package/dist/components/charts/ordinal/LikertChart.d.ts +94 -0
  18. package/dist/components/charts/ordinal/PieChart.d.ts +0 -1
  19. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +11 -7
  20. package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -1
  21. package/dist/components/charts/ordinal/SwarmPlot.d.ts +14 -1
  22. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +65 -0
  23. package/dist/components/charts/ordinal/ViolinPlot.d.ts +16 -2
  24. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +20 -0
  25. package/dist/components/charts/shared/annotationResolvers.d.ts +28 -0
  26. package/dist/components/charts/shared/hooks.d.ts +23 -2
  27. package/dist/components/charts/shared/selectionUtils.d.ts +5 -1
  28. package/dist/components/charts/shared/statsTooltip.d.ts +11 -0
  29. package/dist/components/charts/shared/types.d.ts +22 -1
  30. package/dist/components/charts/shared/useChartSetup.d.ts +12 -2
  31. package/dist/components/charts/shared/useLikertAggregation.d.ts +51 -0
  32. package/dist/components/charts/shared/useOrdinalBrush.d.ts +28 -0
  33. package/dist/components/charts/shared/useOrdinalStreaming.d.ts +54 -0
  34. package/dist/components/charts/shared/useStreamingLegend.d.ts +2 -2
  35. package/dist/components/charts/shared/validateProps.d.ts +2 -2
  36. package/dist/components/charts/shared/validationMap.d.ts +12 -0
  37. package/dist/components/charts/xy/AreaChart.d.ts +11 -0
  38. package/dist/components/charts/xy/MinimapChart.d.ts +1 -1
  39. package/dist/components/charts/xy/StackedAreaChart.d.ts +11 -0
  40. package/dist/components/realtime/types.d.ts +4 -0
  41. package/dist/components/semiotic-ai.d.ts +1 -0
  42. package/dist/components/semiotic-ordinal.d.ts +2 -0
  43. package/dist/components/semiotic-themes.d.ts +16 -0
  44. package/dist/components/semiotic-utils.d.ts +30 -0
  45. package/dist/components/semiotic.d.ts +4 -4
  46. package/dist/components/store/LinkedCrosshairStore.d.ts +11 -0
  47. package/dist/components/store/useSelection.d.ts +1 -0
  48. package/dist/components/stream/AccessibleDataTable.d.ts +28 -6
  49. package/dist/components/stream/FocusRing.d.ts +33 -0
  50. package/dist/components/stream/OrdinalBrushOverlay.d.ts +43 -0
  51. package/dist/components/stream/OrdinalPipelineStore.d.ts +16 -0
  52. package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
  53. package/dist/components/stream/PipelineStore.d.ts +5 -47
  54. package/dist/components/stream/SVGOverlay.d.ts +4 -0
  55. package/dist/components/stream/SceneGraph.d.ts +6 -1
  56. package/dist/components/stream/XYBrushOverlay.d.ts +47 -0
  57. package/dist/components/stream/geoTypes.d.ts +5 -1
  58. package/dist/components/stream/keyboardNav.d.ts +85 -9
  59. package/dist/components/stream/layouts/hierarchySceneBuilders.d.ts +35 -0
  60. package/dist/components/stream/layouts/hierarchyUtils.d.ts +25 -0
  61. package/dist/components/stream/networkTypes.d.ts +5 -1
  62. package/dist/components/stream/ordinalSceneBuilders/swimlaneScene.d.ts +12 -0
  63. package/dist/components/stream/ordinalTypes.d.ts +15 -3
  64. package/dist/components/stream/pipelineDecay.d.ts +20 -0
  65. package/dist/components/stream/pipelinePulse.d.ts +24 -0
  66. package/dist/components/stream/pipelineTransitions.d.ts +59 -0
  67. package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +2 -1
  68. package/dist/components/stream/types.d.ts +19 -1
  69. package/dist/components/stream/useMediaPreferences.d.ts +11 -0
  70. package/dist/components/stream/xySceneBuilders/areaScene.d.ts +13 -0
  71. package/dist/components/stream/xySceneBuilders/barScene.d.ts +18 -0
  72. package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +8 -0
  73. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +10 -0
  74. package/dist/components/stream/xySceneBuilders/emitPointNodes.d.ts +13 -0
  75. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +3 -0
  76. package/dist/components/stream/xySceneBuilders/lineScene.d.ts +12 -0
  77. package/dist/components/stream/xySceneBuilders/pointScene.d.ts +12 -0
  78. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +10 -0
  79. package/dist/components/stream/xySceneBuilders/types.d.ts +93 -0
  80. package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +12 -0
  81. package/dist/geo.min.js +1 -1
  82. package/dist/geo.module.min.js +1 -1
  83. package/dist/network.min.js +1 -1
  84. package/dist/network.module.min.js +1 -1
  85. package/dist/ordinal.min.js +1 -1
  86. package/dist/ordinal.module.min.js +1 -1
  87. package/dist/realtime.min.js +1 -1
  88. package/dist/realtime.module.min.js +1 -1
  89. package/dist/semiotic-ai.d.ts +1 -0
  90. package/dist/semiotic-ai.min.js +1 -1
  91. package/dist/semiotic-ai.module.min.js +1 -1
  92. package/dist/semiotic-ordinal.d.ts +2 -0
  93. package/dist/{semiotic-statisticalOverlays-D8LhSbQt.js → semiotic-statisticalOverlays-DGX_WWc5.js} +1 -1
  94. package/dist/semiotic-themes.d.ts +16 -0
  95. package/dist/semiotic-themes.min.js +1 -1
  96. package/dist/semiotic-themes.module.min.js +1 -1
  97. package/dist/semiotic-utils.d.ts +30 -0
  98. package/dist/semiotic-utils.min.js +1 -0
  99. package/dist/semiotic-utils.module.min.js +1 -0
  100. package/dist/semiotic.d.ts +4 -4
  101. package/dist/semiotic.min.js +1 -1
  102. package/dist/semiotic.module.min.js +1 -1
  103. package/dist/server.min.js +1 -1
  104. package/dist/server.module.min.js +1 -1
  105. package/dist/xy.min.js +1 -1
  106. package/dist/xy.module.min.js +1 -1
  107. package/package.json +15 -8
@@ -0,0 +1,34 @@
1
+ import * as React from "react";
2
+ interface FlippingTooltipProps {
3
+ /** X position within the chart area (relative to margin.left) */
4
+ x: number;
5
+ /** Y position within the chart area (relative to margin.top) */
6
+ y: number;
7
+ /** Chart area width (excluding margins) */
8
+ containerWidth: number;
9
+ /** Chart area height (excluding margins) */
10
+ containerHeight: number;
11
+ /** Chart margins */
12
+ margin: {
13
+ left: number;
14
+ top: number;
15
+ right: number;
16
+ bottom: number;
17
+ };
18
+ /** Tooltip content */
19
+ children: React.ReactNode;
20
+ /** CSS class name for the wrapper */
21
+ className?: string;
22
+ /** z-index (default 1) */
23
+ zIndex?: number;
24
+ }
25
+ /**
26
+ * Viewport-aware tooltip wrapper that flips horizontally and vertically
27
+ * when the tooltip would overflow the chart container.
28
+ *
29
+ * On first render, uses a heuristic (similar to the old 70%/30% thresholds).
30
+ * After measuring the actual tooltip size via ref, repositions precisely to
31
+ * prevent clipping against container edges.
32
+ */
33
+ export declare function FlippingTooltip({ x, y, containerWidth, containerHeight, margin, children, className, zIndex }: FlippingTooltipProps): React.JSX.Element;
34
+ export {};
@@ -32,6 +32,8 @@ export { BarChart } from "./ordinal/BarChart";
32
32
  export type { BarChartProps } from "./ordinal/BarChart";
33
33
  export { StackedBarChart } from "./ordinal/StackedBarChart";
34
34
  export type { StackedBarChartProps } from "./ordinal/StackedBarChart";
35
+ export { LikertChart } from "./ordinal/LikertChart";
36
+ export type { LikertChartProps } from "./ordinal/LikertChart";
35
37
  export { SwarmPlot } from "./ordinal/SwarmPlot";
36
38
  export type { SwarmPlotProps } from "./ordinal/SwarmPlot";
37
39
  export { BoxPlot } from "./ordinal/BoxPlot";
@@ -52,6 +54,8 @@ export { DonutChart } from "./ordinal/DonutChart";
52
54
  export type { DonutChartProps } from "./ordinal/DonutChart";
53
55
  export { GroupedBarChart } from "./ordinal/GroupedBarChart";
54
56
  export type { GroupedBarChartProps } from "./ordinal/GroupedBarChart";
57
+ export { SwimlaneChart } from "./ordinal/SwimlaneChart";
58
+ export type { SwimlaneChartProps } from "./ordinal/SwimlaneChart";
55
59
  export { ForceDirectedGraph } from "./network/ForceDirectedGraph";
56
60
  export type { ForceDirectedGraphProps } from "./network/ForceDirectedGraph";
57
61
  export { ChordDiagram } from "./network/ChordDiagram";
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  /**
@@ -27,6 +27,8 @@ export interface BarChartProps<TDatum extends Record<string, any> = Record<strin
27
27
  legendPosition?: "right" | "left" | "top" | "bottom";
28
28
  tooltip?: TooltipProp;
29
29
  annotations?: Record<string, any>[];
30
+ /** Custom formatter for category tick labels */
31
+ categoryFormat?: CategoryFormatFn;
30
32
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
31
33
  }
32
34
  /**
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface BoxPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -25,6 +25,8 @@ export interface BoxPlotProps<TDatum extends Record<string, any> = Record<string
25
25
  legendPosition?: LegendPosition;
26
26
  tooltip?: TooltipProp;
27
27
  annotations?: Record<string, any>[];
28
+ /** Custom formatter for category tick labels */
29
+ categoryFormat?: CategoryFormatFn;
28
30
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
29
31
  }
30
32
  export declare const BoxPlot: {
@@ -13,7 +13,6 @@ export interface DonutChartProps<TDatum extends Record<string, any> = Record<str
13
13
  colorBy?: ChartAccessor<TDatum, string>;
14
14
  colorScheme?: string | string[];
15
15
  startAngle?: number;
16
- slicePadding?: number;
17
16
  enableHover?: boolean;
18
17
  showCategoryTicks?: boolean;
19
18
  showLegend?: boolean;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface DotPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -25,6 +25,8 @@ export interface DotPlotProps<TDatum extends Record<string, any> = Record<string
25
25
  legendPosition?: LegendPosition;
26
26
  tooltip?: TooltipProp;
27
27
  annotations?: Record<string, any>[];
28
+ /** Custom formatter for category tick labels */
29
+ categoryFormat?: CategoryFormatFn;
28
30
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
29
31
  }
30
32
  export declare const DotPlot: {
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  /**
@@ -37,6 +37,8 @@ export interface FunnelChartProps<TDatum extends Record<string, any> = Record<st
37
37
  legendPosition?: "right" | "left" | "top" | "bottom";
38
38
  tooltip?: TooltipProp;
39
39
  annotations?: Record<string, any>[];
40
+ /** Custom formatter for category tick labels */
41
+ categoryFormat?: CategoryFormatFn;
40
42
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
41
43
  }
42
44
  /**
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface GroupedBarChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -24,6 +24,8 @@ export interface GroupedBarChartProps<TDatum extends Record<string, any> = Recor
24
24
  legendPosition?: "right" | "left" | "top" | "bottom";
25
25
  tooltip?: TooltipProp;
26
26
  annotations?: Record<string, any>[];
27
+ /** Custom formatter for category tick labels */
28
+ categoryFormat?: CategoryFormatFn;
27
29
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
28
30
  }
29
31
  export declare const GroupedBarChart: {
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
- import type { LegendPosition } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
3
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface HistogramProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -20,9 +20,23 @@ export interface HistogramProps<TDatum extends Record<string, any> = Record<stri
20
20
  showGrid?: boolean;
21
21
  showCategoryTicks?: boolean;
22
22
  showLegend?: boolean;
23
+ legendInteraction?: LegendInteractionMode;
23
24
  legendPosition?: LegendPosition;
24
25
  tooltip?: TooltipProp;
25
26
  annotations?: Record<string, any>[];
27
+ /** Enable brush on the value axis */
28
+ brush?: boolean;
29
+ /** Callback when brush selection changes */
30
+ onBrush?: (extent: {
31
+ r: [number, number];
32
+ } | null) => void;
33
+ /** LinkedCharts brush integration */
34
+ linkedBrush?: string | {
35
+ name: string;
36
+ rField?: string;
37
+ };
38
+ /** Custom formatter for category tick labels */
39
+ categoryFormat?: CategoryFormatFn;
26
40
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
27
41
  }
28
42
  export declare const Histogram: {
@@ -0,0 +1,94 @@
1
+ import * as React from "react";
2
+ import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
+ import type { LegendInteractionMode } from "../shared/hooks";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
+ import { type TooltipProp } from "../../Tooltip/Tooltip";
6
+ import type { RealtimeFrameHandle } from "../../realtime/types";
7
+ /**
8
+ * LikertChart — visualize Likert scale survey responses.
9
+ *
10
+ * Supports two data formats:
11
+ *
12
+ * **Raw responses** — each row is one respondent's answer:
13
+ * ```
14
+ * [{ question: "Q1", score: 4 }, { question: "Q1", score: 2 }, ...]
15
+ * ```
16
+ * Set `valueAccessor` to the integer score field. Scores are mapped to
17
+ * `levels` by index (score 1 → levels[0], score 2 → levels[1], …).
18
+ *
19
+ * **Pre-aggregated** — each row is a (question, level, count) triple:
20
+ * ```
21
+ * [{ question: "Q1", level: "Agree", count: 45 }, ...]
22
+ * ```
23
+ * Set `levelAccessor` and `countAccessor`.
24
+ *
25
+ * **Orientation:**
26
+ * - `"horizontal"` (default) — diverging bar chart centered at 0%.
27
+ * Negative levels extend left, positive right. If `levels` has an odd
28
+ * count, the center level is split 50/50 across the centerline and drawn
29
+ * in a neutral color. Even counts split cleanly at the midpoint.
30
+ * - `"vertical"` — stacked 100% bar chart, levels stacked bottom-to-top.
31
+ *
32
+ * **Important:** The diverging layout assigns meaning by position in the
33
+ * `levels` array. The first half is treated as "negative", the second half
34
+ * as "positive", and (if odd) the middle entry as "neutral". If your data
35
+ * doesn't follow this low-to-high convention, the chart will misrepresent
36
+ * the polarity.
37
+ */
38
+ export interface LikertChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
39
+ data?: TDatum[];
40
+ /** Question / item accessor — the ordinal axis. */
41
+ categoryAccessor?: ChartAccessor<TDatum, string>;
42
+ /**
43
+ * Integer score accessor (raw response mode).
44
+ * Scores are 1-based: score 1 maps to levels[0], score 2 to levels[1], etc.
45
+ * Mutually exclusive with levelAccessor/countAccessor.
46
+ */
47
+ valueAccessor?: ChartAccessor<TDatum, number>;
48
+ /**
49
+ * Level name accessor (pre-aggregated mode).
50
+ * Each value must match an entry in `levels`.
51
+ */
52
+ levelAccessor?: ChartAccessor<TDatum, string>;
53
+ /**
54
+ * Count/frequency accessor (pre-aggregated mode). Defaults to "count".
55
+ */
56
+ countAccessor?: ChartAccessor<TDatum, number>;
57
+ /**
58
+ * Ordered response labels from most negative to most positive.
59
+ * Example (5-point): ["Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"]
60
+ * Example (4-point): ["Strongly Disagree", "Disagree", "Agree", "Strongly Agree"]
61
+ *
62
+ * Odd count → center level is neutral. Even count → clean negative/positive split.
63
+ */
64
+ levels: string[];
65
+ /**
66
+ * "horizontal" (default): diverging bar chart centered at 0%.
67
+ * "vertical": stacked 100% bar chart.
68
+ */
69
+ orientation?: "horizontal" | "vertical";
70
+ /**
71
+ * One color per level. Should match the length of `levels`.
72
+ * For diverging orientation, use a diverging palette (red→neutral→blue).
73
+ */
74
+ colorScheme?: string[];
75
+ categoryLabel?: string;
76
+ valueLabel?: string;
77
+ valueFormat?: (d: number | string) => string;
78
+ barPadding?: number;
79
+ enableHover?: boolean;
80
+ showGrid?: boolean;
81
+ showCategoryTicks?: boolean;
82
+ showLegend?: boolean;
83
+ legendInteraction?: LegendInteractionMode;
84
+ legendPosition?: "right" | "left" | "top" | "bottom";
85
+ tooltip?: TooltipProp;
86
+ annotations?: Record<string, any>[];
87
+ /** Custom formatter for category tick labels */
88
+ categoryFormat?: CategoryFormatFn;
89
+ frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
90
+ }
91
+ export declare const LikertChart: {
92
+ <TDatum extends Record<string, any> = Record<string, any>>(props: LikertChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
93
+ displayName?: string;
94
+ };
@@ -11,7 +11,6 @@ export interface PieChartProps<TDatum extends Record<string, any> = Record<strin
11
11
  colorBy?: ChartAccessor<TDatum, string>;
12
12
  colorScheme?: string | string[];
13
13
  startAngle?: number;
14
- slicePadding?: number;
15
14
  enableHover?: boolean;
16
15
  showCategoryTicks?: boolean;
17
16
  showLegend?: boolean;
@@ -1,10 +1,11 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
- import type { LegendPosition } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
3
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
+ import type { RealtimeFrameHandle } from "../../realtime/types";
6
7
  export interface RidgelinePlotProps<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";
@@ -21,9 +22,12 @@ export interface RidgelinePlotProps<TDatum extends Record<string, any> = Record<
21
22
  showGrid?: boolean;
22
23
  showCategoryTicks?: boolean;
23
24
  showLegend?: boolean;
25
+ legendInteraction?: LegendInteractionMode;
24
26
  legendPosition?: LegendPosition;
25
27
  tooltip?: TooltipProp;
26
28
  annotations?: Record<string, any>[];
29
+ /** Custom formatter for category tick labels */
30
+ categoryFormat?: CategoryFormatFn;
27
31
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
28
32
  }
29
33
  /**
@@ -32,7 +36,7 @@ export interface RidgelinePlotProps<TDatum extends Record<string, any> = Record<
32
36
  * Each category shows its value distribution as a filled area extending from a
33
37
  * baseline. The amplitude prop controls overlap between rows.
34
38
  */
35
- export declare function RidgelinePlot<TDatum extends Record<string, any> = Record<string, any>>(props: RidgelinePlotProps<TDatum>): React.JSX.Element;
36
- export declare namespace RidgelinePlot {
37
- var displayName: string;
38
- }
39
+ export declare const RidgelinePlot: {
40
+ <TDatum extends Record<string, any> = Record<string, any>>(props: RidgelinePlotProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
41
+ displayName?: string;
42
+ };
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface StackedBarChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -25,6 +25,8 @@ export interface StackedBarChartProps<TDatum extends Record<string, any> = Recor
25
25
  legendPosition?: "right" | "left" | "top" | "bottom";
26
26
  tooltip?: TooltipProp;
27
27
  annotations?: Record<string, any>[];
28
+ /** Custom formatter for category tick labels */
29
+ categoryFormat?: CategoryFormatFn;
28
30
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
29
31
  }
30
32
  export declare const StackedBarChart: {
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
3
  import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface SwarmPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -27,6 +27,19 @@ export interface SwarmPlotProps<TDatum extends Record<string, any> = Record<stri
27
27
  legendPosition?: LegendPosition;
28
28
  tooltip?: TooltipProp;
29
29
  annotations?: Record<string, any>[];
30
+ /** Enable brush on the value axis */
31
+ brush?: boolean;
32
+ /** Callback when brush selection changes */
33
+ onBrush?: (extent: {
34
+ r: [number, number];
35
+ } | null) => void;
36
+ /** LinkedCharts brush integration */
37
+ linkedBrush?: string | {
38
+ name: string;
39
+ rField?: string;
40
+ };
41
+ /** Custom formatter for category tick labels */
42
+ categoryFormat?: CategoryFormatFn;
30
43
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
31
44
  }
32
45
  export declare const SwarmPlot: {
@@ -0,0 +1,65 @@
1
+ import * as React from "react";
2
+ import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
+ import type { LegendInteractionMode } from "../shared/hooks";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
+ import { type TooltipProp } from "../../Tooltip/Tooltip";
6
+ import type { RealtimeFrameHandle } from "../../realtime/types";
7
+ export interface SwimlaneChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
8
+ /** Data array. Omit for push API mode. */
9
+ data?: TDatum[];
10
+ /** Accessor for lane categories (swim lanes). Default "category". */
11
+ categoryAccessor?: ChartAccessor<TDatum, string>;
12
+ /** Accessor for item subcategory (color grouping within lanes). Required. */
13
+ subcategoryAccessor: ChartAccessor<TDatum, string>;
14
+ /** Accessor for item size/duration. Default "value". */
15
+ valueAccessor?: ChartAccessor<TDatum, number>;
16
+ /** Orientation: "horizontal" renders lanes as rows (default), "vertical" as columns. */
17
+ orientation?: "vertical" | "horizontal";
18
+ /** Label for the category axis */
19
+ categoryLabel?: string;
20
+ /** Label for the value axis */
21
+ valueLabel?: string;
22
+ /** Format function for value axis ticks */
23
+ valueFormat?: (d: number | string) => string;
24
+ /** Color accessor — defaults to subcategoryAccessor */
25
+ colorBy?: ChartAccessor<TDatum, string>;
26
+ /** Color scheme for subcategories */
27
+ colorScheme?: string | string[];
28
+ /** Padding between lanes in pixels */
29
+ barPadding?: number;
30
+ /** Enable hover annotations */
31
+ enableHover?: boolean;
32
+ /** Show grid lines */
33
+ showGrid?: boolean;
34
+ /** Show category axis tick labels */
35
+ showCategoryTicks?: boolean;
36
+ /** Show legend */
37
+ showLegend?: boolean;
38
+ /** Legend interaction mode */
39
+ legendInteraction?: LegendInteractionMode;
40
+ /** Legend position */
41
+ legendPosition?: "right" | "left" | "top" | "bottom";
42
+ /** Tooltip configuration */
43
+ tooltip?: TooltipProp;
44
+ /** Annotation objects */
45
+ annotations?: Record<string, any>[];
46
+ /** Enable brush on the value axis */
47
+ brush?: boolean;
48
+ /** Callback when brush selection changes */
49
+ onBrush?: (extent: {
50
+ r: [number, number];
51
+ } | null) => void;
52
+ /** LinkedCharts brush integration */
53
+ linkedBrush?: string | {
54
+ name: string;
55
+ rField?: string;
56
+ };
57
+ /** Custom formatter for category tick labels */
58
+ categoryFormat?: CategoryFormatFn;
59
+ /** Pass-through props to StreamOrdinalFrame */
60
+ frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
61
+ }
62
+ export declare const SwimlaneChart: {
63
+ <TDatum extends Record<string, any> = Record<string, any>>(props: SwimlaneChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
64
+ displayName?: string;
65
+ };
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
- import type { LegendPosition } from "../shared/hooks";
4
- import type { BaseChartProps, ChartAccessor } from "../shared/types";
3
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
4
+ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
5
5
  import { type TooltipProp } from "../../Tooltip/Tooltip";
6
6
  import type { RealtimeFrameHandle } from "../../realtime/types";
7
7
  export interface ViolinPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
@@ -22,9 +22,23 @@ export interface ViolinPlotProps<TDatum extends Record<string, any> = Record<str
22
22
  showGrid?: boolean;
23
23
  showCategoryTicks?: boolean;
24
24
  showLegend?: boolean;
25
+ legendInteraction?: LegendInteractionMode;
25
26
  legendPosition?: LegendPosition;
26
27
  tooltip?: TooltipProp;
27
28
  annotations?: Record<string, any>[];
29
+ /** Enable brush on the value axis */
30
+ brush?: boolean;
31
+ /** Callback when brush selection changes */
32
+ onBrush?: (extent: {
33
+ r: [number, number];
34
+ } | null) => void;
35
+ /** LinkedCharts brush integration */
36
+ linkedBrush?: string | {
37
+ name: string;
38
+ rField?: string;
39
+ };
40
+ /** Custom formatter for category tick labels */
41
+ categoryFormat?: CategoryFormatFn;
28
42
  frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
29
43
  }
30
44
  export declare const ViolinPlot: {
@@ -102,6 +102,26 @@ export interface RealtimeTemporalHistogramProps<TDatum extends Record<string, an
102
102
  loading?: boolean;
103
103
  /** Custom content to render when data is empty. Set to `false` to disable empty state. */
104
104
  emptyContent?: ReactNode | false;
105
+ /** Brush configuration. `true` defaults to `{ dimension: "x", snap: "bin" }`. */
106
+ brush?: boolean | "x" | {
107
+ dimension?: "x" | "y" | "xy";
108
+ snap?: "continuous" | "bin";
109
+ /** Actual bin boundary values for data-driven snapping (auto-populated from histogram bins when omitted) */
110
+ binBoundaries?: number[];
111
+ /** When true, snap during drag (not just on release). Default false. */
112
+ snapDuring?: boolean;
113
+ };
114
+ /** Callback when brush selection changes. Called with data-space extent, or null when cleared. */
115
+ onBrush?: (extent: {
116
+ x: [number, number];
117
+ y: [number, number];
118
+ } | null) => void;
119
+ /** Linked brush for cross-chart coordination via LinkedCharts */
120
+ linkedBrush?: string | {
121
+ name: string;
122
+ xField?: string;
123
+ yField?: string;
124
+ };
105
125
  /** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
106
126
  emphasis?: "primary" | "secondary";
107
127
  /** Show a legend */
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Coordinate resolution helpers for annotations.
3
+ *
4
+ * Resolves data coordinates to pixel positions, respecting anchor modes
5
+ * (fixed, latest, sticky), pointId matching, and bounds checking for
6
+ * streaming charts where data scrolls off-screen.
7
+ *
8
+ * Dependencies: types (AnnotationContext)
9
+ * Consumed by: annotationRules.tsx (all annotation type renderers)
10
+ */
11
+ 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;
14
+ /**
15
+ * Resolve annotation position respecting anchor mode.
16
+ * - "fixed" (default): resolve from annotation's own fields
17
+ * - "latest": resolve from the most recent datum in the buffer
18
+ * - "sticky": resolve from annotation fields; if not found, use cached position
19
+ */
20
+ export declare function resolveAnchoredPosition(ann: Record<string, any>, index: number, context: AnnotationContext): {
21
+ x: number;
22
+ y: number;
23
+ } | null;
24
+ /**
25
+ * Returns true if a point annotation is within the visible chart area.
26
+ * Used to hide data-anchored annotations that have scrolled off-screen.
27
+ */
28
+ export declare function isInBounds(px: number, py: number, context: AnnotationContext, margin?: number): boolean;
@@ -26,7 +26,8 @@ export declare function resolveDefaultFill(color: string | undefined, themeCateg
26
26
  export declare function resolveAccessor<T = any>(accessor: string | ((d: Record<string, any>, i?: number) => T)): (d: Record<string, any>) => T;
27
27
  /**
28
28
  * Hook to create a color scale from data and colorBy configuration.
29
- * Returns undefined when colorBy is absent or is a function accessor.
29
+ * Returns undefined when colorBy is absent or data is empty (push API mode).
30
+ * Supports both string and function accessors for colorBy.
30
31
  */
31
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;
32
33
  /**
@@ -42,7 +43,7 @@ export declare function useSortedData(data: Array<Record<string, any>>, sort: bo
42
43
  * @param unwrapData - Deprecated / no-op. Hover data is always unwrapped
43
44
  * (stream frames wrap the raw datum in { data, time, value, x, y }).
44
45
  */
45
- export declare function useChartSelection({ selection, linkedHover, fallbackFields, unwrapData, onObservation, chartType, chartId, }: {
46
+ export declare function useChartSelection({ selection, linkedHover, fallbackFields, unwrapData, onObservation, chartType, chartId, onClick, }: {
46
47
  selection?: SelectionConfig;
47
48
  linkedHover?: LinkedHoverProp;
48
49
  fallbackFields?: string[];
@@ -50,11 +51,25 @@ export declare function useChartSelection({ selection, linkedHover, fallbackFiel
50
51
  onObservation?: OnObservationCallback;
51
52
  chartType?: string;
52
53
  chartId?: string;
54
+ onClick?: (datum: any, event: {
55
+ x: number;
56
+ y: number;
57
+ }) => void;
53
58
  }): {
54
59
  activeSelectionHook: SelectionHookResult | null;
55
60
  customHoverBehavior: (d: Record<string, any> | null) => void;
56
61
  customClickBehavior: (d: Record<string, any> | null) => void;
62
+ /** Stable ID for this chart instance, used to suppress linked crosshair on source chart */
63
+ crosshairSourceId: string;
57
64
  };
65
+ /**
66
+ * Compute crosshair props for StreamXYFrame from linkedHover config.
67
+ * Returns undefined when linkedHover is not in x-position mode.
68
+ */
69
+ export declare function getCrosshairProps(linkedHover: unknown, crosshairSourceId: string): {
70
+ linkedCrosshairName: string;
71
+ linkedCrosshairSourceId: string;
72
+ } | undefined;
58
73
  /**
59
74
  * Hook to create a legend and compute margins with legend-aware adjustment.
60
75
  * Consolidates the shouldShowLegend / createLegend / margin merge / right-margin
@@ -118,6 +133,9 @@ interface ChartModeInput {
118
133
  /** "vertical" | "horizontal" — used to shrink the category-axis margin when showCategoryTicks is false */
119
134
  orientation?: string;
120
135
  title?: string;
136
+ description?: string;
137
+ summary?: string;
138
+ accessibleTable?: boolean;
121
139
  xLabel?: string;
122
140
  yLabel?: string;
123
141
  categoryLabel?: string;
@@ -134,6 +152,9 @@ interface ChartModeResult {
134
152
  showLegend: boolean | undefined;
135
153
  showLabels: boolean | undefined;
136
154
  title: string | undefined;
155
+ description: string | undefined;
156
+ summary: string | undefined;
157
+ accessibleTable: boolean | undefined;
137
158
  xLabel: string | undefined;
138
159
  yLabel: string | undefined;
139
160
  categoryLabel: string | undefined;
@@ -7,6 +7,8 @@
7
7
  export interface NormalizedLinkedHover {
8
8
  name: string;
9
9
  fields: string[];
10
+ mode?: "field" | "x-position";
11
+ xField?: string;
10
12
  }
11
13
  export interface NormalizedLinkedBrush {
12
14
  name: string;
@@ -22,7 +24,9 @@ export interface NormalizedLinkedBrush {
22
24
  */
23
25
  export declare function normalizeLinkedHover(prop: boolean | string | {
24
26
  name?: string;
25
- fields: string[];
27
+ fields?: string[];
28
+ mode?: "field" | "x-position";
29
+ xField?: string;
26
30
  } | undefined, fallbackFields?: string[]): NormalizedLinkedHover | null;
27
31
  /**
28
32
  * Normalize the linkedBrush prop into a consistent config object.
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Shared tooltip for distribution charts (BoxPlot, ViolinPlot, RidgelinePlot).
4
+ *
5
+ * Renders category name + summary statistics (n, min, Q1, median, Q3, max, mean).
6
+ * Falls back to category-only display when stats are unavailable.
7
+ */
8
+ export declare function buildStatsTooltip(options?: {
9
+ /** If provided, computes fallback stats from raw data when d.stats is missing */
10
+ valueAccessor?: string | ((d: any) => number);
11
+ }): (d: Record<string, any>) => React.ReactElement;