semiotic 3.5.4 → 3.6.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.
Files changed (94) hide show
  1. package/CLAUDE.md +61 -3
  2. package/README.md +17 -10
  3. package/ai/dist/mcp-server.js +249 -2
  4. package/ai/schema.json +34 -9
  5. package/ai/system-prompt.md +1 -1
  6. package/dist/components/ai/audienceProfile.d.ts +90 -0
  7. package/dist/components/ai/audiences.d.ts +31 -0
  8. package/dist/components/ai/chartCapabilities.d.ts +55 -0
  9. package/dist/components/ai/chartCapabilityTypes.d.ts +196 -0
  10. package/dist/components/ai/diffProfile.d.ts +51 -0
  11. package/dist/components/ai/inferIntent.d.ts +24 -0
  12. package/dist/components/ai/intents.d.ts +34 -0
  13. package/dist/components/ai/profileData.d.ts +16 -0
  14. package/dist/components/ai/qualityFixtures.d.ts +2 -0
  15. package/dist/components/ai/qualityScorecard.d.ts +82 -0
  16. package/dist/components/ai/repairChartConfig.d.ts +73 -0
  17. package/dist/components/ai/streamingTypes.d.ts +64 -0
  18. package/dist/components/ai/suggestCharts.d.ts +76 -0
  19. package/dist/components/ai/suggestDashboard.d.ts +92 -0
  20. package/dist/components/ai/suggestStreamCharts.d.ts +34 -0
  21. package/dist/components/ai/suggestStretchCharts.d.ts +60 -0
  22. package/dist/components/ai/useChartSuggestions.d.ts +22 -0
  23. package/dist/components/charts/geo/ChoroplethMap.capability.d.ts +2 -0
  24. package/dist/components/charts/geo/DistanceCartogram.capability.d.ts +2 -0
  25. package/dist/components/charts/geo/FlowMap.capability.d.ts +2 -0
  26. package/dist/components/charts/geo/ProportionalSymbolMap.capability.d.ts +2 -0
  27. package/dist/components/charts/index.d.ts +1 -1
  28. package/dist/components/charts/network/ChordDiagram.capability.d.ts +2 -0
  29. package/dist/components/charts/network/CirclePack.capability.d.ts +2 -0
  30. package/dist/components/charts/network/ForceDirectedGraph.capability.d.ts +2 -0
  31. package/dist/components/charts/network/OrbitDiagram.capability.d.ts +2 -0
  32. package/dist/components/charts/network/ProcessSankey.capability.d.ts +2 -0
  33. package/dist/components/charts/network/SankeyDiagram.capability.d.ts +2 -0
  34. package/dist/components/charts/network/TreeDiagram.capability.d.ts +2 -0
  35. package/dist/components/charts/network/Treemap.capability.d.ts +2 -0
  36. package/dist/components/charts/ordinal/BarChart.capability.d.ts +2 -0
  37. package/dist/components/charts/ordinal/BoxPlot.capability.d.ts +2 -0
  38. package/dist/components/charts/ordinal/DonutChart.capability.d.ts +2 -0
  39. package/dist/components/charts/ordinal/DotPlot.capability.d.ts +2 -0
  40. package/dist/components/charts/ordinal/FunnelChart.capability.d.ts +2 -0
  41. package/dist/components/charts/ordinal/GaugeChart.capability.d.ts +2 -0
  42. package/dist/components/charts/ordinal/GroupedBarChart.capability.d.ts +2 -0
  43. package/dist/components/charts/ordinal/Histogram.capability.d.ts +2 -0
  44. package/dist/components/charts/ordinal/Histogram.d.ts +4 -2
  45. package/dist/components/charts/ordinal/LikertChart.capability.d.ts +2 -0
  46. package/dist/components/charts/ordinal/LikertChart.d.ts +1 -1
  47. package/dist/components/charts/ordinal/LikertChart.defaults.d.ts +1 -0
  48. package/dist/components/charts/ordinal/PieChart.capability.d.ts +2 -0
  49. package/dist/components/charts/ordinal/RidgelinePlot.capability.d.ts +2 -0
  50. package/dist/components/charts/ordinal/StackedBarChart.capability.d.ts +2 -0
  51. package/dist/components/charts/ordinal/SwarmPlot.capability.d.ts +2 -0
  52. package/dist/components/charts/ordinal/SwimlaneChart.capability.d.ts +2 -0
  53. package/dist/components/charts/ordinal/ViolinPlot.capability.d.ts +2 -0
  54. package/dist/components/charts/realtime/RealtimeHeatmap.capability.d.ts +2 -0
  55. package/dist/components/charts/realtime/RealtimeHistogram.capability.d.ts +2 -0
  56. package/dist/components/charts/realtime/RealtimeLineChart.capability.d.ts +2 -0
  57. package/dist/components/charts/realtime/RealtimeSwarmChart.capability.d.ts +2 -0
  58. package/dist/components/charts/realtime/RealtimeWaterfallChart.capability.d.ts +2 -0
  59. package/dist/components/charts/realtime/TemporalHistogram.capability.d.ts +7 -0
  60. package/dist/components/charts/shared/chartSpecs.d.ts +0 -34
  61. package/dist/components/charts/xy/AreaChart.capability.d.ts +10 -0
  62. package/dist/components/charts/xy/BubbleChart.capability.d.ts +2 -0
  63. package/dist/components/charts/xy/CandlestickChart.capability.d.ts +2 -0
  64. package/dist/components/charts/xy/ConnectedScatterplot.capability.d.ts +2 -0
  65. package/dist/components/charts/xy/DifferenceChart.capability.d.ts +8 -0
  66. package/dist/components/charts/xy/Heatmap.capability.d.ts +9 -0
  67. package/dist/components/charts/xy/LineChart.capability.d.ts +9 -0
  68. package/dist/components/charts/xy/MinimapChart.capability.d.ts +2 -0
  69. package/dist/components/charts/xy/MultiAxisLineChart.capability.d.ts +2 -0
  70. package/dist/components/charts/xy/QuadrantChart.capability.d.ts +2 -0
  71. package/dist/components/charts/xy/QuadrantChart.d.ts +5 -2
  72. package/dist/components/charts/xy/QuadrantChart.defaults.d.ts +2 -0
  73. package/dist/components/charts/xy/Scatterplot.capability.d.ts +2 -0
  74. package/dist/components/charts/xy/StackedAreaChart.capability.d.ts +2 -0
  75. package/dist/components/data/DataSummarizer.d.ts +45 -0
  76. package/dist/components/semiotic-ai.d.ts +35 -0
  77. package/dist/components/semiotic-xy.d.ts +1 -1
  78. package/dist/components/semiotic.d.ts +1 -1
  79. package/dist/components/store/useChartFocus.d.ts +43 -0
  80. package/dist/components/store/useChartInterrogation.d.ts +141 -0
  81. package/dist/ordinal.min.js +1 -1
  82. package/dist/ordinal.module.min.js +1 -1
  83. package/dist/semiotic-ai.d.ts +35 -0
  84. package/dist/semiotic-ai.min.js +1 -1
  85. package/dist/semiotic-ai.module.min.js +1 -1
  86. package/dist/semiotic-utils.min.js +1 -1
  87. package/dist/semiotic-utils.module.min.js +1 -1
  88. package/dist/semiotic-xy.d.ts +1 -1
  89. package/dist/semiotic.d.ts +1 -1
  90. package/dist/semiotic.min.js +1 -1
  91. package/dist/semiotic.module.min.js +1 -1
  92. package/dist/xy.min.js +1 -1
  93. package/dist/xy.module.min.js +1 -1
  94. package/package.json +13 -4
