semiotic 3.0.0-beta.7 → 3.0.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 +24 -11
- package/README.md +67 -64
- package/ai/cli.js +34 -21
- package/ai/dist/componentRegistry.js +2 -0
- package/ai/dist/mcp-server.js +54 -0
- package/ai/examples.md +75 -0
- package/ai/schema.json +71 -0
- package/ai/system-prompt.md +3 -0
- package/dist/{ChartGrid.d.ts → components/ChartGrid.d.ts} +9 -7
- package/dist/{LinkedCharts.d.ts → components/LinkedCharts.d.ts} +34 -1
- package/dist/{Tooltip → components/Tooltip}/Tooltip.d.ts +9 -2
- package/dist/{charts → components/charts}/index.d.ts +2 -0
- package/dist/{charts → components/charts}/network/ChordDiagram.d.ts +2 -0
- package/dist/{charts → components/charts}/network/CirclePack.d.ts +2 -0
- package/dist/{charts → components/charts}/network/ForceDirectedGraph.d.ts +2 -0
- package/dist/components/charts/network/OrbitDiagram.d.ts +78 -0
- package/dist/{charts → components/charts}/network/SankeyDiagram.d.ts +2 -0
- package/dist/{charts → components/charts}/network/TreeDiagram.d.ts +2 -0
- package/dist/{charts → components/charts}/network/Treemap.d.ts +2 -0
- package/dist/{charts → components/charts}/ordinal/BarChart.d.ts +2 -0
- package/dist/{charts → components/charts}/ordinal/BoxPlot.d.ts +2 -0
- package/dist/{charts → components/charts}/ordinal/DonutChart.d.ts +2 -0
- package/dist/{charts → components/charts}/ordinal/DotPlot.d.ts +2 -0
- package/dist/{charts → components/charts}/ordinal/GroupedBarChart.d.ts +2 -0
- package/dist/{charts → components/charts}/ordinal/PieChart.d.ts +2 -0
- package/dist/{charts → components/charts}/ordinal/StackedBarChart.d.ts +2 -0
- package/dist/{charts → components/charts}/ordinal/SwarmPlot.d.ts +2 -0
- package/dist/components/charts/shared/diagnoseConfig.d.ts +23 -0
- package/dist/{charts → components/charts}/shared/hooks.d.ts +23 -1
- package/dist/components/charts/shared/stringDistance.d.ts +11 -0
- package/dist/{charts → components/charts}/shared/tooltipUtils.d.ts +1 -1
- package/dist/{charts → components/charts}/shared/types.d.ts +6 -0
- package/dist/{charts → components/charts}/shared/withChartWrapper.d.ts +10 -0
- package/dist/{charts → components/charts}/xy/AreaChart.d.ts +8 -0
- package/dist/{charts → components/charts}/xy/BubbleChart.d.ts +8 -0
- package/dist/{charts → components/charts}/xy/ConnectedScatterplot.d.ts +3 -0
- package/dist/{charts → components/charts}/xy/Heatmap.d.ts +8 -0
- package/dist/{charts → components/charts}/xy/LineChart.d.ts +26 -0
- package/dist/{charts → components/charts}/xy/Scatterplot.d.ts +3 -0
- package/dist/{charts → components/charts}/xy/StackedAreaChart.d.ts +8 -0
- package/dist/{export → components/export}/exportChart.d.ts +6 -1
- package/dist/components/semiotic-ai.d.ts +61 -0
- package/dist/components/semiotic-data.d.ts +7 -0
- package/dist/components/semiotic-network.d.ts +14 -0
- package/dist/components/semiotic-ordinal.d.ts +18 -0
- package/dist/components/semiotic-realtime.d.ts +22 -0
- package/dist/components/semiotic-server.d.ts +1 -0
- package/dist/components/semiotic-xy.d.ts +16 -0
- package/dist/components/semiotic.d.ts +57 -0
- package/dist/{server → components/server}/renderToStaticSVG.d.ts +7 -0
- package/dist/{stream → components/stream}/NetworkSVGOverlay.d.ts +20 -0
- package/dist/{stream → components/stream}/OrdinalSVGOverlay.d.ts +8 -0
- package/dist/{stream → components/stream}/PipelineStore.d.ts +7 -0
- package/dist/{stream → components/stream}/SVGOverlay.d.ts +15 -0
- package/dist/components/stream/SceneToSVG.d.ts +20 -0
- package/dist/components/stream/hitTestUtils.d.ts +23 -0
- package/dist/{stream → components/stream}/networkTypes.d.ts +10 -2
- package/dist/{stream → components/stream}/ordinalTypes.d.ts +16 -10
- package/dist/components/stream/renderers/areaCanvasRenderer.d.ts +2 -0
- package/dist/{stream → components/stream}/types.d.ts +12 -0
- package/dist/components/stream/useStalenessCheck.d.ts +16 -0
- package/dist/{types → components/types}/legendTypes.d.ts +5 -0
- 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 +3 -0
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-network.d.ts +1 -0
- package/dist/semiotic-ordinal.d.ts +1 -0
- package/dist/semiotic.d.ts +3 -3
- 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/test/canvasMock.d.ts +2 -0
- package/dist/test-utils/canvasMock.d.ts +20 -0
- package/dist/test-utils/frameMock.d.ts +78 -0
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +9 -17
- package/dist/stream/renderers/areaCanvasRenderer.d.ts +0 -7
- /package/dist/{Annotation.d.ts → components/Annotation.d.ts} +0 -0
- /package/dist/{CategoryColors.d.ts → components/CategoryColors.d.ts} +0 -0
- /package/dist/{ChartContainer.d.ts → components/ChartContainer.d.ts} +0 -0
- /package/dist/{ChartErrorBoundary.d.ts → components/ChartErrorBoundary.d.ts} +0 -0
- /package/dist/{ContextLayout.d.ts → components/ContextLayout.d.ts} +0 -0
- /package/dist/{DetailsPanel.d.ts → components/DetailsPanel.d.ts} +0 -0
- /package/dist/{Legend.d.ts → components/Legend.d.ts} +0 -0
- /package/dist/{ThemeProvider.d.ts → components/ThemeProvider.d.ts} +0 -0
- /package/dist/{charts → components/charts}/ordinal/Histogram.d.ts +0 -0
- /package/dist/{charts → components/charts}/ordinal/RidgelinePlot.d.ts +0 -0
- /package/dist/{charts → components/charts}/ordinal/ViolinPlot.d.ts +0 -0
- /package/dist/{charts → components/charts}/realtime/RealtimeHeatmap.d.ts +0 -0
- /package/dist/{charts → components/charts}/realtime/RealtimeHistogram.d.ts +0 -0
- /package/dist/{charts → components/charts}/realtime/RealtimeLineChart.d.ts +0 -0
- /package/dist/{charts → components/charts}/realtime/RealtimeSwarmChart.d.ts +0 -0
- /package/dist/{charts → components/charts}/realtime/RealtimeWaterfallChart.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/ChartError.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/annotationRules.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/colorUtils.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/formatUtils.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/legendUtils.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/loess.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/networkUtils.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/selectionUtils.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/statisticalOverlays.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/validateChartData.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/validateProps.d.ts +0 -0
- /package/dist/{charts → components/charts}/xy/MinimapChart.d.ts +0 -0
- /package/dist/{charts → components/charts}/xy/ScatterplotMatrix.d.ts +0 -0
- /package/dist/{data → components/data}/fromVegaLite.d.ts +0 -0
- /package/dist/{data → components/data}/transforms.d.ts +0 -0
- /package/dist/{export → components/export}/chartConfig.d.ts +0 -0
- /package/dist/{export → components/export}/selectionSerializer.d.ts +0 -0
- /package/dist/{geometry → components/geometry}/sankeyLinks.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/BinAccumulator.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/IncrementalExtent.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/RingBuffer.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/renderers/types.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/renderers/waterfallRenderer.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/types.d.ts +0 -0
- /package/dist/{store → components/store}/ObservationStore.d.ts +0 -0
- /package/dist/{store → components/store}/SelectionStore.d.ts +0 -0
- /package/dist/{store → components/store}/ThemeStore.d.ts +0 -0
- /package/dist/{store → components/store}/TooltipStore.d.ts +0 -0
- /package/dist/{store → components/store}/createStore.d.ts +0 -0
- /package/dist/{store → components/store}/useObservation.d.ts +0 -0
- /package/dist/{store → components/store}/useSelection.d.ts +0 -0
- /package/dist/{stream → components/stream}/CanvasHitTester.d.ts +0 -0
- /package/dist/{stream → components/stream}/DataSourceAdapter.d.ts +0 -0
- /package/dist/{stream → components/stream}/MarginalGraphics.d.ts +0 -0
- /package/dist/{stream → components/stream}/NetworkCanvasHitTester.d.ts +0 -0
- /package/dist/{stream → components/stream}/NetworkPipelineStore.d.ts +0 -0
- /package/dist/{stream → components/stream}/OrdinalCanvasHitTester.d.ts +0 -0
- /package/dist/{stream → components/stream}/OrdinalPipelineStore.d.ts +0 -0
- /package/dist/{stream → components/stream}/ParticlePool.d.ts +0 -0
- /package/dist/{stream → components/stream}/SceneGraph.d.ts +0 -0
- /package/dist/{stream → components/stream}/StreamNetworkFrame.d.ts +0 -0
- /package/dist/{stream → components/stream}/StreamOrdinalFrame.d.ts +0 -0
- /package/dist/{stream → components/stream}/StreamXYFrame.d.ts +0 -0
- /package/dist/{stream → components/stream}/accessorUtils.d.ts +0 -0
- /package/dist/{stream → components/stream}/keyboardNav.d.ts +0 -0
- /package/dist/{stream → components/stream}/layouts/chordLayoutPlugin.d.ts +0 -0
- /package/dist/{stream → components/stream}/layouts/forceLayoutPlugin.d.ts +0 -0
- /package/dist/{stream → components/stream}/layouts/hierarchyLayoutPlugin.d.ts +0 -0
- /package/dist/{stream → components/stream}/layouts/index.d.ts +0 -0
- /package/dist/{stream → components/stream}/layouts/sankeyLayoutPlugin.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/barScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/connectorScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/pieScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/pointScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/statisticalScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/timelineScene.d.ts +0 -0
- /package/dist/{stream → components/stream}/ordinalSceneBuilders/types.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/barCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/boxplotCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/candlestickCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/connectorCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/heatmapCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/lineCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/networkArcRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/networkCircleRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/networkEdgeRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/networkParticleRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/networkRectRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/pointCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/swarmCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/types.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/violinCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/waterfallCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/renderers/wedgeCanvasRenderer.d.ts +0 -0
- /package/dist/{stream → components/stream}/useResponsiveSize.d.ts +0 -0
- /package/dist/{types → components/types}/annotationTypes.d.ts +0 -0
- /package/dist/{types → components/types}/generalTypes.d.ts +0 -0
- /package/dist/{types → components/types}/interactionTypes.d.ts +0 -0
- /package/dist/{types → components/types}/networkTypes.d.ts +0 -0
- /package/dist/{types → components/types}/ordinalTypes.d.ts +0 -0
package/ai/system-prompt.md
CHANGED
|
@@ -8,6 +8,7 @@ Use `import { ComponentName } from "semiotic/ai"` for all components below.
|
|
|
8
8
|
- **StackedAreaChart** — `xAccessor`, `yAccessor`, `areaBy` (required), `normalize`
|
|
9
9
|
- **Scatterplot** — `xAccessor`, `yAccessor`, `colorBy`, `sizeBy`
|
|
10
10
|
- **BubbleChart** — `xAccessor`, `yAccessor`, **`sizeBy`** (required), `sizeRange`
|
|
11
|
+
- **ConnectedScatterplot** — `xAccessor`, `yAccessor`, `orderAccessor` (sequencing field), `pointRadius`
|
|
11
12
|
- **Heatmap** — `xAccessor`, `yAccessor`, `valueAccessor`, `colorScheme` ("blues"|"reds"|"greens"|"viridis")
|
|
12
13
|
- **BarChart** — `categoryAccessor`, `valueAccessor`, `orientation`, `sort`
|
|
13
14
|
- **StackedBarChart** — `categoryAccessor`, `valueAccessor`, **`stackBy`** (required), `normalize`
|
|
@@ -24,6 +25,7 @@ Use `import { ComponentName } from "semiotic/ai"` for all components below.
|
|
|
24
25
|
- **TreeDiagram** — `childrenAccessor`, `nodeIdAccessor`, `layout` ("tree"|"cluster"|"partition"), `orientation`
|
|
25
26
|
- **Treemap** — `childrenAccessor`, `valueAccessor`, `nodeIdAccessor`, `colorByDepth`
|
|
26
27
|
- **CirclePack** — `childrenAccessor`, `valueAccessor`, `nodeIdAccessor`, `colorByDepth`
|
|
28
|
+
- **OrbitDiagram** — `childrenAccessor`, `nodeIdAccessor`, `orbitMode` ("flat"|"solar"|"atomic"|number[]), `speed`, `animated`
|
|
27
29
|
|
|
28
30
|
## Network Data (`nodes: object[]`, `edges: object[]`)
|
|
29
31
|
- **ForceDirectedGraph** — **`nodes`**, **`edges`** (both required), `nodeIDAccessor`, `sourceAccessor`, `targetAccessor`
|
|
@@ -35,6 +37,7 @@ Use `import { ComponentName } from "semiotic/ai"` for all components below.
|
|
|
35
37
|
- **RealtimeHistogram** — **`binSize`** (required), `timeAccessor`, `valueAccessor`
|
|
36
38
|
- **RealtimeSwarmChart** — `timeAccessor`, `valueAccessor`, `categoryAccessor`
|
|
37
39
|
- **RealtimeWaterfallChart** — `timeAccessor`, `valueAccessor`, `positiveColor`, `negativeColor`
|
|
40
|
+
- **RealtimeHeatmap** — `timeAccessor`, `valueAccessor`, `heatmapXBins`, `heatmapYBins`, `aggregation`
|
|
38
41
|
- **StreamNetworkFrame** (`chartType="sankey"`) — `ref.current.push({ source, target, value })`, `sourceAccessor`, `targetAccessor`, `valueAccessor` (import from `semiotic`)
|
|
39
42
|
|
|
40
43
|
## Common Props (all components)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
export type ChartEmphasis = "primary" | "secondary";
|
|
2
3
|
export interface ChartGridProps {
|
|
3
4
|
/** Chart components to arrange in the grid */
|
|
4
5
|
children: React.ReactNode;
|
|
@@ -20,15 +21,16 @@ export interface ChartGridProps {
|
|
|
20
21
|
* Each cell automatically gets `responsiveWidth` behavior since the grid
|
|
21
22
|
* manages the cell dimensions.
|
|
22
23
|
*
|
|
23
|
-
*
|
|
24
|
+
* Children can set `emphasis="primary"` to span two columns and receive
|
|
25
|
+
* higher visual weight, following the F-pattern reading layout recommended
|
|
26
|
+
* by Carbon Design guidelines.
|
|
24
27
|
*
|
|
25
28
|
* ```tsx
|
|
26
|
-
* <
|
|
27
|
-
* <
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* </LinkedCharts>
|
|
29
|
+
* <ChartGrid columns={2}>
|
|
30
|
+
* <LineChart data={d} emphasis="primary" responsiveWidth />
|
|
31
|
+
* <BarChart data={d} responsiveWidth />
|
|
32
|
+
* <ScatterChart data={d} responsiveWidth />
|
|
33
|
+
* </ChartGrid>
|
|
32
34
|
* ```
|
|
33
35
|
*/
|
|
34
36
|
export declare function ChartGrid({ children, columns, minCellWidth, gap, className, style, }: ChartGridProps): React.JSX.Element;
|
|
@@ -1,15 +1,48 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ResolutionMode } from "./store/SelectionStore";
|
|
3
|
+
type LegendInteractionMode = "highlight" | "isolate" | "none";
|
|
3
4
|
export { useSelection, useLinkedHover, useBrushSelection, useFilteredData } from "./store/useSelection";
|
|
4
5
|
export type { UseSelectionOptions, UseSelectionResult, UseLinkedHoverOptions, UseLinkedHoverResult, UseBrushSelectionOptions, UseBrushSelectionResult } from "./store/useSelection";
|
|
5
6
|
export { useChartObserver } from "./store/useObservation";
|
|
6
7
|
export type { UseChartObserverOptions, UseChartObserverResult } from "./store/useObservation";
|
|
8
|
+
/** Hook: returns true when a parent LinkedCharts is handling the legend. */
|
|
9
|
+
export declare function useLinkedLegendSuppression(): boolean;
|
|
7
10
|
export interface LinkedChartsProps {
|
|
8
11
|
children: React.ReactNode;
|
|
9
12
|
/** Pre-configure selections with resolution modes */
|
|
10
13
|
selections?: Record<string, {
|
|
11
14
|
resolution?: ResolutionMode;
|
|
12
15
|
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Show a unified legend for all linked charts.
|
|
18
|
+
* When true, child chart legends are automatically suppressed unless explicitly set.
|
|
19
|
+
* @default true (when a CategoryColorProvider is present)
|
|
20
|
+
*/
|
|
21
|
+
showLegend?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Position of the unified legend.
|
|
24
|
+
* @default "top"
|
|
25
|
+
*/
|
|
26
|
+
legendPosition?: "top" | "bottom";
|
|
27
|
+
/**
|
|
28
|
+
* Legend interaction mode for the unified legend.
|
|
29
|
+
* - "highlight": hover dims non-hovered categories across all linked charts
|
|
30
|
+
* - "isolate": click toggles category visibility across all linked charts
|
|
31
|
+
* - "none": static legend (default)
|
|
32
|
+
*/
|
|
33
|
+
legendInteraction?: LegendInteractionMode;
|
|
34
|
+
/**
|
|
35
|
+
* Selection name that the unified legend produces on.
|
|
36
|
+
* Child charts must use the same name in their `selection` prop to respond.
|
|
37
|
+
* @default "legend"
|
|
38
|
+
*/
|
|
39
|
+
legendSelectionName?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Field name that the unified legend uses for cross-chart highlighting.
|
|
42
|
+
* This must match the field used in child charts' `linkedHover.fields` / `colorBy`.
|
|
43
|
+
* @default first field from the first child's linkedHover config, or "category"
|
|
44
|
+
*/
|
|
45
|
+
legendField?: string;
|
|
13
46
|
}
|
|
14
47
|
/**
|
|
15
48
|
* LinkedCharts — context provider for coordinated chart views.
|
|
@@ -41,4 +74,4 @@ export interface LinkedChartsProps {
|
|
|
41
74
|
* </LinkedCharts>
|
|
42
75
|
* ```
|
|
43
76
|
*/
|
|
44
|
-
export declare function LinkedCharts({ children, selections }: LinkedChartsProps): React.JSX.Element;
|
|
77
|
+
export declare function LinkedCharts({ children, selections, showLegend, legendPosition, legendInteraction, legendSelectionName, legendField, }: LinkedChartsProps): React.JSX.Element;
|
|
@@ -136,6 +136,13 @@ export declare function MultiLineTooltip(config?: MultiLineTooltipConfig): (data
|
|
|
136
136
|
*/
|
|
137
137
|
export type TooltipProp = boolean | ((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
|
+
* Compatible with HoverData and any Record-based hover object.
|
|
140
141
|
*/
|
|
141
|
-
export
|
|
142
|
+
export type TooltipContentFn = (d: Record<string, any>) => React.ReactNode;
|
|
143
|
+
/**
|
|
144
|
+
* Convert a tooltip prop to the format Semiotic expects.
|
|
145
|
+
* Returns `false` to disable, or a `TooltipContentFn` compatible with
|
|
146
|
+
* all Stream Frame `tooltipContent` signatures.
|
|
147
|
+
*/
|
|
148
|
+
export declare function normalizeTooltip(tooltip: TooltipProp | undefined): false | TooltipContentFn;
|
|
@@ -58,6 +58,8 @@ export { Treemap } from "./network/Treemap";
|
|
|
58
58
|
export type { TreemapProps } from "./network/Treemap";
|
|
59
59
|
export { CirclePack } from "./network/CirclePack";
|
|
60
60
|
export type { CirclePackProps } from "./network/CirclePack";
|
|
61
|
+
export { OrbitDiagram } from "./network/OrbitDiagram";
|
|
62
|
+
export type { OrbitDiagramProps, OrbitNode } from "./network/OrbitDiagram";
|
|
61
63
|
export { RealtimeLineChart } from "./realtime/RealtimeLineChart";
|
|
62
64
|
export type { RealtimeLineChartProps } from "./realtime/RealtimeLineChart";
|
|
63
65
|
export { RealtimeTemporalHistogram, RealtimeHistogram } from "./realtime/RealtimeHistogram";
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import type { StreamNetworkFrameProps } from "../../stream/networkTypes";
|
|
3
3
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
4
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
5
6
|
/**
|
|
6
7
|
* ChordDiagram component props
|
|
7
8
|
*/
|
|
@@ -21,6 +22,7 @@ export interface ChordDiagramProps<TNode extends Record<string, any> = Record<st
|
|
|
21
22
|
nodeLabel?: ChartAccessor<TNode, string>;
|
|
22
23
|
showLabels?: boolean;
|
|
23
24
|
enableHover?: boolean;
|
|
25
|
+
legendInteraction?: LegendInteractionMode;
|
|
24
26
|
edgeOpacity?: number;
|
|
25
27
|
tooltip?: TooltipProp;
|
|
26
28
|
frameProps?: Partial<Omit<StreamNetworkFrameProps, "edges" | "size">>;
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import type { StreamNetworkFrameProps } from "../../stream/networkTypes";
|
|
3
3
|
import type { BaseChartProps, ChartAccessor, Accessor } from "../shared/types";
|
|
4
4
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
5
6
|
/**
|
|
6
7
|
* CirclePack component props
|
|
7
8
|
*/
|
|
@@ -18,6 +19,7 @@ export interface CirclePackProps<TNode extends Record<string, any> = Record<stri
|
|
|
18
19
|
circleOpacity?: number;
|
|
19
20
|
padding?: number;
|
|
20
21
|
enableHover?: boolean;
|
|
22
|
+
legendInteraction?: LegendInteractionMode;
|
|
21
23
|
tooltip?: TooltipProp;
|
|
22
24
|
frameProps?: Partial<Omit<StreamNetworkFrameProps, "edges" | "size">>;
|
|
23
25
|
}
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import type { StreamNetworkFrameProps } from "../../stream/networkTypes";
|
|
3
3
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
4
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
5
6
|
/**
|
|
6
7
|
* ForceDirectedGraph component props
|
|
7
8
|
*/
|
|
@@ -24,6 +25,7 @@ export interface ForceDirectedGraphProps<TNode extends Record<string, any> = Rec
|
|
|
24
25
|
showLabels?: boolean;
|
|
25
26
|
enableHover?: boolean;
|
|
26
27
|
showLegend?: boolean;
|
|
28
|
+
legendInteraction?: LegendInteractionMode;
|
|
27
29
|
tooltip?: TooltipProp;
|
|
28
30
|
frameProps?: Partial<Omit<StreamNetworkFrameProps, "nodes" | "edges" | "size">>;
|
|
29
31
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { BaseChartProps } from "../shared/types";
|
|
3
|
+
export interface OrbitNode {
|
|
4
|
+
datum: any;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
ring: number;
|
|
8
|
+
angle: number;
|
|
9
|
+
depth: number;
|
|
10
|
+
parent?: OrbitNode;
|
|
11
|
+
children?: OrbitNode[];
|
|
12
|
+
id?: string;
|
|
13
|
+
}
|
|
14
|
+
type OrbitMode = "flat" | "solar" | "atomic" | number[];
|
|
15
|
+
export interface OrbitDiagramProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
16
|
+
/** Hierarchical data — single root object with children */
|
|
17
|
+
data: TDatum;
|
|
18
|
+
/** How to access children from each datum @default "children" */
|
|
19
|
+
childrenAccessor?: string | ((d: TDatum) => TDatum[] | null | undefined);
|
|
20
|
+
/** How to identify each node @default "name" */
|
|
21
|
+
nodeIdAccessor?: string | ((d: any) => string);
|
|
22
|
+
/** Field or function for node color */
|
|
23
|
+
colorBy?: string | ((d: any) => string);
|
|
24
|
+
/** Color scheme @default "category10" */
|
|
25
|
+
colorScheme?: string | string[];
|
|
26
|
+
/** Color by hierarchy depth instead of field @default false */
|
|
27
|
+
colorByDepth?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Ring arrangement mode:
|
|
30
|
+
* - "flat": all children in one ring
|
|
31
|
+
* - "solar": one child per ring
|
|
32
|
+
* - "atomic": [2, 8] electron shell pattern
|
|
33
|
+
* - number[]: custom ring capacities (last value repeats)
|
|
34
|
+
* @default "flat"
|
|
35
|
+
*/
|
|
36
|
+
orbitMode?: OrbitMode;
|
|
37
|
+
/** Ring size divisor per depth. Larger = tighter orbits. @default 2.95 */
|
|
38
|
+
orbitSize?: number | ((node: OrbitNode) => number);
|
|
39
|
+
/** Orbit speed in degrees per frame @default 0.25 */
|
|
40
|
+
speed?: number;
|
|
41
|
+
/** Per-node speed modifier @default (node) => 1 / (node.depth + 1) */
|
|
42
|
+
revolution?: (node: OrbitNode) => number;
|
|
43
|
+
/** Vertical squash for elliptical orbits. 1 = circle, 0.5 = ellipse @default 1 */
|
|
44
|
+
eccentricity?: number | ((node: OrbitNode) => number);
|
|
45
|
+
/** Show orbital ring paths @default true */
|
|
46
|
+
showRings?: boolean;
|
|
47
|
+
/** Node radius. Number or function of node. @default 6 */
|
|
48
|
+
nodeRadius?: number | ((node: OrbitNode) => number);
|
|
49
|
+
/** Show node labels @default false */
|
|
50
|
+
showLabels?: boolean;
|
|
51
|
+
/** Enable animation @default true */
|
|
52
|
+
animated?: boolean;
|
|
53
|
+
/** Tooltip configuration */
|
|
54
|
+
tooltip?: (node: OrbitNode) => React.ReactNode;
|
|
55
|
+
/** Enable hover @default true */
|
|
56
|
+
enableHover?: boolean;
|
|
57
|
+
/** Annotation objects. Supports type: "widget" with content (ReactNode) anchored to a node by nodeId. */
|
|
58
|
+
annotations?: Array<{
|
|
59
|
+
type: string;
|
|
60
|
+
nodeId?: string;
|
|
61
|
+
dx?: number;
|
|
62
|
+
dy?: number;
|
|
63
|
+
width?: number;
|
|
64
|
+
height?: number;
|
|
65
|
+
content?: React.ReactNode;
|
|
66
|
+
label?: string;
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
}>;
|
|
69
|
+
/** Additional SVG content */
|
|
70
|
+
foregroundGraphics?: React.ReactNode;
|
|
71
|
+
/** Frame props passthrough (unused, for API consistency) */
|
|
72
|
+
frameProps?: Record<string, any>;
|
|
73
|
+
}
|
|
74
|
+
export declare function OrbitDiagram<TDatum extends Record<string, any> = Record<string, any>>(props: OrbitDiagramProps<TDatum>): React.JSX.Element;
|
|
75
|
+
export declare namespace OrbitDiagram {
|
|
76
|
+
var displayName: string;
|
|
77
|
+
}
|
|
78
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import type { StreamNetworkFrameProps } from "../../stream/networkTypes";
|
|
3
3
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
4
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
5
6
|
/**
|
|
6
7
|
* SankeyDiagram component props
|
|
7
8
|
*/
|
|
@@ -22,6 +23,7 @@ export interface SankeyDiagramProps<TNode extends Record<string, any> = Record<s
|
|
|
22
23
|
nodeLabel?: ChartAccessor<TNode, string>;
|
|
23
24
|
showLabels?: boolean;
|
|
24
25
|
enableHover?: boolean;
|
|
26
|
+
legendInteraction?: LegendInteractionMode;
|
|
25
27
|
edgeOpacity?: number;
|
|
26
28
|
edgeSort?: (a: any, b: any) => number;
|
|
27
29
|
tooltip?: TooltipProp;
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import type { StreamNetworkFrameProps } from "../../stream/networkTypes";
|
|
3
3
|
import type { BaseChartProps, ChartAccessor, Accessor } from "../shared/types";
|
|
4
4
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
5
6
|
/**
|
|
6
7
|
* TreeDiagram component props
|
|
7
8
|
*/
|
|
@@ -20,6 +21,7 @@ export interface TreeDiagramProps<TNode extends Record<string, any> = Record<str
|
|
|
20
21
|
showLabels?: boolean;
|
|
21
22
|
nodeSize?: number;
|
|
22
23
|
enableHover?: boolean;
|
|
24
|
+
legendInteraction?: LegendInteractionMode;
|
|
23
25
|
tooltip?: TooltipProp;
|
|
24
26
|
frameProps?: Partial<Omit<StreamNetworkFrameProps, "edges" | "size">>;
|
|
25
27
|
}
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import type { StreamNetworkFrameProps } from "../../stream/networkTypes";
|
|
3
3
|
import type { BaseChartProps, ChartAccessor, Accessor } from "../shared/types";
|
|
4
4
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
5
6
|
/**
|
|
6
7
|
* Treemap component props
|
|
7
8
|
*/
|
|
@@ -19,6 +20,7 @@ export interface TreemapProps<TNode extends Record<string, any> = Record<string,
|
|
|
19
20
|
padding?: number;
|
|
20
21
|
paddingTop?: number;
|
|
21
22
|
enableHover?: boolean;
|
|
23
|
+
legendInteraction?: LegendInteractionMode;
|
|
22
24
|
tooltip?: TooltipProp;
|
|
23
25
|
frameProps?: Partial<Omit<StreamNetworkFrameProps, "edges" | "size">>;
|
|
24
26
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
/**
|
|
@@ -20,6 +21,7 @@ export interface BarChartProps<TDatum extends Record<string, any> = Record<strin
|
|
|
20
21
|
enableHover?: boolean;
|
|
21
22
|
showGrid?: boolean;
|
|
22
23
|
showLegend?: boolean;
|
|
24
|
+
legendInteraction?: LegendInteractionMode;
|
|
23
25
|
tooltip?: TooltipProp;
|
|
24
26
|
annotations?: Record<string, any>[];
|
|
25
27
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
export interface BoxPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
@@ -18,6 +19,7 @@ export interface BoxPlotProps<TDatum extends Record<string, any> = Record<string
|
|
|
18
19
|
enableHover?: boolean;
|
|
19
20
|
showGrid?: boolean;
|
|
20
21
|
showLegend?: boolean;
|
|
22
|
+
legendInteraction?: LegendInteractionMode;
|
|
21
23
|
tooltip?: TooltipProp;
|
|
22
24
|
annotations?: Record<string, any>[];
|
|
23
25
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
export interface DonutChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
@@ -14,6 +15,7 @@ export interface DonutChartProps<TDatum extends Record<string, any> = Record<str
|
|
|
14
15
|
slicePadding?: number;
|
|
15
16
|
enableHover?: boolean;
|
|
16
17
|
showLegend?: boolean;
|
|
18
|
+
legendInteraction?: LegendInteractionMode;
|
|
17
19
|
tooltip?: TooltipProp;
|
|
18
20
|
annotations?: Record<string, any>[];
|
|
19
21
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
export interface DotPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
@@ -18,6 +19,7 @@ export interface DotPlotProps<TDatum extends Record<string, any> = Record<string
|
|
|
18
19
|
enableHover?: boolean;
|
|
19
20
|
showGrid?: boolean;
|
|
20
21
|
showLegend?: boolean;
|
|
22
|
+
legendInteraction?: LegendInteractionMode;
|
|
21
23
|
tooltip?: TooltipProp;
|
|
22
24
|
annotations?: Record<string, any>[];
|
|
23
25
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
export interface GroupedBarChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
@@ -17,6 +18,7 @@ export interface GroupedBarChartProps<TDatum extends Record<string, any> = Recor
|
|
|
17
18
|
enableHover?: boolean;
|
|
18
19
|
showGrid?: boolean;
|
|
19
20
|
showLegend?: boolean;
|
|
21
|
+
legendInteraction?: LegendInteractionMode;
|
|
20
22
|
tooltip?: TooltipProp;
|
|
21
23
|
annotations?: Record<string, any>[];
|
|
22
24
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
export interface PieChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
@@ -12,6 +13,7 @@ export interface PieChartProps<TDatum extends Record<string, any> = Record<strin
|
|
|
12
13
|
slicePadding?: number;
|
|
13
14
|
enableHover?: boolean;
|
|
14
15
|
showLegend?: boolean;
|
|
16
|
+
legendInteraction?: LegendInteractionMode;
|
|
15
17
|
tooltip?: TooltipProp;
|
|
16
18
|
annotations?: Record<string, any>[];
|
|
17
19
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
export interface StackedBarChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
@@ -18,6 +19,7 @@ export interface StackedBarChartProps<TDatum extends Record<string, any> = Recor
|
|
|
18
19
|
enableHover?: boolean;
|
|
19
20
|
showGrid?: boolean;
|
|
20
21
|
showLegend?: boolean;
|
|
22
|
+
legendInteraction?: LegendInteractionMode;
|
|
21
23
|
tooltip?: TooltipProp;
|
|
22
24
|
annotations?: Record<string, any>[];
|
|
23
25
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
export interface SwarmPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
@@ -20,6 +21,7 @@ export interface SwarmPlotProps<TDatum extends Record<string, any> = Record<stri
|
|
|
20
21
|
enableHover?: boolean;
|
|
21
22
|
showGrid?: boolean;
|
|
22
23
|
showLegend?: boolean;
|
|
24
|
+
legendInteraction?: LegendInteractionMode;
|
|
23
25
|
tooltip?: TooltipProp;
|
|
24
26
|
annotations?: Record<string, any>[];
|
|
25
27
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* diagnoseConfig — anti-pattern detector for Semiotic chart configurations.
|
|
3
|
+
*
|
|
4
|
+
* Catches common failure modes that produce blank charts or runtime errors,
|
|
5
|
+
* returning actionable fix instructions for each issue found.
|
|
6
|
+
*/
|
|
7
|
+
export interface Diagnosis {
|
|
8
|
+
severity: "error" | "warning";
|
|
9
|
+
code: string;
|
|
10
|
+
message: string;
|
|
11
|
+
fix: string;
|
|
12
|
+
}
|
|
13
|
+
export interface DiagnosisResult {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
diagnoses: Diagnosis[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Run anti-pattern diagnostics on a Semiotic chart configuration.
|
|
19
|
+
*
|
|
20
|
+
* Returns actionable diagnoses with severity, code, message, and fix instruction.
|
|
21
|
+
* Runs validateProps internally — validation errors are included as diagnoses.
|
|
22
|
+
*/
|
|
23
|
+
export declare function diagnoseConfig(componentName: string, props: Record<string, any>): DiagnosisResult;
|
|
@@ -16,7 +16,7 @@ export declare function resolveAccessor<T = any>(accessor: string | ((d: Record<
|
|
|
16
16
|
* Hook to create a color scale from data and colorBy configuration.
|
|
17
17
|
* Returns undefined when colorBy is absent or is a function accessor.
|
|
18
18
|
*/
|
|
19
|
-
export declare function useColorScale(data: Array<Record<string, any>>, colorBy:
|
|
19
|
+
export declare function useColorScale(data: Array<Record<string, any>>, colorBy: string | ((d: any, i?: number) => any) | undefined, colorScheme?: string | string[]): ((v: string) => string) | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* Hook to sort data by a value accessor.
|
|
22
22
|
* Used by BarChart and DotPlot.
|
|
@@ -69,6 +69,28 @@ export declare function useChartLegendAndMargin({ data, colorBy, colorScale, sho
|
|
|
69
69
|
right: number;
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
+
export type LegendInteractionMode = "highlight" | "isolate" | "none";
|
|
73
|
+
export interface LegendInteractionState {
|
|
74
|
+
highlightedCategory: string | null;
|
|
75
|
+
isolatedCategories: Set<string>;
|
|
76
|
+
onLegendHover: (item: {
|
|
77
|
+
label: string;
|
|
78
|
+
} | null) => void;
|
|
79
|
+
onLegendClick: (item: {
|
|
80
|
+
label: string;
|
|
81
|
+
}) => void;
|
|
82
|
+
/** Selection predicate that dims non-matching data — use with wrapStyleWithSelection */
|
|
83
|
+
legendSelectionHook: {
|
|
84
|
+
isActive: boolean;
|
|
85
|
+
predicate: (d: Record<string, any>) => boolean;
|
|
86
|
+
} | null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Hook managing legend highlight/isolate interaction.
|
|
90
|
+
* - "highlight": hover over legend item dims everything else to 30% opacity
|
|
91
|
+
* - "isolate": click toggles category visibility; click all to reset
|
|
92
|
+
*/
|
|
93
|
+
export declare function useLegendInteraction(mode: LegendInteractionMode | undefined, colorBy: string | ((d: any) => string) | undefined, allCategories: string[]): LegendInteractionState;
|
|
72
94
|
interface ChartModeInput {
|
|
73
95
|
width?: number;
|
|
74
96
|
height?: number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String distance utilities for typo detection and field suggestions.
|
|
3
|
+
* Shared by validateProps and validateChartData.
|
|
4
|
+
*/
|
|
5
|
+
/** Levenshtein edit distance between two strings. */
|
|
6
|
+
export declare function levenshtein(a: string, b: string): number;
|
|
7
|
+
/**
|
|
8
|
+
* Find the closest match from candidates by Levenshtein distance.
|
|
9
|
+
* Returns the match if distance <= maxDist, otherwise null/undefined.
|
|
10
|
+
*/
|
|
11
|
+
export declare function closestMatch(input: string, candidates: string[], maxDist?: number): string | undefined;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import type { HoverData } from "../../realtime/types";
|
|
3
3
|
export interface TooltipFieldConfig {
|
|
4
4
|
label: string;
|
|
5
|
-
accessor: string | ((d:
|
|
5
|
+
accessor: string | ((d: any) => any);
|
|
6
6
|
role?: "x" | "y" | "color" | "size" | "group" | "value";
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -69,6 +69,12 @@ export interface BaseChartProps {
|
|
|
69
69
|
onObservation?: OnObservationCallback;
|
|
70
70
|
/** Identifier for this chart instance, included in observation events */
|
|
71
71
|
chartId?: string;
|
|
72
|
+
/** Show a loading skeleton placeholder */
|
|
73
|
+
loading?: boolean;
|
|
74
|
+
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
75
|
+
emptyContent?: React.ReactNode | false;
|
|
76
|
+
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
77
|
+
emphasis?: "primary" | "secondary";
|
|
72
78
|
}
|
|
73
79
|
/**
|
|
74
80
|
* Axis configuration props
|
|
@@ -11,6 +11,16 @@ interface SafeRenderProps {
|
|
|
11
11
|
* with the component name and error message instead of crashing the page.
|
|
12
12
|
*/
|
|
13
13
|
export declare function SafeRender({ componentName, width, height, children }: SafeRenderProps): React.JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Renders a "No data available" placeholder when data is empty.
|
|
16
|
+
* Returns null when data is present or emptyContent is `false`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function renderEmptyState(data: any[] | undefined | null, width: number, height: number, emptyContent?: React.ReactNode | false): React.ReactElement | null;
|
|
19
|
+
/**
|
|
20
|
+
* Renders a shimmer/skeleton loading placeholder.
|
|
21
|
+
* Returns null when loading is false.
|
|
22
|
+
*/
|
|
23
|
+
export declare function renderLoadingState(loading: boolean | undefined, width: number, height: number): React.ReactElement | null;
|
|
14
24
|
/** Warn if a string accessor isn't found in the first data element */
|
|
15
25
|
export declare function warnMissingField(componentName: string, data: any[] | undefined, accessorName: string, accessorValue: any): void;
|
|
16
26
|
/** Warn if data looks like the wrong shape for this chart type */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamXYFrameProps } from "../../stream/types";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
/**
|
|
@@ -110,6 +111,13 @@ export interface AreaChartProps<TDatum extends Record<string, any> = Record<stri
|
|
|
110
111
|
* @default true (when multiple areas)
|
|
111
112
|
*/
|
|
112
113
|
showLegend?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Legend interaction mode.
|
|
116
|
+
* - "highlight": hover dims non-hovered categories to 30% opacity
|
|
117
|
+
* - "isolate": click toggles category visibility with checkmark indicators
|
|
118
|
+
* - "none": static legend (default)
|
|
119
|
+
*/
|
|
120
|
+
legendInteraction?: LegendInteractionMode;
|
|
113
121
|
/**
|
|
114
122
|
* Tooltip configuration
|
|
115
123
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamXYFrameProps, MarginalGraphicsConfig } from "../../stream/types";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
/**
|
|
@@ -92,6 +93,13 @@ export interface BubbleChartProps<TDatum extends Record<string, any> = Record<st
|
|
|
92
93
|
marginalGraphics?: MarginalGraphicsConfig;
|
|
93
94
|
/** Accessor for unique point IDs, used by point-anchored annotations */
|
|
94
95
|
pointIdAccessor?: ChartAccessor<TDatum, string>;
|
|
96
|
+
/**
|
|
97
|
+
* Legend interaction mode.
|
|
98
|
+
* - "highlight": hover dims non-hovered categories to 30% opacity
|
|
99
|
+
* - "isolate": click toggles category visibility with checkmark indicators
|
|
100
|
+
* - "none": static legend (default)
|
|
101
|
+
*/
|
|
102
|
+
legendInteraction?: LegendInteractionMode;
|
|
95
103
|
/**
|
|
96
104
|
* Annotation objects to render on the chart
|
|
97
105
|
*/
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import type { StreamXYFrameProps } from "../../stream/types";
|
|
3
3
|
import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
|
|
4
4
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
5
6
|
/**
|
|
6
7
|
* ConnectedScatterplot component props
|
|
7
8
|
*/
|
|
@@ -30,6 +31,8 @@ export interface ConnectedScatterplotProps<TDatum extends Record<string, any> =
|
|
|
30
31
|
tooltip?: TooltipProp;
|
|
31
32
|
/** Accessor for unique point IDs, used by point-anchored annotations */
|
|
32
33
|
pointIdAccessor?: ChartAccessor<TDatum, string>;
|
|
34
|
+
/** Legend interaction mode */
|
|
35
|
+
legendInteraction?: LegendInteractionMode;
|
|
33
36
|
/** Annotation objects to render on the chart */
|
|
34
37
|
annotations?: Record<string, any>[];
|
|
35
38
|
/** Additional StreamXYFrame props for advanced customization */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamXYFrameProps } from "../../stream/types";
|
|
3
|
+
import type { LegendInteractionMode } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
5
6
|
/**
|
|
@@ -86,6 +87,13 @@ export interface HeatmapProps<TDatum extends Record<string, any> = Record<string
|
|
|
86
87
|
* Tooltip configuration
|
|
87
88
|
*/
|
|
88
89
|
tooltip?: TooltipProp;
|
|
90
|
+
/**
|
|
91
|
+
* Legend interaction mode.
|
|
92
|
+
* - "highlight": hover dims non-hovered categories to 30% opacity
|
|
93
|
+
* - "isolate": click toggles category visibility with checkmark indicators
|
|
94
|
+
* - "none": static legend (default)
|
|
95
|
+
*/
|
|
96
|
+
legendInteraction?: LegendInteractionMode;
|
|
89
97
|
/**
|
|
90
98
|
* Annotation objects to render on the chart
|
|
91
99
|
*/
|