semiotic 3.2.1 → 3.2.3

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 (50) hide show
  1. package/CLAUDE.md +47 -5
  2. package/ai/dist/mcp-server.js +31925 -528
  3. package/ai/schema.json +76 -1
  4. package/dist/components/Tooltip/Tooltip.d.ts +6 -1
  5. package/dist/components/charts/index.d.ts +2 -0
  6. package/dist/components/charts/ordinal/BarChart.d.ts +2 -0
  7. package/dist/components/charts/ordinal/GaugeChart.d.ts +55 -0
  8. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +1 -0
  9. package/dist/components/charts/ordinal/StackedBarChart.d.ts +1 -0
  10. package/dist/components/charts/shared/hooks.d.ts +4 -1
  11. package/dist/components/charts/shared/types.d.ts +10 -5
  12. package/dist/components/charts/shared/useChartSetup.d.ts +2 -0
  13. package/dist/components/charts/xy/AreaChart.d.ts +17 -2
  14. package/dist/components/charts/xy/LineChart.d.ts +14 -3
  15. package/dist/components/semiotic-ordinal.d.ts +2 -0
  16. package/dist/components/semiotic-utils.d.ts +2 -1
  17. package/dist/components/semiotic.d.ts +3 -3
  18. package/dist/components/store/LinkedCrosshairStore.d.ts +6 -2
  19. package/dist/components/stream/CanvasHitTester.d.ts +13 -0
  20. package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
  21. package/dist/components/stream/PipelineStore.d.ts +17 -1
  22. package/dist/components/stream/SVGOverlay.d.ts +11 -5
  23. package/dist/components/stream/devDataAccessWarning.d.ts +13 -0
  24. package/dist/components/stream/hitTestUtils.d.ts +15 -0
  25. package/dist/components/stream/ordinalTypes.d.ts +7 -1
  26. package/dist/components/stream/types.d.ts +54 -5
  27. package/dist/components/stream/xySceneBuilders/mixedScene.d.ts +12 -0
  28. package/dist/components/stream/xySceneBuilders/types.d.ts +15 -0
  29. package/dist/geo.min.js +1 -1
  30. package/dist/geo.module.min.js +1 -1
  31. package/dist/network.min.js +1 -1
  32. package/dist/network.module.min.js +1 -1
  33. package/dist/ordinal.min.js +1 -1
  34. package/dist/ordinal.module.min.js +1 -1
  35. package/dist/realtime.min.js +1 -1
  36. package/dist/realtime.module.min.js +1 -1
  37. package/dist/semiotic-ai.min.js +1 -1
  38. package/dist/semiotic-ai.module.min.js +1 -1
  39. package/dist/semiotic-ordinal.d.ts +2 -0
  40. package/dist/semiotic-utils.d.ts +2 -1
  41. package/dist/semiotic-utils.min.js +1 -1
  42. package/dist/semiotic-utils.module.min.js +1 -1
  43. package/dist/semiotic.d.ts +3 -3
  44. package/dist/semiotic.min.js +1 -1
  45. package/dist/semiotic.module.min.js +1 -1
  46. package/dist/server.min.js +1 -1
  47. package/dist/server.module.min.js +1 -1
  48. package/dist/xy.min.js +1 -1
  49. package/dist/xy.module.min.js +1 -1
  50. package/package.json +12 -8
package/ai/schema.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "name": "semiotic",
4
- "version": "3.2.1",
4
+ "version": "3.2.2",
5
5
  "description": "React data visualization library for charts, networks, and beyond",
6
6
  "tools": [
7
7
  {
@@ -2778,6 +2778,69 @@
2778
2778
  }
2779
2779
  }
2780
2780
  },