@@ -0,0 +1,76 @@
1
+ import type { Datum } from "../charts/shared/datumTypes";
2
+ import { type ProfileDataOptions } from "./profileData";
3
+ import type { ChartCapability, ChartDataProfile, Suggestion } from "./chartCapabilityTypes";
4
+ import type { IntentId } from "./intents";
5
+ import { type AudienceProfile } from "./audienceProfile";
6
+ export interface SuggestChartsOptions extends ProfileDataOptions {
7
+ /** Ranking intent(s). When omitted, suggestions are ranked by mean intent score. */
8
+ intent?: IntentId | IntentId[];
9
+ /** Restrict to these component names. */
10
+ allow?: ReadonlyArray<string>;
11
+ /** Exclude these component names. */
12
+ deny?: ReadonlyArray<string>;
13
+ /** Maximum suggestions to return (default 10). */
14
+ maxResults?: number;
15
+ /** Include variant-level suggestions (default true). */
16
+ includeVariants?: boolean;
17
+ /** Filter out suggestions with a composite score below this (default 0 — keep all). */
18
+ minScore?: number;
19
+ /** Provide a pre-built profile instead of re-deriving from data. */
20
+ profile?: ChartDataProfile;
21
+ /** Override the registry. Defaults to the global capability registry. */
22
+ capabilities?: ReadonlyArray<ChartCapability>;
23
+ /**
24
+ * Audience profile — overrides chart familiarity and applies adoption-target
25
+ * bias to the ranking. See `audienceProfile.ts`.
26
+ */
27
+ audience?: AudienceProfile;
28
+ }
29
+ /**
30
+ * Suggest charts for a dataset, ranked by intent suitability.
31
+ *
32
+ * Heuristic-only — does not call an LLM. Designed to be cheap enough to run on every
33
+ * keystroke in a UI, and to feed structured context to an LLM when one is available.
34
+ */
35
+ export declare function suggestCharts(data: ReadonlyArray<Datum> | null | undefined, options?: SuggestChartsOptions): Suggestion[];
36
+ /**
37
+ * One rejected capability: a chart whose `fits()` returned a reason.
38
+ * Surfaced by `explainCapabilityFit` for diagnostic panels and `--doctor` auto-fix.
39
+ */
40
+ export interface RejectedCapability {
41
+ component: string;
42
+ family: ChartCapability["family"];
43
+ importPath: ChartCapability["importPath"];
44
+ /** Human-readable reason this chart can't render this profile. */
45
+ reason: string;
46
+ }
47
+ export interface ExplainCapabilityFitResult {
48
+ /** Capabilities that fit the profile — full ranked suggestion list. */
49
+ fitting: Suggestion[];
50
+ /** Capabilities that did not fit, with their rejection reasons. */
51
+ rejected: RejectedCapability[];
52
+ /** The profile that was evaluated against (provided or computed). */
53
+ profile: ChartDataProfile;
54
+ }
55
+ /**
56
+ * Like `suggestCharts`, but also returns the capabilities that *didn't* fit
57
+ * along with their rejection reasons. The single best primitive for:
58
+ * • "Why isn't there a pie chart option?" UI surfaces (vizmart V.4)
59
+ * • `--doctor` auto-fix loops that need to enumerate alternatives
60
+ * • Descriptor authoring — quickly see whose `fits()` is too strict
61
+ *
62
+ * Mirrors `suggestCharts` for the fitting side. Rejection enumeration walks
63
+ * every registered capability whether it fits or not.
64
+ */
65
+ export declare function explainCapabilityFit(data: ReadonlyArray<Datum> | null | undefined, options?: SuggestChartsOptions): ExplainCapabilityFitResult;
66
+ /**
67
+ * Score a specific (component, variant) pair against a dataset and (optionally) an intent.
68
+ * Useful for evaluating a chart a user already chose: "is this a good fit for what they want?"
69
+ */
70
+ export declare function scoreChart(component: string, data: ReadonlyArray<Datum> | null | undefined, options?: {
71
+ intent?: IntentId | IntentId[];
72
+ variantKey?: string;
73
+ profile?: ChartDataProfile;
74
+ }): Suggestion | {
75
+ reason: string;
76
+ };
@@ -0,0 +1,92 @@
1
+ import type { Datum } from "../charts/shared/datumTypes";
2
+ import { type StretchSuggestion } from "./suggestStretchCharts";
3
+ import type { ChartDataProfile, Suggestion } from "./chartCapabilityTypes";
4
+ import type { IntentId } from "./intents";
5
+ import type { AudienceProfile } from "./audienceProfile";
6
+ /**
7
+ * One panel in a generated dashboard. Pairs a chart suggestion with the
8
+ * intent that motivated it — consumers render the suggestion and label it
9
+ * with the intent so readers know *why* that panel exists.
10
+ */
11
+ export interface DashboardPanel {
12
+ /** The intent this panel covers. */
13
+ intent: IntentId;
14
+ /** The chart picked for that intent. */
15
+ suggestion: Suggestion;
16
+ }
17
+ export interface DashboardSuggestion {
18
+ /** Ordered panels, each covering a distinct intent. */
19
+ panels: DashboardPanel[];
20
+ /** Intents the engine actually filled. */
21
+ intentsCovered: IntentId[];
22
+ /** Intents the engine couldn't fill from this data. */
23
+ intentsMissing: IntentId[];
24
+ /**
25
+ * Stretch panels — unfamiliar-but-fitting charts the audience could grow
26
+ * into. Empty when no `audience` is provided or `exposureLevel` is 0.
27
+ * Render alongside the main panels in a distinct surface so users see
28
+ * them as opt-in literacy growth, not silent defaults.
29
+ */
30
+ stretchPanels: StretchSuggestion[];
31
+ /** The shape profile (computed once, reused for every panel). */
32
+ profile: ChartDataProfile;
33
+ }
34
+ export interface SuggestDashboardOptions {
35
+ /**
36
+ * Intents to attempt. When omitted, the engine picks a sensible default set
37
+ * based on the data shape (e.g. if `hasTimeAxis`, include "trend"; if
38
+ * `categoryCount`, include "rank" and "part-to-whole").
39
+ */
40
+ intents?: ReadonlyArray<IntentId>;
41
+ /** Maximum number of panels. Default 6. */
42
+ maxPanels?: number;
43
+ /**
44
+ * When true (default), prefer not to repeat the same chart family across
45
+ * panels — produces a more varied dashboard. Set false to allow duplicates.
46
+ */
47
+ diversifyByFamily?: boolean;
48
+ /** Allow only these component names. */
49
+ allow?: ReadonlyArray<string>;
50
+ /** Exclude these component names. */
51
+ deny?: ReadonlyArray<string>;
52
+ /** Optional pre-built profile (avoids recomputation). */
53
+ profile?: ChartDataProfile;
54
+ /** Non-tabular payload — forwarded to profileData. */
55
+ rawInput?: unknown;
56
+ /**
57
+ * Audience profile — applies familiarity overrides and adoption-target bias
58
+ * to every panel's ranking. When set with `exposureLevel >= 1`, the dashboard
59
+ * additionally returns `stretchPanels` showing unfamiliar-but-fitting charts.
60
+ */
61
+ audience?: AudienceProfile;
62
+ /** Max stretch panels (default min(maxPanels, 3)). */
63
+ maxStretchPanels?: number;
64
+ }
65
+ /**
66
+ * Generate a dashboard: a set of complementary chart panels, each
67
+ * answering a distinct analytical intent on the same dataset.
68
+ *
69
+ * The contract: every panel has a stated `intent` and a suggestion that
70
+ * fits that intent. The engine diversifies by chart family by default to
71
+ * avoid "every panel is a bar chart" outcomes. Intents that can't be
72
+ * filled from the data (e.g. "geo" on row data with no lat/lon) are
73
+ * reported in `intentsMissing` so consumers can show "no fit for geo
74
+ * here" rather than silently dropping them.
75
+ *
76
+ * Heuristic only — no LLM call. The result is suitable for direct
77
+ * rendering (each panel's `suggestion.props` is spreadable into the
78
+ * matching chart) or for piping to an LLM as composition context.
79
+ *
80
+ * @example
81
+ * const { panels } = suggestDashboard(data)
82
+ * return (
83
+ * <Grid>
84
+ * {panels.map(({ intent, suggestion }) => (
85
+ * <Panel key={intent} title={intent}>
86
+ * <DynamicChart component={suggestion.component} props={suggestion.props} />
87
+ * </Panel>
88
+ * ))}
89
+ * </Grid>
90
+ * )
91
+ */
92
+ export declare function suggestDashboard(data: ReadonlyArray<Datum> | null | undefined, options?: SuggestDashboardOptions): DashboardSuggestion;
@@ -0,0 +1,34 @@
1
+ import type { StreamChartCapability, StreamSchema, StreamSuggestion } from "./streamingTypes";
2
+ import type { IntentId } from "./intents";
3
+ export declare function registerStreamChartCapability(capability: StreamChartCapability): void;
4
+ export declare function unregisterStreamChartCapability(component: string): void;
5
+ export declare function getStreamCapabilities(): ReadonlyArray<StreamChartCapability>;
6
+ export interface SuggestStreamChartsOptions {
7
+ intent?: IntentId | IntentId[];
8
+ allow?: ReadonlyArray<string>;
9
+ deny?: ReadonlyArray<string>;
10
+ maxResults?: number;
11
+ minScore?: number;
12
+ capabilities?: ReadonlyArray<StreamChartCapability>;
13
+ }
14
+ /**
15
+ * Suggest realtime charts for a schema, ranked by intent.
16
+ *
17
+ * Parallel to `suggestCharts` but operates on a `StreamSchema` (fields +
18
+ * throughput/retention hints) rather than row data. Use for live dashboards,
19
+ * monitoring views, anywhere events arrive over time rather than as a bounded
20
+ * table.
21
+ *
22
+ * @example
23
+ * const suggestions = suggestStreamCharts({
24
+ * fields: [
25
+ * { name: "ts", kind: "date" },
26
+ * { name: "latency_ms", kind: "numeric" },
27
+ * { name: "endpoint", kind: "categorical" },
28
+ * ],
29
+ * throughput: "high",
30
+ * retention: "windowed",
31
+ * }, { intent: "trend" })
32
+ * // → [{ component: "RealtimeHeatmap", ... }, { component: "RealtimeWaterfallChart", ... }]
33
+ */
34
+ export declare function suggestStreamCharts(schema: StreamSchema, options?: SuggestStreamChartsOptions): StreamSuggestion[];
@@ -0,0 +1,60 @@
1
+ import type { Datum } from "../charts/shared/datumTypes";
2
+ import type { ChartDataProfile, Suggestion } from "./chartCapabilityTypes";
3
+ import type { IntentId } from "./intents";
4
+ import { type AudienceProfile } from "./audienceProfile";
5
+ /**
6
+ * A "stretch pick" — an unfamiliar-but-fitting chart paired with the
7
+ * familiar chart it could substitute for. Pairing makes the literacy
8
+ * suggestion concrete: "instead of BarChart, try BoxPlot here, because…"
9
+ */
10
+ export interface StretchSuggestion {
11
+ /** The unfamiliar chart we're suggesting as growth. */
12
+ suggestion: Suggestion;
13
+ /**
14
+ * The familiar chart this stretch could replace for the same intent.
15
+ * Undefined when the stretch is recommended on its own merits (e.g. a
16
+ * direct "increase" target with no obvious familiar counterpart).
17
+ */
18
+ replacing?: string;
19
+ /** Human-readable rationale, suitable for verbatim display. */
20
+ rationale: string;
21
+ /** Audience familiarity for this chart — the number that made it qualify as a stretch. */
22
+ familiarity: number;
23
+ }
24
+ export interface SuggestStretchChartsOptions {
25
+ /** Intent(s) to rank by. When omitted, charts are picked by data fit alone. */
26
+ intent?: IntentId | IntentId[];
27
+ /** Required — without an audience profile, the concept of "stretch" doesn't apply. */
28
+ audience?: AudienceProfile;
29
+ /** Restrict to these component names. */
30
+ allow?: ReadonlyArray<string>;
31
+ /** Exclude these component names. */
32
+ deny?: ReadonlyArray<string>;
33
+ /** Max stretch picks to return (default 5). */
34
+ maxResults?: number;
35
+ /** Pre-built profile. */
36
+ profile?: ChartDataProfile;
37
+ /** Non-tabular payload — forwarded to profileData. */
38
+ rawInput?: unknown;
39
+ /**
40
+ * Only return stretches within this score distance of the top familiar pick
41
+ * (default 1.5). Tighter values keep the suggestions plausible; wider values
42
+ * expose more variety.
43
+ */
44
+ scoreTolerance?: number;
45
+ }
46
+ /**
47
+ * Find pairs (familiar, stretch) where the stretch chart fits the data,
48
+ * has audience familiarity at or below the stretch ceiling, and either:
49
+ * • is an `increase` target for this audience, OR
50
+ * • scores within `scoreTolerance` of a familiar alternative for the
51
+ * same intent.
52
+ *
53
+ * Each pair is returned as a StretchSuggestion with `replacing` (the
54
+ * familiar chart it could substitute for) and a rationale string.
55
+ *
56
+ * Heuristic only. Use `audience` with care — without target signals, every
57
+ * audience-unfamiliar chart becomes a candidate, which can drown the
58
+ * surface in dubious recommendations.
59
+ */
60
+ export declare function suggestStretchCharts(data: ReadonlyArray<Datum> | null | undefined, options?: SuggestStretchChartsOptions): StretchSuggestion[];
@@ -0,0 +1,22 @@
1
+ import type { Datum } from "../charts/shared/datumTypes";
2
+ import { type ProfileDataOptions } from "./profileData";
3
+ import { type SuggestChartsOptions } from "./suggestCharts";
4
+ import type { ChartDataProfile, Suggestion } from "./chartCapabilityTypes";
5
+ export interface UseChartSuggestionsOptions extends SuggestChartsOptions, ProfileDataOptions {
6
+ }
7
+ export interface UseChartSuggestionsResult {
8
+ suggestions: ReadonlyArray<Suggestion>;
9
+ profile: ChartDataProfile;
10
+ }
11
+ /**
12
+ * Memoized chart suggestion hook.
13
+ *
14
+ * Heuristic-only: this hook never calls an LLM. Pair with `useChartInterrogation`
15
+ * to let an LLM re-rank or narrate the heuristic suggestions.
16
+ *
17
+ * @example
18
+ * const { suggestions } = useChartSuggestions(data, { intent: "trend" })
19
+ * const top = suggestions[0]
20
+ * return <DynamicChart component={top.component} props={top.props} />
21
+ */
22
+ export declare function useChartSuggestions(data: ReadonlyArray<Datum> | null | undefined, options?: UseChartSuggestionsOptions): UseChartSuggestionsResult;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const ChoroplethMapCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const DistanceCartogramCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const FlowMapCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const ProportionalSymbolMapCapability: ChartCapability;
@@ -27,7 +27,7 @@ export type { ScatterplotMatrixProps } from "./xy/ScatterplotMatrix";
27
27
  export { MinimapChart } from "./xy/MinimapChart";
