semiotic 3.2.0 → 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.
Files changed (107) hide show
  1. package/CLAUDE.md +50 -8
  2. package/README.md +11 -11
  3. package/ai/examples.md +91 -0
  4. package/ai/schema.json +223 -9
  5. package/ai/system-prompt.md +12 -4
  6. package/dist/components/ChartContainer.d.ts +2 -0
  7. package/dist/components/DataSummaryContext.d.ts +12 -0
  8. package/dist/components/Tooltip/FlippingTooltip.d.ts +34 -0
  9. package/dist/components/charts/index.d.ts +4 -0
  10. package/dist/components/charts/ordinal/BarChart.d.ts +3 -1
  11. package/dist/components/charts/ordinal/BoxPlot.d.ts +3 -1
  12. package/dist/components/charts/ordinal/DonutChart.d.ts +0 -1
  13. package/dist/components/charts/ordinal/DotPlot.d.ts +3 -1
  14. package/dist/components/charts/ordinal/FunnelChart.d.ts +3 -1
  15. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -1
  16. package/dist/components/charts/ordinal/Histogram.d.ts +16 -2
  17. package/dist/components/charts/ordinal/LikertChart.d.ts +94 -0
  18. package/dist/components/charts/ordinal/PieChart.d.ts +0 -1
  19. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +11 -7
  20. package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -1
  21. package/dist/components/charts/ordinal/SwarmPlot.d.ts +14 -1
  22. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +65 -0
  23. package/dist/components/charts/ordinal/ViolinPlot.d.ts +16 -2
  24. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +20 -0
  25. package/dist/components/charts/shared/annotationResolvers.d.ts +28 -0
  26. package/dist/components/charts/shared/hooks.d.ts +23 -2
  27. package/dist/components/charts/shared/selectionUtils.d.ts +5 -1
  28. package/dist/components/charts/shared/statsTooltip.d.ts +11 -0
  29. package/dist/components/charts/shared/types.d.ts +22 -1
  30. package/dist/components/charts/shared/useChartSetup.d.ts +12 -2
  31. package/dist/components/charts/shared/useLikertAggregation.d.ts +51 -0
  32. package/dist/components/charts/shared/useOrdinalBrush.d.ts +28 -0
  33. package/dist/components/charts/shared/useOrdinalStreaming.d.ts +54 -0
  34. package/dist/components/charts/shared/useStreamingLegend.d.ts +2 -2
  35. package/dist/components/charts/shared/validateProps.d.ts +2 -2
  36. package/dist/components/charts/shared/validationMap.d.ts +12 -0
  37. package/dist/components/charts/xy/AreaChart.d.ts +11 -0
  38. package/dist/components/charts/xy/MinimapChart.d.ts +1 -1
  39. package/dist/components/charts/xy/StackedAreaChart.d.ts +11 -0
  40. package/dist/components/realtime/types.d.ts +4 -0
  41. package/dist/components/semiotic-ai.d.ts +1 -0
  42. package/dist/components/semiotic-ordinal.d.ts +2 -0
  43. package/dist/components/semiotic-themes.d.ts +16 -0
  44. package/dist/components/semiotic-utils.d.ts +30 -0
  45. package/dist/components/semiotic.d.ts +4 -4
  46. package/dist/components/store/LinkedCrosshairStore.d.ts +11 -0
  47. package/dist/components/store/useSelection.d.ts +1 -0
  48. package/dist/components/stream/AccessibleDataTable.d.ts +28 -6
  49. package/dist/components/stream/FocusRing.d.ts +33 -0
  50. package/dist/components/stream/OrdinalBrushOverlay.d.ts +43 -0
  51. package/dist/components/stream/OrdinalPipelineStore.d.ts +16 -0
  52. package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
  53. package/dist/components/stream/PipelineStore.d.ts +5 -47
  54. package/dist/components/stream/SVGOverlay.d.ts +4 -0
  55. package/dist/components/stream/SceneGraph.d.ts +6 -1
  56. package/dist/components/stream/XYBrushOverlay.d.ts +47 -0
  57. package/dist/components/stream/geoTypes.d.ts +5 -1
  58. package/dist/components/stream/keyboardNav.d.ts +85 -9
  59. package/dist/components/stream/layouts/hierarchySceneBuilders.d.ts +35 -0
  60. package/dist/components/stream/layouts/hierarchyUtils.d.ts +25 -0
  61. package/dist/components/stream/networkTypes.d.ts +5 -1
  62. package/dist/components/stream/ordinalSceneBuilders/swimlaneScene.d.ts +12 -0
  63. package/dist/components/stream/ordinalTypes.d.ts +15 -3
  64. package/dist/components/stream/pipelineDecay.d.ts +20 -0
  65. package/dist/components/stream/pipelinePulse.d.ts +24 -0
  66. package/dist/components/stream/pipelineTransitions.d.ts +59 -0
  67. package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +2 -1
  68. package/dist/components/stream/types.d.ts +19 -1
  69. package/dist/components/stream/useMediaPreferences.d.ts +11 -0
  70. package/dist/components/stream/xySceneBuilders/areaScene.d.ts +13 -0
  71. package/dist/components/stream/xySceneBuilders/barScene.d.ts +18 -0
  72. package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +8 -0
  73. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +10 -0
  74. package/dist/components/stream/xySceneBuilders/emitPointNodes.d.ts +13 -0
  75. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +3 -0
  76. package/dist/components/stream/xySceneBuilders/lineScene.d.ts +12 -0
  77. package/dist/components/stream/xySceneBuilders/pointScene.d.ts +12 -0
  78. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +10 -0
  79. package/dist/components/stream/xySceneBuilders/types.d.ts +93 -0
  80. package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +12 -0
  81. package/dist/geo.min.js +1 -1
  82. package/dist/geo.module.min.js +1 -1
  83. package/dist/network.min.js +1 -1
  84. package/dist/network.module.min.js +1 -1
  85. package/dist/ordinal.min.js +1 -1
  86. package/dist/ordinal.module.min.js +1 -1
  87. package/dist/realtime.min.js +1 -1
  88. package/dist/realtime.module.min.js +1 -1
  89. package/dist/semiotic-ai.d.ts +1 -0
  90. package/dist/semiotic-ai.min.js +1 -1
  91. package/dist/semiotic-ai.module.min.js +1 -1
  92. package/dist/semiotic-ordinal.d.ts +2 -0
  93. package/dist/{semiotic-statisticalOverlays-D8LhSbQt.js → semiotic-statisticalOverlays-DGX_WWc5.js} +1 -1
  94. package/dist/semiotic-themes.d.ts +16 -0
  95. package/dist/semiotic-themes.min.js +1 -1
  96. package/dist/semiotic-themes.module.min.js +1 -1
  97. package/dist/semiotic-utils.d.ts +30 -0
  98. package/dist/semiotic-utils.min.js +1 -0
  99. package/dist/semiotic-utils.module.min.js +1 -0
  100. package/dist/semiotic.d.ts +4 -4
  101. package/dist/semiotic.min.js +1 -1
  102. package/dist/semiotic.module.min.js +1 -1
  103. package/dist/server.min.js +1 -1
  104. package/dist/server.module.min.js +1 -1
  105. package/dist/xy.min.js +1 -1
  106. package/dist/xy.module.min.js +1 -1
  107. package/package.json +15 -8
