semiotic 3.2.0 → 3.2.2
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.
- package/CLAUDE.md +50 -8
- package/README.md +11 -11
- package/ai/dist/mcp-server.js +31925 -528
- package/ai/examples.md +91 -0
- package/ai/schema.json +235 -9
- package/ai/system-prompt.md +12 -4
- package/dist/components/ChartContainer.d.ts +2 -0
- package/dist/components/DataSummaryContext.d.ts +12 -0
- package/dist/components/Tooltip/FlippingTooltip.d.ts +34 -0
- package/dist/components/charts/index.d.ts +4 -0
- package/dist/components/charts/ordinal/BarChart.d.ts +3 -1
- package/dist/components/charts/ordinal/BoxPlot.d.ts +3 -1
- package/dist/components/charts/ordinal/DonutChart.d.ts +0 -1
- package/dist/components/charts/ordinal/DotPlot.d.ts +3 -1
- package/dist/components/charts/ordinal/FunnelChart.d.ts +3 -1
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -1
- package/dist/components/charts/ordinal/Histogram.d.ts +16 -2
- package/dist/components/charts/ordinal/LikertChart.d.ts +94 -0
- package/dist/components/charts/ordinal/PieChart.d.ts +0 -1
- package/dist/components/charts/ordinal/RidgelinePlot.d.ts +11 -7
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -1
- package/dist/components/charts/ordinal/SwarmPlot.d.ts +14 -1
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +65 -0
- package/dist/components/charts/ordinal/ViolinPlot.d.ts +16 -2
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +20 -0
- package/dist/components/charts/shared/annotationResolvers.d.ts +28 -0
- package/dist/components/charts/shared/hooks.d.ts +23 -2
- package/dist/components/charts/shared/selectionUtils.d.ts +5 -1
- package/dist/components/charts/shared/statsTooltip.d.ts +11 -0
- package/dist/components/charts/shared/types.d.ts +22 -1
- package/dist/components/charts/shared/useChartSetup.d.ts +12 -2
- package/dist/components/charts/shared/useLikertAggregation.d.ts +51 -0
- package/dist/components/charts/shared/useOrdinalBrush.d.ts +28 -0
- package/dist/components/charts/shared/useOrdinalStreaming.d.ts +54 -0
- package/dist/components/charts/shared/useStreamingLegend.d.ts +2 -2
- package/dist/components/charts/shared/validateProps.d.ts +2 -2
- package/dist/components/charts/shared/validationMap.d.ts +12 -0
- package/dist/components/charts/xy/AreaChart.d.ts +11 -0
- package/dist/components/charts/xy/MinimapChart.d.ts +1 -1
- package/dist/components/charts/xy/StackedAreaChart.d.ts +11 -0
- package/dist/components/realtime/types.d.ts +4 -0
- package/dist/components/semiotic-ai.d.ts +1 -0
- package/dist/components/semiotic-ordinal.d.ts +2 -0
- package/dist/components/semiotic-themes.d.ts +16 -0
- package/dist/components/semiotic-utils.d.ts +30 -0
- package/dist/components/semiotic.d.ts +4 -4
- package/dist/components/store/LinkedCrosshairStore.d.ts +11 -0
- package/dist/components/store/useSelection.d.ts +1 -0
- package/dist/components/stream/AccessibleDataTable.d.ts +28 -6
- package/dist/components/stream/FocusRing.d.ts +33 -0
- package/dist/components/stream/OrdinalBrushOverlay.d.ts +43 -0
- package/dist/components/stream/OrdinalPipelineStore.d.ts +16 -0
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +5 -47
- package/dist/components/stream/SVGOverlay.d.ts +4 -0
- package/dist/components/stream/SceneGraph.d.ts +6 -1
- package/dist/components/stream/XYBrushOverlay.d.ts +47 -0
- package/dist/components/stream/devDataAccessWarning.d.ts +13 -0
- package/dist/components/stream/geoTypes.d.ts +5 -1
- package/dist/components/stream/keyboardNav.d.ts +85 -9
- package/dist/components/stream/layouts/hierarchySceneBuilders.d.ts +35 -0
- package/dist/components/stream/layouts/hierarchyUtils.d.ts +25 -0
- package/dist/components/stream/networkTypes.d.ts +5 -1
- package/dist/components/stream/ordinalSceneBuilders/swimlaneScene.d.ts +12 -0
- package/dist/components/stream/ordinalTypes.d.ts +15 -3
- package/dist/components/stream/pipelineDecay.d.ts +20 -0
- package/dist/components/stream/pipelinePulse.d.ts +24 -0
- package/dist/components/stream/pipelineTransitions.d.ts +59 -0
- package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +2 -1
- package/dist/components/stream/types.d.ts +19 -1
- package/dist/components/stream/useMediaPreferences.d.ts +11 -0
- package/dist/components/stream/xySceneBuilders/areaScene.d.ts +13 -0
- package/dist/components/stream/xySceneBuilders/barScene.d.ts +18 -0
- package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +8 -0
- package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +10 -0
- package/dist/components/stream/xySceneBuilders/emitPointNodes.d.ts +13 -0
- package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +3 -0
- package/dist/components/stream/xySceneBuilders/lineScene.d.ts +12 -0
- package/dist/components/stream/xySceneBuilders/pointScene.d.ts +12 -0
- package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +10 -0
- package/dist/components/stream/xySceneBuilders/types.d.ts +93 -0
- package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +12 -0
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +1 -0
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-ordinal.d.ts +2 -0
- package/dist/{semiotic-statisticalOverlays-D8LhSbQt.js → semiotic-statisticalOverlays-DGX_WWc5.js} +1 -1
- package/dist/semiotic-themes.d.ts +16 -0
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils.d.ts +30 -0
- package/dist/semiotic-utils.min.js +1 -0
- package/dist/semiotic-utils.module.min.js +1 -0
- package/dist/semiotic.d.ts +4 -4
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +19 -11
|
@@ -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
|
|
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
|
|
36
|
-
|
|
37
|
-
|
|
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
|
|
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
|
|
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;
|
|
@@ -21,7 +21,9 @@ export interface SelectionConfig {
|
|
|
21
21
|
*/
|
|
22
22
|
export type LinkedHoverProp = boolean | string | {
|
|
23
23
|
name?: string;
|
|
24
|
-
fields
|
|
24
|
+
fields?: string[];
|
|
25
|
+
mode?: "field" | "x-position";
|
|
26
|
+
xField?: string;
|
|
25
27
|
};
|
|
26
28
|
/**
|
|
27
29
|
* Linked brush config
|
|
@@ -76,6 +78,20 @@ export interface BaseChartProps {
|
|
|
76
78
|
/** Uniform fill color for all data marks. Overrides colorScheme and theme categorical.
|
|
77
79
|
* For per-category coloring, use `colorBy` + `colorScheme` instead. */
|
|
78
80
|
color?: string;
|
|
81
|
+
/** Accessible description overriding the auto-generated aria-label on the chart container.
|
|
82
|
+
* Should describe the chart's purpose or content for screen reader users. */
|
|
83
|
+
description?: string;
|
|
84
|
+
/** Accessible summary rendered as a screen-reader-only note.
|
|
85
|
+
* Use for trend descriptions or key takeaways that supplement the visual. */
|
|
86
|
+
summary?: string;
|
|
87
|
+
/** Enable accessible data table below the chart canvas. Default: true (via frame). */
|
|
88
|
+
accessibleTable?: boolean;
|
|
89
|
+
/** Callback when a data element is clicked. Receives the original datum and pixel coordinates.
|
|
90
|
+
* For lines, receives the line data; for bars, the bar datum; for pie slices, the slice datum. */
|
|
91
|
+
onClick?: (datum: any, event: {
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
}) => void;
|
|
79
95
|
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
80
96
|
emphasis?: "primary" | "secondary";
|
|
81
97
|
/** Enable declarative bounded animation (enter/exit/update transitions).
|
|
@@ -98,6 +114,11 @@ export interface AxisConfig {
|
|
|
98
114
|
/** Format function for y-axis tick labels */
|
|
99
115
|
yFormat?: (d: any) => string;
|
|
100
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Category formatting for ordinal chart tick labels.
|
|
119
|
+
* Receives the category value and its index, returns a formatted string.
|
|
120
|
+
*/
|
|
121
|
+
export type CategoryFormatFn = (label: string, index?: number) => string;
|
|
101
122
|
/**
|
|
102
123
|
* Accessor type - can be a property name or a function
|
|
103
124
|
* @deprecated Use DataAccessor from generalTypes for generic type safety
|
|
@@ -19,8 +19,8 @@ export interface ChartSetupInput {
|
|
|
19
19
|
rawData: unknown[] | undefined;
|
|
20
20
|
/** The color-by accessor (may be an "actual" colorBy derived from stackBy/groupBy/categoryAccessor) */
|
|
21
21
|
colorBy: Accessor<string> | undefined;
|
|
22
|
-
/** Color scheme name or custom array */
|
|
23
|
-
colorScheme: string | string[];
|
|
22
|
+
/** Color scheme name or custom array — undefined lets useColorScale consult the theme */
|
|
23
|
+
colorScheme: string | string[] | undefined;
|
|
24
24
|
/** Legend interaction mode */
|
|
25
25
|
legendInteraction: LegendInteractionMode | undefined;
|
|
26
26
|
/** Legend position override */
|
|
@@ -50,6 +50,11 @@ export interface ChartSetupInput {
|
|
|
50
50
|
left: number;
|
|
51
51
|
right: number;
|
|
52
52
|
};
|
|
53
|
+
/** onClick callback */
|
|
54
|
+
onClick?: (datum: any, event: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
}) => void;
|
|
53
58
|
/** Loading state */
|
|
54
59
|
loading: boolean | undefined;
|
|
55
60
|
/** Empty content override */
|
|
@@ -92,6 +97,11 @@ export interface ChartSetupResult {
|
|
|
92
97
|
earlyReturn: ReactElement | null;
|
|
93
98
|
/** Props to spread into the stream frame for legend behavior */
|
|
94
99
|
legendBehaviorProps: Record<string, any>;
|
|
100
|
+
/** Crosshair props to spread into StreamXYFrame when linkedHover mode is "x-position" */
|
|
101
|
+
crosshairProps: {
|
|
102
|
+
linkedCrosshairName: string;
|
|
103
|
+
linkedCrosshairSourceId: string;
|
|
104
|
+
} | undefined;
|
|
95
105
|
}
|
|
96
106
|
/**
|
|
97
107
|
* Hook that consolidates the shared boilerplate across all HOC charts:
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { RefObject, MutableRefObject } from "react";
|
|
2
|
+
import type { StreamOrdinalFrameHandle } from "../../stream/ordinalTypes";
|
|
3
|
+
export interface AggregatedRow {
|
|
4
|
+
__likertCategory: string;
|
|
5
|
+
/** Stacking key — may be sentinel value for neutral halves */
|
|
6
|
+
__likertLevel: string;
|
|
7
|
+
/** Human-readable level label — always the original level name (for legend/selection) */
|
|
8
|
+
__likertLevelLabel: string;
|
|
9
|
+
__likertCount: number;
|
|
10
|
+
__likertPct: number;
|
|
11
|
+
__likertLevelIndex: number;
|
|
12
|
+
}
|
|
13
|
+
/** Sentinel level names for the neutral split halves */
|
|
14
|
+
export declare const NEUTRAL_NEG = "__likert_neutral_neg";
|
|
15
|
+
export declare const NEUTRAL_POS = "__likert_neutral_pos";
|
|
16
|
+
export declare function resolveAccessorFn<T>(accessor: string | ((d: any) => T) | undefined, fallback: string): (d: any) => T;
|
|
17
|
+
/**
|
|
18
|
+
* Generate a diverging color scheme for N levels.
|
|
19
|
+
* Interpolates from red → gray → blue for odd, red → blue for even.
|
|
20
|
+
*/
|
|
21
|
+
export declare function defaultDivergingScheme(n: number): string[];
|
|
22
|
+
export declare function aggregateData(data: any[], levels: string[], getCat: (d: any) => string, getScore: ((d: any) => number) | null, getLevel: ((d: any) => string) | null, getCount: ((d: any) => number) | null): AggregatedRow[];
|
|
23
|
+
export declare function toDivergingValues(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
|
|
24
|
+
export declare function orderForDiverging(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
|
|
25
|
+
interface UseLikertAggregationConfig {
|
|
26
|
+
data: any[] | undefined;
|
|
27
|
+
levels: string[];
|
|
28
|
+
categoryAccessor?: string | ((d: any) => string);
|
|
29
|
+
valueAccessor?: string | ((d: any) => number);
|
|
30
|
+
levelAccessor?: string | ((d: any) => string);
|
|
31
|
+
countAccessor?: string | ((d: any) => number);
|
|
32
|
+
isDiverging: boolean;
|
|
33
|
+
frameRef: RefObject<StreamOrdinalFrameHandle | null>;
|
|
34
|
+
}
|
|
35
|
+
interface UseLikertAggregationResult {
|
|
36
|
+
/** Pre-processed data for static mode */
|
|
37
|
+
processedData: AggregatedRow[];
|
|
38
|
+
/** Re-aggregate all accumulated data (call from push handlers) */
|
|
39
|
+
reAggregate: (rawData: any[]) => void;
|
|
40
|
+
/** Ref holding accumulated raw data for push mode */
|
|
41
|
+
accumulatorRef: MutableRefObject<any[]>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Encapsulates Likert-specific data aggregation:
|
|
45
|
+
* - Resolves accessor functions
|
|
46
|
+
* - Aggregates raw/pre-aggregated data to percentages
|
|
47
|
+
* - Applies diverging transforms (sign flip, neutral split, stacking order)
|
|
48
|
+
* - Provides re-aggregation callback for push API streaming
|
|
49
|
+
*/
|
|
50
|
+
export declare function useLikertAggregation({ data, levels, categoryAccessor, valueAccessor, levelAccessor, countAccessor, isDiverging, frameRef, }: UseLikertAggregationConfig): UseLikertAggregationResult;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ChartAccessor } from "./types";
|
|
2
|
+
export interface OrdinalBrushInput {
|
|
3
|
+
brushProp: boolean | undefined;
|
|
4
|
+
onBrushProp: ((extent: {
|
|
5
|
+
r: [number, number];
|
|
6
|
+
} | null) => void) | undefined;
|
|
7
|
+
linkedBrush: string | {
|
|
8
|
+
name: string;
|
|
9
|
+
rField?: string;
|
|
10
|
+
} | undefined;
|
|
11
|
+
valueAccessor: ChartAccessor<any, number>;
|
|
12
|
+
}
|
|
13
|
+
export interface OrdinalBrushResult {
|
|
14
|
+
hasBrush: boolean;
|
|
15
|
+
handleBrush: (extent: {
|
|
16
|
+
r: [number, number];
|
|
17
|
+
} | null) => void;
|
|
18
|
+
/** Spread into streamProps: `...brushStreamProps` */
|
|
19
|
+
brushStreamProps: {
|
|
20
|
+
brush: {
|
|
21
|
+
dimension: "r";
|
|
22
|
+
};
|
|
23
|
+
onBrush: (extent: {
|
|
24
|
+
r: [number, number];
|
|
25
|
+
} | null) => void;
|
|
26
|
+
} | Record<string, never>;
|
|
27
|
+
}
|
|
28
|
+
export declare function useOrdinalBrush({ brushProp, onBrushProp, linkedBrush, valueAccessor, }: OrdinalBrushInput): OrdinalBrushResult;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Ref, RefObject } from "react";
|
|
2
|
+
import type { StreamOrdinalFrameHandle } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
4
|
+
import type { Accessor } from "./types";
|
|
5
|
+
import type { LegendPosition } from "./hooks";
|
|
6
|
+
interface UseOrdinalStreamingConfig {
|
|
7
|
+
/** External ref for push API */
|
|
8
|
+
ref: Ref<RealtimeFrameHandle>;
|
|
9
|
+
/** Internal frame ref */
|
|
10
|
+
frameRef: RefObject<StreamOrdinalFrameHandle | null>;
|
|
11
|
+
/** True when data prop is undefined (push API mode) */
|
|
12
|
+
isPushMode: boolean;
|
|
13
|
+
/** Color-by accessor (may be derived from stackBy/groupBy/etc.) */
|
|
14
|
+
colorBy: Accessor<string> | undefined;
|
|
15
|
+
/** Color scheme name or array — undefined lets useColorScale consult the theme */
|
|
16
|
+
colorScheme: string | string[] | undefined;
|
|
17
|
+
/** Whether legend is requested */
|
|
18
|
+
showLegend: boolean | undefined;
|
|
19
|
+
/** Legend position */
|
|
20
|
+
legendPosition?: LegendPosition;
|
|
21
|
+
/** Results from useChartSetup — needed for legend/margin merge */
|
|
22
|
+
setup: {
|
|
23
|
+
legendBehaviorProps: Record<string, any>;
|
|
24
|
+
legendPosition: LegendPosition;
|
|
25
|
+
margin: {
|
|
26
|
+
top: number;
|
|
27
|
+
right: number;
|
|
28
|
+
bottom: number;
|
|
29
|
+
left: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
interface UseOrdinalStreamingResult {
|
|
34
|
+
/** Legend props merged with streaming legend (spread into streamProps) */
|
|
35
|
+
effectiveLegendProps: Record<string, any>;
|
|
36
|
+
/** Margin merged with streaming legend margin adjustments */
|
|
37
|
+
effectiveMargin: {
|
|
38
|
+
top: number;
|
|
39
|
+
right: number;
|
|
40
|
+
bottom: number;
|
|
41
|
+
left: number;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Shared hook for ordinal charts that support push API + streaming legend.
|
|
46
|
+
*
|
|
47
|
+
* Consolidates: useStreamingLegend, wrappedPush/pushMany,
|
|
48
|
+
* useImperativeHandle, effectiveLegendProps, effectiveMargin.
|
|
49
|
+
*
|
|
50
|
+
* Used by: StackedBarChart, GroupedBarChart, PieChart, DonutChart, SwimlaneChart.
|
|
51
|
+
* NOT used by LikertChart (custom accumulator + deterministic legend).
|
|
52
|
+
*/
|
|
53
|
+
export declare function useOrdinalStreaming({ ref, frameRef, isPushMode, colorBy, colorScheme, showLegend, legendPosition, setup, }: UseOrdinalStreamingConfig): UseOrdinalStreamingResult;
|
|
54
|
+
export {};
|