28
28
  export type { MinimapChartProps, MinimapConfig } from "./xy/MinimapChart";
29
29
  export { QuadrantChart } from "./xy/QuadrantChart";
30
- export type { QuadrantChartProps, QuadrantsConfig, QuadrantConfig, CenterlineStyle } from "./xy/QuadrantChart";
30
+ export type { QuadrantChartProps, QuadrantsConfig, QuadrantsConfigOverride, QuadrantConfig, CenterlineStyle } from "./xy/QuadrantChart";
31
31
  export { MultiAxisLineChart } from "./xy/MultiAxisLineChart";
32
32
  export type { MultiAxisLineChartProps, MultiAxisSeriesConfig } from "./xy/MultiAxisLineChart";
33
33
  export { CandlestickChart } from "./xy/CandlestickChart";
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const ChordDiagramCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const CirclePackCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const ForceDirectedGraphCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const OrbitDiagramCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const ProcessSankeyCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const SankeyDiagramCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const TreeDiagramCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const TreemapCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const BarChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const BoxPlotCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const DonutChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const DotPlotCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const FunnelChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const GaugeChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const GroupedBarChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const HistogramCapability: ChartCapability;
@@ -23,8 +23,10 @@ export interface HistogramProps<TDatum extends Datum = Datum> extends BaseChartP
23
23
  data?: TDatum[];