@@ -21,7 +21,9 @@ export interface SelectionConfig {
21
21
  */
22
22
  export type LinkedHoverProp = boolean | string | {
23
23
  name?: string;
24
- fields: string[];
24
+ fields?: string[];
25
+ mode?: "field" | "x-position";
26
+ xField?: string;
25
27
  };
26
28
  /**
27
29
  * Linked brush config
@@ -76,6 +78,20 @@ export interface BaseChartProps {
76
78
  /** Uniform fill color for all data marks. Overrides colorScheme and theme categorical.
77
79
  * For per-category coloring, use `colorBy` + `colorScheme` instead. */
78
80
  color?: string;
81
+ /** Accessible description overriding the auto-generated aria-label on the chart container.
82
+ * Should describe the chart's purpose or content for screen reader users. */
83
+ description?: string;
84
+ /** Accessible summary rendered as a screen-reader-only note.
85
+ * Use for trend descriptions or key takeaways that supplement the visual. */
86
+ summary?: string;
87
+ /** Enable accessible data table below the chart canvas. Default: true (via frame). */
88
+ accessibleTable?: boolean;
89
+ /** Callback when a data element is clicked. Receives the original datum and pixel coordinates.
90
+ * For lines, receives the line data; for bars, the bar datum; for pie slices, the slice datum. */
91
+ onClick?: (datum: any, event: {
92
+ x: number;
93
+ y: number;
94
+ }) => void;
79
95
  /** Visual emphasis level for dashboard hierarchy. "primary" spans two columns in ChartGrid. */
80
96
  emphasis?: "primary" | "secondary";
81
97
  /** Enable declarative bounded animation (enter/exit/update transitions).
@@ -98,6 +114,11 @@ export interface AxisConfig {
98
114
  /** Format function for y-axis tick labels */
99
115
  yFormat?: (d: any) => string;
100
116
  }