2781
+ {
2782
+ "type": "function",
2783
+ "function": {
2784
+ "name": "GaugeChart",
2785
+ "description": "Single-value gauge with threshold zones, needle indicator, and configurable sweep angle. Built on StreamOrdinalFrame radial projection.",
2786
+ "parameters": {
2787
+ "type": "object",
2788
+ "properties": {
2789
+ "value": {
2790
+ "type": "number",
2791
+ "description": "Current gauge value"
2792
+ },
2793
+ "min": {
2794
+ "type": "number",
2795
+ "default": 0
2796
+ },
2797
+ "max": {
2798
+ "type": "number",
2799
+ "default": 100
2800
+ },
2801
+ "thresholds": {
2802
+ "type": "array",
2803
+ "description": "Array of { value, color, label? } defining threshold zones. Last value should equal max.",
2804
+ "items": { "type": "object" }
2805
+ },
2806
+ "arcWidth": {
2807
+ "type": "number",
2808
+ "description": "Arc thickness as fraction of radius (0-1)",
2809
+ "default": 0.3
2810
+ },
2811
+ "sweep": {
2812
+ "type": "number",
2813
+ "description": "Arc sweep angle in degrees (gap centered at bottom)",
2814
+ "default": 240
2815
+ },
2816
+ "showNeedle": {
2817
+ "type": "boolean",
2818
+ "default": true
2819
+ },
2820
+ "needleColor": {
2821
+ "type": "string"
2822
+ },
2823
+ "valueFormat": {
2824
+ "type": "string",
2825
+ "description": "Format function for center value label"
2826
+ },
2827
+ "showScaleLabels": {
2828
+ "type": "boolean",
2829
+ "default": true
2830
+ },
2831
+ "width": {
2832
+ "type": "number",
2833
+ "default": 300
2834
+ },
2835
+ "height": {
2836
+ "type": "number",
2837
+ "default": 250
2838
+ }
2839
+ },
2840
+ "required": ["value"]
2841
+ }
2842
+ }
2843
+ },
2781
2844
  {
2782
2845
  "type": "function",
2783
2846
  "function": {
@@ -3938,6 +4001,18 @@
3938
4001
  "gap": {
3939
4002
  "type": "number"
3940
4003
  },
4004
+ "brush": {
4005
+ "type": ["boolean", "string", "object"],
4006
+ "description": "Enable brush selection. true defaults to { dimension: \"x\", snap: \"bin\" }. String: \"x\". Object: { dimension, snap: \"continuous\"|\"bin\", snapDuring }."
4007
+ },
4008
+ "onBrush": {
4009
+ "type": "function",
4010
+ "description": "Callback when brush extent changes: (extent | null) => void"
4011
+ },
4012
+ "linkedBrush": {
4013
+ "type": ["string", "object"],
4014
+ "description": "Cross-chart brush coordination via LinkedCharts. String: selection name. Object: { name, xField, yField }."
4015
+ },
3941
4016
  "showAxes": {
3942
4017
  "type": "boolean",
3943
4018
  "default": true
@@ -134,12 +134,17 @@ export declare function MultiLineTooltip(config?: MultiLineTooltipConfig): (data
134
134
  /**
135
135
  * Type for tooltip prop that chart components accept
136
136
  */
137
- export type TooltipProp = boolean | ((data: Record<string, unknown>) => React.ReactNode) | ReturnType<typeof Tooltip> | ReturnType<typeof MultiLineTooltip> | TooltipConfig;
137
+ export type TooltipProp = boolean | "multi" | ((data: Record<string, unknown>) => React.ReactNode) | ReturnType<typeof Tooltip> | ReturnType<typeof MultiLineTooltip> | TooltipConfig;
138
138
  /**
139
139
  * The function signature that Stream Frames expect for tooltipContent.
140
140
  * Compatible with HoverData and any Record-based hover object.
141
141
  */
142
142
  export type TooltipContentFn = (d: Record<string, any>) => React.ReactNode;
143
+ /**
144
+ * Multi-point tooltip: shows all series values at the hovered X position
145
+ * with color swatches (legend-style). Used when tooltipMode="multi".
146
+ */
147
+ export declare function MultiPointTooltip(): TooltipContentFn;
143
148
  /**
144
149
  * Convert a tooltip prop to the format Semiotic expects.
145
150
  * Returns `false` to disable, or a `TooltipContentFn` compatible with
@@ -52,6 +52,8 @@ export { PieChart } from "./ordinal/PieChart";
52
52
  export type { PieChartProps } from "./ordinal/PieChart";
53
53
  export { DonutChart } from "./ordinal/DonutChart";
54
54
  export type { DonutChartProps } from "./ordinal/DonutChart";
55
+ export { GaugeChart } from "./ordinal/GaugeChart";
56
+ export type { GaugeChartProps, GaugeThreshold } from "./ordinal/GaugeChart";
55
57
  export { GroupedBarChart } from "./ordinal/GroupedBarChart";
56
58
  export type { GroupedBarChartProps } from "./ordinal/GroupedBarChart";
57
59
  export { SwimlaneChart } from "./ordinal/SwimlaneChart";
@@ -19,6 +19,8 @@ export interface BarChartProps<TDatum extends Record<string, any> = Record<strin
19
19
  colorScheme?: string | string[];
20
20
  sort?: boolean | "asc" | "desc" | ((a: Record<string, any>, b: Record<string, any>) => number);
21
21
  barPadding?: number;
22
+ /** When true, adds padding below the 0 baseline. Default false (bars flush with axis). */
23
+ baselinePadding?: boolean;
22
24
  enableHover?: boolean;
23
25
  showGrid?: boolean;
24
26
  showCategoryTicks?: boolean;
@@ -0,0 +1,55 @@
1
+ import * as React from "react";
2
+ import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
3
+ import type { BaseChartProps } from "../shared/types";
4
+ import { type TooltipProp } from "../../Tooltip/Tooltip";
5
+ import type { RealtimeFrameHandle } from "../../realtime/types";
6
+ export interface GaugeThreshold {
7
+ /** Upper bound of this zone (value, not percentage) */
8
+ value: number;
9
+ /** Color for this threshold zone */
10
+ color: string;
11
+ /** Optional label for the zone */
12
+ label?: string;
13
+ }
14
+ export interface GaugeChartProps extends BaseChartProps {
15
+ /** Current gauge value */
16
+ value: number;
17
+ /** Minimum scale value (default 0) */
18
+ min?: number;
19
+ /** Maximum scale value (default 100) */
20
+ max?: number;
21
+ /** Threshold zones — ordered list of { value, color, label? }. Last threshold's value should equal max. */
22
+ thresholds?: GaugeThreshold[];
23
+ /** Color of the value arc when no thresholds defined (default: theme primary) */
24
+ color?: string;
25
+ /** Background arc color (default: var(--semiotic-grid, #e0e0e0)) */
26
+ backgroundColor?: string;
27
+ /** Arc thickness as fraction of radius (0–1, default 0.3) */
28
+ arcWidth?: number;
29
+ /** Show needle indicator (default true) */
30
+ showNeedle?: boolean;
31
+ /** Needle color (default: var(--semiotic-text, #333)) */
32
+ needleColor?: string;
33
+ /** Center content — ReactNode rendered at the gauge center. If not provided, shows the value. */
34
+ centerContent?: React.ReactNode | ((value: number, min: number, max: number) => React.ReactNode);
35
+ /** Format function for the default center value label */
36
+ valueFormat?: (value: number) => string;
37
+ /** Show scale tick labels at min, max, and threshold boundaries (default true) */
38
+ showScaleLabels?: boolean;
39
+ /** Arc sweep angle in degrees (default 240 — leaves a 120° gap at the bottom) */
40
+ sweep?: number;
41
+ /** When false, all threshold zones render at full color and only the needle indicates value. Default true (zones fill up to value). */
42
+ fillZones?: boolean;
43
+ /** Enable tooltip on arc segments */
44
+ tooltip?: TooltipProp;
45
+ /** Annotations — supports threshold markers via standard annotation system */
46
+ annotations?: Record<string, any>[];
47
+ /** Enable hover interaction (default true) */
48
+ enableHover?: boolean;
49
+ /** frameProps escape hatch */
50
+ frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
51
+ }
52
+ export declare const GaugeChart: {
53
+ (props: GaugeChartProps & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
54
+ displayName?: string;
55
+ };
@@ -16,6 +16,7 @@ export interface GroupedBarChartProps<TDatum extends Record<string, any> = Recor
16
16
  colorBy?: ChartAccessor<TDatum, string>;
17
17
  colorScheme?: string | string[];
18
18
  barPadding?: number;
19
+ baselinePadding?: boolean;
19
20
  enableHover?: boolean;
20
21
  showGrid?: boolean;
21
22
  showCategoryTicks?: boolean;
@@ -17,6 +17,7 @@ export interface StackedBarChartProps<TDatum extends Record<string, any> = Recor
17
17
  colorScheme?: string | string[];
18
18
  normalize?: boolean;
19
19
  barPadding?: number;
20
+ baselinePadding?: boolean;
20
21
  enableHover?: boolean;
21
22
  showGrid?: boolean;
22
23
  showCategoryTicks?: boolean;
@@ -43,7 +43,7 @@ export declare function useSortedData(data: Array<Record<string, any>>, sort: bo
43
43
  * @param unwrapData - Deprecated / no-op. Hover data is always unwrapped
44
44
  * (stream frames wrap the raw datum in { data, time, value, x, y }).
45
45
  */
46
- export declare function useChartSelection({ selection, linkedHover, fallbackFields, unwrapData, onObservation, chartType, chartId, onClick, }: {
46
+ export declare function useChartSelection({ selection, linkedHover, fallbackFields, unwrapData, onObservation, chartType, chartId, onClick, hoverHighlight, colorByField, }: {
47
47
  selection?: SelectionConfig;
48
48
  linkedHover?: LinkedHoverProp;
49
49
  fallbackFields?: string[];
@@ -55,8 +55,11 @@ export declare function useChartSelection({ selection, linkedHover, fallbackFiel
55
55
  x: number;
56
56
  y: number;
57
57
  }) => void;
58
+ hoverHighlight?: boolean | "series";
59
+ colorByField?: string;
58
60
  }): {
59
61
  activeSelectionHook: SelectionHookResult | null;
62
+ hoverSelectionHook: SelectionHookResult | null;
60
63
  customHoverBehavior: (d: Record<string, any> | null) => void;
61
64
  customClickBehavior: (d: Record<string, any> | null) => void;
62
65
  /** Stable ID for this chart instance, used to suppress linked crosshair on source chart */
@@ -1,3 +1,4 @@
1
+ import type React from "react";
1
2
  import type { MarginType } from "../../types/generalTypes";
2
3
  import type { OnObservationCallback } from "../../store/ObservationStore";
3
4
  /**
@@ -92,6 +93,10 @@ export interface BaseChartProps {
92
93
  x: number;
93
94
  y: number;
94
95
  }) => void;
96
+ /** Dim non-hovered series when hovering a data mark. "series" dims by the colorBy group key. */
97
+ hoverHighlight?: boolean | "series";
98
+ /** Max pixel distance for hover/click hit testing. Default 30. Increase for sparse charts, decrease for dense ones. */
99
+ hoverRadius?: number;
95
100
  /** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
96
101
  emphasis?: "primary" | "secondary";
97
102
  /** Enable declarative bounded animation (enter/exit/update transitions).
@@ -109,16 +114,16 @@ export interface AxisConfig {
109
114
  xLabel?: string;
110
115
  /** Label for the y-axis */
111
116
  yLabel?: string;
112
- /** Format function for x-axis tick labels */
113
- xFormat?: (d: any, index?: number, allTicks?: number[]) => string;
114
- /** Format function for y-axis tick labels */
115
- yFormat?: (d: any) => string;
117
+ /** Format function for x-axis tick labels. Return string or ReactNode for custom rendering. */
118
+ xFormat?: (d: any, index?: number, allTicks?: number[]) => string | React.ReactNode;
119
+ /** Format function for y-axis tick labels. Return string or ReactNode for custom rendering. */
120
+ yFormat?: (d: any) => string | React.ReactNode;
116
121
  }
117
122
  /**
118
123
  * Category formatting for ordinal chart tick labels.
119
124
  * Receives the category value and its index, returns a formatted string.
120
125
  */
121
- export type CategoryFormatFn = (label: string, index?: number) => string;
126
+ export type CategoryFormatFn = (label: string, index?: number) => string | React.ReactNode;
122
127
  /**
123
128
  * Accessor type - can be a property name or a function
124
129
  * @deprecated Use DataAccessor from generalTypes for generic type safety
@@ -55,6 +55,8 @@ export interface ChartSetupInput {
55
55
  x: number;
56
56
  y: number;
57
57
  }) => void;
58
+ /** Dim non-hovered series on data mark hover */
59
+ hoverHighlight?: boolean | "series";
58
60
  /** Loading state */
59
61
  loading: boolean | undefined;
60
62
  /** Empty content override */
@@ -74,19 +74,34 @@ export interface AreaChartProps<TDatum extends Record<string, any> = Record<stri
74
74
  */
75
75
  y0Accessor?: ChartAccessor<TDatum, number>;
76
76
  /**
77
- * Gradient fill from line to baseline. Set `true` for default (80% → 5%)
78
- * or `{ topOpacity, bottomOpacity }` for custom values.
77
+ * Gradient fill from line to baseline. Set `true` for default opacity (80% → 5%),
78
+ * `{ topOpacity, bottomOpacity }` for custom opacity, or
79
+ * `{ colorStops: [{offset, color}] }` for multi-color gradients.
79
80
  * @default false
80
81
  */
81
82
  gradientFill?: boolean | {
82
83
  topOpacity: number;
83
84
  bottomOpacity: number;
85
+ } | {
86
+ colorStops: Array<{
87
+ offset: number;
88
+ color: string;
89
+ }>;
84
90
  };
85
91
  /**
86
92
  * Area opacity (flat fill, ignored when gradientFill is set)
87
93
  * @default 0.7
88
94
  */
89
95
  areaOpacity?: number;
96
+ /**
97
+ * Horizontal gradient for the line stroke. Color stops define a left-to-right gradient.
98
+ */
99
+ lineGradient?: {
100
+ colorStops: Array<{
101
+ offset: number;
102
+ color: string;
103
+ }>;
104
+ };
90
105
  /**
91
106
  * Show line on top of area
92
107
  * @default true
@@ -38,7 +38,7 @@ export interface LineChartProps<TDatum extends Record<string, any> = Record<stri
38
38
  * Scale type for the x-axis
39
39
  * @default "linear"
40
40
  */
41
- xScaleType?: "linear" | "log";
41
+ xScaleType?: "linear" | "log" | "time";
42
42
  /**
43
43
  * Scale type for the y-axis
44
44
  * @default "linear"
@@ -89,15 +89,26 @@ export interface LineChartProps<TDatum extends Record<string, any> = Record<stri
89
89
  */
90
90
  pointRadius?: number;
91
91
  /**
92
- * Fill area under the line
92
+ * Fill area under the line. `true` fills all series, `string[]` lists series
93
+ * names (matching lineBy/colorBy group key) that get area fill while others stay as lines.
93
94
  * @default false
94
95
  */
95
- fillArea?: boolean;
96
+ fillArea?: boolean | string[];
96
97
  /**
97
98
  * Area opacity when fillArea is true
98
99
  * @default 0.3
99
100
  */
100
101
  areaOpacity?: number;
102
+ /**
103
+ * Horizontal gradient for the line stroke. Color stops define a left-to-right gradient.
104
+ * `{ colorStops: [{ offset: 0, color: "blue" }, { offset: 1, color: "red" }] }`
105
+ */
106
+ lineGradient?: {
107
+ colorStops: Array<{
108
+ offset: number;
109
+ color: string;
110
+ }>;
111
+ };
101
112
  /**
102
113
  * Line stroke width
103
114
  * @default 2
@@ -15,6 +15,8 @@ export { ViolinPlot } from "./charts/ordinal/ViolinPlot";
15
15
  export { DotPlot } from "./charts/ordinal/DotPlot";
16
16
  export { PieChart } from "./charts/ordinal/PieChart";
17
17
  export { DonutChart } from "./charts/ordinal/DonutChart";
18
+ export { GaugeChart } from "./charts/ordinal/GaugeChart";
19
+ export type { GaugeChartProps, GaugeThreshold } from "./charts/ordinal/GaugeChart";
18
20
  export { RidgelinePlot } from "./charts/ordinal/RidgelinePlot";
19
21
  export { FunnelChart } from "./charts/ordinal/FunnelChart";
20
22
  export { LikertChart } from "./charts/ordinal/LikertChart";
@@ -17,6 +17,7 @@ export { createHatchPattern } from "./charts/shared/hatchPattern";
17
17
  export type { HatchPatternOptions } from "./charts/shared/hatchPattern";
18
18
  export { validateProps } from "./charts/shared/validateProps";
19
19
  export { diagnoseConfig } from "./charts/shared/diagnoseConfig";
20
+ export { getHitRadius } from "./stream/hitTestUtils";
20
21
  export { toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX } from "./export/chartConfig";
21
22
  export type { ChartConfig, ToConfigOptions, CopyFormat } from "./export/chartConfig";
22
23
  export { serializeSelections, deserializeSelections } from "./export/selectionSerializer";
@@ -26,5 +27,5 @@ export { fromVegaLite } from "./data/fromVegaLite";
26
27
  export type { VegaLiteSpec, VegaLiteEncoding } from "./data/fromVegaLite";
27
28
  export { RingBuffer } from "./realtime/RingBuffer";
28
29
  export { IncrementalExtent } from "./realtime/IncrementalExtent";
29
- export { normalizeTooltip } from "./Tooltip/Tooltip";
30
+ export { normalizeTooltip, MultiPointTooltip } from "./Tooltip/Tooltip";
30
31
  export { useReducedMotion, useHighContrast } from "./stream/useMediaPreferences";
@@ -1,7 +1,7 @@
1
1
  import StreamXYFrame from "./stream/StreamXYFrame";
2
2
  import StreamOrdinalFrame from "./stream/StreamOrdinalFrame";
3
3
  import StreamNetworkFrame from "./stream/StreamNetworkFrame";
4
- import { Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GroupedBarChart, FunnelChart, SwimlaneChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart } from "./charts";
4
+ import { Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GaugeChart, GroupedBarChart, FunnelChart, SwimlaneChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart } from "./charts";
5
5
  import { LinkedCharts } from "./LinkedCharts";
6
6
  import { ThemeProvider, useTheme } from "./ThemeProvider";
7
7
  import { exportChart } from "./export/exportChart";
@@ -23,8 +23,8 @@ import { RealtimeTemporalHistogram, RealtimeHistogram } from "./charts/realtime/
23
23
  import { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
24
24
  import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
25
25
  import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
26
- export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, FunnelChart, GroupedBarChart, SwimlaneChart, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart, LinkedCharts, ThemeProvider, useTheme, exportChart, toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX, serializeSelections, deserializeSelections, fromVegaLite, ChartErrorBoundary, ChartContainer, ChartGrid, CategoryColorProvider, useCategoryColors, ContextLayout, DetailsPanel, Tooltip, MultiLineTooltip, normalizeTooltip, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeTemporalHistogram, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap, createHatchPattern };
27
- export { ScatterplotProps, ConnectedScatterplotProps, LineChartProps, AreaChartProps, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, LikertChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, FunnelChartProps, GroupedBarChartProps, SwimlaneChartProps, RidgelinePlotProps, OrbitDiagramProps, OrbitNode, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, QuadrantChartProps, MultiAxisLineChartProps, MultiAxisSeriesConfig, QuadrantsConfig, QuadrantConfig, CenterlineStyle, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
26
+ export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, GaugeChart, FunnelChart, GroupedBarChart, SwimlaneChart, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart, LinkedCharts, ThemeProvider, useTheme, exportChart, toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX, serializeSelections, deserializeSelections, fromVegaLite, ChartErrorBoundary, ChartContainer, ChartGrid, CategoryColorProvider, useCategoryColors, ContextLayout, DetailsPanel, Tooltip, MultiLineTooltip, normalizeTooltip, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeTemporalHistogram, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap, createHatchPattern };
27
+ export { ScatterplotProps, ConnectedScatterplotProps, LineChartProps, AreaChartProps, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, LikertChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, GaugeChartProps, GaugeThreshold, FunnelChartProps, GroupedBarChartProps, SwimlaneChartProps, RidgelinePlotProps, OrbitDiagramProps, OrbitNode, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, QuadrantChartProps, MultiAxisLineChartProps, MultiAxisSeriesConfig, QuadrantsConfig, QuadrantConfig, CenterlineStyle, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
28
28
  export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType, RuntimeMode, SceneNode, Changeset, StreamScales, StreamLayout, CurveType, CanvasRendererFn } from "./stream/types";
29
29
  export type { StreamRendererFn } from "./stream/renderers/types";
30
30
  export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
@@ -1,11 +1,15 @@
1
1
  export declare function setCrosshairPosition(name: string, xValue: number, sourceId: string): void;
2
2
  export declare function clearCrosshairPosition(name: string, sourceId: string): void;
3
+ /** Toggle lock: if unlocked, lock at xValue; if locked, unlock and clear. Returns new locked state. */
4
+ export declare function toggleCrosshairLock(name: string, xValue: number, sourceId: string): boolean;
5
+ /** Force-unlock a crosshair by name. When sourceId is provided, only unlocks if it matches (safe for multi-chart unmount). */
6
+ export declare function unlockCrosshair(name: string, sourceId?: string): void;
3
7
  /**
4
8
  * Hook to read a specific crosshair position by name.
5
- * Returns the X value and sourceId, or null if no crosshair is active.
6
- * When name is undefined, uses a no-op subscription to avoid unnecessary re-renders.
9
+ * Returns the X value, sourceId, and locked state, or null if no crosshair is active.
7
10
  */
8
11
  export declare function useCrosshairPosition(name: string | undefined): {
9
12
  xValue: number;
10
13
  sourceId: string;
14
+ locked?: boolean;
11
15
  } | null;
@@ -18,6 +18,19 @@ export interface HitResult {
18
18
  * use the linear scan.
19
19
  */
20
20
  export declare function findNearestNode(scene: SceneNode[], px: number, py: number, maxDistance?: number, pointQuadtree?: Quadtree<PointSceneNode> | null): HitResult | null;
21
+ /**
22
+ * Find all line/area nodes at a given X pixel coordinate.
23
+ * For each node, interpolates the Y value at px using the path data.
24
+ * Used for multi-point tooltip (show all series values at the hovered X).
25
+ */
26
+ export declare function findAllNodesAtX(scene: SceneNode[], px: number, maxXDistance?: number): Array<{
27
+ node: SceneNode;
28
+ datum: any;
29
+ x: number;
30
+ y: number;
31
+ group?: string;
32
+ color?: string;
33
+ }>;
21
34
  /**
22
35
  * Binary search for nearest point by time value in a RingBuffer.
23
36
  */
@@ -19,7 +19,7 @@ interface OrdinalSVGOverlayProps {
19
19
  showCategoryTicks?: boolean;
20
20
  oLabel?: string;
21
21
  rLabel?: string;
22
- oFormat?: (d: string, index?: number) => string;
22
+ oFormat?: (d: string, index?: number) => string | React.ReactNode;
23
23
  rFormat?: (d: number) => string;
24
24
  showGrid?: boolean;
25
25
  title?: string | ReactNode;
@@ -9,6 +9,8 @@ export interface PipelineConfig {
9
9
  windowMode: WindowMode;
10
10
  arrowOfTime: ArrowOfTime;
11
11
  extentPadding: number;
12
+ /** Pixel inset on scale ranges to prevent glyph clipping at chart edges. Default 0. */
13
+ scalePadding?: number;
12
14
  maxCapacity?: number;
13
15
  xAccessor?: string | ((d: any) => number);
14
16
  yAccessor?: string | ((d: any) => number);
@@ -19,7 +21,7 @@ export interface PipelineConfig {
19
21
  groupAccessor?: string | ((d: any) => string);
20
22
  categoryAccessor?: string | ((d: any) => string);
21
23
  lineDataAccessor?: string;
22
- xScaleType?: "linear" | "log";
24
+ xScaleType?: "linear" | "log" | "time";
23
25
  yScaleType?: "linear" | "log";
24
26
  xExtent?: [number | undefined, number | undefined] | [number];
25
27
  yExtent?: [number | undefined, number | undefined] | [number];
@@ -31,12 +33,26 @@ export interface PipelineConfig {
31
33
  lowAccessor?: string | ((d: any) => number);
32
34
  closeAccessor?: string | ((d: any) => number);
33
35
  candlestickStyle?: CandlestickStyle;
36
+ /** Internal: set by PipelineStore when open/close accessors are both missing */
37
+ candlestickRangeMode?: boolean;
34
38
  boundsAccessor?: string | ((d: any) => number);
35
39
  boundsStyle?: any;
36
40
  y0Accessor?: string | ((d: any) => number);
37
41
  gradientFill?: {
38
42
  topOpacity: number;
39
43
  bottomOpacity: number;
44
+ } | {
45
+ colorStops: Array<{
46
+ offset: number;
47
+ color: string;
48
+ }>;
49
+ };
50
+ areaGroups?: Set<string>;
51
+ lineGradient?: {
52
+ colorStops: Array<{
53
+ offset: number;
54
+ color: string;
55
+ }>;
40
56
  };
41
57
  lineStyle?: any;
42
58
  pointStyle?: (d: any) => Style & {
@@ -7,9 +7,15 @@ export interface AxisConfig {
7
7
  orient: "left" | "right" | "top" | "bottom";
8
8
  label?: string;
9
9
  ticks?: number;
10
- tickFormat?: (d: any, index?: number, allTicks?: number[]) => string;
10
+ tickFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
11
11
  baseline?: boolean | "under";
12
12
  jaggedBase?: boolean;
13
+ /** Grid line stroke style: "dashed" (6,4), "dotted" (2,4), or a custom strokeDasharray string. Applied to grid lines extending from ticks across the chart area. */
14
+ gridStyle?: "dashed" | "dotted" | string;
15
+ /** Always include the domain max as a tick, even if d3 omits it. */
16
+ includeMax?: boolean;
17
+ /** Auto-rotate labels 45° when horizontal spacing is too tight. */
18
+ autoRotate?: boolean;
13
19
  /** Highlight ticks at time boundaries (new month, year, etc.) with semibold text.
14
20
  * `true` auto-detects Date boundaries. A function receives (value, index) and returns true for landmark ticks. */
15
21
  landmarkTicks?: boolean | ((value: any, index: number) => boolean);
@@ -32,8 +38,8 @@ interface SVGOverlayProps {
32
38
  yLabel?: string;
33
39
  /** Label for the right Y axis (dual-axis charts) */
34
40
  yLabelRight?: string;
35
- xFormat?: (d: any, index?: number, allTicks?: number[]) => string;
36
- yFormat?: (d: any) => string;
41
+ xFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
42
+ yFormat?: (d: any) => string | ReactNode;
37
43
  showGrid?: boolean;
38
44
  title?: string | ReactNode;
39
45
  legend?: ReactNode | {
@@ -96,8 +102,8 @@ interface SVGUnderlayProps {
96
102
  showAxes?: boolean;
97
103
  axes?: AxisConfig[];
98
104
  showGrid?: boolean;
99
- xFormat?: (d: any, index?: number, allTicks?: number[]) => string;
100
- yFormat?: (d: any) => string;
105
+ xFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
106
+ yFormat?: (d: any) => string | ReactNode;
101
107
  }
102
108
  export declare function SVGUnderlay(props: SVGUnderlayProps): React.JSX.Element | null;
103
109
  export declare function SVGOverlay(props: SVGOverlayProps): React.JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Dev-mode helper that warns when user callbacks access properties that exist
3
+ * on `.data` but not on the RealtimeNode/RealtimeEdge wrapper.
4
+ *
5
+ * Common pitfall:
6
+ * nodeStyle={(d) => ({ fill: d.category })} // undefined!
7
+ * nodeStyle={(d) => ({ fill: d.data?.category })} // correct
8
+ *
9
+ * In production, this is a no-op passthrough.
10
+ */
11
+ export declare function wrapWithDataHint<T extends {
12
+ data?: Record<string, any>;
13
+ }>(datum: T, callbackName: string): T;
@@ -17,6 +17,21 @@ export declare function hitTestRect(px: number, py: number, node: {
17
17
  w: number;
18
18
  h: number;
19
19
  }): RectHitResult;
20
+ /**
21
+ * Compute the effective hit radius for a point/circle node.
22
+ * Uses the larger of the visual radius + tolerance, Fitts's law minimum (12px),
23
+ * and the caller's maxDistance (default 30px).
24
+ */
25
+ export declare function getHitRadius(nodeRadius: number | undefined, maxDistance?: number): number;
26
+ /**
27
+ * Convert a value to a Date if possible. Returns null for non-date values.
28
+ * Treats numbers > 1e9 as millisecond timestamps.
29
+ */
30
+ export declare function toDate(value: any): Date | null;
31
+ /**
32
+ * Detect whether a tick marks a time boundary (new month or year) compared to the previous tick.
33
+ */
34
+ export declare function isTimeLandmark(value: any, prevValue: any): boolean;
20
35
  /**
21
36
  * Normalize an angle to the [0, 2π) range.
22
37
  */
@@ -146,9 +146,13 @@ export interface OrdinalPipelineConfig {
146
146
  rExtent?: [number?, number?];
147
147
  oExtent?: string[];
148
148
  barPadding?: number;
149
+ /** When true, adds padding below the 0 baseline. When false (default), bars are flush with the axis line. */
150
+ baselinePadding?: boolean;
149
151
  innerRadius?: number;
150
152
  normalize?: boolean;
151
153
  startAngle?: number;
154
+ /** Total arc sweep in degrees (default 360 = full circle). Used by GaugeChart for partial arcs. */
155
+ sweepAngle?: number;
152
156
  bins?: number;
153
157
  showOutliers?: boolean;
154
158
  showIQR?: boolean;
@@ -192,9 +196,11 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
192
196
  left?: number;
193
197
  };
194
198
  barPadding?: number;
199
+ baselinePadding?: boolean;
195
200
  innerRadius?: number;
196
201
  normalize?: boolean;
197
202
  startAngle?: number;
203
+ sweepAngle?: number;
198
204
  dynamicColumnWidth?: string | ((data: T[]) => number);
199
205
  bins?: number;
200
206
  showOutliers?: boolean;
@@ -219,7 +225,7 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
219
225
  showCategoryTicks?: boolean;
220
226
  oLabel?: string;
221
227
  rLabel?: string;
222
- oFormat?: (d: string, index?: number) => string;
228
+ oFormat?: (d: string, index?: number) => string | ReactNode;
223
229
  rFormat?: (d: number | string) => string;
224
230
  enableHover?: boolean;
225
231
  hoverAnnotation?: boolean | HoverAnnotationConfig;