24
24
  /**
25
25
  * Field name or function returning the bin label (used when data is
26
- * already binned). Ignored when binning raw values.
27
- * @default "category"
26
+ * already binned). For raw-observation data with no category dimension,
27
+ * the default treats all rows as a single "All" bucket — no need to set
28
+ * this explicitly.
29
+ * @default (d) => d.category ?? "All"
28
30
  */
29
31
  categoryAccessor?: ChartAccessor<TDatum, string>;
30
32
  /**
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const LikertChartCapability: ChartCapability;
@@ -62,7 +62,7 @@ export interface LikertChartProps<TDatum extends Datum = Datum> extends BaseChar
62
62
  *
63
63
  * Odd count → center level is neutral. Even count → clean negative/positive split.
64
64
  */
65
- levels: string[];
65
+ levels?: string[];
66
66
  /**
67
67
  * "horizontal" (default): diverging bar chart centered at 0%.
68
68
  * "vertical": stacked 100% bar chart.
@@ -0,0 +1 @@
1
+ export declare const DEFAULT_LIKERT_LEVELS: string[];
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const PieChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const RidgelinePlotCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const StackedBarChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const SwarmPlotCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const SwimlaneChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const ViolinPlotCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { StreamChartCapability } from "../../ai/streamingTypes";
2
+ export declare const RealtimeHeatmapCapability: StreamChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { StreamChartCapability } from "../../ai/streamingTypes";
2
+ export declare const RealtimeHistogramCapability: StreamChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { StreamChartCapability } from "../../ai/streamingTypes";
2
+ export declare const RealtimeLineChartCapability: StreamChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { StreamChartCapability } from "../../ai/streamingTypes";
2
+ export declare const RealtimeSwarmChartCapability: StreamChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { StreamChartCapability } from "../../ai/streamingTypes";
2
+ export declare const RealtimeWaterfallChartCapability: StreamChartCapability;
@@ -0,0 +1,7 @@
1
+ import type { StreamChartCapability } from "../../ai/streamingTypes";
2
+ /**
3
+ * TemporalHistogram is the bounded sibling of RealtimeHistogram — same chart
4
+ * but for static data with a fixed window. For stream selection it competes
5
+ * with RealtimeHistogram; the choice depends on retention.
6
+ */
7
+ export declare const TemporalHistogramCapability: StreamChartCapability;
@@ -1,37 +1,3 @@
1
- /**
2
- * Single source of truth for per-chart prop specifications.
3
- *
4
- * Three downstream consumers used to maintain their own per-chart entries:
5
- * - `ai/schema.json` (LLM tool definitions)
6
- * - `src/components/charts/shared/validationMap.ts` (runtime prop validation)
7
- * - `ai/componentMetadata.cjs` (category buckets)
8
- *
9
- * Today, `ai/schema.json` is generated from this registry — run
10
- * `npm run docs:chart-specs:schema` to refresh it after editing a spec.
11
- * `validationMap.ts` and `ai/componentMetadata.cjs` are still hand-edited
12
- * but are gated for parity by the registry: `check:chart-specs` (run via
13
- * `npm run check:chart-specs`) regenerates each chart's schema/
14
- * validation/metadata entries with the pure functions in
15
- * `scripts/lib/chart-specs-generators.mjs` and fails the build on any
16
- * drift, including unexpected adds or removes that bypass the registry.
17
- *
18
- * Design notes:
19
- * - Shared prop bags (common, xyAxis, ordinalAxis) live in `PROP_BAGS` and
20
- * are referenced by name in each spec so common surface stays in one place.
21
- * - The runtime PropType set ("string" | "number" | "boolean" | "array" |
22
- * "object" | "function") is broader than JSON Schema's, but the schema
23
- * generator emits whatever types this registry declares — including
24
- * "function" inside type unions (canonical entries like
25
- * `RidgelinePlot.tooltip: ["function", "object"]` and
26
- * `SwimlaneChart.onBrush: "function"` already use this convention; LLMs
27
- * read the union and pick a non-function alternative when they can't
28
- * supply a function value). For props that are purely callbacks or
29
- * escape hatches an LLM cannot meaningfully populate, tag the spec
30
- * with `omitFromSchema: true` to keep it in validationMap but out of
31
- * schema.json. `description` and `default` annotations surface in
32
- * schema.json (and MCP responses) but are dropped from validationMap
33
- * (which only reads `type` and `enum`).
34
- */
35
1
  export type PropType = "string" | "number" | "boolean" | "array" | "object" | "function";