117
+ /**
118
+ * Category formatting for ordinal chart tick labels.
119
+ * Receives the category value and its index, returns a formatted string.
120
+ */
121
+ export type CategoryFormatFn = (label: string, index?: number) => string;
101
122
  /**
102
123
  * Accessor type - can be a property name or a function
103
124
  * @deprecated Use DataAccessor from generalTypes for generic type safety
@@ -19,8 +19,8 @@ export interface ChartSetupInput {
19
19
  rawData: unknown[] | undefined;
20
20
  /** The color-by accessor (may be an "actual" colorBy derived from stackBy/groupBy/categoryAccessor) */
21
21
  colorBy: Accessor<string> | undefined;
22
- /** Color scheme name or custom array */
23
- colorScheme: string | string[];
22
+ /** Color scheme name or custom array — undefined lets useColorScale consult the theme */
23
+ colorScheme: string | string[] | undefined;
24
24
  /** Legend interaction mode */
25
25
  legendInteraction: LegendInteractionMode | undefined;
26
26
  /** Legend position override */
@@ -50,6 +50,11 @@ export interface ChartSetupInput {
50
50
  left: number;
51
51
  right: number;
52
52
  };
53
+ /** onClick callback */
54
+ onClick?: (datum: any, event: {
55
+ x: number;
56
+ y: number;
57
+ }) => void;
53
58
  /** Loading state */
54
59
  loading: boolean | undefined;
55
60
  /** Empty content override */
@@ -92,6 +97,11 @@ export interface ChartSetupResult {
92
97
  earlyReturn: ReactElement | null;
93
98
  /** Props to spread into the stream frame for legend behavior */
94
99
  legendBehaviorProps: Record<string, any>;
100
+ /** Crosshair props to spread into StreamXYFrame when linkedHover mode is "x-position" */
101
+ crosshairProps: {
102
+ linkedCrosshairName: string;
103
+ linkedCrosshairSourceId: string;
104
+ } | undefined;
95
105
  }
