semiotic 3.1.2 → 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.
- package/CLAUDE.md +173 -213
- package/LICENSE +197 -10
- package/README.md +12 -11
- package/ai/dist/componentRegistry.js +6 -0
- package/ai/dist/mcp-server.js +115 -5
- package/ai/examples.md +184 -0
- package/ai/schema.json +4140 -888
- package/ai/system-prompt.md +36 -1
- package/dist/components/ChartContainer.d.ts +2 -0
- package/dist/components/DataSummaryContext.d.ts +12 -0
- package/dist/components/ThemeProvider.d.ts +5 -3
- package/dist/components/Tooltip/FlippingTooltip.d.ts +34 -0
- package/dist/components/charts/geo/ChoroplethMap.d.ts +1 -1
- package/dist/components/charts/index.d.ts +12 -1
- package/dist/components/charts/ordinal/BarChart.d.ts +4 -1
- package/dist/components/charts/ordinal/BoxPlot.d.ts +4 -1
- package/dist/components/charts/ordinal/DonutChart.d.ts +1 -1
- package/dist/components/charts/ordinal/DotPlot.d.ts +4 -1
- package/dist/components/charts/ordinal/FunnelChart.d.ts +57 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +4 -1
- package/dist/components/charts/ordinal/Histogram.d.ts +17 -2
- package/dist/components/charts/ordinal/LikertChart.d.ts +94 -0
- package/dist/components/charts/ordinal/PieChart.d.ts +1 -1
- package/dist/components/charts/ordinal/RidgelinePlot.d.ts +12 -7
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -1
- package/dist/components/charts/ordinal/SwarmPlot.d.ts +15 -1
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +65 -0
- package/dist/components/charts/ordinal/ViolinPlot.d.ts +17 -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/colorManipulation.d.ts +15 -0
- package/dist/components/charts/shared/formatUtils.d.ts +28 -0
- package/dist/components/charts/shared/hatchPattern.d.ts +35 -0
- package/dist/components/charts/shared/hooks.d.ts +39 -3
- package/dist/components/charts/shared/legendUtils.d.ts +2 -1
- package/dist/components/charts/shared/selectionUtils.d.ts +16 -1
- package/dist/components/charts/shared/statisticalOverlays.d.ts +49 -5
- package/dist/components/charts/shared/statsTooltip.d.ts +11 -0
- package/dist/components/charts/shared/types.d.ts +26 -2
- 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/Heatmap.d.ts +1 -1
- package/dist/components/charts/xy/MinimapChart.d.ts +1 -1
- package/dist/components/charts/xy/MultiAxisLineChart.d.ts +71 -0
- package/dist/components/charts/xy/StackedAreaChart.d.ts +11 -0
- package/dist/components/realtime/types.d.ts +6 -0
- package/dist/components/semiotic-ai.d.ts +4 -0
- package/dist/components/semiotic-ordinal.d.ts +5 -0
- package/dist/components/semiotic-themes.d.ts +80 -0
- package/dist/components/semiotic-utils.d.ts +30 -0
- package/dist/components/semiotic-xy.d.ts +1 -0
- package/dist/components/semiotic.d.ts +11 -5
- package/dist/components/store/LinkedCrosshairStore.d.ts +11 -0
- package/dist/components/store/ThemeStore.d.ts +22 -2
- 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 +2 -1
- package/dist/components/stream/PipelineStore.d.ts +7 -47
- package/dist/components/stream/SVGOverlay.d.ts +9 -3
- package/dist/components/stream/SceneGraph.d.ts +6 -1
- package/dist/components/stream/XYBrushOverlay.d.ts +47 -0
- package/dist/components/stream/accessorUtils.d.ts +14 -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 +7 -1
- package/dist/components/stream/ordinalSceneBuilders/barFunnelScene.d.ts +27 -0
- package/dist/components/stream/ordinalSceneBuilders/funnelScene.d.ts +26 -0
- package/dist/components/stream/ordinalSceneBuilders/swimlaneScene.d.ts +12 -0
- package/dist/components/stream/ordinalTypes.d.ts +30 -4
- 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/barFunnelCanvasRenderer.d.ts +12 -0
- package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +2 -1
- package/dist/components/stream/renderers/trapezoidCanvasRenderer.d.ts +15 -0
- package/dist/components/stream/sceneUtils.d.ts +10 -0
- package/dist/components/stream/types.d.ts +29 -4
- 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-statisticalOverlays-C2PPlmXv.js +1 -0
- package/dist/semiotic-ai.d.ts +4 -0
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-ordinal.d.ts +5 -0
- package/dist/semiotic-statisticalOverlays-DGX_WWc5.js +1 -0
- package/dist/semiotic-themes.d.ts +80 -0
- package/dist/semiotic-themes.min.js +1 -0
- package/dist/semiotic-themes.module.min.js +1 -0
- 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-xy.d.ts +1 -0
- package/dist/semiotic.d.ts +11 -5
- 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-statisticalOverlays-C2PPlmXv.js +1 -0
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +38 -12
- package/dist/semiotic-ai-statisticalOverlays-C1f7TYyD.js +0 -1
- package/dist/semiotic-statisticalOverlays-C1f7TYyD.js +0 -1
- package/dist/xy-statisticalOverlays-C1f7TYyD.js +0 -1
package/ai/system-prompt.md
CHANGED
|
@@ -21,6 +21,8 @@ Use `import { ComponentName } from "semiotic/ai"` for all components below.
|
|
|
21
21
|
- **PieChart** — `categoryAccessor`, `valueAccessor`
|
|
22
22
|
- **DonutChart** — `categoryAccessor`, `valueAccessor`, `innerRadius`, `centerContent` (ReactNode, e.g. `<div>50%</div>`)
|
|
23
23
|
|
|
24
|
+
All ordinal HOCs (except Pie/Donut) support `categoryFormat` — a function `(label, index?) => string` for custom tick label formatting (truncation, abbreviation).
|
|
25
|
+
|
|
24
26
|
## Hierarchical Data (`data: { children: [...] }`)
|
|
25
27
|
- **TreeDiagram** — `childrenAccessor`, `nodeIdAccessor`, `layout` ("tree"|"cluster"|"partition"), `orientation`
|
|
26
28
|
- **Treemap** — `childrenAccessor`, `valueAccessor`, `nodeIdAccessor`, `colorByDepth`
|
|
@@ -65,17 +67,50 @@ For advanced streaming control, use Stream Frames (`StreamXYFrame`, `StreamOrdin
|
|
|
65
67
|
- When using with `size={[w, h]}`, set `height={h}` on the container or you'll get extra whitespace.
|
|
66
68
|
|
|
67
69
|
## Common Props (all components)
|
|
68
|
-
`width`, `height`, `margin`, `title`, `colorBy`, `colorScheme`, `enableHover`, `tooltip`, `showLegend`, `className`, `frameProps`, `onObservation`, `emphasis` ("primary"|"secondary")
|
|
70
|
+
`width`, `height`, `margin`, `title`, `colorBy`, `colorScheme`, `enableHover`, `tooltip`, `showLegend`, `className`, `frameProps`, `onObservation`, `onClick`, `emphasis` ("primary"|"secondary")
|
|
69
71
|
|
|
70
72
|
### tooltip
|
|
71
73
|
`true` (default) | `false` | `(datum) => ReactNode` (function receives your raw data) | config `{ fields?, title?, format?, style? }`
|
|
72
74
|
|
|
75
|
+
### onClick
|
|
76
|
+
`onClick={(datum, { x, y }) => ...}` — called when a data element is clicked. Receives the original datum and pixel coordinates. Works on lines, bars, areas, pie slices, nodes, and geo features.
|
|
77
|
+
|
|
73
78
|
### onObservation
|
|
74
79
|
Callback receiving `ChartObservation`: `{ type: "hover"|"click"|"brush"|"selection", datum: <your data>, x, y, timestamp, chartType, chartId }`. The `datum` field is your original data object. Hover-end/click-end events omit `datum`.
|
|
75
80
|
|
|
76
81
|
### emphasis
|
|
77
82
|
`emphasis="primary"` makes a chart span two columns inside a `ChartGrid`.
|
|
78
83
|
|
|
84
|
+
## Annotations (XY and ordinal charts)
|
|
85
|
+
- `annotations={[{ type: "y-threshold", value: 200, label: "SLA limit", color: "#e45050", labelPosition: "right" }]}` — horizontal reference line (works on XY and vertical ordinal charts). `labelPosition`: "left"|"center"|"right"
|
|
86
|
+
- `annotations={[{ type: "x-threshold", value: 50, label: "Cutoff", labelPosition: "top" }]}` — vertical reference line. `labelPosition`: "top"|"center"|"bottom"
|
|
87
|
+
- `annotations={[{ type: "category-highlight", category: "Q3 2024", color: "#4589ff", opacity: 0.15 }]}` — highlight a category column/row in ordinal charts
|
|
88
|
+
- `annotations={[{ type: "widget", time: 42, latency: 850, dy: -10, content: <span>Alert</span> }]}` — place React element at data coordinates
|
|
89
|
+
- `annotations={[{ type: "enclose", coordinates: [datum1, datum2], label: "Cluster" }]}` — circle enclosing data points
|
|
90
|
+
|
|
91
|
+
## Theming & Brand Styling
|
|
92
|
+
All charts respond to CSS custom properties on any ancestor:
|
|
93
|
+
```css
|
|
94
|
+
.my-theme {
|
|
95
|
+
--semiotic-bg: #1a1a2e; /* chart background */
|
|
96
|
+
--semiotic-text: #ededed; /* primary text */
|
|
97
|
+
--semiotic-text-secondary: #aaa; /* tick labels */
|
|
98
|
+
--semiotic-grid: #333; /* grid lines */
|
|
99
|
+
--semiotic-border: #555; /* axis lines */
|
|
100
|
+
--semiotic-font-family: Georgia, serif;
|
|
101
|
+
--semiotic-tooltip-bg: #1a1a2e;
|
|
102
|
+
--semiotic-tooltip-text: #ededed;
|
|
103
|
+
--semiotic-tooltip-radius: 8px;
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
Or use ThemeProvider with 15 named presets: `<ThemeProvider theme="tufte">`, `"tufte-dark"`, `"pastels"`, `"bi-tool"`, `"italian"`, `"journalist"`, `"playful"` (each with `-dark` variant), `"dark"`, `"high-contrast"`.
|
|
107
|
+
|
|
108
|
+
**Color resolution**: When `colorBy` is set, charts use: explicit `colorScheme` prop > ThemeProvider `colors.categorical` > `"category10"`. No need to pass `colorScheme` on every chart when using ThemeProvider.
|
|
109
|
+
|
|
110
|
+
`semiotic/themes` entry point: `themeToCSS(theme, selector)` generates CSS string, `themeToTokens(theme)` generates DTCG design tokens, `resolveThemePreset("tufte")` returns theme object by name. Theme objects: `TUFTE_LIGHT`, `TUFTE_DARK`, `PASTELS_LIGHT`, `BI_TOOL_LIGHT`, `ITALIAN_LIGHT`, `JOURNALIST_LIGHT`, `PLAYFUL_LIGHT`, etc.
|
|
111
|
+
|
|
112
|
+
`COLOR_BLIND_SAFE_CATEGORICAL` — 8-color accessible palette (Wong 2011). Import from `semiotic`.
|
|
113
|
+
|
|
79
114
|
## Key Patterns
|
|
80
115
|
- **Percentile band + main line**: Layer `<AreaChart yAccessor="p95" y0Accessor="p5" showLine={false} />` + `<LineChart yAccessor="p50" />`. AreaChart's `showLine` only draws the top edge, NOT a separate main line.
|
|
81
116
|
- **SSR**: `renderToStaticSVG("ordinal", props)` or `renderOrdinalToStaticSVG(props)` from `semiotic/server`. Frame type is `"xy"` | `"ordinal"` | `"network"` (NOT component name).
|
|
@@ -23,6 +23,8 @@ export interface ChartContainerProps {
|
|
|
23
23
|
copyConfig?: boolean | {
|
|
24
24
|
format?: CopyFormat;
|
|
25
25
|
};
|
|
26
|
+
/** Enable "Data Summary" action button — shows statistical summary + sample rows */
|
|
27
|
+
dataSummary?: boolean;
|
|
26
28
|
};
|
|
27
29
|
/** Chart configuration for serialization. Enables the "Copy Config" toolbar action. */
|
|
28
30
|
chartConfig?: ChartConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface DataSummaryState {
|
|
3
|
+
/** When true, AccessibleDataTable renders visibly instead of sr-only */
|
|
4
|
+
visible: boolean;
|
|
5
|
+
setVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
|
6
|
+
}
|
|
7
|
+
export declare function DataSummaryProvider({ children }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export declare function useDataSummary(): DataSummaryState | null;
|
|
11
|
+
export declare function useDataSummaryToggle(): (() => void) | null;
|
|
12
|
+
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { LIGHT_THEME, DARK_THEME } from "./store/ThemeStore";
|
|
2
|
+
import { LIGHT_THEME, DARK_THEME, HIGH_CONTRAST_THEME } from "./store/ThemeStore";
|
|
3
3
|
import type { SemioticTheme } from "./store/ThemeStore";
|
|
4
|
+
import type { ThemePresetName } from "./semiotic-themes";
|
|
4
5
|
interface ThemeProviderProps {
|
|
5
|
-
|
|
6
|
+
/** Theme preset name (e.g. "tufte", "pastels-dark", "bi-tool") or a partial SemioticTheme object. */
|
|
7
|
+
theme?: ThemePresetName | Partial<SemioticTheme>;
|
|
6
8
|
children: React.ReactNode;
|
|
7
9
|
}
|
|
8
10
|
declare function ThemeProviderWrapper({ theme, children }: ThemeProviderProps): React.JSX.Element;
|
|
9
11
|
declare function useTheme(): SemioticTheme;
|
|
10
12
|
export { ThemeProviderWrapper as ThemeProvider, useTheme };
|
|
11
|
-
export { LIGHT_THEME, DARK_THEME };
|
|
13
|
+
export { LIGHT_THEME, DARK_THEME, HIGH_CONTRAST_THEME };
|
|
12
14
|
export type { SemioticTheme };
|
|
@@ -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 {};
|
|
@@ -47,7 +47,7 @@ export interface ChoroplethMapProps<TDatum extends Record<string, any> = Record<
|
|
|
47
47
|
/** Passthrough to StreamGeoFrame */
|
|
48
48
|
frameProps?: Partial<Omit<StreamGeoFrameProps, "areas" | "projection">>;
|
|
49
49
|
}
|
|
50
|
-
export declare function ChoroplethMap<TDatum extends Record<string, any> = Record<string, any>>(props: ChoroplethMapProps<TDatum>): React.JSX.Element
|
|
50
|
+
export declare function ChoroplethMap<TDatum extends Record<string, any> = Record<string, any>>(props: ChoroplethMapProps<TDatum>): React.JSX.Element;
|
|
51
51
|
export declare namespace ChoroplethMap {
|
|
52
52
|
var displayName: string;
|
|
53
53
|
}
|
|
@@ -26,10 +26,14 @@ export { MinimapChart } from "./xy/MinimapChart";
|
|
|
26
26
|
export type { MinimapChartProps, MinimapConfig } from "./xy/MinimapChart";
|
|
27
27
|
export { QuadrantChart } from "./xy/QuadrantChart";
|
|
28
28
|
export type { QuadrantChartProps, QuadrantsConfig, QuadrantConfig, CenterlineStyle } from "./xy/QuadrantChart";
|
|
29
|
+
export { MultiAxisLineChart } from "./xy/MultiAxisLineChart";
|
|
30
|
+
export type { MultiAxisLineChartProps, MultiAxisSeriesConfig } from "./xy/MultiAxisLineChart";
|
|
29
31
|
export { BarChart } from "./ordinal/BarChart";
|
|
30
32
|
export type { BarChartProps } from "./ordinal/BarChart";
|
|
31
33
|
export { StackedBarChart } from "./ordinal/StackedBarChart";
|
|
32
34
|
export type { StackedBarChartProps } from "./ordinal/StackedBarChart";
|
|
35
|
+
export { LikertChart } from "./ordinal/LikertChart";
|
|
36
|
+
export type { LikertChartProps } from "./ordinal/LikertChart";
|
|
33
37
|
export { SwarmPlot } from "./ordinal/SwarmPlot";
|
|
34
38
|
export type { SwarmPlotProps } from "./ordinal/SwarmPlot";
|
|
35
39
|
export { BoxPlot } from "./ordinal/BoxPlot";
|
|
@@ -40,6 +44,8 @@ export { ViolinPlot } from "./ordinal/ViolinPlot";
|
|
|
40
44
|
export type { ViolinPlotProps } from "./ordinal/ViolinPlot";
|
|
41
45
|
export { RidgelinePlot } from "./ordinal/RidgelinePlot";
|
|
42
46
|
export type { RidgelinePlotProps } from "./ordinal/RidgelinePlot";
|
|
47
|
+
export { FunnelChart } from "./ordinal/FunnelChart";
|
|
48
|
+
export type { FunnelChartProps } from "./ordinal/FunnelChart";
|
|
43
49
|
export { DotPlot } from "./ordinal/DotPlot";
|
|
44
50
|
export type { DotPlotProps } from "./ordinal/DotPlot";
|
|
45
51
|
export { PieChart } from "./ordinal/PieChart";
|
|
@@ -48,6 +54,8 @@ export { DonutChart } from "./ordinal/DonutChart";
|
|
|
48
54
|
export type { DonutChartProps } from "./ordinal/DonutChart";
|
|
49
55
|
export { GroupedBarChart } from "./ordinal/GroupedBarChart";
|
|
50
56
|
export type { GroupedBarChartProps } from "./ordinal/GroupedBarChart";
|
|
57
|
+
export { SwimlaneChart } from "./ordinal/SwimlaneChart";
|
|
58
|
+
export type { SwimlaneChartProps } from "./ordinal/SwimlaneChart";
|
|
51
59
|
export { ForceDirectedGraph } from "./network/ForceDirectedGraph";
|
|
52
60
|
export type { ForceDirectedGraphProps } from "./network/ForceDirectedGraph";
|
|
53
61
|
export { ChordDiagram } from "./network/ChordDiagram";
|
|
@@ -75,6 +83,9 @@ export type { RealtimeHeatmapProps } from "./realtime/RealtimeHeatmap";
|
|
|
75
83
|
export type { BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./shared/types";
|
|
76
84
|
export { useColorScale, useSortedData, DEFAULT_COLOR } from "./shared/hooks";
|
|
77
85
|
export { COLOR_SCHEMES, DEFAULT_COLORS, getColor, createColorScale, getSize } from "./shared/colorUtils";
|
|
78
|
-
export { formatNumber, formatDate, formatAxis, createTooltip, formatLargeNumber, truncateText } from "./shared/formatUtils";
|
|
86
|
+
export { formatNumber, formatDate, formatAxis, createTooltip, formatLargeNumber, truncateText, adaptiveTimeTicks } from "./shared/formatUtils";
|
|
87
|
+
export { darkenColor, lightenColor } from "./shared/colorManipulation";
|
|
79
88
|
export { Tooltip, MultiLineTooltip, normalizeTooltip } from "../Tooltip/Tooltip";
|
|
80
89
|
export type { TooltipProp, TooltipConfig, TooltipField, MultiLineTooltipConfig } from "../Tooltip/Tooltip";
|
|
90
|
+
export { createHatchPattern } from "./shared/hatchPattern";
|
|
91
|
+
export type { HatchPatternOptions } from "./shared/hatchPattern";
|
|
@@ -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
|
/**
|
|
@@ -21,11 +21,14 @@ export interface BarChartProps<TDatum extends Record<string, any> = Record<strin
|
|
|
21
21
|
barPadding?: number;
|
|
22
22
|
enableHover?: boolean;
|
|
23
23
|
showGrid?: boolean;
|
|
24
|
+
showCategoryTicks?: boolean;
|
|
24
25
|
showLegend?: boolean;
|
|
25
26
|
legendInteraction?: LegendInteractionMode;
|
|
26
27
|
legendPosition?: "right" | "left" | "top" | "bottom";
|
|
27
28
|
tooltip?: TooltipProp;
|
|
28
29
|
annotations?: Record<string, any>[];
|
|
30
|
+
/** Custom formatter for category tick labels */
|
|
31
|
+
categoryFormat?: CategoryFormatFn;
|
|
29
32
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
30
33
|
}
|
|
31
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 {
|
|
@@ -19,11 +19,14 @@ export interface BoxPlotProps<TDatum extends Record<string, any> = Record<string
|
|
|
19
19
|
categoryPadding?: number;
|
|
20
20
|
enableHover?: boolean;
|
|
21
21
|
showGrid?: boolean;
|
|
22
|
+
showCategoryTicks?: boolean;
|
|
22
23
|
showLegend?: boolean;
|
|
23
24
|
legendInteraction?: LegendInteractionMode;
|
|
24
25
|
legendPosition?: LegendPosition;
|
|
25
26
|
tooltip?: TooltipProp;
|
|
26
27
|
annotations?: Record<string, any>[];
|
|
28
|
+
/** Custom formatter for category tick labels */
|
|
29
|
+
categoryFormat?: CategoryFormatFn;
|
|
27
30
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
28
31
|
}
|
|
29
32
|
export declare const BoxPlot: {
|
|
@@ -13,8 +13,8 @@ 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;
|
|
17
|
+
showCategoryTicks?: boolean;
|
|
18
18
|
showLegend?: boolean;
|
|
19
19
|
legendInteraction?: LegendInteractionMode;
|
|
20
20
|
legendPosition?: LegendPosition;
|
|
@@ -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 {
|
|
@@ -19,11 +19,14 @@ export interface DotPlotProps<TDatum extends Record<string, any> = Record<string
|
|
|
19
19
|
categoryPadding?: number;
|
|
20
20
|
enableHover?: boolean;
|
|
21
21
|
showGrid?: boolean;
|
|
22
|
+
showCategoryTicks?: boolean;
|
|
22
23
|
showLegend?: boolean;
|
|
23
24
|
legendInteraction?: LegendInteractionMode;
|
|
24
25
|
legendPosition?: LegendPosition;
|
|
25
26
|
tooltip?: TooltipProp;
|
|
26
27
|
annotations?: Record<string, any>[];
|
|
28
|
+
/** Custom formatter for category tick labels */
|
|
29
|
+
categoryFormat?: CategoryFormatFn;
|
|
27
30
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
28
31
|
}
|
|
29
32
|
export declare const DotPlot: {
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
* FunnelChart component props
|
|
9
|
+
*/
|
|
10
|
+
export interface FunnelChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
11
|
+
data?: TDatum[];
|
|
12
|
+
/** Accessor for funnel step names (e.g., "Awareness", "Interest", "Purchase") */
|
|
13
|
+
stepAccessor?: ChartAccessor<TDatum, string>;
|
|
14
|
+
/** Accessor for the numeric value at each step */
|
|
15
|
+
valueAccessor?: ChartAccessor<TDatum, number>;
|
|
16
|
+
/** Accessor for splitting into mirrored categories (e.g., "control" vs "treatment") */
|
|
17
|
+
categoryAccessor?: ChartAccessor<TDatum, string>;
|
|
18
|
+
colorBy?: ChartAccessor<TDatum, string>;
|
|
19
|
+
colorScheme?: string | string[];
|
|
20
|
+
/**
|
|
21
|
+
* Funnel orientation.
|
|
22
|
+
*
|
|
23
|
+
* - `"horizontal"` (default): steps run top-to-bottom with centered bars and
|
|
24
|
+
* trapezoid connectors between steps.
|
|
25
|
+
* - `"vertical"`: steps on the x-axis as vertical bars. Each bar is stacked:
|
|
26
|
+
* solid = retained value, hatched = dropoff from the previous step.
|
|
27
|
+
* Multi-category data renders grouped bars within each step.
|
|
28
|
+
*/
|
|
29
|
+
orientation?: "horizontal" | "vertical";
|
|
30
|
+
/** Opacity of the trapezoid connectors between steps (0–1, default 0.3). Horizontal only. */
|
|
31
|
+
connectorOpacity?: number;
|
|
32
|
+
/** Show step name + value labels on bars (default true) */
|
|
33
|
+
showLabels?: boolean;
|
|
34
|
+
enableHover?: boolean;
|
|
35
|
+
showLegend?: boolean;
|
|
36
|
+
legendInteraction?: LegendInteractionMode;
|
|
37
|
+
legendPosition?: "right" | "left" | "top" | "bottom";
|
|
38
|
+
tooltip?: TooltipProp;
|
|
39
|
+
annotations?: Record<string, any>[];
|
|
40
|
+
/** Custom formatter for category tick labels */
|
|
41
|
+
categoryFormat?: CategoryFormatFn;
|
|
42
|
+
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* FunnelChart — Visualize sequential conversion steps.
|
|
46
|
+
*
|
|
47
|
+
* **Horizontal** (default): centered bars narrowing top-to-bottom with
|
|
48
|
+
* trapezoid connectors. Multi-category mirrors around center axis.
|
|
49
|
+
*
|
|
50
|
+
* **Vertical** (`orientation="vertical"`): vertical bars with hatched
|
|
51
|
+
* dropoff stacking. Each bar shows retained (solid) + dropoff from
|
|
52
|
+
* previous step (hatched). Multi-category renders grouped bars.
|
|
53
|
+
*/
|
|
54
|
+
export declare const FunnelChart: {
|
|
55
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: FunnelChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
56
|
+
displayName?: string;
|
|
57
|
+
};
|
|
@@ -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 {
|
|
@@ -18,11 +18,14 @@ export interface GroupedBarChartProps<TDatum extends Record<string, any> = Recor
|
|
|
18
18
|
barPadding?: number;
|
|
19
19
|
enableHover?: boolean;
|
|
20
20
|
showGrid?: boolean;
|
|
21
|
+
showCategoryTicks?: boolean;
|
|
21
22
|
showLegend?: boolean;
|
|
22
23
|
legendInteraction?: LegendInteractionMode;
|
|
23
24
|
legendPosition?: "right" | "left" | "top" | "bottom";
|
|
24
25
|
tooltip?: TooltipProp;
|
|
25
26
|
annotations?: Record<string, any>[];
|
|
27
|
+
/** Custom formatter for category tick labels */
|
|
28
|
+
categoryFormat?: CategoryFormatFn;
|
|
26
29
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
27
30
|
}
|
|
28
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 {
|
|
@@ -18,10 +18,25 @@ export interface HistogramProps<TDatum extends Record<string, any> = Record<stri
|
|
|
18
18
|
categoryPadding?: number;
|
|
19
19
|
enableHover?: boolean;
|
|
20
20
|
showGrid?: boolean;
|
|
21
|
+
showCategoryTicks?: boolean;
|
|
21
22
|
showLegend?: boolean;
|
|
23
|
+
legendInteraction?: LegendInteractionMode;
|
|
22
24
|
legendPosition?: LegendPosition;
|
|
23
25
|
tooltip?: TooltipProp;
|
|
24
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;
|
|
25
40
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
26
41
|
}
|
|
27
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,8 +11,8 @@ 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;
|
|
15
|
+
showCategoryTicks?: boolean;
|
|
16
16
|
showLegend?: boolean;
|
|
17
17
|
legendInteraction?: LegendInteractionMode;
|
|
18
18
|
legendPosition?: LegendPosition;
|
|
@@ -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";
|
|
@@ -19,10 +20,14 @@ export interface RidgelinePlotProps<TDatum extends Record<string, any> = Record<
|
|
|
19
20
|
categoryPadding?: number;
|
|
20
21
|
enableHover?: boolean;
|
|
21
22
|
showGrid?: boolean;
|
|
23
|
+
showCategoryTicks?: boolean;
|
|
22
24
|
showLegend?: boolean;
|
|
25
|
+
legendInteraction?: LegendInteractionMode;
|
|
23
26
|
legendPosition?: LegendPosition;
|
|
24
27
|
tooltip?: TooltipProp;
|
|
25
28
|
annotations?: Record<string, any>[];
|
|
29
|
+
/** Custom formatter for category tick labels */
|
|
30
|
+
categoryFormat?: CategoryFormatFn;
|
|
26
31
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
27
32
|
}
|
|
28
33
|
/**
|
|
@@ -31,7 +36,7 @@ export interface RidgelinePlotProps<TDatum extends Record<string, any> = Record<
|
|
|
31
36
|
* Each category shows its value distribution as a filled area extending from a
|
|
32
37
|
* baseline. The amplitude prop controls overlap between rows.
|
|
33
38
|
*/
|
|
34
|
-
export declare
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
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 {
|
|
@@ -19,11 +19,14 @@ export interface StackedBarChartProps<TDatum extends Record<string, any> = Recor
|
|
|
19
19
|
barPadding?: number;
|
|
20
20
|
enableHover?: boolean;
|
|
21
21
|
showGrid?: boolean;
|
|
22
|
+
showCategoryTicks?: boolean;
|
|
22
23
|
showLegend?: boolean;
|
|
23
24
|
legendInteraction?: LegendInteractionMode;
|
|
24
25
|
legendPosition?: "right" | "left" | "top" | "bottom";
|
|
25
26
|
tooltip?: TooltipProp;
|
|
26
27
|
annotations?: Record<string, any>[];
|
|
28
|
+
/** Custom formatter for category tick labels */
|
|
29
|
+
categoryFormat?: CategoryFormatFn;
|
|
27
30
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
28
31
|
}
|
|
29
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 {
|
|
@@ -21,11 +21,25 @@ export interface SwarmPlotProps<TDatum extends Record<string, any> = Record<stri
|
|
|
21
21
|
categoryPadding?: number;
|
|
22
22
|
enableHover?: boolean;
|
|
23
23
|
showGrid?: boolean;
|
|
24
|
+
showCategoryTicks?: boolean;
|
|
24
25
|
showLegend?: boolean;
|
|
25
26
|
legendInteraction?: LegendInteractionMode;
|
|
26
27
|
legendPosition?: LegendPosition;
|
|
27
28
|
tooltip?: TooltipProp;
|
|
28
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;
|
|
29
43
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
30
44
|
}
|
|
31
45
|
export declare const SwarmPlot: {
|