36
2
  export type DataShape = "array" | "object" | "network" | "realtime" | "none";
37
3
  export type ChartCategory = "xy" | "ordinal" | "network" | "geo" | "realtime";
@@ -0,0 +1,10 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ /**
3
+ * AreaChart is treated as a strictly single-series chart. Multi-series areas
4
+ * are an occlusion nightmare — when the data has 2+ series we subselect the
5
+ * leading series (largest cumulative y) and surface a caveat so the reader
6
+ * knows they're looking at one slice, not the whole dataset. For full multi-
7
+ * series comparison the engine routes callers to LineChart; for two-series
8
+ * comparison, to DifferenceChart.
9
+ */
10
+ export declare const AreaChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const BubbleChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const CandlestickChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const ConnectedScatterplotCapability: ChartCapability;
@@ -0,0 +1,8 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ /**
3
+ * DifferenceChart's native shape is two series. When the input has 2+ series
4
+ * we subselect the top two by total y and pivot them into the wide form the
5
+ * chart expects — same "narrow the dataset to make the chart honest" pattern
6
+ * AreaChart uses for its single-series fallback.
7
+ */
8
+ export declare const DifferenceChartCapability: ChartCapability;
@@ -0,0 +1,9 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ /**
3
+ * Heatmap is a matrix: categorical × categorical (or temporal × categorical),
4
+ * with a numeric encoded as color. Without two genuine discrete dimensions
5
+ * for the axes, a heatmap of raw rows is sparse and unreadable. Tuned in
6
+ * Phase 2.1 after the scorecard surfaced Heatmap winning unsuitable
7
+ * compare-categories rankings.
8
+ */
9
+ export declare const HeatmapCapability: ChartCapability;
@@ -0,0 +1,9 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ /**
3
+ * LineChart capability — declares what data shapes LineChart serves well,
4
+ * what intents it answers, and what variants change those answers.
5
+ *
6
+ * Read alongside `LineChart.tsx`; this file is what makes the chart
7
+ * "self-aware" for suggestion and interrogation flows.
8
+ */
9
+ export declare const LineChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const MinimapChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const MultiAxisLineChartCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const QuadrantChartCapability: ChartCapability;
@@ -30,6 +30,9 @@ export interface QuadrantsConfig {
30
30
  bottomRight: QuadrantConfig;
31
31
  bottomLeft: QuadrantConfig;
32
32
  }