96
106
  /**
97
107
  * Hook that consolidates the shared boilerplate across all HOC charts:
@@ -0,0 +1,51 @@
1
+ import type { RefObject, MutableRefObject } from "react";
2
+ import type { StreamOrdinalFrameHandle } from "../../stream/ordinalTypes";
3
+ export interface AggregatedRow {
4
+ __likertCategory: string;
5
+ /** Stacking key — may be sentinel value for neutral halves */
6
+ __likertLevel: string;
7
+ /** Human-readable level label — always the original level name (for legend/selection) */
8
+ __likertLevelLabel: string;
9
+ __likertCount: number;
10
+ __likertPct: number;
11
+ __likertLevelIndex: number;
12
+ }
13
+ /** Sentinel level names for the neutral split halves */
14
+ export declare const NEUTRAL_NEG = "__likert_neutral_neg";
15
+ export declare const NEUTRAL_POS = "__likert_neutral_pos";
16
+ export declare function resolveAccessorFn<T>(accessor: string | ((d: any) => T) | undefined, fallback: string): (d: any) => T;
17
+ /**
18
+ * Generate a diverging color scheme for N levels.
19
+ * Interpolates from red → gray → blue for odd, red → blue for even.
20
+ */
21
+ export declare function defaultDivergingScheme(n: number): string[];
22
+ export declare function aggregateData(data: any[], levels: string[], getCat: (d: any) => string, getScore: ((d: any) => number) | null, getLevel: ((d: any) => string) | null, getCount: ((d: any) => number) | null): AggregatedRow[];
23
+ export declare function toDivergingValues(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
24
+ export declare function orderForDiverging(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
25
+ interface UseLikertAggregationConfig {
26
+ data: any[] | undefined;
27
+ levels: string[];
28
+ categoryAccessor?: string | ((d: any) => string);
29
+ valueAccessor?: string | ((d: any) => number);
30
+ levelAccessor?: string | ((d: any) => string);
31
+ countAccessor?: string | ((d: any) => number);
32
+ isDiverging: boolean;
33
+ frameRef: RefObject<StreamOrdinalFrameHandle | null>;
34
+ }
35
+ interface UseLikertAggregationResult {
36
+ /** Pre-processed data for static mode */
37
+ processedData: AggregatedRow[];
38
+ /** Re-aggregate all accumulated data (call from push handlers) */
39
+ reAggregate: (rawData: any[]) => void;
40
+ /** Ref holding accumulated raw data for push mode */
41
+ accumulatorRef: MutableRefObject<any[]>;
42
+ }
43
+ /**
44
+ * Encapsulates Likert-specific data aggregation:
45
+ * - Resolves accessor functions
46
+ * - Aggregates raw/pre-aggregated data to percentages
47
+ * - Applies diverging transforms (sign flip, neutral split, stacking order)
48
+ * - Provides re-aggregation callback for push API streaming
49
+ */
50
+ export declare function useLikertAggregation({ data, levels, categoryAccessor, valueAccessor, levelAccessor, countAccessor, isDiverging, frameRef, }: UseLikertAggregationConfig): UseLikertAggregationResult;
51
+ export {};
@@ -0,0 +1,28 @@
1
+ import type { ChartAccessor } from "./types";
2
+ export interface OrdinalBrushInput {
3
+ brushProp: boolean | undefined;
4
+ onBrushProp: ((extent: {
5
+ r: [number, number];
6
+ } | null) => void) | undefined;
7
+ linkedBrush: string | {
8
+ name: string;
9
+ rField?: string;
10
+ } | undefined;
11
+ valueAccessor: ChartAccessor<any, number>;
12
+ }
13
+ export interface OrdinalBrushResult {
14
+ hasBrush: boolean;
15
+ handleBrush: (extent: {
16
+ r: [number, number];
17
+ } | null) => void;
18
+ /** Spread into streamProps: `...brushStreamProps` */
19
+ brushStreamProps: {
20
+ brush: {
21
+ dimension: "r";
22
+ };
23
+ onBrush: (extent: {
24
+ r: [number, number];
25
+ } | null) => void;
26
+ } | Record<string, never>;
27
+ }
28
+ export declare function useOrdinalBrush({ brushProp, onBrushProp, linkedBrush, valueAccessor, }: OrdinalBrushInput): OrdinalBrushResult;
@@ -0,0 +1,54 @@
1
+ import type { Ref, RefObject } from "react";
2
+ import type { StreamOrdinalFrameHandle } from "../../stream/ordinalTypes";
3
+ import type { RealtimeFrameHandle } from "../../realtime/types";
4
+ import type { Accessor } from "./types";
5
+ import type { LegendPosition } from "./hooks";
6
+ interface UseOrdinalStreamingConfig {
7
+ /** External ref for push API */
8
+ ref: Ref<RealtimeFrameHandle>;
9
+ /** Internal frame ref */
10
+ frameRef: RefObject<StreamOrdinalFrameHandle | null>;
11
+ /** True when data prop is undefined (push API mode) */
12
+ isPushMode: boolean;
13
+ /** Color-by accessor (may be derived from stackBy/groupBy/etc.) */
14
+ colorBy: Accessor<string> | undefined;
15
+ /** Color scheme name or array — undefined lets useColorScale consult the theme */
16
+ colorScheme: string | string[] | undefined;
17
+ /** Whether legend is requested */
18
+ showLegend: boolean | undefined;
19
+ /** Legend position */
20
+ legendPosition?: LegendPosition;
21
+ /** Results from useChartSetup — needed for legend/margin merge */
22
+ setup: {
23
+ legendBehaviorProps: Record<string, any>;
24
+ legendPosition: LegendPosition;
25
+ margin: {
26
+ top: number;
27
+ right: number;
28
+ bottom: number;
29
+ left: number;
30
+ };
31
+ };
32
+ }
33
+ interface UseOrdinalStreamingResult {
34
+ /** Legend props merged with streaming legend (spread into streamProps) */
35
+ effectiveLegendProps: Record<string, any>;
36
+ /** Margin merged with streaming legend margin adjustments */
37
+ effectiveMargin: {
38
+ top: number;
39
+ right: number;
40
+ bottom: number;
41
+ left: number;
42
+ };
43
+ }
44
+ /**
45
+ * Shared hook for ordinal charts that support push API + streaming legend.
46
+ *
47
+ * Consolidates: useStreamingLegend, wrappedPush/pushMany,
48
+ * useImperativeHandle, effectiveLegendProps, effectiveMargin.
49
+ *
50
+ * Used by: StackedBarChart, GroupedBarChart, PieChart, DonutChart, SwimlaneChart.
51
+ * NOT used by LikertChart (custom accumulator + deterministic legend).
52
+ */
53
+ export declare function useOrdinalStreaming({ ref, frameRef, isPushMode, colorBy, colorScheme, showLegend, legendPosition, setup, }: UseOrdinalStreamingConfig): UseOrdinalStreamingResult;
54
+ export {};
@@ -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
@@ -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") */
@@ -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;
@@ -22,6 +22,7 @@ export { RidgelinePlot } from "./charts/ordinal/RidgelinePlot";
22
22
  export { PieChart } from "./charts/ordinal/PieChart";
23
23
  export { DonutChart } from "./charts/ordinal/DonutChart";
24
24
  export { FunnelChart } from "./charts/ordinal/FunnelChart";
25
+ export { LikertChart } from "./charts/ordinal/LikertChart";
25
26
  export { ForceDirectedGraph } from "./charts/network/ForceDirectedGraph";
26
27
  export { ChordDiagram } from "./charts/network/ChordDiagram";
27
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";
@@ -16,6 +17,7 @@ export { PieChart } from "./charts/ordinal/PieChart";
16
17
  export { DonutChart } from "./charts/ordinal/DonutChart";
17
18
  export { RidgelinePlot } from "./charts/ordinal/RidgelinePlot";
18
19
  export { FunnelChart } from "./charts/ordinal/FunnelChart";
20
+ export { LikertChart } from "./charts/ordinal/LikertChart";
19
21
  export { createHatchPattern } from "./charts/shared/hatchPattern";
20
22
  export type { HatchPatternOptions } from "./charts/shared/hatchPattern";
21
23
  export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
@@ -23,6 +23,22 @@ export declare const JOURNALIST_LIGHT: SemioticTheme;
23
23
  export declare const JOURNALIST_DARK: SemioticTheme;
24
24
  export declare const PLAYFUL_LIGHT: SemioticTheme;
25
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;
26
42
  /** All named theme presets, keyed by slug. */
27
43
  export declare const THEME_PRESETS: Record<string, SemioticTheme>;
28
44
  /** All valid named theme strings for ThemeProvider. */
@@ -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";
@@ -1,7 +1,7 @@
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, FunnelChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, MultiAxisLineChart } 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";
@@ -23,8 +23,8 @@ import { RealtimeTemporalHistogram, RealtimeHistogram } from "./charts/realtime/
23
23
  import { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
24
24
  import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
25
25
  import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
26
- 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, FunnelChart, GroupedBarChart, 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, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, FunnelChartProps, GroupedBarChartProps, 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";
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";
28
28
  export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType, RuntimeMode, SceneNode, Changeset, StreamScales, StreamLayout, CurveType, CanvasRendererFn } from "./stream/types";
29
29
  export type { StreamRendererFn } from "./stream/renderers/types";
30
30
  export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
@@ -40,7 +40,7 @@ export type { ResolutionMode, SelectionClause, Selection } from "./store/Selecti
40
40
  export type { SemioticTheme } from "./ThemeProvider";
41
41
  export { LIGHT_THEME, DARK_THEME, HIGH_CONTRAST_THEME } from "./ThemeProvider";
42
42
  export { COLOR_BLIND_SAFE_CATEGORICAL } from "./store/ThemeStore";
43
- export { themeToCSS, themeToTokens, resolveThemePreset, THEME_PRESETS } from "./semiotic-themes";
43
+ export { themeToCSS, themeToTokens, resolveThemePreset, THEME_PRESETS, CARBON_CATEGORICAL_14, CARBON_ALERT } from "./semiotic-themes";
44
44
  export type { ThemePresetName } from "./semiotic-themes";
45
45
  export type { ChartErrorBoundaryProps } from "./ChartErrorBoundary";
46
46
  export type { ChartContainerProps, ChartContainerHandle } from "./ChartContainer";
@@ -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;
@@ -1,3 +1,4 @@
1
+ export { useCrosshairPosition, setCrosshairPosition, clearCrosshairPosition } from "./LinkedCrosshairStore";
1
2
  export interface UseSelectionOptions {
2
3
  /** Name of the selection to participate in */
3
4
  name: string;
@@ -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
- * Visually-hidden data table for screen readers, generated from the scene graph.
21
- * Renders up to 50 rows with a truncation note.
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
- * Visually-hidden data table for network charts.
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;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * OrdinalBrushOverlay — d3-brush SVG overlay for ordinal frames.
3
+ *
4
+ * Renders a transparent SVG positioned above the canvas. Brushes along the
5
+ * r-axis (value axis) only: horizontal projection → brushX, vertical → brushY.
6
+ *
7
+ * Key design decisions:
8
+ * - Outer SVG has pointerEvents:"none", inner brush-g has "all", so
9
+ * axes/legends rendered underneath remain clickable.
10
+ * - d3-brush lifecycle (useEffect) depends on [width, height, isHorizontal]
11
+ * only — NOT scales. Scales are read from a ref to avoid brush teardown
12
+ * mid-drag (scales change every render due to new object identity).
13
+ * - A separate useEffect repositions the brush when scales change (streaming).
14
+ *
15
+ * Consumed by: StreamOrdinalFrame (rendered when brush prop is set).
16
+ * Wired by: useOrdinalBrush hook in HOC charts.
17
+ */
18
+ import * as React from "react";
19
+ import type { OrdinalScales } from "./ordinalTypes";
20
+ interface OrdinalBrushOverlayProps {
21
+ width: number;
22
+ height: number;
23
+ totalWidth: number;
24
+ totalHeight: number;
25
+ margin: {
26
+ top: number;
27
+ right: number;
28
+ bottom: number;
29
+ left: number;
30
+ };
31
+ scales: OrdinalScales | null;
32
+ onBrush: (extent: {
33
+ r: [number, number];
34
+ } | null) => void;
35
+ }
36
+ /**
37
+ * SVG brush overlay for ordinal frames.
38
+ * Brushes along the r-axis (value axis) only.
39
+ * In horizontal projection, r maps to x-pixels → uses brushX.
40
+ * In vertical projection, r maps to y-pixels → uses brushY.
41
+ */
42
+ export declare function OrdinalBrushOverlay({ width, height, totalWidth, totalHeight, margin, scales, onBrush }: OrdinalBrushOverlayProps): React.JSX.Element;
43
+ export {};
@@ -1,3 +1,19 @@
1
+ /**
2
+ * OrdinalPipelineStore — stateful pipeline for ordinal chart data.
3
+ *
4
+ * Owns: data ingestion (RingBuffer), scale computation (o-band + r-linear),
5
+ * value domain logic (per-lane sums for swimlane, zero-inclusion for bars),
6
+ * and scene layout delegation to ordinalSceneBuilders/*.
7
+ *
8
+ * Key design decisions:
9
+ * - Swimlane domain uses per-lane sums, not individual values, because
10
+ * stacked bars within a lane must fit within the lane's total range.
11
+ * - Zero-inclusion for bar/swimlane is skipped when explicit rExtent is
12
+ * set (either end non-null), enabling zoom/brush without domain override.
13
+ * - Scene builders are pure functions; this store coordinates them.
14
+ *
15
+ * Consumed by: StreamOrdinalFrame (sole consumer).
16
+ */
1
17
  import { type ScaleLinear } from "d3-scale";
2
18
  import type { OrdinalPipelineConfig, OrdinalScales, OrdinalSceneNode, OrdinalColumn, OrdinalLayout } from "./ordinalTypes";
3
19
  import type { Changeset } from "./types";
@@ -19,7 +19,7 @@ interface OrdinalSVGOverlayProps {
19
19
  showCategoryTicks?: boolean;
20
20
  oLabel?: string;
21
21
  rLabel?: string;
22
- oFormat?: (d: string) => string;
22
+ oFormat?: (d: string, index?: number) => string;
23
23
  rFormat?: (d: number) => string;
24
24
  showGrid?: boolean;
25
25
  title?: string | ReactNode;