semiotic 3.1.2 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +173 -213
- package/LICENSE +197 -10
- package/README.md +12 -11
- package/ai/dist/componentRegistry.js +6 -0
- package/ai/dist/mcp-server.js +115 -5
- package/ai/examples.md +184 -0
- package/ai/schema.json +4140 -888
- package/ai/system-prompt.md +36 -1
- package/dist/components/ChartContainer.d.ts +2 -0
- package/dist/components/DataSummaryContext.d.ts +12 -0
- package/dist/components/ThemeProvider.d.ts +5 -3
- package/dist/components/Tooltip/FlippingTooltip.d.ts +34 -0
- package/dist/components/charts/geo/ChoroplethMap.d.ts +1 -1
- package/dist/components/charts/index.d.ts +12 -1
- package/dist/components/charts/ordinal/BarChart.d.ts +4 -1
- package/dist/components/charts/ordinal/BoxPlot.d.ts +4 -1
- package/dist/components/charts/ordinal/DonutChart.d.ts +1 -1
- package/dist/components/charts/ordinal/DotPlot.d.ts +4 -1
- package/dist/components/charts/ordinal/FunnelChart.d.ts +57 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +4 -1
- package/dist/components/charts/ordinal/Histogram.d.ts +17 -2
- package/dist/components/charts/ordinal/LikertChart.d.ts +94 -0
- package/dist/components/charts/ordinal/PieChart.d.ts +1 -1
- package/dist/components/charts/ordinal/RidgelinePlot.d.ts +12 -7
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -1
- package/dist/components/charts/ordinal/SwarmPlot.d.ts +15 -1
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +65 -0
- package/dist/components/charts/ordinal/ViolinPlot.d.ts +17 -2
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +20 -0
- package/dist/components/charts/shared/annotationResolvers.d.ts +28 -0
- package/dist/components/charts/shared/colorManipulation.d.ts +15 -0
- package/dist/components/charts/shared/formatUtils.d.ts +28 -0
- package/dist/components/charts/shared/hatchPattern.d.ts +35 -0
- package/dist/components/charts/shared/hooks.d.ts +39 -3
- package/dist/components/charts/shared/legendUtils.d.ts +2 -1
- package/dist/components/charts/shared/selectionUtils.d.ts +16 -1
- package/dist/components/charts/shared/statisticalOverlays.d.ts +49 -5
- package/dist/components/charts/shared/statsTooltip.d.ts +11 -0
- package/dist/components/charts/shared/types.d.ts +26 -2
- package/dist/components/charts/shared/useChartSetup.d.ts +12 -2
- package/dist/components/charts/shared/useLikertAggregation.d.ts +51 -0
- package/dist/components/charts/shared/useOrdinalBrush.d.ts +28 -0
- package/dist/components/charts/shared/useOrdinalStreaming.d.ts +54 -0
- package/dist/components/charts/shared/useStreamingLegend.d.ts +2 -2
- package/dist/components/charts/shared/validateProps.d.ts +2 -2
- package/dist/components/charts/shared/validationMap.d.ts +12 -0
- package/dist/components/charts/xy/AreaChart.d.ts +11 -0
- package/dist/components/charts/xy/Heatmap.d.ts +1 -1
- package/dist/components/charts/xy/MinimapChart.d.ts +1 -1
- package/dist/components/charts/xy/MultiAxisLineChart.d.ts +71 -0
- package/dist/components/charts/xy/StackedAreaChart.d.ts +11 -0
- package/dist/components/realtime/types.d.ts +6 -0
- package/dist/components/semiotic-ai.d.ts +4 -0
- package/dist/components/semiotic-ordinal.d.ts +5 -0
- package/dist/components/semiotic-themes.d.ts +80 -0
- package/dist/components/semiotic-utils.d.ts +30 -0
- package/dist/components/semiotic-xy.d.ts +1 -0
- package/dist/components/semiotic.d.ts +11 -5
- package/dist/components/store/LinkedCrosshairStore.d.ts +11 -0
- package/dist/components/store/ThemeStore.d.ts +22 -2
- package/dist/components/store/useSelection.d.ts +1 -0
- package/dist/components/stream/AccessibleDataTable.d.ts +28 -6
- package/dist/components/stream/FocusRing.d.ts +33 -0
- package/dist/components/stream/OrdinalBrushOverlay.d.ts +43 -0
- package/dist/components/stream/OrdinalPipelineStore.d.ts +16 -0
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -1
- package/dist/components/stream/PipelineStore.d.ts +7 -47
- package/dist/components/stream/SVGOverlay.d.ts +9 -3
- package/dist/components/stream/SceneGraph.d.ts +6 -1
- package/dist/components/stream/XYBrushOverlay.d.ts +47 -0
- package/dist/components/stream/accessorUtils.d.ts +14 -0
- package/dist/components/stream/geoTypes.d.ts +5 -1
- package/dist/components/stream/keyboardNav.d.ts +85 -9
- package/dist/components/stream/layouts/hierarchySceneBuilders.d.ts +35 -0
- package/dist/components/stream/layouts/hierarchyUtils.d.ts +25 -0
- package/dist/components/stream/networkTypes.d.ts +7 -1
- package/dist/components/stream/ordinalSceneBuilders/barFunnelScene.d.ts +27 -0
- package/dist/components/stream/ordinalSceneBuilders/funnelScene.d.ts +26 -0
- package/dist/components/stream/ordinalSceneBuilders/swimlaneScene.d.ts +12 -0
- package/dist/components/stream/ordinalTypes.d.ts +30 -4
- package/dist/components/stream/pipelineDecay.d.ts +20 -0
- package/dist/components/stream/pipelinePulse.d.ts +24 -0
- package/dist/components/stream/pipelineTransitions.d.ts +59 -0
- package/dist/components/stream/renderers/barFunnelCanvasRenderer.d.ts +12 -0
- package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +2 -1
- package/dist/components/stream/renderers/trapezoidCanvasRenderer.d.ts +15 -0
- package/dist/components/stream/sceneUtils.d.ts +10 -0
- package/dist/components/stream/types.d.ts +29 -4
- package/dist/components/stream/useMediaPreferences.d.ts +11 -0
- package/dist/components/stream/xySceneBuilders/areaScene.d.ts +13 -0
- package/dist/components/stream/xySceneBuilders/barScene.d.ts +18 -0
- package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +8 -0
- package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +10 -0
- package/dist/components/stream/xySceneBuilders/emitPointNodes.d.ts +13 -0
- package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +3 -0
- package/dist/components/stream/xySceneBuilders/lineScene.d.ts +12 -0
- package/dist/components/stream/xySceneBuilders/pointScene.d.ts +12 -0
- package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +10 -0
- package/dist/components/stream/xySceneBuilders/types.d.ts +93 -0
- package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +12 -0
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai-statisticalOverlays-C2PPlmXv.js +1 -0
- package/dist/semiotic-ai.d.ts +4 -0
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-ordinal.d.ts +5 -0
- package/dist/semiotic-statisticalOverlays-DGX_WWc5.js +1 -0
- package/dist/semiotic-themes.d.ts +80 -0
- package/dist/semiotic-themes.min.js +1 -0
- package/dist/semiotic-themes.module.min.js +1 -0
- package/dist/semiotic-utils.d.ts +30 -0
- package/dist/semiotic-utils.min.js +1 -0
- package/dist/semiotic-utils.module.min.js +1 -0
- package/dist/semiotic-xy.d.ts +1 -0
- package/dist/semiotic.d.ts +11 -5
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy-statisticalOverlays-C2PPlmXv.js +1 -0
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +38 -12
- package/dist/semiotic-ai-statisticalOverlays-C1f7TYyD.js +0 -1
- package/dist/semiotic-statisticalOverlays-C1f7TYyD.js +0 -1
- package/dist/xy-statisticalOverlays-C1f7TYyD.js +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Ref, RefObject } from "react";
|
|
2
|
+
import type { StreamOrdinalFrameHandle } from "../../stream/ordinalTypes";
|
|
3
|
+
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
4
|
+
import type { Accessor } from "./types";
|
|
5
|
+
import type { LegendPosition } from "./hooks";
|
|
6
|
+
interface UseOrdinalStreamingConfig {
|
|
7
|
+
/** External ref for push API */
|
|
8
|
+
ref: Ref<RealtimeFrameHandle>;
|
|
9
|
+
/** Internal frame ref */
|
|
10
|
+
frameRef: RefObject<StreamOrdinalFrameHandle | null>;
|
|
11
|
+
/** True when data prop is undefined (push API mode) */
|
|
12
|
+
isPushMode: boolean;
|
|
13
|
+
/** Color-by accessor (may be derived from stackBy/groupBy/etc.) */
|
|
14
|
+
colorBy: Accessor<string> | undefined;
|
|
15
|
+
/** Color scheme name or array — undefined lets useColorScale consult the theme */
|
|
16
|
+
colorScheme: string | string[] | undefined;
|
|
17
|
+
/** Whether legend is requested */
|
|
18
|
+
showLegend: boolean | undefined;
|
|
19
|
+
/** Legend position */
|
|
20
|
+
legendPosition?: LegendPosition;
|
|
21
|
+
/** Results from useChartSetup — needed for legend/margin merge */
|
|
22
|
+
setup: {
|
|
23
|
+
legendBehaviorProps: Record<string, any>;
|
|
24
|
+
legendPosition: LegendPosition;
|
|
25
|
+
margin: {
|
|
26
|
+
top: number;
|
|
27
|
+
right: number;
|
|
28
|
+
bottom: number;
|
|
29
|
+
left: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
interface UseOrdinalStreamingResult {
|
|
34
|
+
/** Legend props merged with streaming legend (spread into streamProps) */
|
|
35
|
+
effectiveLegendProps: Record<string, any>;
|
|
36
|
+
/** Margin merged with streaming legend margin adjustments */
|
|
37
|
+
effectiveMargin: {
|
|
38
|
+
top: number;
|
|
39
|
+
right: number;
|
|
40
|
+
bottom: number;
|
|
41
|
+
left: number;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Shared hook for ordinal charts that support push API + streaming legend.
|
|
46
|
+
*
|
|
47
|
+
* Consolidates: useStreamingLegend, wrappedPush/pushMany,
|
|
48
|
+
* useImperativeHandle, effectiveLegendProps, effectiveMargin.
|
|
49
|
+
*
|
|
50
|
+
* Used by: StackedBarChart, GroupedBarChart, PieChart, DonutChart, SwimlaneChart.
|
|
51
|
+
* NOT used by LikertChart (custom accumulator + deterministic legend).
|
|
52
|
+
*/
|
|
53
|
+
export declare function useOrdinalStreaming({ ref, frameRef, isPushMode, colorBy, colorScheme, showLegend, legendPosition, setup, }: UseOrdinalStreamingConfig): UseOrdinalStreamingResult;
|
|
54
|
+
export {};
|
|
@@ -20,8 +20,8 @@ export declare function useStreamingLegend({ isPushMode, colorBy, colorScheme, s
|
|
|
20
20
|
isPushMode: boolean;
|
|
21
21
|
/** The color-by accessor (may be derived from stackBy/groupBy/categoryAccessor) */
|
|
22
22
|
colorBy: Accessor<string> | undefined;
|
|
23
|
-
/** Color scheme name or custom array */
|
|
24
|
-
colorScheme: string | string[];
|
|
23
|
+
/** Color scheme name or custom array — undefined lets useColorScale consult the theme */
|
|
24
|
+
colorScheme: string | string[] | undefined;
|
|
25
25
|
/** Whether legend is requested */
|
|
26
26
|
showLegend: boolean | undefined;
|
|
27
27
|
/** Legend position */
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* unknown props (typo detection), and data shape via the existing
|
|
6
6
|
* validateArrayData / validateObjectData / validateNetworkData helpers.
|
|
7
7
|
*/
|
|
8
|
+
import { VALIDATION_MAP } from "./validationMap";
|
|
9
|
+
export { VALIDATION_MAP };
|
|
8
10
|
export interface ValidationResult {
|
|
9
11
|
valid: boolean;
|
|
10
12
|
errors: string[];
|
|
@@ -25,7 +27,6 @@ export interface ComponentSpec {
|
|
|
25
27
|
/** Per-prop type / enum constraints */
|
|
26
28
|
props: Record<string, PropDef>;
|
|
27
29
|
}
|
|
28
|
-
export declare const VALIDATION_MAP: Record<string, ComponentSpec>;
|
|
29
30
|
/**
|
|
30
31
|
* Validate props for a Semiotic HOC chart component.
|
|
31
32
|
*
|
|
@@ -33,4 +34,3 @@ export declare const VALIDATION_MAP: Record<string, ComponentSpec>;
|
|
|
33
34
|
* unknown prop names (typo detection), and data shape + accessor validity.
|
|
34
35
|
*/
|
|
35
36
|
export declare function validateProps(componentName: string, props: Record<string, any>): ValidationResult;
|
|
36
|
-
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-component prop specifications for validation.
|
|
3
|
+
*
|
|
4
|
+
* Pure data — one ComponentSpec entry per Semiotic HOC chart.
|
|
5
|
+
* Shared prop fragments (commonProps, xyAxisProps, etc.) are composed
|
|
6
|
+
* via spread to keep individual entries concise.
|
|
7
|
+
*
|
|
8
|
+
* Consumed by: validateProps.ts (validation engine), diagnoseConfig.ts,
|
|
9
|
+
* chartConfig.ts, check-schema-freshness.js
|
|
10
|
+
*/
|
|
11
|
+
import type { ComponentSpec } from "./validateProps";
|
|
12
|
+
export declare const VALIDATION_MAP: Record<string, ComponentSpec>;
|
|
@@ -97,6 +97,17 @@ export interface AreaChartProps<TDatum extends Record<string, any> = Record<stri
|
|
|
97
97
|
* @default 2
|
|
98
98
|
*/
|
|
99
99
|
lineWidth?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Show data points on the area line.
|
|
102
|
+
* Useful for sparse data or single-point series.
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
105
|
+
showPoints?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Point radius when showPoints is true
|
|
108
|
+
* @default 3
|
|
109
|
+
*/
|
|
110
|
+
pointRadius?: number;
|
|
100
111
|
/**
|
|
101
112
|
* Enable hover annotations
|
|
102
113
|
* @default true
|
|
@@ -42,7 +42,7 @@ export interface HeatmapProps<TDatum extends Record<string, any> = Record<string
|
|
|
42
42
|
/**
|
|
43
43
|
* Format function for x-axis tick labels
|
|
44
44
|
*/
|
|
45
|
-
xFormat?: (d: any) => string;
|
|
45
|
+
xFormat?: (d: any, index?: number, allTicks?: number[]) => string;
|
|
46
46
|
/**
|
|
47
47
|
* Format function for y-axis tick labels
|
|
48
48
|
*/
|
|
@@ -22,7 +22,7 @@ export interface MinimapConfig {
|
|
|
22
22
|
/** Brush direction: "x" (default) or "y" */
|
|
23
23
|
brushDirection?: "x" | "y";
|
|
24
24
|
}
|
|
25
|
-
export interface MinimapChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps, AxisConfig {
|
|
25
|
+
export interface MinimapChartProps<TDatum extends Record<string, any> = Record<string, any>> extends Omit<BaseChartProps, "onClick" | "onObservation" | "selection" | "linkedHover">, AxisConfig {
|
|
26
26
|
/** Array of data points or line objects with coordinates */
|
|
27
27
|
data: TDatum[];
|
|
28
28
|
/** X accessor (default: "x") */
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { StreamXYFrameProps, CurveType } from "../../stream/types";
|
|
3
|
+
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
4
|
+
import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
|
|
5
|
+
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
6
|
+
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for a single series in a MultiAxisLineChart.
|
|
9
|
+
*/
|
|
10
|
+
export interface MultiAxisSeriesConfig<TDatum = Record<string, any>> {
|
|
11
|
+
/** Field name or function to access y values for this series */
|
|
12
|
+
yAccessor: ChartAccessor<TDatum, number>;
|
|
13
|
+
/** Axis label for this series */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Override color for this series (defaults to theme palette) */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** Tick format function for this series' axis */
|
|
18
|
+
format?: (d: number) => string;
|
|
19
|
+
/** Fixed extent [min, max] for this series. Required for push API streaming.
|
|
20
|
+
* If omitted, computed from data. */
|
|
21
|
+
extent?: [number, number];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* MultiAxisLineChart component props
|
|
25
|
+
*/
|
|
26
|
+
export interface MultiAxisLineChartProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps, AxisConfig {
|
|
27
|
+
/** Array of data points shared by both series */
|
|
28
|
+
data?: TDatum[];
|
|
29
|
+
/** Field name or function to access x values @default "x" */
|
|
30
|
+
xAccessor?: ChartAccessor<TDatum, number>;
|
|
31
|
+
/** Series configuration — exactly 2 for dual-axis mode.
|
|
32
|
+
* If not exactly 2, renders as a normal line chart with a console warning. */
|
|
33
|
+
series: MultiAxisSeriesConfig<TDatum>[];
|
|
34
|
+
/** Color scheme or custom colors array @default "category10" */
|
|
35
|
+
colorScheme?: string | string[];
|
|
36
|
+
/** Enable hover annotations @default true */
|
|
37
|
+
enableHover?: boolean;
|
|
38
|
+
/** Curve interpolation @default "monotoneX" */
|
|
39
|
+
curve?: CurveType;
|
|
40
|
+
/** Line width in pixels @default 2 */
|
|
41
|
+
lineWidth?: number;
|
|
42
|
+
/** Show legend @default true */
|
|
43
|
+
showLegend?: boolean;
|
|
44
|
+
/** Show grid lines @default false */
|
|
45
|
+
showGrid?: boolean;
|
|
46
|
+
/** Tooltip configuration */
|
|
47
|
+
tooltip?: TooltipProp;
|
|
48
|
+
/** Legend interaction mode */
|
|
49
|
+
legendInteraction?: LegendInteractionMode;
|
|
50
|
+
/** Legend position */
|
|
51
|
+
legendPosition?: LegendPosition;
|
|
52
|
+
/** Annotations */
|
|
53
|
+
annotations?: Record<string, any>[];
|
|
54
|
+
/** Additional StreamXYFrame props */
|
|
55
|
+
frameProps?: Partial<Omit<StreamXYFrameProps, "chartType" | "data" | "size">>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* MultiAxisLineChart — Dual Y-axis line chart for comparing two series
|
|
59
|
+
* with different scales on the same time/x axis.
|
|
60
|
+
*
|
|
61
|
+
* Data is unitized (normalized to [0,1]) internally so both series share
|
|
62
|
+
* a common visual scale. The left axis shows series[0] values and the
|
|
63
|
+
* right axis shows series[1] values in their original units.
|
|
64
|
+
*
|
|
65
|
+
* If `series` does not contain exactly 2 entries, renders as a standard
|
|
66
|
+
* multi-line chart with a dev-mode console warning.
|
|
67
|
+
*/
|
|
68
|
+
export declare const MultiAxisLineChart: {
|
|
69
|
+
<TDatum extends Record<string, any> = Record<string, any>>(props: MultiAxisLineChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
|
|
70
|
+
displayName?: string;
|
|
71
|
+
};
|
|
@@ -75,6 +75,17 @@ export interface StackedAreaChartProps<TDatum extends Record<string, any> = Reco
|
|
|
75
75
|
* @default 2
|
|
76
76
|
*/
|
|
77
77
|
lineWidth?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Show data points on the area lines.
|
|
80
|
+
* Useful for sparse data or single-point series.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
showPoints?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Point radius when showPoints is true
|
|
86
|
+
* @default 3
|
|
87
|
+
*/
|
|
88
|
+
pointRadius?: number;
|
|
78
89
|
/**
|
|
79
90
|
* Normalize to 100% stacked (proportional)
|
|
80
91
|
* @default false
|
|
@@ -24,6 +24,8 @@ export interface AnnotationContext {
|
|
|
24
24
|
y?: ScaleLinear<number, number>;
|
|
25
25
|
time?: ScaleLinear<number, number>;
|
|
26
26
|
value?: ScaleLinear<number, number>;
|
|
27
|
+
/** The raw ordinal band scale (only in ordinal frames). Has .bandwidth(). */
|
|
28
|
+
o?: any;
|
|
27
29
|
} | null;
|
|
28
30
|
/** @deprecated Use scales.x / scales.y instead */
|
|
29
31
|
timeAxis?: "x" | "y";
|
|
@@ -33,6 +35,8 @@ export interface AnnotationContext {
|
|
|
33
35
|
height?: number;
|
|
34
36
|
data?: Record<string, any>[];
|
|
35
37
|
frameType?: "xy" | "ordinal" | "network";
|
|
38
|
+
/** Ordinal projection direction (only in ordinal frames) */
|
|
39
|
+
projection?: "vertical" | "horizontal";
|
|
36
40
|
/** Point scene nodes for point-anchored annotations */
|
|
37
41
|
pointNodes?: {
|
|
38
42
|
pointId?: string;
|
|
@@ -56,6 +60,8 @@ export interface CrosshairStyle {
|
|
|
56
60
|
export interface HoverAnnotationConfig {
|
|
57
61
|
crosshair?: boolean | CrosshairStyle;
|
|
58
62
|
snapToPoint?: boolean;
|
|
63
|
+
/** Color of the hover indicator dot. Defaults to the hovered element's color (stroke for lines, fill for points). Set a CSS color string to override. */
|
|
64
|
+
pointColor?: string;
|
|
59
65
|
}
|
|
60
66
|
export interface HoverData {
|
|
61
67
|
data: Record<string, any>;
|
|
@@ -6,6 +6,8 @@ export { ConnectedScatterplot } from "./charts/xy/ConnectedScatterplot";
|
|
|
6
6
|
export { BubbleChart } from "./charts/xy/BubbleChart";
|
|
7
7
|
export { Heatmap } from "./charts/xy/Heatmap";
|
|
8
8
|
export { ScatterplotMatrix } from "./charts/xy/ScatterplotMatrix";
|
|
9
|
+
export { QuadrantChart } from "./charts/xy/QuadrantChart";
|
|
10
|
+
export { MultiAxisLineChart } from "./charts/xy/MultiAxisLineChart";
|
|
9
11
|
export { LinkedCharts } from "./LinkedCharts";
|
|
10
12
|
export { useSelection, useLinkedHover, useBrushSelection, useFilteredData } from "./LinkedCharts";
|
|
11
13
|
export { BarChart } from "./charts/ordinal/BarChart";
|
|
@@ -19,6 +21,8 @@ export { DotPlot } from "./charts/ordinal/DotPlot";
|
|
|
19
21
|
export { RidgelinePlot } from "./charts/ordinal/RidgelinePlot";
|
|
20
22
|
export { PieChart } from "./charts/ordinal/PieChart";
|
|
21
23
|
export { DonutChart } from "./charts/ordinal/DonutChart";
|
|
24
|
+
export { FunnelChart } from "./charts/ordinal/FunnelChart";
|
|
25
|
+
export { LikertChart } from "./charts/ordinal/LikertChart";
|
|
22
26
|
export { ForceDirectedGraph } from "./charts/network/ForceDirectedGraph";
|
|
23
27
|
export { ChordDiagram } from "./charts/network/ChordDiagram";
|
|
24
28
|
export { SankeyDiagram } from "./charts/network/SankeyDiagram";
|
|
@@ -7,6 +7,7 @@ export { StreamOrdinalFrame };
|
|
|
7
7
|
export { BarChart } from "./charts/ordinal/BarChart";
|
|
8
8
|
export { StackedBarChart } from "./charts/ordinal/StackedBarChart";
|
|
9
9
|
export { GroupedBarChart } from "./charts/ordinal/GroupedBarChart";
|
|
10
|
+
export { SwimlaneChart } from "./charts/ordinal/SwimlaneChart";
|
|
10
11
|
export { SwarmPlot } from "./charts/ordinal/SwarmPlot";
|
|
11
12
|
export { BoxPlot } from "./charts/ordinal/BoxPlot";
|
|
12
13
|
export { Histogram } from "./charts/ordinal/Histogram";
|
|
@@ -15,4 +16,8 @@ export { DotPlot } from "./charts/ordinal/DotPlot";
|
|
|
15
16
|
export { PieChart } from "./charts/ordinal/PieChart";
|
|
16
17
|
export { DonutChart } from "./charts/ordinal/DonutChart";
|
|
17
18
|
export { RidgelinePlot } from "./charts/ordinal/RidgelinePlot";
|
|
19
|
+
export { FunnelChart } from "./charts/ordinal/FunnelChart";
|
|
20
|
+
export { LikertChart } from "./charts/ordinal/LikertChart";
|
|
21
|
+
export { createHatchPattern } from "./charts/shared/hatchPattern";
|
|
22
|
+
export type { HatchPatternOptions } from "./charts/shared/hatchPattern";
|
|
18
23
|
export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* semiotic/themes — Named theme presets for Semiotic charts.
|
|
3
|
+
*
|
|
4
|
+
* Each theme provides light and dark mode variants as full SemioticTheme objects.
|
|
5
|
+
* Use with ThemeProvider: `<ThemeProvider theme={TUFTE_LIGHT} />` or by name:
|
|
6
|
+
* `<ThemeProvider theme="tufte" />` / `<ThemeProvider theme="tufte-dark" />`.
|
|
7
|
+
*
|
|
8
|
+
* Also exports `themeToCSS()` and `themeToTokens()` for serialization.
|
|
9
|
+
*/
|
|
10
|
+
import type { SemioticTheme } from "./store/ThemeStore";
|
|
11
|
+
import { LIGHT_THEME, DARK_THEME, HIGH_CONTRAST_THEME, COLOR_BLIND_SAFE_CATEGORICAL } from "./store/ThemeStore";
|
|
12
|
+
export { LIGHT_THEME, DARK_THEME, HIGH_CONTRAST_THEME, COLOR_BLIND_SAFE_CATEGORICAL };
|
|
13
|
+
export type { SemioticTheme };
|
|
14
|
+
export declare const PASTELS_LIGHT: SemioticTheme;
|
|
15
|
+
export declare const PASTELS_DARK: SemioticTheme;
|
|
16
|
+
export declare const BI_TOOL_LIGHT: SemioticTheme;
|
|
17
|
+
export declare const BI_TOOL_DARK: SemioticTheme;
|
|
18
|
+
export declare const ITALIAN_LIGHT: SemioticTheme;
|
|
19
|
+
export declare const ITALIAN_DARK: SemioticTheme;
|
|
20
|
+
export declare const TUFTE_LIGHT: SemioticTheme;
|
|
21
|
+
export declare const TUFTE_DARK: SemioticTheme;
|
|
22
|
+
export declare const JOURNALIST_LIGHT: SemioticTheme;
|
|
23
|
+
export declare const JOURNALIST_DARK: SemioticTheme;
|
|
24
|
+
export declare const PLAYFUL_LIGHT: SemioticTheme;
|
|
25
|
+
export declare const PLAYFUL_DARK: SemioticTheme;
|
|
26
|
+
/**
|
|
27
|
+
* IBM Carbon Design System categorical palette (14 colors).
|
|
28
|
+
* Full palette for data-dense visualizations; themes use the first 4.
|
|
29
|
+
*/
|
|
30
|
+
export declare const CARBON_CATEGORICAL_14: string[];
|
|
31
|
+
/**
|
|
32
|
+
* IBM Carbon alert palette — danger, warning, success, info.
|
|
33
|
+
*/
|
|
34
|
+
export declare const CARBON_ALERT: {
|
|
35
|
+
readonly danger: "#da1e28";
|
|
36
|
+
readonly warning: "#f1c21b";
|
|
37
|
+
readonly success: "#24a148";
|
|
38
|
+
readonly info: "#0043ce";
|
|
39
|
+
};
|
|
40
|
+
export declare const CARBON_LIGHT: SemioticTheme;
|
|
41
|
+
export declare const CARBON_DARK: SemioticTheme;
|
|
42
|
+
/** All named theme presets, keyed by slug. */
|
|
43
|
+
export declare const THEME_PRESETS: Record<string, SemioticTheme>;
|
|
44
|
+
/** All valid named theme strings for ThemeProvider. */
|
|
45
|
+
export type ThemePresetName = keyof typeof THEME_PRESETS;
|
|
46
|
+
/**
|
|
47
|
+
* Resolve a theme preset name to a SemioticTheme object.
|
|
48
|
+
* Returns undefined if the name is not recognized.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveThemePreset(name: string): SemioticTheme | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Convert a SemioticTheme to a CSS custom properties string.
|
|
53
|
+
* Useful for SSR or generating stylesheet content.
|
|
54
|
+
*
|
|
55
|
+
* @param theme - A SemioticTheme object
|
|
56
|
+
* @param selector - CSS selector to scope the variables (default: `:root`)
|
|
57
|
+
* @returns CSS string with custom properties
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const css = themeToCSS(TUFTE_LIGHT, ".my-charts")
|
|
62
|
+
* // .my-charts {
|
|
63
|
+
* // --semiotic-bg: #fffff8;
|
|
64
|
+
* // --semiotic-text: #111111;
|
|
65
|
+
* // ...
|
|
66
|
+
* // }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function themeToCSS(theme: SemioticTheme, selector?: string): string;
|
|
70
|
+
/**
|
|
71
|
+
* Convert a SemioticTheme to a design tokens JSON object.
|
|
72
|
+
* Compatible with Style Dictionary / Design Token Community Group format.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const tokens = themeToTokens(TUFTE_LIGHT)
|
|
77
|
+
* // { semiotic: { bg: { $value: "#fffff8", $type: "color" }, ... } }
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function themeToTokens(theme: SemioticTheme): Record<string, any>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* semiotic/utils — Shared utilities, ThemeProvider, and data helpers.
|
|
3
|
+
*
|
|
4
|
+
* Lightweight entry point for consumers that need the theme system,
|
|
5
|
+
* format utilities, data transforms, or color constants without pulling
|
|
6
|
+
* in any chart type bundles. Import from "semiotic/utils" instead of
|
|
7
|
+
* "semiotic" to keep bundle size minimal.
|
|
8
|
+
*/
|
|
9
|
+
export { ThemeProvider, useTheme } from "./ThemeProvider";
|
|
10
|
+
export type { SemioticTheme } from "./store/ThemeStore";
|
|
11
|
+
export { LIGHT_THEME, DARK_THEME, HIGH_CONTRAST_THEME, COLOR_BLIND_SAFE_CATEGORICAL, } from "./store/ThemeStore";
|
|
12
|
+
export { themeToCSS, themeToTokens, resolveThemePreset, THEME_PRESETS, CARBON_CATEGORICAL_14, CARBON_ALERT, } from "./semiotic-themes";
|
|
13
|
+
export type { ThemePresetName } from "./semiotic-themes";
|
|
14
|
+
export { adaptiveTimeTicks, smartTickFormat } from "./charts/shared/formatUtils";
|
|
15
|
+
export { darkenColor, lightenColor } from "./charts/shared/colorManipulation";
|
|
16
|
+
export { createHatchPattern } from "./charts/shared/hatchPattern";
|
|
17
|
+
export type { HatchPatternOptions } from "./charts/shared/hatchPattern";
|
|
18
|
+
export { validateProps } from "./charts/shared/validateProps";
|
|
19
|
+
export { diagnoseConfig } from "./charts/shared/diagnoseConfig";
|
|
20
|
+
export { toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX } from "./export/chartConfig";
|
|
21
|
+
export type { ChartConfig, ToConfigOptions, CopyFormat } from "./export/chartConfig";
|
|
22
|
+
export { serializeSelections, deserializeSelections } from "./export/selectionSerializer";
|
|
23
|
+
export type { SerializedSelections, SerializedSelection, SerializedFieldSelection } from "./export/selectionSerializer";
|
|
24
|
+
export { exportChart } from "./export/exportChart";
|
|
25
|
+
export { fromVegaLite } from "./data/fromVegaLite";
|
|
26
|
+
export type { VegaLiteSpec, VegaLiteEncoding } from "./data/fromVegaLite";
|
|
27
|
+
export { RingBuffer } from "./realtime/RingBuffer";
|
|
28
|
+
export { IncrementalExtent } from "./realtime/IncrementalExtent";
|
|
29
|
+
export { normalizeTooltip } from "./Tooltip/Tooltip";
|
|
30
|
+
export { useReducedMotion, useHighContrast } from "./stream/useMediaPreferences";
|
|
@@ -14,4 +14,5 @@ export { Heatmap } from "./charts/xy/Heatmap";
|
|
|
14
14
|
export { ScatterplotMatrix } from "./charts/xy/ScatterplotMatrix";
|
|
15
15
|
export { MinimapChart } from "./charts/xy/MinimapChart";
|
|
16
16
|
export { QuadrantChart } from "./charts/xy/QuadrantChart";
|
|
17
|
+
export { MultiAxisLineChart } from "./charts/xy/MultiAxisLineChart";
|
|
17
18
|
export type { StreamXYFrameProps, StreamXYFrameHandle } from "./stream/types";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import StreamXYFrame from "./stream/StreamXYFrame";
|
|
2
2
|
import StreamOrdinalFrame from "./stream/StreamOrdinalFrame";
|
|
3
3
|
import StreamNetworkFrame from "./stream/StreamNetworkFrame";
|
|
4
|
-
import { Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GroupedBarChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart } from "./charts";
|
|
4
|
+
import { Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GroupedBarChart, FunnelChart, SwimlaneChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart } from "./charts";
|
|
5
5
|
import { LinkedCharts } from "./LinkedCharts";
|
|
6
6
|
import { ThemeProvider, useTheme } from "./ThemeProvider";
|
|
7
7
|
import { exportChart } from "./export/exportChart";
|
|
8
|
+
import { createHatchPattern } from "./charts/shared/hatchPattern";
|
|
8
9
|
import { toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX } from "./export/chartConfig";
|
|
9
10
|
import { serializeSelections, deserializeSelections } from "./export/selectionSerializer";
|
|
10
11
|
import { fromVegaLite } from "./data/fromVegaLite";
|
|
@@ -22,8 +23,8 @@ import { RealtimeTemporalHistogram, RealtimeHistogram } from "./charts/realtime/
|
|
|
22
23
|
import { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
|
|
23
24
|
import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
|
|
24
25
|
import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
|
|
25
|
-
export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, GroupedBarChart, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, LinkedCharts, ThemeProvider, useTheme, exportChart, toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX, serializeSelections, deserializeSelections, fromVegaLite, ChartErrorBoundary, ChartContainer, ChartGrid, CategoryColorProvider, useCategoryColors, ContextLayout, DetailsPanel, Tooltip, MultiLineTooltip, normalizeTooltip, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeTemporalHistogram, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap };
|
|
26
|
-
export { ScatterplotProps, ConnectedScatterplotProps, LineChartProps, AreaChartProps, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, GroupedBarChartProps, RidgelinePlotProps, OrbitDiagramProps, OrbitNode, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, QuadrantChartProps, QuadrantsConfig, QuadrantConfig, CenterlineStyle, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
|
|
26
|
+
export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, LikertChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, FunnelChart, GroupedBarChart, SwimlaneChart, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart, LinkedCharts, ThemeProvider, useTheme, exportChart, toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX, serializeSelections, deserializeSelections, fromVegaLite, ChartErrorBoundary, ChartContainer, ChartGrid, CategoryColorProvider, useCategoryColors, ContextLayout, DetailsPanel, Tooltip, MultiLineTooltip, normalizeTooltip, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeTemporalHistogram, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap, createHatchPattern };
|
|
27
|
+
export { ScatterplotProps, ConnectedScatterplotProps, LineChartProps, AreaChartProps, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, LikertChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, FunnelChartProps, GroupedBarChartProps, SwimlaneChartProps, RidgelinePlotProps, OrbitDiagramProps, OrbitNode, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, QuadrantChartProps, MultiAxisLineChartProps, MultiAxisSeriesConfig, QuadrantsConfig, QuadrantConfig, CenterlineStyle, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
|
|
27
28
|
export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType, RuntimeMode, SceneNode, Changeset, StreamScales, StreamLayout, CurveType, CanvasRendererFn } from "./stream/types";
|
|
28
29
|
export type { StreamRendererFn } from "./stream/renderers/types";
|
|
29
30
|
export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
|
|
@@ -37,7 +38,10 @@ export type { UseChartObserverOptions, UseChartObserverResult } from "./LinkedCh
|
|
|
37
38
|
export type { ChartObservation, OnObservationCallback } from "./store/ObservationStore";
|
|
38
39
|
export type { ResolutionMode, SelectionClause, Selection } from "./store/SelectionStore";
|
|
39
40
|
export type { SemioticTheme } from "./ThemeProvider";
|
|
40
|
-
export { LIGHT_THEME, DARK_THEME } from "./ThemeProvider";
|
|
41
|
+
export { LIGHT_THEME, DARK_THEME, HIGH_CONTRAST_THEME } from "./ThemeProvider";
|
|
42
|
+
export { COLOR_BLIND_SAFE_CATEGORICAL } from "./store/ThemeStore";
|
|
43
|
+
export { themeToCSS, themeToTokens, resolveThemePreset, THEME_PRESETS, CARBON_CATEGORICAL_14, CARBON_ALERT } from "./semiotic-themes";
|
|
44
|
+
export type { ThemePresetName } from "./semiotic-themes";
|
|
41
45
|
export type { ChartErrorBoundaryProps } from "./ChartErrorBoundary";
|
|
42
46
|
export type { ChartContainerProps, ChartContainerHandle } from "./ChartContainer";
|
|
43
47
|
export type { ChartGridProps } from "./ChartGrid";
|
|
@@ -47,7 +51,9 @@ export type { DetailsPanelProps } from "./DetailsPanel";
|
|
|
47
51
|
export type { ChartConfig, ToConfigOptions, CopyFormat } from "./export/chartConfig";
|
|
48
52
|
export type { VegaLiteSpec, VegaLiteEncoding } from "./data/fromVegaLite";
|
|
49
53
|
export type { SerializedSelections, SerializedSelection, SerializedFieldSelection } from "./export/selectionSerializer";
|
|
50
|
-
export {
|
|
54
|
+
export type { HatchPatternOptions } from "./charts/shared/hatchPattern";
|
|
55
|
+
export { smartTickFormat, adaptiveTimeTicks } from "./charts/shared/formatUtils";
|
|
56
|
+
export { darkenColor, lightenColor } from "./charts/shared/colorManipulation";
|
|
51
57
|
export type { TooltipProp, TooltipConfig, TooltipField, MultiLineTooltipConfig } from "./Tooltip/Tooltip";
|
|
52
58
|
export type { ArrowOfTime, WindowMode, ThresholdType, LineStyle, BarStyle, WaterfallStyle, SwarmStyle, AnnotationContext, AnnotationAnchorMode, CrosshairStyle, HoverAnnotationConfig, HoverData } from "./realtime/types";
|
|
53
59
|
export type { RealtimeLineChartProps } from "./charts/realtime/RealtimeLineChart";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function setCrosshairPosition(name: string, xValue: number, sourceId: string): void;
|
|
2
|
+
export declare function clearCrosshairPosition(name: string, sourceId: string): void;
|
|
3
|
+
/**
|
|
4
|
+
* Hook to read a specific crosshair position by name.
|
|
5
|
+
* Returns the X value and sourceId, or null if no crosshair is active.
|
|
6
|
+
* When name is undefined, uses a no-op subscription to avoid unnecessary re-renders.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useCrosshairPosition(name: string | undefined): {
|
|
9
|
+
xValue: number;
|
|
10
|
+
sourceId: string;
|
|
11
|
+
} | null;
|
|
@@ -4,11 +4,18 @@ export interface SemioticTheme {
|
|
|
4
4
|
primary: string;
|
|
5
5
|
categorical: string[];
|
|
6
6
|
sequential: string;
|
|
7
|
+
/** d3-scale-chromatic diverging scheme name, e.g. "RdBu", "PiYG" */
|
|
8
|
+
diverging?: string;
|
|
7
9
|
background: string;
|
|
8
10
|
text: string;
|
|
9
11
|
textSecondary: string;
|
|
10
12
|
grid: string;
|
|
11
13
|
border: string;
|
|
14
|
+
focus?: string;
|
|
15
|
+
/** Linked hover/selection highlight color */
|
|
16
|
+
selection?: string;
|
|
17
|
+
/** Opacity for non-selected (dimmed) elements, 0–1 */
|
|
18
|
+
selectionOpacity?: number;
|
|
12
19
|
};
|
|
13
20
|
typography: {
|
|
14
21
|
fontFamily: string;
|
|
@@ -16,16 +23,29 @@ export interface SemioticTheme {
|
|
|
16
23
|
labelSize: number;
|
|
17
24
|
tickSize: number;
|
|
18
25
|
};
|
|
26
|
+
tooltip?: {
|
|
27
|
+
background?: string;
|
|
28
|
+
text?: string;
|
|
29
|
+
borderRadius?: string;
|
|
30
|
+
fontSize?: string;
|
|
31
|
+
shadow?: string;
|
|
32
|
+
};
|
|
33
|
+
borderRadius?: string;
|
|
19
34
|
}
|
|
35
|
+
/** Color-blind safe categorical palette (8 colors).
|
|
36
|
+
* Derived from Wong (2011) "Points of view: Color blindness" — safe for
|
|
37
|
+
* deuteranopia, protanopia, and tritanopia. */
|
|
38
|
+
export declare const COLOR_BLIND_SAFE_CATEGORICAL: string[];
|
|
20
39
|
export declare const LIGHT_THEME: SemioticTheme;
|
|
21
40
|
export declare const DARK_THEME: SemioticTheme;
|
|
41
|
+
export declare const HIGH_CONTRAST_THEME: SemioticTheme;
|
|
22
42
|
export interface ThemeStoreState {
|
|
23
43
|
theme: SemioticTheme;
|
|
24
|
-
setTheme: (theme: Partial<SemioticTheme> | "light" | "dark") => void;
|
|
44
|
+
setTheme: (theme: Partial<SemioticTheme> | "light" | "dark" | "high-contrast") => void;
|
|
25
45
|
}
|
|
26
46
|
export declare const ThemeProvider: import("react").FC<{
|
|
27
47
|
children: React.ReactNode;
|
|
28
48
|
}>, useThemeSelector: <R>(selector: (state: {
|
|
29
49
|
theme: SemioticTheme;
|
|
30
|
-
setTheme(theme: Partial<SemioticTheme> | "light" | "dark"): void;
|
|
50
|
+
setTheme(theme: Partial<SemioticTheme> | "light" | "dark" | "high-contrast"): void;
|
|
31
51
|
}) => R) => R;
|
|
@@ -4,6 +4,7 @@ type AnySceneNode = {
|
|
|
4
4
|
type: string;
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
};
|
|
7
|
+
declare const SR_ONLY_STYLE: React.CSSProperties;
|
|
7
8
|
/**
|
|
8
9
|
* Compute an aria-label describing the chart type and data shape from the scene graph.
|
|
9
10
|
*/
|
|
@@ -15,12 +16,17 @@ export declare function computeNetworkAriaLabel(nodeCount: number, edgeCount: nu
|
|
|
15
16
|
interface AccessibleDataTableProps {
|
|
16
17
|
scene: AnySceneNode[];
|
|
17
18
|
chartType: string;
|
|
19
|
+
/** Unique ID for skip-navigation link targeting */
|
|
20
|
+
tableId?: string;
|
|
21
|
+
/** Chart title — used to disambiguate aria-labels when multiple charts of the same type exist */
|
|
22
|
+
chartTitle?: string;
|
|
18
23
|
}
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
25
|
+
* JIT accessible data summary. Renders a lightweight sr-only button by default.
|
|
26
|
+
* On activation (or when ChartContainer's dataSummary action is toggled),
|
|
27
|
+
* computes a statistical summary (.describe()-style) and shows 5 sample rows.
|
|
22
28
|
*/
|
|
23
|
-
export declare function AccessibleDataTable({ scene, chartType }: AccessibleDataTableProps): React.JSX.Element | null;
|
|
29
|
+
export declare function AccessibleDataTable({ scene, chartType, tableId, chartTitle }: AccessibleDataTableProps): React.JSX.Element | null;
|
|
24
30
|
interface NetworkAccessibleDataTableProps {
|
|
25
31
|
nodes: Array<{
|
|
26
32
|
datum?: any;
|
|
@@ -36,15 +42,31 @@ interface NetworkAccessibleDataTableProps {
|
|
|
36
42
|
target?: string;
|
|
37
43
|
}>;
|
|
38
44
|
chartType: string;
|
|
45
|
+
tableId?: string;
|
|
46
|
+
chartTitle?: string;
|
|
39
47
|
}
|
|
40
48
|
/**
|
|
41
|
-
*
|
|
49
|
+
* JIT accessible data summary for network charts.
|
|
42
50
|
*/
|
|
43
|
-
export declare function NetworkAccessibleDataTable({ nodes, edges, chartType }: NetworkAccessibleDataTableProps): React.JSX.Element | null;
|
|
51
|
+
export declare function NetworkAccessibleDataTable({ nodes, edges, chartType, tableId, chartTitle }: NetworkAccessibleDataTableProps): React.JSX.Element | null;
|
|
52
|
+
/**
|
|
53
|
+
* Screen-reader-only summary note for the chart.
|
|
54
|
+
* Rendered as role="note" so assistive technology can discover it.
|
|
55
|
+
*/
|
|
56
|
+
export declare function ScreenReaderSummary({ summary }: {
|
|
57
|
+
summary?: string;
|
|
58
|
+
}): React.JSX.Element | null;
|
|
59
|
+
/**
|
|
60
|
+
* Screen-reader-only skip link to jump past chart canvas to the data table.
|
|
61
|
+
* Only rendered when accessibleTable is enabled.
|
|
62
|
+
*/
|
|
63
|
+
export declare function SkipToTableLink({ tableId }: {
|
|
64
|
+
tableId: string;
|
|
65
|
+
}): React.JSX.Element;
|
|
44
66
|
/**
|
|
45
67
|
* Visually-hidden aria-live region that mirrors tooltip text for screen readers.
|
|
46
68
|
*/
|
|
47
69
|
export declare function AriaLiveTooltip({ hoverPoint }: {
|
|
48
70
|
hoverPoint: any;
|
|
49
71
|
}): React.JSX.Element;
|
|
50
|
-
export {};
|
|
72
|
+
export { SR_ONLY_STYLE };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Shape-appropriate keyboard focus indicator for canvas-based charts.
|
|
4
|
+
*
|
|
5
|
+
* Renders an SVG overlay with a dashed focus ring whose shape adapts
|
|
6
|
+
* to the focused element type (circle for points, rect for bars/nodes,
|
|
7
|
+
* emphasized arc for wedges).
|
|
8
|
+
*/
|
|
9
|
+
export interface FocusRingProps {
|
|
10
|
+
/** Whether keyboard focus is active */
|
|
11
|
+
active: boolean;
|
|
12
|
+
/** Hover point with position info */
|
|
13
|
+
hoverPoint: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
} | null;
|
|
17
|
+
/** Chart margin */
|
|
18
|
+
margin: {
|
|
19
|
+
top: number;
|
|
20
|
+
right: number;
|
|
21
|
+
bottom: number;
|
|
22
|
+
left: number;
|
|
23
|
+
};
|
|
24
|
+
/** Total chart size */
|
|
25
|
+
size: [number, number];
|
|
26
|
+
/** Shape hint from the focused nav point */
|
|
27
|
+
shape?: "circle" | "rect" | "wedge";
|
|
28
|
+
/** Width of rect-shaped focus target */
|
|
29
|
+
width?: number;
|
|
30
|
+
/** Height of rect-shaped focus target */
|
|
31
|
+
height?: number;
|
|
32
|
+
}
|
|
33
|
+
export declare function FocusRing({ active, hoverPoint, margin, size, shape, width, height }: FocusRingProps): React.JSX.Element | null;
|