33
+ export type QuadrantsConfigOverride = {
34
+ [TQuadrant in keyof QuadrantsConfig]?: Partial<QuadrantsConfig[TQuadrant]>;
35
+ };
33
36
  /**
34
37
  * Centerline style configuration
35
38
  */
@@ -55,8 +58,8 @@ export interface QuadrantChartProps<TDatum extends Datum = Datum> extends BaseCh
55
58
  xCenter?: number;
56
59
  /** Y-coordinate of the horizontal center line. Defaults to midpoint of y domain. */
57
60
  yCenter?: number;
58
- /** Quadrant configuration: labels and colors for each of the four quadrants */
59
- quadrants: QuadrantsConfig;
61
+ /** Optional quadrant overrides. Omitted quadrants and quadrant fields fall back to built-in defaults. */
62
+ quadrants?: QuadrantsConfigOverride;
60
63
  /** Style for the center lines */
61
64
  centerlineStyle?: CenterlineStyle;
62
65
  /** Show quadrant labels @default true */
@@ -0,0 +1,2 @@
1
+ import type { QuadrantsConfig } from "./QuadrantChart";
2
+ export declare const DEFAULT_QUADRANTS: QuadrantsConfig;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const ScatterplotCapability: ChartCapability;
@@ -0,0 +1,2 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ export declare const StackedAreaChartCapability: ChartCapability;