semiotic 3.0.0 → 3.1.0
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 +242 -29
- package/README.md +101 -66
- 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 +433 -18
- package/ai/schema.json +134 -1
- package/ai/system-prompt.md +51 -10
- package/dist/{ChartGrid.d.ts → components/ChartGrid.d.ts} +9 -7
- package/dist/components/Legend.d.ts +9 -0
- package/dist/{LinkedCharts.d.ts → components/LinkedCharts.d.ts} +34 -1
- package/dist/{Tooltip → components/Tooltip}/Tooltip.d.ts +9 -2
- package/dist/components/charts/geo/ChoroplethMap.d.ts +53 -0
- package/dist/components/charts/geo/DistanceCartogram.d.ts +90 -0
- package/dist/components/charts/geo/FlowMap.d.ts +83 -0
- package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +67 -0
- package/dist/components/charts/geo/index.d.ts +8 -0
- package/dist/{charts → components/charts}/index.d.ts +4 -0
- package/dist/{charts → components/charts}/network/ChordDiagram.d.ts +8 -5
- package/dist/{charts → components/charts}/network/CirclePack.d.ts +4 -2
- package/dist/{charts → components/charts}/network/ForceDirectedGraph.d.ts +10 -6
- package/dist/components/charts/network/OrbitDiagram.d.ts +79 -0
- package/dist/{charts → components/charts}/network/SankeyDiagram.d.ts +8 -5
- package/dist/{charts → components/charts}/network/TreeDiagram.d.ts +4 -2
- package/dist/{charts → components/charts}/network/Treemap.d.ts +4 -2
- package/dist/{charts → components/charts}/ordinal/BarChart.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/BoxPlot.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/DonutChart.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/DotPlot.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/GroupedBarChart.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/Histogram.d.ts +8 -5
- package/dist/{charts → components/charts}/ordinal/PieChart.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/RidgelinePlot.d.ts +2 -0
- package/dist/{charts → components/charts}/ordinal/StackedBarChart.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/SwarmPlot.d.ts +9 -5
- package/dist/{charts → components/charts}/ordinal/ViolinPlot.d.ts +8 -5
- package/dist/{charts → components/charts}/realtime/RealtimeHeatmap.d.ts +24 -6
- package/dist/{charts → components/charts}/realtime/RealtimeHistogram.d.ts +28 -7
- package/dist/{charts → components/charts}/realtime/RealtimeLineChart.d.ts +23 -5
- package/dist/{charts → components/charts}/realtime/RealtimeSwarmChart.d.ts +24 -6
- package/dist/{charts → components/charts}/realtime/RealtimeWaterfallChart.d.ts +23 -5
- package/dist/{charts → components/charts}/shared/colorUtils.d.ts +5 -0
- package/dist/components/charts/shared/diagnoseConfig.d.ts +23 -0
- package/dist/{charts → components/charts}/shared/hooks.d.ts +36 -2
- package/dist/{charts → components/charts}/shared/legendUtils.d.ts +2 -3
- package/dist/{charts → components/charts}/shared/statisticalOverlays.d.ts +1 -2
- package/dist/components/charts/shared/statisticalOverlaysLazy.d.ts +10 -0
- package/dist/components/charts/shared/stringDistance.d.ts +11 -0
- package/dist/{charts → components/charts}/shared/tooltipUtils.d.ts +2 -2
- package/dist/{charts → components/charts}/shared/types.d.ts +16 -4
- package/dist/components/charts/shared/useChartSetup.d.ts +112 -0
- package/dist/components/charts/shared/useStreamingLegend.d.ts +65 -0
- package/dist/{charts → components/charts}/shared/withChartWrapper.d.ts +10 -0
- package/dist/{charts → components/charts}/xy/AreaChart.d.ts +18 -5
- package/dist/{charts → components/charts}/xy/BubbleChart.d.ts +18 -5
- package/dist/{charts → components/charts}/xy/ConnectedScatterplot.d.ts +10 -6
- package/dist/{charts → components/charts}/xy/Heatmap.d.ts +24 -5
- package/dist/{charts → components/charts}/xy/LineChart.d.ts +47 -5
- package/dist/{charts → components/charts}/xy/MinimapChart.d.ts +3 -0
- package/dist/components/charts/xy/QuadrantChart.d.ts +120 -0
- package/dist/{charts → components/charts}/xy/Scatterplot.d.ts +11 -5
- package/dist/{charts → components/charts}/xy/StackedAreaChart.d.ts +18 -5
- package/dist/{export → components/export}/exportChart.d.ts +6 -1
- package/dist/components/geo/mergeData.d.ts +18 -0
- package/dist/components/geo/referenceGeography.d.ts +10 -0
- package/dist/components/geo/useReferenceAreas.d.ts +13 -0
- package/dist/{realtime → components/realtime}/RingBuffer.d.ts +1 -0
- package/dist/{realtime → components/realtime}/types.d.ts +17 -0
- package/dist/components/semiotic-ai.d.ts +61 -0
- package/dist/components/semiotic-data.d.ts +8 -0
- package/dist/components/semiotic-geo.d.ts +16 -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 +17 -0
- package/dist/components/semiotic.d.ts +57 -0
- package/dist/{server → components/server}/renderToStaticSVG.d.ts +11 -2
- package/dist/components/stream/AccessibleDataTable.d.ts +50 -0
- package/dist/{stream → components/stream}/CanvasHitTester.d.ts +8 -2
- package/dist/components/stream/DataSourceAdapter.d.ts +64 -0
- package/dist/components/stream/GeoCanvasHitTester.d.ts +19 -0
- package/dist/components/stream/GeoParticlePool.d.ts +46 -0
- package/dist/components/stream/GeoPipelineStore.d.ts +81 -0
- package/dist/components/stream/GeoTileRenderer.d.ts +31 -0
- package/dist/{stream → components/stream}/NetworkPipelineStore.d.ts +16 -4
- package/dist/{stream → components/stream}/NetworkSVGOverlay.d.ts +24 -1
- package/dist/{stream → components/stream}/OrdinalPipelineStore.d.ts +8 -4
- package/dist/{stream → components/stream}/OrdinalSVGOverlay.d.ts +31 -1
- package/dist/{stream → components/stream}/PipelineStore.d.ts +64 -5
- package/dist/components/stream/SVGOverlay.d.ts +98 -0
- package/dist/{stream → components/stream}/SceneGraph.d.ts +7 -3
- package/dist/components/stream/SceneToSVG.d.ts +22 -0
- package/dist/components/stream/StreamGeoFrame.d.ts +4 -0
- package/dist/{stream → components/stream}/accessorUtils.d.ts +1 -0
- package/dist/components/stream/canvasSetup.d.ts +26 -0
- package/dist/components/stream/geoTypes.d.ts +186 -0
- package/dist/components/stream/hitTestUtils.d.ts +23 -0
- package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +2 -0
- package/dist/{stream → components/stream}/layouts/index.d.ts +2 -1
- package/dist/components/stream/layouts/orbitLayoutPlugin.d.ts +2 -0
- package/dist/components/stream/legendRenderer.d.ts +33 -0
- package/dist/{stream → components/stream}/networkTypes.d.ts +59 -3
- package/dist/{stream → components/stream}/ordinalTypes.d.ts +26 -10
- package/dist/components/stream/pipelineTransitionUtils.d.ts +42 -0
- package/dist/components/stream/renderers/areaCanvasRenderer.d.ts +2 -0
- package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +9 -0
- package/dist/{stream → components/stream}/renderers/heatmapCanvasRenderer.d.ts +2 -1
- package/dist/{stream → components/stream}/renderers/lineCanvasRenderer.d.ts +1 -0
- package/dist/components/stream/renderers/renderPulse.d.ts +50 -0
- package/dist/{stream → components/stream}/types.d.ts +89 -3
- package/dist/components/stream/useStalenessCheck.d.ts +16 -0
- package/dist/components/types/legendTypes.d.ts +49 -0
- package/dist/geo.min.js +1 -0
- package/dist/geo.module.min.js +1 -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-data.d.ts +1 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-geo.d.ts +16 -0
- package/dist/semiotic-network.d.ts +1 -0
- package/dist/semiotic-ordinal.d.ts +1 -0
- package/dist/semiotic-server.d.ts +1 -1
- package/dist/semiotic-xy.d.ts +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/test-utils/canvasMock.d.ts +23 -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 +34 -20
- package/dist/Legend.d.ts +0 -3
- package/dist/stream/DataSourceAdapter.d.ts +0 -35
- package/dist/stream/SVGOverlay.d.ts +0 -56
- package/dist/stream/layouts/forceLayoutPlugin.d.ts +0 -9
- package/dist/stream/renderers/areaCanvasRenderer.d.ts +0 -7
- package/dist/types/legendTypes.d.ts +0 -20
- /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/{ThemeProvider.d.ts → components/ThemeProvider.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/formatUtils.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/validateChartData.d.ts +0 -0
- /package/dist/{charts → components/charts}/shared/validateProps.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}/renderers/types.d.ts +0 -0
- /package/dist/{realtime → components/realtime}/renderers/waterfallRenderer.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}/MarginalGraphics.d.ts +0 -0
- /package/dist/{stream → components/stream}/NetworkCanvasHitTester.d.ts +0 -0
- /package/dist/{stream → components/stream}/OrdinalCanvasHitTester.d.ts +0 -0
- /package/dist/{stream → components/stream}/ParticlePool.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}/keyboardNav.d.ts +0 -0
- /package/dist/{stream → components/stream}/layouts/chordLayoutPlugin.d.ts +0 -0
- /package/dist/{stream → components/stream}/layouts/hierarchyLayoutPlugin.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/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
|
@@ -1,9 +1,11 @@
|
|
|
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";
|
|
6
|
+
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
5
7
|
export interface StackedBarChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
6
|
-
data
|
|
8
|
+
data?: TDatum[];
|
|
7
9
|
categoryAccessor?: ChartAccessor<TDatum, string>;
|
|
8
10
|
stackBy: ChartAccessor<TDatum, string>;
|
|
9
11
|
valueAccessor?: ChartAccessor<TDatum, number>;
|
|
@@ -18,11 +20,13 @@ export interface StackedBarChartProps<TDatum extends Record<string, any> = Recor
|
|
|
18
20
|
enableHover?: boolean;
|
|
19
21
|
showGrid?: boolean;
|
|
20
22
|
showLegend?: boolean;
|
|
23
|
+
legendInteraction?: LegendInteractionMode;
|
|
24
|
+
legendPosition?: "right" | "left" | "top" | "bottom";
|
|
21
25
|
tooltip?: TooltipProp;
|
|
22
26
|
annotations?: Record<string, any>[];
|
|
23
27
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
24
28
|
}
|
|
25
|
-
export declare
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
+
export declare const StackedBarChart: {
|
|
30
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: StackedBarChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
31
|
+
displayName?: string;
|
|
32
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
6
|
+
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
5
7
|
export interface SwarmPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
6
|
-
data
|
|
8
|
+
data?: TDatum[];
|
|
7
9
|
categoryAccessor?: ChartAccessor<TDatum, string>;
|
|
8
10
|
valueAccessor?: ChartAccessor<TDatum, number>;
|
|
9
11
|
orientation?: "vertical" | "horizontal";
|
|
@@ -20,11 +22,13 @@ export interface SwarmPlotProps<TDatum extends Record<string, any> = Record<stri
|
|
|
20
22
|
enableHover?: boolean;
|
|
21
23
|
showGrid?: boolean;
|
|
22
24
|
showLegend?: boolean;
|
|
25
|
+
legendInteraction?: LegendInteractionMode;
|
|
26
|
+
legendPosition?: LegendPosition;
|
|
23
27
|
tooltip?: TooltipProp;
|
|
24
28
|
annotations?: Record<string, any>[];
|
|
25
29
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
26
30
|
}
|
|
27
|
-
export declare
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
+
export declare const SwarmPlot: {
|
|
32
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: SwarmPlotProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
33
|
+
displayName?: string;
|
|
34
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { LegendPosition } from "../shared/hooks";
|
|
3
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
6
|
+
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
5
7
|
export interface ViolinPlotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps {
|
|
6
|
-
data
|
|
8
|
+
data?: TDatum[];
|
|
7
9
|
categoryAccessor?: ChartAccessor<TDatum, string>;
|
|
8
10
|
valueAccessor?: ChartAccessor<TDatum, number>;
|
|
9
11
|
orientation?: "vertical" | "horizontal";
|
|
@@ -19,11 +21,12 @@ export interface ViolinPlotProps<TDatum extends Record<string, any> = Record<str
|
|
|
19
21
|
enableHover?: boolean;
|
|
20
22
|
showGrid?: boolean;
|
|
21
23
|
showLegend?: boolean;
|
|
24
|
+
legendPosition?: LegendPosition;
|
|
22
25
|
tooltip?: TooltipProp;
|
|
23
26
|
annotations?: Record<string, any>[];
|
|
24
27
|
frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
|
|
25
28
|
}
|
|
26
|
-
export declare
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
29
|
+
export declare const ViolinPlot: {
|
|
30
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: ViolinPlotProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
31
|
+
displayName?: string;
|
|
32
|
+
};
|
|
@@ -2,9 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext, DecayConfig, PulseConfig, StalenessConfig } from "../../stream/types";
|
|
3
3
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
5
|
-
import type {
|
|
5
|
+
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
6
|
+
import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
|
|
6
7
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
7
|
-
export interface RealtimeHeatmapProps {
|
|
8
|
+
export interface RealtimeHeatmapProps<TDatum extends Record<string, any> = Record<string, any>> {
|
|
8
9
|
/** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
|
|
9
10
|
mode?: ChartMode;
|
|
10
11
|
/** Chart dimensions as [width, height] */
|
|
@@ -33,11 +34,11 @@ export interface RealtimeHeatmapProps {
|
|
|
33
34
|
/** Controlled data array */
|
|
34
35
|
data?: Record<string, any>[];
|
|
35
36
|
/** Time/x value accessor */
|
|
36
|
-
timeAccessor?:
|
|
37
|
+
timeAccessor?: ChartAccessor<TDatum, number>;
|
|
37
38
|
/** Value/y accessor */
|
|
38
|
-
valueAccessor?:
|
|
39
|
+
valueAccessor?: ChartAccessor<TDatum, number>;
|
|
39
40
|
/** Category accessor for colored cells */
|
|
40
|
-
categoryAccessor?:
|
|
41
|
+
categoryAccessor?: ChartAccessor<TDatum, string>;
|
|
41
42
|
/** Fixed time domain */
|
|
42
43
|
timeExtent?: [number, number];
|
|
43
44
|
/** Fixed value domain */
|
|
@@ -81,6 +82,20 @@ export interface RealtimeHeatmapProps {
|
|
|
81
82
|
name?: string;
|
|
82
83
|
fields: string[];
|
|
83
84
|
};
|
|
85
|
+
/** Consume a named selection — dims unselected elements */
|
|
86
|
+
selection?: SelectionConfig;
|
|
87
|
+
/** Show a loading skeleton placeholder */
|
|
88
|
+
loading?: boolean;
|
|
89
|
+
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
90
|
+
emptyContent?: ReactNode | false;
|
|
91
|
+
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
92
|
+
emphasis?: "primary" | "secondary";
|
|
93
|
+
/** Show a legend */
|
|
94
|
+
showLegend?: boolean;
|
|
95
|
+
/** Legend position */
|
|
96
|
+
legendPosition?: LegendPosition;
|
|
97
|
+
/** Legend interaction mode */
|
|
98
|
+
legendInteraction?: LegendInteractionMode;
|
|
84
99
|
}
|
|
85
100
|
/**
|
|
86
101
|
* RealtimeHeatmap - Streaming heatmap with 2D grid binning.
|
|
@@ -103,4 +118,7 @@ export interface RealtimeHeatmapProps {
|
|
|
103
118
|
* />
|
|
104
119
|
* ```
|
|
105
120
|
*/
|
|
106
|
-
export declare const RealtimeHeatmap:
|
|
121
|
+
export declare const RealtimeHeatmap: {
|
|
122
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeHeatmapProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
123
|
+
displayName?: string;
|
|
124
|
+
};
|
|
@@ -2,9 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext, DecayConfig, PulseConfig, StalenessConfig, TransitionConfig } from "../../stream/types";
|
|
3
3
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
5
|
-
import type {
|
|
5
|
+
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
6
|
+
import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
|
|
6
7
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
7
|
-
export interface RealtimeTemporalHistogramProps {
|
|
8
|
+
export interface RealtimeTemporalHistogramProps<TDatum extends Record<string, any> = Record<string, any>> {
|
|
8
9
|
/** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
|
|
9
10
|
mode?: ChartMode;
|
|
10
11
|
/** Time interval for binning */
|
|
@@ -35,9 +36,9 @@ export interface RealtimeTemporalHistogramProps {
|
|
|
35
36
|
/** Controlled data array */
|
|
36
37
|
data?: Record<string, any>[];
|
|
37
38
|
/** Time value accessor */
|
|
38
|
-
timeAccessor?:
|
|
39
|
+
timeAccessor?: ChartAccessor<TDatum, number>;
|
|
39
40
|
/** Value accessor */
|
|
40
|
-
valueAccessor?:
|
|
41
|
+
valueAccessor?: ChartAccessor<TDatum, number>;
|
|
41
42
|
/** Fixed time domain */
|
|
42
43
|
timeExtent?: [number, number];
|
|
43
44
|
/** Fixed value domain */
|
|
@@ -48,7 +49,7 @@ export interface RealtimeTemporalHistogramProps {
|
|
|
48
49
|
* Category accessor for stacked bars.
|
|
49
50
|
* When provided, bars are stacked by category within each bin.
|
|
50
51
|
*/
|
|
51
|
-
categoryAccessor?:
|
|
52
|
+
categoryAccessor?: ChartAccessor<TDatum, string>;
|
|
52
53
|
/**
|
|
53
54
|
* Category-to-color map for stacked bars.
|
|
54
55
|
* Keys also determine stack order (listed keys first, then alphabetical).
|
|
@@ -87,6 +88,8 @@ export interface RealtimeTemporalHistogramProps {
|
|
|
87
88
|
name?: string;
|
|
88
89
|
fields: string[];
|
|
89
90
|
};
|
|
91
|
+
/** Consume a named selection — dims unselected elements */
|
|
92
|
+
selection?: SelectionConfig;
|
|
90
93
|
/** Configurable opacity decay for older data */
|
|
91
94
|
decay?: DecayConfig;
|
|
92
95
|
/** Flash effect on newly inserted data */
|
|
@@ -95,6 +98,18 @@ export interface RealtimeTemporalHistogramProps {
|
|
|
95
98
|
staleness?: StalenessConfig;
|
|
96
99
|
/** Smooth position interpolation on data change */
|
|
97
100
|
transition?: TransitionConfig;
|
|
101
|
+
/** Show a loading skeleton placeholder */
|
|
102
|
+
loading?: boolean;
|
|
103
|
+
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
104
|
+
emptyContent?: ReactNode | false;
|
|
105
|
+
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
106
|
+
emphasis?: "primary" | "secondary";
|
|
107
|
+
/** Show a legend */
|
|
108
|
+
showLegend?: boolean;
|
|
109
|
+
/** Legend position */
|
|
110
|
+
legendPosition?: LegendPosition;
|
|
111
|
+
/** Legend interaction mode */
|
|
112
|
+
legendInteraction?: LegendInteractionMode;
|
|
98
113
|
}
|
|
99
114
|
/**
|
|
100
115
|
* RealtimeTemporalHistogram - Streaming temporal histogram.
|
|
@@ -126,8 +141,14 @@ export interface RealtimeTemporalHistogramProps {
|
|
|
126
141
|
* />
|
|
127
142
|
* ```
|
|
128
143
|
*/
|
|
129
|
-
export declare const RealtimeTemporalHistogram:
|
|
144
|
+
export declare const RealtimeTemporalHistogram: {
|
|
145
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeTemporalHistogramProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
146
|
+
displayName?: string;
|
|
147
|
+
};
|
|
130
148
|
/** @deprecated Use RealtimeTemporalHistogram instead */
|
|
131
|
-
export declare const RealtimeHistogram:
|
|
149
|
+
export declare const RealtimeHistogram: {
|
|
150
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeTemporalHistogramProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
151
|
+
displayName?: string;
|
|
152
|
+
};
|
|
132
153
|
/** @deprecated Use RealtimeTemporalHistogramProps instead */
|
|
133
154
|
export type RealtimeHistogramProps = RealtimeTemporalHistogramProps;
|
|
@@ -2,9 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext, DecayConfig, PulseConfig, StalenessConfig, TransitionConfig } from "../../stream/types";
|
|
3
3
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
5
|
-
import type {
|
|
5
|
+
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
6
|
+
import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
|
|
6
7
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
7
|
-
export interface RealtimeLineChartProps {
|
|
8
|
+
export interface RealtimeLineChartProps<TDatum extends Record<string, any> = Record<string, any>> {
|
|
8
9
|
/** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
|
|
9
10
|
mode?: ChartMode;
|
|
10
11
|
/** Chart dimensions as [width, height] */
|
|
@@ -33,9 +34,9 @@ export interface RealtimeLineChartProps {
|
|
|
33
34
|
/** Controlled data array */
|
|
34
35
|
data?: Record<string, any>[];
|
|
35
36
|
/** Time value accessor */
|
|
36
|
-
timeAccessor?:
|
|
37
|
+
timeAccessor?: ChartAccessor<TDatum, number>;
|
|
37
38
|
/** Value accessor */
|
|
38
|
-
valueAccessor?:
|
|
39
|
+
valueAccessor?: ChartAccessor<TDatum, number>;
|
|
39
40
|
/** Fixed time domain */
|
|
40
41
|
timeExtent?: [number, number];
|
|
41
42
|
/** Fixed value domain */
|
|
@@ -81,6 +82,20 @@ export interface RealtimeLineChartProps {
|
|
|
81
82
|
name?: string;
|
|
82
83
|
fields: string[];
|
|
83
84
|
};
|
|
85
|
+
/** Consume a named selection — dims unselected elements */
|
|
86
|
+
selection?: SelectionConfig;
|
|
87
|
+
/** Show a loading skeleton placeholder */
|
|
88
|
+
loading?: boolean;
|
|
89
|
+
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
90
|
+
emptyContent?: ReactNode | false;
|
|
91
|
+
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
92
|
+
emphasis?: "primary" | "secondary";
|
|
93
|
+
/** Show a legend */
|
|
94
|
+
showLegend?: boolean;
|
|
95
|
+
/** Legend position */
|
|
96
|
+
legendPosition?: LegendPosition;
|
|
97
|
+
/** Legend interaction mode */
|
|
98
|
+
legendInteraction?: LegendInteractionMode;
|
|
84
99
|
}
|
|
85
100
|
/**
|
|
86
101
|
* RealtimeLineChart - Simplified wrapper for streaming line charts.
|
|
@@ -101,4 +116,7 @@ export interface RealtimeLineChartProps {
|
|
|
101
116
|
* />
|
|
102
117
|
* ```
|
|
103
118
|
*/
|
|
104
|
-
export declare const RealtimeLineChart:
|
|
119
|
+
export declare const RealtimeLineChart: {
|
|
120
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeLineChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
121
|
+
displayName?: string;
|
|
122
|
+
};
|
|
@@ -2,9 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext } from "../../stream/types";
|
|
3
3
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
5
|
-
import type {
|
|
5
|
+
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
6
|
+
import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
|
|
6
7
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
7
|
-
export interface RealtimeSwarmChartProps {
|
|
8
|
+
export interface RealtimeSwarmChartProps<TDatum extends Record<string, any> = Record<string, any>> {
|
|
8
9
|
/** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
|
|
9
10
|
mode?: ChartMode;
|
|
10
11
|
/** Chart dimensions as [width, height] */
|
|
@@ -33,9 +34,9 @@ export interface RealtimeSwarmChartProps {
|
|
|
33
34
|
/** Controlled data array */
|
|
34
35
|
data?: Record<string, any>[];
|
|
35
36
|
/** Time value accessor */
|
|
36
|
-
timeAccessor?:
|
|
37
|
+
timeAccessor?: ChartAccessor<TDatum, number>;
|
|
37
38
|
/** Value accessor */
|
|
38
|
-
valueAccessor?:
|
|
39
|
+
valueAccessor?: ChartAccessor<TDatum, number>;
|
|
39
40
|
/** Fixed time domain */
|
|
40
41
|
timeExtent?: [number, number];
|
|
41
42
|
/** Fixed value domain */
|
|
@@ -43,7 +44,7 @@ export interface RealtimeSwarmChartProps {
|
|
|
43
44
|
/** Extent padding factor */
|
|
44
45
|
extentPadding?: number;
|
|
45
46
|
/** Category accessor for color-coding dots */
|
|
46
|
-
categoryAccessor?:
|
|
47
|
+
categoryAccessor?: ChartAccessor<TDatum, string>;
|
|
47
48
|
/** Category-to-color map */
|
|
48
49
|
colors?: Record<string, string>;
|
|
49
50
|
/** Dot radius */
|
|
@@ -81,6 +82,20 @@ export interface RealtimeSwarmChartProps {
|
|
|
81
82
|
name?: string;
|
|
82
83
|
fields: string[];
|
|
83
84
|
};
|
|
85
|
+
/** Consume a named selection — dims unselected elements */
|
|
86
|
+
selection?: SelectionConfig;
|
|
87
|
+
/** Show a loading skeleton placeholder */
|
|
88
|
+
loading?: boolean;
|
|
89
|
+
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
90
|
+
emptyContent?: ReactNode | false;
|
|
91
|
+
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
92
|
+
emphasis?: "primary" | "secondary";
|
|
93
|
+
/** Show a legend */
|
|
94
|
+
showLegend?: boolean;
|
|
95
|
+
/** Legend position */
|
|
96
|
+
legendPosition?: LegendPosition;
|
|
97
|
+
/** Legend interaction mode */
|
|
98
|
+
legendInteraction?: LegendInteractionMode;
|
|
84
99
|
}
|
|
85
100
|
/**
|
|
86
101
|
* RealtimeSwarmChart - Simplified wrapper for streaming dot/swarm charts.
|
|
@@ -103,4 +118,7 @@ export interface RealtimeSwarmChartProps {
|
|
|
103
118
|
* />
|
|
104
119
|
* ```
|
|
105
120
|
*/
|
|
106
|
-
export declare const RealtimeSwarmChart:
|
|
121
|
+
export declare const RealtimeSwarmChart: {
|
|
122
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeSwarmChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
123
|
+
displayName?: string;
|
|
124
|
+
};
|
|
@@ -2,9 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext } from "../../stream/types";
|
|
3
3
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
5
|
-
import type {
|
|
5
|
+
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
6
|
+
import type { ChartMode, ChartAccessor, SelectionConfig } from "../shared/types";
|
|
6
7
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
7
|
-
export interface RealtimeWaterfallChartProps {
|
|
8
|
+
export interface RealtimeWaterfallChartProps<TDatum extends Record<string, any> = Record<string, any>> {
|
|
8
9
|
/** Display mode: "primary" (full chrome), "context" (compact), "sparkline" (inline) */
|
|
9
10
|
mode?: ChartMode;
|
|
10
11
|
/** Chart dimensions as [width, height] */
|
|
@@ -33,9 +34,9 @@ export interface RealtimeWaterfallChartProps {
|
|
|
33
34
|
/** Controlled data array */
|
|
34
35
|
data?: Record<string, any>[];
|
|
35
36
|
/** Time value accessor */
|
|
36
|
-
timeAccessor?:
|
|
37
|
+
timeAccessor?: ChartAccessor<TDatum, number>;
|
|
37
38
|
/** Value accessor (positive = gain, negative = loss) */
|
|
38
|
-
valueAccessor?:
|
|
39
|
+
valueAccessor?: ChartAccessor<TDatum, number>;
|
|
39
40
|
/** Fixed time domain */
|
|
40
41
|
timeExtent?: [number, number];
|
|
41
42
|
/** Fixed value domain */
|
|
@@ -81,6 +82,20 @@ export interface RealtimeWaterfallChartProps {
|
|
|
81
82
|
name?: string;
|
|
82
83
|
fields: string[];
|
|
83
84
|
};
|
|
85
|
+
/** Consume a named selection — dims unselected elements */
|
|
86
|
+
selection?: SelectionConfig;
|
|
87
|
+
/** Show a loading skeleton placeholder */
|
|
88
|
+
loading?: boolean;
|
|
89
|
+
/** Custom content to render when data is empty. Set to `false` to disable empty state. */
|
|
90
|
+
emptyContent?: ReactNode | false;
|
|
91
|
+
/** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
|
|
92
|
+
emphasis?: "primary" | "secondary";
|
|
93
|
+
/** Show a legend */
|
|
94
|
+
showLegend?: boolean;
|
|
95
|
+
/** Legend position */
|
|
96
|
+
legendPosition?: LegendPosition;
|
|
97
|
+
/** Legend interaction mode */
|
|
98
|
+
legendInteraction?: LegendInteractionMode;
|
|
84
99
|
}
|
|
85
100
|
/**
|
|
86
101
|
* RealtimeWaterfallChart - Simplified wrapper for streaming waterfall charts.
|
|
@@ -100,4 +115,7 @@ export interface RealtimeWaterfallChartProps {
|
|
|
100
115
|
* />
|
|
101
116
|
* ```
|
|
102
117
|
*/
|
|
103
|
-
export declare const RealtimeWaterfallChart:
|
|
118
|
+
export declare const RealtimeWaterfallChart: {
|
|
119
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: RealtimeWaterfallChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
120
|
+
displayName?: string;
|
|
121
|
+
};
|
|
@@ -22,6 +22,11 @@ export declare const DEFAULT_COLORS: readonly string[];
|
|
|
22
22
|
* Pastel palette for depth-based hierarchy coloring (Treemap, CirclePack, TreeDiagram).
|
|
23
23
|
* Index corresponds to hierarchy depth, wraps via modulo.
|
|
24
24
|
*/
|
|
25
|
+
/**
|
|
26
|
+
* Default streaming palette — used by PipelineStore, OrdinalPipelineStore,
|
|
27
|
+
* and useStreamingLegend for consistent colors when no colorScheme is specified.
|
|
28
|
+
*/
|
|
29
|
+
export declare const STREAMING_PALETTE: string[];
|
|
25
30
|
export declare const DEPTH_PALETTE_COLORS: string[];
|
|
26
31
|
/**
|
|
27
32
|
* Gets a color for a data point based on the colorBy configuration
|
|
@@ -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;
|
|
@@ -3,6 +3,7 @@ import type { SelectionHookResult } from "./selectionUtils";
|
|
|
3
3
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
4
4
|
import type { Accessor, SelectionConfig, LinkedHoverProp, ChartMode } from "./types";
|
|
5
5
|
import type { MarginType } from "../../types/generalTypes";
|
|
6
|
+
import type { TransitionConfig } from "../../stream/types";
|
|
6
7
|
/**
|
|
7
8
|
* Default fill color used when no colorBy is specified
|
|
8
9
|
*/
|
|
@@ -16,7 +17,7 @@ export declare function resolveAccessor<T = any>(accessor: string | ((d: Record<
|
|
|
16
17
|
* Hook to create a color scale from data and colorBy configuration.
|
|
17
18
|
* Returns undefined when colorBy is absent or is a function accessor.
|
|
18
19
|
*/
|
|
19
|
-
export declare function useColorScale(data: Array<Record<string, any>>, colorBy:
|
|
20
|
+
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
21
|
/**
|
|
21
22
|
* Hook to sort data by a value accessor.
|
|
22
23
|
* Used by BarChart and DotPlot.
|
|
@@ -48,11 +49,13 @@ export declare function useChartSelection({ selection, linkedHover, fallbackFiel
|
|
|
48
49
|
* Consolidates the shouldShowLegend / createLegend / margin merge / right-margin
|
|
49
50
|
* expansion pattern that every chart with color encoding repeats.
|
|
50
51
|
*/
|
|
51
|
-
export
|
|
52
|
+
export type LegendPosition = "right" | "left" | "top" | "bottom";
|
|
53
|
+
export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, legendPosition, userMargin, defaults, }: {
|
|
52
54
|
data: Array<Record<string, any>>;
|
|
53
55
|
colorBy: Accessor<string> | undefined;
|
|
54
56
|
colorScale: ((v: string) => string) | undefined;
|
|
55
57
|
showLegend: boolean | undefined;
|
|
58
|
+
legendPosition?: LegendPosition;
|
|
56
59
|
userMargin: MarginType | undefined;
|
|
57
60
|
defaults?: {
|
|
58
61
|
top: number;
|
|
@@ -68,7 +71,30 @@ export declare function useChartLegendAndMargin({ data, colorBy, colorScale, sho
|
|
|
68
71
|
left: number;
|
|
69
72
|
right: number;
|
|
70
73
|
};
|
|
74
|
+
legendPosition: LegendPosition;
|
|
71
75
|
};
|
|
76
|
+
export type LegendInteractionMode = "highlight" | "isolate" | "none";
|
|
77
|
+
export interface LegendInteractionState {
|
|
78
|
+
highlightedCategory: string | null;
|
|
79
|
+
isolatedCategories: Set<string>;
|
|
80
|
+
onLegendHover: (item: {
|
|
81
|
+
label: string;
|
|
82
|
+
} | null) => void;
|
|
83
|
+
onLegendClick: (item: {
|
|
84
|
+
label: string;
|
|
85
|
+
}) => void;
|
|
86
|
+
/** Selection predicate that dims non-matching data — use with wrapStyleWithSelection */
|
|
87
|
+
legendSelectionHook: {
|
|
88
|
+
isActive: boolean;
|
|
89
|
+
predicate: (d: Record<string, any>) => boolean;
|
|
90
|
+
} | null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Hook managing legend highlight/isolate interaction.
|
|
94
|
+
* - "highlight": hover over legend item dims everything else to 30% opacity
|
|
95
|
+
* - "isolate": click toggles category visibility; click all to reset
|
|
96
|
+
*/
|
|
97
|
+
export declare function useLegendInteraction(mode: LegendInteractionMode | undefined, colorBy: string | ((d: any) => string) | undefined, allCategories: string[]): LegendInteractionState;
|
|
72
98
|
interface ChartModeInput {
|
|
73
99
|
width?: number;
|
|
74
100
|
height?: number;
|
|
@@ -112,4 +138,12 @@ export declare function useChartMode(mode: ChartMode | undefined, userProps: Cha
|
|
|
112
138
|
width?: number;
|
|
113
139
|
height?: number;
|
|
114
140
|
}): ChartModeResult;
|
|
141
|
+
/**
|
|
142
|
+
* Resolve the `animate` prop into a `TransitionConfig` for Stream Frames.
|
|
143
|
+
* Returns undefined when animate is falsy (no transition).
|
|
144
|
+
*/
|
|
145
|
+
export declare function resolveAnimateConfig(animate: boolean | {
|
|
146
|
+
duration?: number;
|
|
147
|
+
easing?: "linear" | "ease-out";
|
|
148
|
+
} | undefined): TransitionConfig | undefined;
|
|
115
149
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Accessor } from "./types";
|
|
2
|
+
import type { LegendItem } from "../../types/legendTypes";
|
|
2
3
|
/**
|
|
3
4
|
* Create a legend configuration for HOC components
|
|
4
5
|
*
|
|
@@ -19,9 +20,7 @@ export declare function createLegend({ data, colorBy, colorScale, getColor, stro
|
|
|
19
20
|
strokeWidth?: number;
|
|
20
21
|
}): {
|
|
21
22
|
legendGroups: {
|
|
22
|
-
styleFn: (d:
|
|
23
|
-
color: string;
|
|
24
|
-
}) => Record<string, string | number>;
|
|
23
|
+
styleFn: (d: LegendItem) => Record<string, string | number>;
|
|
25
24
|
type: "fill";
|
|
26
25
|
items: {
|
|
27
26
|
label: string;
|
|
@@ -67,10 +67,9 @@ export interface ForecastConfig {
|
|
|
67
67
|
export declare const SEGMENT_FIELD: "__forecastSegment";
|
|
68
68
|
export type SegmentType = "training" | "observed" | "forecast";
|
|
69
69
|
export declare function buildAnomalyAnnotations(config: AnomalyConfig): Record<string, any>[];
|
|
70
|
-
interface ForecastResult {
|
|
70
|
+
export interface ForecastResult {
|
|
71
71
|
processedData: Record<string, any>[];
|
|
72
72
|
annotations: Record<string, any>[];
|
|
73
73
|
}
|
|
74
74
|
export declare function buildForecast(data: Record<string, any>[], xAccessor: string, yAccessor: string, forecastConfig: ForecastConfig, anomalyConfig?: AnomalyConfig): ForecastResult;
|
|
75
75
|
export declare function createSegmentLineStyle(baseStyle: (d: Record<string, any>) => Record<string, any>, forecastConfig: ForecastConfig): (d: Record<string, any>) => Record<string, any>;
|
|
76
|
-
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy-loaded wrapper for statistical overlays.
|
|
3
|
+
* Only loads the LOESS/forecast logic when forecast or anomaly props are actually used.
|
|
4
|
+
*/
|
|
5
|
+
export type { ForecastResult } from "./statisticalOverlays";
|
|
6
|
+
/** Duplicated here to avoid pulling in the heavy statisticalOverlays module at import time */
|
|
7
|
+
export declare const SEGMENT_FIELD: "__forecastSegment";
|
|
8
|
+
export declare function buildForecastLazy(...args: Parameters<typeof import("./statisticalOverlays")["buildForecast"]>): Promise<import("./statisticalOverlays").ForecastResult>;
|
|
9
|
+
export declare function buildAnomalyAnnotationsLazy(...args: Parameters<typeof import("./statisticalOverlays")["buildAnomalyAnnotations"]>): Promise<Record<string, any>[]>;
|
|
10
|
+
export declare function createSegmentLineStyleLazy(...args: Parameters<typeof import("./statisticalOverlays")["createSegmentLineStyle"]>): Promise<(d: Record<string, any>) => Record<string, any>>;
|
|
@@ -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,8 +2,8 @@ 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:
|
|
6
|
-
role?: "x" | "y" | "color" | "size" | "group" | "value";
|
|
5
|
+
accessor: string | ((d: any) => any);
|
|
6
|
+
role?: "title" | "x" | "y" | "color" | "size" | "group" | "value";
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Extract a display name from an accessor.
|
|
@@ -69,6 +69,18 @@ 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";
|
|
78
|
+
/** Enable declarative bounded animation (enter/exit/update transitions).
|
|
79
|
+
* `true` uses defaults (300ms ease-out). Object form allows customization. */
|
|
80
|
+
animate?: boolean | {
|
|
81
|
+
duration?: number;
|
|
82
|
+
easing?: "linear" | "ease-out";
|
|
83
|
+
};
|
|
72
84
|
}
|
|
73
85
|
/**
|
|
74
86
|
* Axis configuration props
|
|
@@ -97,9 +109,9 @@ export type ChartAccessor<TDatum, T> = (keyof TDatum & string) | ((d: Record<str
|
|
|
97
109
|
/**
|
|
98
110
|
* Color configuration
|
|
99
111
|
*/
|
|
100
|
-
export interface ColorConfig {
|
|
112
|
+
export interface ColorConfig<TDatum = Record<string, any>> {
|
|
101
113
|
/** Field name or function to determine color */
|
|
102
|
-
colorBy?:
|
|
114
|
+
colorBy?: ChartAccessor<TDatum, string>;
|
|
103
115
|
/** Color scheme name (e.g., "blues", "category10") */
|
|
104
116
|
colorScheme?: string;
|
|
105
117
|
/** Custom color palette */
|
|
@@ -108,9 +120,9 @@ export interface ColorConfig {
|
|
|
108
120
|
/**
|
|
109
121
|
* Size configuration
|
|
110
122
|
*/
|
|
111
|
-
export interface SizeConfig {
|
|
123
|
+
export interface SizeConfig<TDatum = Record<string, any>> {
|
|
112
124
|
/** Field name or function to determine size */
|
|
113
|
-
sizeBy?:
|
|
125
|
+
sizeBy?: ChartAccessor<TDatum, number>;
|
|
114
126
|
/** Min and max size range */
|
|
115
127
|
sizeRange?: [number, number];
|
|
116
128
|
}
|