semiotic 3.6.0 → 3.7.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 (122) hide show
  1. package/CLAUDE.md +192 -228
  2. package/README.md +70 -17
  3. package/ai/cli.js +41 -0
  4. package/ai/componentMetadata.cjs +11 -2
  5. package/ai/dist/mcp-server.js +625 -10
  6. package/ai/examples.md +98 -0
  7. package/ai/schema.json +581 -1
  8. package/ai/system-prompt.md +7 -4
  9. package/dist/components/AccessibleNavTree.d.ts +26 -0
  10. package/dist/components/Annotation.d.ts +41 -15
  11. package/dist/components/CategoryColors.d.ts +1 -1
  12. package/dist/components/ChartContainer.d.ts +32 -2
  13. package/dist/components/ChartGrid.d.ts +1 -1
  14. package/dist/components/ContextLayout.d.ts +1 -1
  15. package/dist/components/DataSummaryContext.d.ts +1 -1
  16. package/dist/components/DetailsPanel.d.ts +1 -1
  17. package/dist/components/Legend.d.ts +3 -2
  18. package/dist/components/LinkedCharts.d.ts +1 -1
  19. package/dist/components/ThemeProvider.d.ts +1 -1
  20. package/dist/components/Tooltip/FlippingTooltip.d.ts +1 -1
  21. package/dist/components/Tooltip/Tooltip.d.ts +2 -2
  22. package/dist/components/ai/annotationProvenance.d.ts +349 -0
  23. package/dist/components/ai/audienceProfile.d.ts +60 -3
  24. package/dist/components/ai/chartCapabilityTypes.d.ts +60 -2
  25. package/dist/components/ai/chartRoles.d.ts +27 -0
  26. package/dist/components/ai/conversationArc.d.ts +379 -0
  27. package/dist/components/ai/dataScaleProfile.d.ts +320 -0
  28. package/dist/components/ai/describeChart.d.ts +114 -0
  29. package/dist/components/ai/navigationTree.d.ts +45 -0
  30. package/dist/components/ai/qualityScorecard.d.ts +11 -0
  31. package/dist/components/ai/readerGrounding.d.ts +70 -0
  32. package/dist/components/ai/suggestCharts.d.ts +34 -1
  33. package/dist/components/ai/useConversationArc.d.ts +89 -0
  34. package/dist/components/ai/useNavigationSync.d.ts +61 -0
  35. package/dist/components/ai/variantDiscovery.d.ts +168 -0
  36. package/dist/components/charts/geo/ChoroplethMap.d.ts +2 -1
  37. package/dist/components/charts/network/CirclePack.d.ts +2 -1
  38. package/dist/components/charts/network/OrbitDiagram.d.ts +1 -1
  39. package/dist/components/charts/network/TreeDiagram.d.ts +2 -1
  40. package/dist/components/charts/network/Treemap.d.ts +2 -1
  41. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +3 -0
  42. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +4 -1
  43. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +3 -0
  44. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +3 -0
  45. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +3 -0
  46. package/dist/components/charts/shared/ChartError.d.ts +2 -1
  47. package/dist/components/charts/shared/annotationHierarchy.d.ts +42 -0
  48. package/dist/components/charts/shared/annotationResolvers.d.ts +3 -2
  49. package/dist/components/charts/shared/annotationRules.d.ts +16 -0
  50. package/dist/components/charts/shared/annotationTypes.d.ts +14 -0
  51. package/dist/components/charts/shared/auditAccessibility.d.ts +90 -0
  52. package/dist/components/charts/shared/chartSpecs.d.ts +2 -3
  53. package/dist/components/charts/shared/diagnoseConfig.d.ts +4 -6
  54. package/dist/components/charts/shared/selectionUtils.d.ts +5 -2
  55. package/dist/components/charts/shared/streamPropsHelpers.d.ts +2 -0
  56. package/dist/components/charts/shared/types.d.ts +5 -1
  57. package/dist/components/charts/shared/withChartWrapper.d.ts +1 -1
  58. package/dist/components/charts/value/BigNumber.capability.d.ts +13 -0
  59. package/dist/components/charts/value/BigNumber.d.ts +14 -0
  60. package/dist/components/charts/value/formatting.d.ts +40 -0
  61. package/dist/components/charts/value/thresholdSparkline.d.ts +40 -0
  62. package/dist/components/charts/value/types.d.ts +292 -0
  63. package/dist/components/charts/xy/MinimapChart.d.ts +2 -1
  64. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +2 -1
  65. package/dist/components/realtime/lifecycleBands.d.ts +44 -0
  66. package/dist/components/realtime/types.d.ts +23 -8
  67. package/dist/components/recipes/annotationDensity.d.ts +69 -0
  68. package/dist/components/recipes/annotationLayout.d.ts +93 -0
  69. package/dist/components/semiotic-ai.d.ts +38 -15
  70. package/dist/components/semiotic-realtime.d.ts +2 -0
  71. package/dist/components/semiotic-recipes.d.ts +4 -0
  72. package/dist/components/semiotic-server.d.ts +2 -1
  73. package/dist/components/semiotic-utils.d.ts +8 -0
  74. package/dist/components/semiotic-value.d.ts +55 -0
  75. package/dist/components/semiotic.d.ts +7 -0
  76. package/dist/components/server/renderEvidence.d.ts +92 -0
  77. package/dist/components/server/renderToStaticSVG.d.ts +14 -1
  78. package/dist/components/server/staticAnnotations.d.ts +2 -0
  79. package/dist/components/stream/AccessibleDataTable.d.ts +15 -6
  80. package/dist/components/stream/FocusRing.d.ts +2 -1
  81. package/dist/components/stream/MarginalGraphics.d.ts +2 -1
  82. package/dist/components/stream/NetworkSVGOverlay.d.ts +13 -6
  83. package/dist/components/stream/OrdinalBrushOverlay.d.ts +19 -1
  84. package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -2
  85. package/dist/components/stream/SVGOverlay.d.ts +5 -2
  86. package/dist/components/stream/XYBrushOverlay.d.ts +21 -1
  87. package/dist/components/stream/geoTypes.d.ts +3 -0
  88. package/dist/components/stream/networkTypes.d.ts +2 -0
  89. package/dist/components/stream/ordinalTypes.d.ts +2 -0
  90. package/dist/components/stream/types.d.ts +2 -0
  91. package/dist/geo.min.js +1 -1
  92. package/dist/geo.module.min.js +1 -1
  93. package/dist/network.min.js +1 -1
  94. package/dist/network.module.min.js +1 -1
  95. package/dist/ordinal.min.js +1 -1
  96. package/dist/ordinal.module.min.js +1 -1
  97. package/dist/realtime.min.js +1 -1
  98. package/dist/realtime.module.min.js +1 -1
  99. package/dist/semiotic-ai.d.ts +38 -15
  100. package/dist/semiotic-ai.min.js +1 -1
  101. package/dist/semiotic-ai.module.min.js +1 -1
  102. package/dist/semiotic-realtime.d.ts +2 -0
  103. package/dist/semiotic-recipes.d.ts +4 -0
  104. package/dist/semiotic-recipes.min.js +1 -1
  105. package/dist/semiotic-recipes.module.min.js +1 -1
  106. package/dist/semiotic-server.d.ts +2 -1
  107. package/dist/semiotic-themes.min.js +1 -1
  108. package/dist/semiotic-themes.module.min.js +1 -1
  109. package/dist/semiotic-utils.d.ts +8 -0
  110. package/dist/semiotic-utils.min.js +1 -1
  111. package/dist/semiotic-utils.module.min.js +1 -1
  112. package/dist/semiotic-value.d.ts +55 -0
  113. package/dist/semiotic-value.min.js +2 -0
  114. package/dist/semiotic-value.module.min.js +2 -0
  115. package/dist/semiotic.d.ts +7 -0
  116. package/dist/semiotic.min.js +1 -1
  117. package/dist/semiotic.module.min.js +1 -1
  118. package/dist/server.min.js +1 -1
  119. package/dist/server.module.min.js +1 -1
  120. package/dist/xy.min.js +1 -1
  121. package/dist/xy.module.min.js +1 -1
  122. package/package.json +19 -5
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Named lifecycle bands. Shared by the annotation freshness surface
3
+ * today and available to other temporal-lifecycle policies that opt
4
+ * into banded classification.
5
+ */
6
+ export type LifecycleBand = "fresh" | "aging" | "stale" | "expired";
7
+ /**
8
+ * Multipliers of `ttlMs` that mark the upper edge of each band. The
9
+ * default schedule:
10
+ *
11
+ * • `fresh` — `age < 1.0 × ttl`
12
+ * • `aging` — `age < 1.5 × ttl`
13
+ * • `stale` — `age < 3.0 × ttl`
14
+ * • `expired` — `age ≥ 3.0 × ttl`
15
+ *
16
+ * Override individual thresholds; missing entries fall back to the
17
+ * defaults. Setting a smaller value than the previous band's
18
+ * threshold is allowed but produces an unreachable band.
19
+ */
20
+ export interface LifecycleBandThresholds {
21
+ /** Upper edge of the `fresh` band, as a multiple of `ttlMs`. Default `1.0`. */
22
+ fresh?: number;
23
+ /** Upper edge of the `aging` band, as a multiple of `ttlMs`. Default `1.5`. */
24
+ aging?: number;
25
+ /** Upper edge of the `stale` band, as a multiple of `ttlMs`. Default `3.0`. */
26
+ stale?: number;
27
+ }
28
+ export declare const DEFAULT_LIFECYCLE_THRESHOLDS: Required<LifecycleBandThresholds>;
29
+ /**
30
+ * Classify an age into a named band given a TTL.
31
+ *
32
+ * Pure function. Edge cases:
33
+ *
34
+ * - **Negative age** (future-dated items): classifies as `fresh`.
35
+ * - **`NaN` age** (parse failure or `now - undefined`): classifies as
36
+ * `fresh` — the safer default, since `expired` is filtered by the
37
+ * visual treatment.
38
+ * - **`+Infinity` age**: classifies as `expired`. Monotonic in age —
39
+ * "older than any finite TTL multiple" should be the oldest band.
40
+ * - **Non-finite / non-positive TTL**: classifies as `fresh`, since
41
+ * there's no meaningful interval to age against. Callers that need
42
+ * stricter handling should gate `ttlMs` before calling.
43
+ */
44
+ export declare function bandFromAge(ageMs: number, ttlMs: number, thresholds?: LifecycleBandThresholds): LifecycleBand;
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { ScaleBand, ScaleLinear } from "d3-scale";
3
3
  import type { Datum } from "../charts/shared/datumTypes";
4
+ import type { AutoPlaceAnnotations } from "../recipes/annotationLayout";
4
5
  export type ArrowOfTime = "up" | "down" | "left" | "right";
5
6
  export type WindowMode = "sliding" | "growing";
6
7
  export type ThresholdType = "greater" | "lesser";
@@ -11,15 +12,28 @@ export interface LineStyle {
11
12
  opacity?: number;
12
13
  }
13
14
  /**
14
- * Anchoring mode for streaming annotations.
15
- * - `"fixed"` (default): anchored to specific datum coordinates; disappears when out of view.
16
- * - `"latest"`: annotation attaches to the most recent datum in the buffer.
17
- * On each frame, the annotation's position is re-resolved to the latest data point.
18
- * Useful for "current value" labels.
19
- * - `"sticky"`: annotation stays at its last known pixel position after the target datum
20
- * is evicted from the window. It freezes in place rather than disappearing.
15
+ * How an annotation's anchor is resolved across renders. Shared between
16
+ * the streaming runtime (which implements the resolution) and the
17
+ * `semiotic/ai` annotation lifecycle surface (which exposes the choice
18
+ * to authors via `lifecycle.anchor`).
19
+ *
20
+ * - `"fixed"` (default): anchored to specific datum coordinates;
21
+ * disappears when out of view.
22
+ * - `"latest"`: annotation re-pins to the most recent datum each frame.
23
+ * - `"sticky"`: annotation stays at its last known pixel position
24
+ * after the target datum scrolls off; uses `stickyPositionCache`
25
+ * on `AnnotationContext`.
26
+ * - `"semantic"`: re-resolves via `provenance.stableId` when new data
27
+ * arrives, falling back to the recorded coordinate if the anchor
28
+ * can no longer be located.
21
29
  */
22
- export type AnnotationAnchorMode = "fixed" | "latest" | "sticky";
30
+ export type AnnotationAnchor = "fixed" | "latest" | "sticky" | "semantic";
31
+ /**
32
+ * @deprecated Use {@link AnnotationAnchor}. Kept as a back-compat alias
33
+ * because earlier 3.x releases shipped this name from the streaming
34
+ * surface; the `Mode` suffix added nothing semantically.
35
+ */
36
+ export type AnnotationAnchorMode = AnnotationAnchor;
23
37
  export interface AnnotationContext {
24
38
  scales?: {
25
39
  x?: ScaleLinear<number, number>;
@@ -154,6 +168,7 @@ export interface RealtimeFrameProps {
154
168
  className?: string;
155
169
  lineStyle?: LineStyle;
156
170
  annotations?: Datum[];
171
+ autoPlaceAnnotations?: AutoPlaceAnnotations;
157
172
  svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
158
173
  hoverAnnotation?: boolean | HoverAnnotationConfig;
159
174
  tooltipContent?: (d: HoverData) => ReactNode;
@@ -0,0 +1,69 @@
1
+ import type { Datum } from "../charts/shared/datumTypes";
2
+ /**
3
+ * M3 — Amount & density management (Rahman et al.'s sixth consideration:
4
+ * "balance explanatory support against clutter").
5
+ *
6
+ * A pure, geometry-light pass that decides *which* note-like annotations should
7
+ * stay on screen when there are more than the plot area can carry without
8
+ * clutter. It does not move anything (that is M2's `annotationLayout`); it
9
+ * partitions notes into a persistent set and a deferred set by importance and
10
+ * freshness, with the lowest-priority notes shed first.
11
+ *
12
+ * Priority signals, reusing what M0/M1 already attach:
13
+ * • `emphasis` (M1) — `"primary"` is the floor (never shed); `"secondary"`
14
+ * ranks below an un-emphasised note.
15
+ * • `provenance.confidence` (M0) — a small nudge so a higher-confidence note
16
+ * outranks a lower-confidence one at the same emphasis.
17
+ * • `lifecycle.freshness` (M0) — `fresh > aging > stale`; `expired` is shed
18
+ * first.
19
+ *
20
+ * Only note types compete for the budget; reference lines, bands, enclosures
21
+ * and statistical overlays pass through untouched (they are not "clutter notes"
22
+ * in the paper's sense and a density cap shedding a threshold line would be
23
+ * surprising).
24
+ *
25
+ * The persistent set is the floor and is never empty when any note exists — the
26
+ * paper's "keep the core message persistent; hover is not guaranteed."
27
+ */
28
+ /** Plot area (px²) allotted per note before the budget tightens. */
29
+ export declare const DEFAULT_AREA_PER_ANNOTATION = 20000;
30
+ export interface AnnotationDensityConfig {
31
+ /**
32
+ * Hard cap on simultaneously-persistent notes. When set, overrides the
33
+ * `width`×`height`-derived budget.
34
+ */
35
+ maxAnnotations?: number;
36
+ /**
37
+ * Plot area (px²) allotted per note when deriving the budget from the chart
38
+ * dimensions. Larger ⇒ fewer notes. Default {@link DEFAULT_AREA_PER_ANNOTATION}.
39
+ */
40
+ areaPerAnnotation?: number;
41
+ /** Minimum notes kept regardless of budget. Default 1. */
42
+ minVisible?: number;
43
+ }
44
+ export interface AnnotationDensityOptions extends AnnotationDensityConfig {
45
+ annotations: ReadonlyArray<Datum>;
46
+ /** Plot width in px (used to derive the budget when `maxAnnotations` is unset). */
47
+ width: number;
48
+ /** Plot height in px. */
49
+ height: number;
50
+ }
51
+ export interface AnnotationDensityResult {
52
+ /** Notes kept on screen plus every non-note annotation, in author order. */
53
+ visible: Datum[];
54
+ /** Notes shed by the budget, in author order. Empty when nothing is shed. */
55
+ deferred: Datum[];
56
+ /** The note budget that produced this partition. */
57
+ budget: number;
58
+ }
59
+ /**
60
+ * Derive the note budget for a plot. Exported so the clutter diagnostic
61
+ * (`diagnoseConfig`) and the runtime pass agree on the same threshold.
62
+ */
63
+ export declare function annotationBudget(width: number, height: number, config?: AnnotationDensityConfig): number;
64
+ /**
65
+ * Partition annotations into a persistent (visible) set and a deferred set
66
+ * given a note budget. Pure and deterministic; preserves author order within
67
+ * each returned array.
68
+ */
69
+ export declare function annotationDensity(options: AnnotationDensityOptions): AnnotationDensityResult;
@@ -0,0 +1,93 @@
1
+ import type { AnnotationContext } from "../realtime/types";
2
+ import type { Datum } from "../charts/shared/datumTypes";
3
+ import { type AnnotationDensityConfig } from "./annotationDensity";
4
+ export interface AnnotationLayoutConfig {
5
+ /** Distance from the anchor for the first candidate ring. */
6
+ defaultOffset?: number;
7
+ /** Gap around note boxes when testing note-note collisions. */
8
+ notePadding?: number;
9
+ /** Gap around point marks when testing note-mark collisions. */
10
+ markPadding?: number;
11
+ /** Gap from the plot edge, used as a cheap axis-occlusion proxy. */
12
+ edgePadding?: number;
13
+ /** Preserve annotations that already declare either dx or dy. Default true. */
14
+ preserveManualOffsets?: boolean;
15
+ /** Use a curved connector when auto-placement has to route far from the target. */
16
+ routeLongConnectors?: boolean;
17
+ /** Distance threshold for routeLongConnectors. */
18
+ connectorThreshold?: number;
19
+ /**
20
+ * M3 — amount & density management. When set, after placement the lowest-
21
+ * priority note-like annotations are shed so the plot is not over-crowded
22
+ * (`true` uses the area-derived default budget; an object tunes it). Reference
23
+ * lines, bands and overlays are never shed. Off by default.
24
+ */
25
+ density?: boolean | AnnotationDensityConfig;
26
+ /**
27
+ * M3 — progressive disclosure. When `true`, notes shed by `density` (M3) or
28
+ * the `responsive` breakpoint (M5) are kept in the output tagged
29
+ * `_annotationDeferred` (hidden by default, revealed on chart hover/focus)
30
+ * instead of dropped. The persistent set is always rendered, so a non-hover
31
+ * reader still sees the core notes. No effect unless a shedding pass is on.
32
+ */
33
+ progressiveDisclosure?: boolean;
34
+ /**
35
+ * M4 — redundant-cue default (Rahman et al.'s "Association"). A colored
36
+ * `text` note is the one note type that never draws a connector, so it ties
37
+ * to its target by color alone — invisible to a color-blind or non-visual
38
+ * reader. When `true`, an offset colored `text` note is flagged
39
+ * `_redundantConnector` so the renderer adds a faint leader line from the
40
+ * anchor to the text: a spatial cue, not another color. Off by default.
41
+ */
42
+ redundantCues?: boolean;
43
+ /**
44
+ * M5 — responsive annotation behavior. As the plot narrows past `minWidth`
45
+ * (default 480px), `secondary`-emphasis notes are shed by *importance* — a
46
+ * complement to `density`'s count budget. Pass `true` for the default
47
+ * breakpoint or `{ minWidth }` to tune it. With `progressiveDisclosure`,
48
+ * shed notes are deferred (revealable) rather than dropped. Primary and
49
+ * unmarked notes are always kept. Off by default.
50
+ */
51
+ responsive?: boolean | {
52
+ minWidth?: number;
53
+ };
54
+ /**
55
+ * M5 — cohesion mode (Rahman et al.'s "Cohesion"). `"blended"` lets notes
56
+ * adopt the chart's visual language (mark colors / chart typography — the
57
+ * default look); `"layer"` presents them as a distinct editorial layer
58
+ * (annotation-color, italic editorial type). Stamped onto note-like
59
+ * annotations that don't set their own `cohesion`; a per-annotation
60
+ * `cohesion` always wins. Off (inherit) by default.
61
+ */
62
+ cohesion?: AnnotationCohesion;
63
+ /**
64
+ * M6 — audience adaptation. An `AudienceProfile` (structurally, anything with
65
+ * a `familiarity` map) biases annotation *amount*: a low-familiarity audience
66
+ * keeps more notes (orienting context), an expert audience fewer. It scales
67
+ * the `density` budget, so it only takes effect when `density` is engaged.
68
+ */
69
+ audience?: AnnotationAudience;
70
+ }
71
+ export type AnnotationCohesion = "blended" | "layer";
72
+ /** Structural subset of `AudienceProfile` the annotation layer reads — anything
73
+ * with a per-chart `familiarity` map satisfies it, so a real `AudienceProfile`
74
+ * can be passed directly without coupling `recipes` to the `ai` module. */
75
+ export interface AnnotationAudience {
76
+ name?: string;
77
+ familiarity?: Partial<Record<string, number>>;
78
+ }
79
+ export type AutoPlaceAnnotationsConfig = AnnotationLayoutConfig;
80
+ export type AutoPlaceAnnotations = boolean | AutoPlaceAnnotationsConfig;
81
+ export interface AnnotationLayoutOptions extends AnnotationLayoutConfig {
82
+ annotations: ReadonlyArray<Datum>;
83
+ context: AnnotationContext;
84
+ }
85
+ /**
86
+ * Pure annotation placement recipe.
87
+ *
88
+ * It clones note-like annotations that do not already declare `dx`/`dy`, picks
89
+ * an adjacent candidate offset, and leaves every other annotation untouched.
90
+ * The pass is deterministic and geometry-only; renderers still own the actual
91
+ * SVG/HTML annotation drawing.
92
+ */
93
+ export declare function annotationLayout(options: AnnotationLayoutOptions): Datum[];
@@ -41,6 +41,7 @@ export { RealtimeHistogram, TemporalHistogram } from "./charts/realtime/Realtime
41
41
  export { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
42
42
  export { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
43
43
  export { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
44
+ export { BigNumber } from "./charts/value/BigNumber";
44
45
  export { TooltipProvider } from "./store/TooltipStore";
45
46
  export { MultiLineTooltip } from "./Tooltip/Tooltip";
46
47
  export { ThemeProvider, useTheme } from "./ThemeProvider";
@@ -59,6 +60,8 @@ export { validateProps } from "./charts/shared/validateProps";
59
60
  export type { ValidationResult } from "./charts/shared/validateProps";
60
61
  export { diagnoseConfig } from "./charts/shared/diagnoseConfig";
61
62
  export type { Diagnosis, DiagnosisResult } from "./charts/shared/diagnoseConfig";
63
+ export { auditAccessibility, formatAccessibilityAudit, accessibilityCaveats } from "./charts/shared/auditAccessibility";
64
+ export type { A11yPrinciple, A11yStatus, A11yFinding, AccessibilityAuditResult, AuditAccessibilityOptions } from "./charts/shared/auditAccessibility";
62
65
  export type { AnomalyConfig, ForecastConfig } from "./charts/shared/statisticalOverlays";
63
66
  export { toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX } from "./export/chartConfig";
64
67
  export type { ChartConfig, ToConfigOptions, CopyFormat } from "./export/chartConfig";
@@ -67,40 +70,60 @@ export type { SerializedSelections, SerializedSelection, SerializedFieldSelectio
67
70
  export { fromVegaLite } from "./data/fromVegaLite";
68
71
  export type { VegaLiteSpec, VegaLiteEncoding } from "./data/fromVegaLite";
69
72
  export { useChartInterrogation } from "./store/useChartInterrogation";
70
- export type { UseChartInterrogationOptions, UseChartInterrogationResult, InterrogationContext, InterrogationFocus, InterrogationResult, InterrogationQuery, InterrogationMessage, } from "./store/useChartInterrogation";
73
+ export type { UseChartInterrogationOptions, UseChartInterrogationResult, InterrogationContext, InterrogationFocus, InterrogationResult, InterrogationQuery, InterrogationMessage } from "./store/useChartInterrogation";
71
74
  export { useChartFocus } from "./store/useChartFocus";
72
75
  export type { UseChartFocusOptions } from "./store/useChartFocus";
73
76
  export { summarizeData } from "./data/DataSummarizer";
74
- export type { DataSummary, FieldSummary, FieldType, NumericFieldSummary, DateFieldSummary, CategoricalFieldSummary, UnknownFieldSummary, SummarizeOptions, } from "./data/DataSummarizer";
77
+ export { describeChart, resolveCommunicativeAct, communicativeActForIntent } from "./ai/describeChart";
78
+ export type { DescribeChartResult, DescribeChartOptions, DescribeLevel, CommunicativeAct, DescribeCapabilityContext } from "./ai/describeChart";
79
+ export { buildReaderGrounding } from "./ai/readerGrounding";
80
+ export type { ChartReaderGrounding, ChartReaderGroundingOptions, ChartReaderGroundingIntent } from "./ai/readerGrounding";
81
+ export { buildNavigationTree, flattenVisible, countNodes } from "./ai/navigationTree";
82
+ export type { NavTreeNode, NavTreeRole, BuildNavigationTreeOptions } from "./ai/navigationTree";
83
+ export { AccessibleNavTree } from "./AccessibleNavTree";
84
+ export type { AccessibleNavTreeProps } from "./AccessibleNavTree";
85
+ export { useNavigationSync } from "./ai/useNavigationSync";
86
+ export type { UseNavigationSyncOptions, UseNavigationSyncResult } from "./ai/useNavigationSync";
87
+ export type { DataSummary, FieldSummary, FieldType, NumericFieldSummary, DateFieldSummary, CategoricalFieldSummary, UnknownFieldSummary, SummarizeOptions } from "./data/DataSummarizer";
75
88
  export { profileData } from "./ai/profileData";
76
89
  export type { ProfileDataOptions } from "./ai/profileData";
77
- export { suggestCharts, scoreChart, explainCapabilityFit } from "./ai/suggestCharts";
78
- export type { SuggestChartsOptions, RejectedCapability, ExplainCapabilityFitResult, } from "./ai/suggestCharts";
90
+ export { suggestCharts, suggestChartsGrouped, scoreChart, explainCapabilityFit } from "./ai/suggestCharts";
91
+ export type { SuggestChartsOptions, RejectedCapability, ExplainCapabilityFitResult } from "./ai/suggestCharts";
92
+ export { DEFAULT_SCALE_THRESHOLDS, applyScaleBias, classifyRowBand, classifyCardinalityBand, classifyFieldBand, compareBands, computeEffectiveScale, resolveRowsToNumber, resolveCardinalityToNumber, scaleHints } from "./ai/dataScaleProfile";
93
+ export type { DataScaleProfile, DataQualityProfile, ScaleBand, CardinalityBand, FieldBand, ScaleThresholds, ChartScalePreference, EffectiveScale, ScaleBiasResult, ScaleFitFn, ScaleFitResult, QualityFitFn, ScaleHintInput } from "./ai/dataScaleProfile";
79
94
  export { inferIntent } from "./ai/inferIntent";
80
95
  export type { InferIntentResult } from "./ai/inferIntent";
81
96
  export { suggestDashboard } from "./ai/suggestDashboard";
82
- export type { DashboardPanel, DashboardSuggestion, SuggestDashboardOptions, } from "./ai/suggestDashboard";
83
- export { applyAudienceBias, effectiveFamiliarity, stretchFamiliarityCeiling, } from "./ai/audienceProfile";
84
- export type { AudienceProfile, AudienceTarget, AudienceBiasResult, } from "./ai/audienceProfile";
85
- export { executivePersona, analystPersona, dataScientistPersona, BUILT_IN_AUDIENCES, } from "./ai/audiences";
97
+ export type { DashboardPanel, DashboardSuggestion, SuggestDashboardOptions } from "./ai/suggestDashboard";
98
+ export { applyAudienceBias, effectiveFamiliarity, stretchFamiliarityCeiling, receivabilityBias } from "./ai/audienceProfile";
99
+ export type { AudienceProfile, AudienceTarget, AudienceBiasResult, ReceptionModality, ReceivabilitySignal } from "./ai/audienceProfile";
100
+ export { executivePersona, analystPersona, dataScientistPersona, BUILT_IN_AUDIENCES } from "./ai/audiences";
86
101
  export { suggestStretchCharts } from "./ai/suggestStretchCharts";
87
- export type { StretchSuggestion, SuggestStretchChartsOptions, } from "./ai/suggestStretchCharts";
88
- export { suggestStreamCharts, registerStreamChartCapability, unregisterStreamChartCapability, getStreamCapabilities, } from "./ai/suggestStreamCharts";
102
+ export type { StretchSuggestion, SuggestStretchChartsOptions } from "./ai/suggestStretchCharts";
103
+ export { suggestStreamCharts, registerStreamChartCapability, unregisterStreamChartCapability, getStreamCapabilities } from "./ai/suggestStreamCharts";
89
104
  export type { SuggestStreamChartsOptions } from "./ai/suggestStreamCharts";
90
- export type { StreamSchema, StreamFieldSchema, StreamFieldKind, StreamChartCapability, StreamIntentScorer, StreamSuggestion, } from "./ai/streamingTypes";
105
+ export type { StreamSchema, StreamFieldSchema, StreamFieldKind, StreamChartCapability, StreamIntentScorer, StreamSuggestion } from "./ai/streamingTypes";
91
106
  export { diffProfile } from "./ai/diffProfile";
92
107
  export type { ProfileDiff, FieldTypeChange, PrimaryRoleChange, PrimaryRole } from "./ai/diffProfile";
93
108
  export { repairChartConfig } from "./ai/repairChartConfig";
94
- export type { RepairResult, RepairOkResult, RepairAlternativeResult, RepairUnknownResult, RepairOptions, } from "./ai/repairChartConfig";
109
+ export type { RepairResult, RepairOkResult, RepairAlternativeResult, RepairUnknownResult, RepairOptions } from "./ai/repairChartConfig";
95
110
  export { runQualityScorecard } from "./ai/qualityScorecard";
96
- export type { ScorecardFixture, ScorecardReport, PerCapabilityScore, PerFixtureScore, } from "./ai/qualityScorecard";
111
+ export type { ScorecardFixture, ScorecardReport, PerCapabilityScore, PerFixtureScore } from "./ai/qualityScorecard";
97
112
  export { CANONICAL_FIXTURES } from "./ai/qualityFixtures";
98
113
  export { useChartSuggestions } from "./ai/useChartSuggestions";
99
114
  export type { UseChartSuggestionsOptions, UseChartSuggestionsResult } from "./ai/useChartSuggestions";
100
- export { getCapabilities, getCapability, registerChartCapability, unregisterChartCapability, LineChartCapability, AreaChartCapability, StackedAreaChartCapability, ScatterplotCapability, ConnectedScatterplotCapability, BubbleChartCapability, QuadrantChartCapability, MultiAxisLineChartCapability, MinimapChartCapability, DifferenceChartCapability, CandlestickChartCapability, HeatmapCapability, BarChartCapability, GroupedBarChartCapability, StackedBarChartCapability, DotPlotCapability, PieChartCapability, DonutChartCapability, FunnelChartCapability, GaugeChartCapability, LikertChartCapability, SwimlaneChartCapability, HistogramCapability, BoxPlotCapability, SwarmPlotCapability, ViolinPlotCapability, RidgelinePlotCapability, ForceDirectedGraphCapability, SankeyDiagramCapability, ChordDiagramCapability, ProcessSankeyCapability, TreeDiagramCapability, TreemapCapability, CirclePackCapability, OrbitDiagramCapability, ChoroplethMapCapability, ProportionalSymbolMapCapability, FlowMapCapability, DistanceCartogramCapability, } from "./ai/chartCapabilities";
101
- export type { ChartCapability, ChartDataProfile, ChartFamily, ChartImportPath, ChartRubric, ChartVariant, FieldCandidate, FieldKind, FitResult, IntentScorer, Suggestion, } from "./ai/chartCapabilityTypes";
115
+ export { getCapabilities, getCapability, registerChartCapability, unregisterChartCapability, LineChartCapability, AreaChartCapability, StackedAreaChartCapability, ScatterplotCapability, ConnectedScatterplotCapability, BubbleChartCapability, QuadrantChartCapability, MultiAxisLineChartCapability, MinimapChartCapability, DifferenceChartCapability, CandlestickChartCapability, HeatmapCapability, BarChartCapability, GroupedBarChartCapability, StackedBarChartCapability, DotPlotCapability, PieChartCapability, DonutChartCapability, FunnelChartCapability, GaugeChartCapability, LikertChartCapability, SwimlaneChartCapability, HistogramCapability, BoxPlotCapability, SwarmPlotCapability, ViolinPlotCapability, RidgelinePlotCapability, ForceDirectedGraphCapability, SankeyDiagramCapability, ChordDiagramCapability, ProcessSankeyCapability, TreeDiagramCapability, TreemapCapability, CirclePackCapability, OrbitDiagramCapability, ChoroplethMapCapability, ProportionalSymbolMapCapability, FlowMapCapability, DistanceCartogramCapability } from "./ai/chartCapabilities";
116
+ export type { ChartCapability, ChartDataProfile, ChartFamily, ChartImportPath, ChartRubric, ChartVariant, FieldCandidate, FieldKind, FitResult, IntentScorer, ScaledSuggestionGroups, Suggestion, SuggestionScaleRange } from "./ai/chartCapabilityTypes";
102
117
  export { listIntents, getIntent, registerIntent, BUILT_IN_INTENT_IDS } from "./ai/intents";
103
118
  export type { BuiltInIntentId, IntentId, IntentDescriptor } from "./ai/intents";
119
+ export { proposeVariant, evaluateVariantProposal, registerVariantDiscovery, getRegisteredVariantDiscovery, clearVariantDiscovery } from "./ai/variantDiscovery";
120
+ export type { VariantProposal, VariantProposalSource, VariantScore, VariantRejectionReason, VariantDiscoveryContext, EvaluateVariantProposalOptions, ProposeVariantFn, EvaluateVariantProposalFn } from "./ai/variantDiscovery";
121
+ export { withProvenance, withCurrentProvenance, currentTimestamp, computeAnnotationFreshness, applyAnnotationLifecycle, applyAnnotationStatus, filterAnnotationsByStatus, annotationFreshnessFor, bandFromAge, DEFAULT_LIFECYCLE_THRESHOLDS } from "./ai/annotationProvenance";
122
+ export type { AnnotationProvenance, AnnotationSource, AnnotationActorKind, AnnotationBasis, AnnotationLifecycle, AnnotationFreshness, AnnotationStatus, AnnotationAnchor, Annotated, ComputeAnnotationFreshnessOptions, AnnotationLifecycleTreatment, ApplyAnnotationLifecycleOptions, AnnotationStatusTreatment, AnnotationStatusVisibility, LifecycleBand, LifecycleBandThresholds } from "./ai/annotationProvenance";
123
+ export { useConversationArc, summarizeArc } from "./ai/useConversationArc";
124
+ export type { UseConversationArcOptions, UseConversationArcResult, ConversationArcSummary } from "./ai/useConversationArc";
125
+ export { enableConversationArc, disableConversationArc, getConversationArcStore, subscribeToConversationArcChange, registerConversationArcSink, createLocalStorageConversationArcSink, createIndexedDBConversationArcSink, createWebhookConversationArcSink, loadConversationArc, replayConversationArc, recordAudienceChange, recordAnnotationStatusChange } from "./ai/conversationArc";
126
+ export type { ConversationArcEvent, ConversationArcEventType, ConversationArcEventInput, ConversationArcStore, ConversationArcListener, ConversationArcSink, ConversationArcStorageLike, EnableConversationArcOptions, LoadConversationArcOptions, LocalStorageConversationArcSinkOptions, IndexedDBConversationArcSinkOptions, ConversationArcWebhookFetch, WebhookConversationArcSinkOptions, SuggestionShownEvent, SuggestionChosenEvent, AudienceSetEvent, ChartRenderedEvent, ChartEditedEvent, ChartReplacedEvent, ChartExportedEvent, ChartAbandonedEvent, InterrogationAskedEvent, InterrogationAnsweredEvent, NavNodeFocusedEvent, NavBranchExpandedEvent, AnnotationStatusChangedEvent } from "./ai/conversationArc";
104
127
  export { useChartObserver } from "./store/useObservation";
105
128
  export type { UseChartObserverOptions, UseChartObserverResult } from "./store/useObservation";
106
129
  export type { ChartObservation, OnObservationCallback, HoverObservation, HoverEndObservation, BrushObservation, BrushEndObservation, SelectionObservation, SelectionEndObservation, ClickObservation, ClickEndObservation } from "./store/ObservationStore";
@@ -22,3 +22,5 @@ export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType } from ".
22
22
  export type { StreamNetworkFrameProps, StreamNetworkFrameHandle, NetworkChartType } from "./stream/networkTypes";
23
23
  export { useStreamStatus } from "./charts/shared/useStreamStatus";
24
24
  export type { StreamStatus, StreamStatusOptions, StreamStatusResult, } from "./charts/shared/useStreamStatus";
25
+ export { bandFromAge, DEFAULT_LIFECYCLE_THRESHOLDS } from "./realtime/lifecycleBands";
26
+ export type { LifecycleBand, LifecycleBandThresholds } from "./realtime/lifecycleBands";
@@ -19,6 +19,10 @@ export { bulletLayout } from "./recipes/bullet";
19
19
  export type { BulletConfig } from "./recipes/bullet";
20
20
  export { parallelCoordinatesLayout } from "./recipes/parallelCoordinates";
21
21
  export type { ParallelCoordinatesConfig } from "./recipes/parallelCoordinates";
22
+ export { annotationLayout } from "./recipes/annotationLayout";
23
+ export type { AnnotationLayoutConfig, AnnotationLayoutOptions, AutoPlaceAnnotations, AutoPlaceAnnotationsConfig, AnnotationCohesion, AnnotationAudience, } from "./recipes/annotationLayout";
24
+ export { annotationDensity, annotationBudget, DEFAULT_AREA_PER_ANNOTATION } from "./recipes/annotationDensity";
25
+ export type { AnnotationDensityConfig, AnnotationDensityOptions, AnnotationDensityResult, } from "./recipes/annotationDensity";
22
26
  export type { CustomLayout, LayoutContext, LayoutResult, } from "./stream/customLayout";
23
27
  export type { NetworkCustomLayout, NetworkLayoutContext, NetworkLayoutResult, } from "./stream/networkCustomLayout";
24
28
  export type { OrdinalCustomLayout, OrdinalLayoutContext, OrdinalLayoutResult, } from "./stream/ordinalCustomLayout";
@@ -1,4 +1,5 @@
1
- export { renderToStaticSVG, renderXYToStaticSVG, renderOrdinalToStaticSVG, renderNetworkToStaticSVG, renderGeoToStaticSVG, renderChart, renderToImage, renderDashboard, } from "./server/renderToStaticSVG";
1
+ export { renderToStaticSVG, renderXYToStaticSVG, renderOrdinalToStaticSVG, renderNetworkToStaticSVG, renderGeoToStaticSVG, renderChart, renderChartWithEvidence, renderToImage, renderDashboard, } from "./server/renderToStaticSVG";
2
+ export type { RenderEvidence } from "./server/renderEvidence";
2
3
  export type { RenderToImageOptions, DashboardChart, DashboardLayout, RenderDashboardOptions, } from "./server/renderToStaticSVG";
3
4
  export type { LegendLayout } from "./types/legendTypes";
4
5
  export { renderToAnimatedGif, generateFrameSVGs, generateFrameSequence } from "./server/animatedGif";
@@ -17,6 +17,14 @@ export { createHatchPattern } from "./charts/shared/hatchPattern";
17
17
  export type { HatchPatternOptions } from "./charts/shared/hatchPattern";
18
18
  export { validateProps } from "./charts/shared/validateProps";
19
19
  export { diagnoseConfig } from "./charts/shared/diagnoseConfig";
20
+ export { auditAccessibility, formatAccessibilityAudit, accessibilityCaveats } from "./charts/shared/auditAccessibility";
21
+ export { describeChart, resolveCommunicativeAct, communicativeActForIntent } from "./ai/describeChart";
22
+ export type { DescribeChartResult, DescribeChartOptions, DescribeLevel, CommunicativeAct, DescribeCapabilityContext } from "./ai/describeChart";
23
+ export { buildNavigationTree, flattenVisible, countNodes } from "./ai/navigationTree";
24
+ export type { NavTreeNode, NavTreeRole, BuildNavigationTreeOptions } from "./ai/navigationTree";
25
+ export { buildReaderGrounding } from "./ai/readerGrounding";
26
+ export type { ChartReaderGrounding, ChartReaderGroundingOptions, ChartReaderGroundingIntent } from "./ai/readerGrounding";
27
+ export type { A11yPrinciple, A11yStatus, A11yFinding, AccessibilityAuditResult, AuditAccessibilityOptions } from "./charts/shared/auditAccessibility";
20
28
  export { getHitRadius } from "./stream/hitTestUtils";
21
29
  export { toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX } from "./export/chartConfig";
22
30
  export type { ChartConfig, ToConfigOptions, CopyFormat } from "./export/chartConfig";
@@ -0,0 +1,55 @@
1
+ /**
2
+ * semiotic/value — Focal-value visualizations.
3
+ *
4
+ * Charts that render *one* number rather than a coordinate space. At
5
+ * row counts of 1–3, a chart is usually the wrong abstraction — the
6
+ * scale-aware suggestion engine routes those datasets here.
7
+ *
8
+ * v1 ships `BigNumber` as a plain React component. The component is
9
+ * deliberately chart-dependency-free: consumers compose their own
10
+ * Semiotic chart (or any ReactNode) into the `trendSlot` (wide /
11
+ * rectangular charts, e.g. LineChart / AreaChart in sparkline mode) or
12
+ * `chartSlot` (square charts, e.g. DonutChart / PieChart / Scatterplot
13
+ * / Treemap). The slot context exposes the resolved threshold colour
14
+ * + sentiment + push buffer so embedded charts can theme-link.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * import { BigNumber } from "semiotic/value"
19
+ * import { LineChart } from "semiotic/xy"
20
+ * import { DonutChart } from "semiotic/ordinal"
21
+ *
22
+ * <BigNumber
23
+ * value={1284900}
24
+ * label="Q3 Revenue"
25
+ * format="currency"
26
+ * comparison={{ value: 980000, label: "vs Q2" }}
27
+ * target={{ value: 1500000, label: "Q3 plan" }}
28
+ * thresholds={[
29
+ * { at: -Infinity, level: "danger" },
30
+ * { at: 1_000_000, level: "warning" },
31
+ * { at: 1_300_000, level: "success" },
32
+ * ]}
33
+ * trendSlot={(ctx) => (
34
+ * <LineChart
35
+ * data={recentMonths.map((y, x) => ({ x, y }))}
36
+ * xAccessor="x" yAccessor="y"
37
+ * mode="sparkline"
38
+ * width={260} height={32}
39
+ * color={ctx.color}
40
+ * />
41
+ * )}
42
+ * chartSlot={(ctx) => (
43
+ * <DonutChart
44
+ * data={revenueByRegion}
45
+ * categoryAccessor="region" valueAccessor="revenue"
46
+ * width={120} height={120}
47
+ * />
48
+ * )}
49
+ * />
50
+ * ```
51
+ */
52
+ export { BigNumber, default as BigNumberDefault } from "./charts/value/BigNumber";
53
+ export type { BigNumberProps, BigNumberHandle, BigNumberMode, BigNumberLevel, BigNumberDirection, BigNumberSentiment, BigNumberFormat, BigNumberThreshold, BigNumberComparison, BigNumberTarget, BigNumberPushInput, BigNumberSlot, BigNumberSlotContext } from "./charts/value/types";
54
+ export { buildFormatter, formatSignedDelta, formatDeltaPercent, formatDuration } from "./charts/value/formatting";
55
+ export { resolveThreshold, colorForLevel, buildSparklinePath } from "./charts/value/thresholdSparkline";
@@ -44,6 +44,12 @@ export { COLOR_BLIND_SAFE_CATEGORICAL } from "./store/ThemeStore";
44
44
  export { themeToCSS, themeToTokens, resolveThemePreset, THEME_PRESETS, CARBON_CATEGORICAL_14, CARBON_ALERT } from "./semiotic-themes";
45
45
  export type { ThemePresetName } from "./semiotic-themes";
46
46
  export type { ChartErrorBoundaryProps } from "./ChartErrorBoundary";
47
+ export { AccessibleNavTree } from "./AccessibleNavTree";
48
+ export type { AccessibleNavTreeProps } from "./AccessibleNavTree";
49
+ export { buildNavigationTree } from "./ai/navigationTree";
50
+ export type { NavTreeNode, NavTreeRole, BuildNavigationTreeOptions } from "./ai/navigationTree";
51
+ export { useNavigationSync } from "./ai/useNavigationSync";
52
+ export type { UseNavigationSyncOptions, UseNavigationSyncResult } from "./ai/useNavigationSync";
47
53
  export type { ChartContainerProps, ChartContainerHandle } from "./ChartContainer";
48
54
  export type { ChartGridProps } from "./ChartGrid";
49
55
  export type { CategoryColorMap, CategoryColorProviderProps } from "./CategoryColors";
@@ -62,3 +68,4 @@ export type { RealtimeTemporalHistogramProps, RealtimeHistogramProps, TemporalHi
62
68
  export type { RealtimeSwarmChartProps } from "./charts/realtime/RealtimeSwarmChart";
63
69
  export type { RealtimeWaterfallChartProps } from "./charts/realtime/RealtimeWaterfallChart";
64
70
  export type { RealtimeHeatmapProps } from "./charts/realtime/RealtimeHeatmap";
71
+ export type { AnnotationProvenance, AnnotationSource, AnnotationActorKind, AnnotationBasis, AnnotationLifecycle, AnnotationFreshness, AnnotationStatus, AnnotationAnchor, Annotated, } from "./ai/annotationProvenance";
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Render evidence — machine-readable ground truth about what a server render
3
+ * actually produced, emitted from the same scene the SVG converter walks.
4
+ *
5
+ * The chart-reading literature's consistent failure mode is models
6
+ * hallucinating about what a chart contains — worst of all about what is
7
+ * *absent* from it. Render evidence is the artifact an agent can quote
8
+ * instead of trusting its eyes: did marks render, how many, of what kind,
9
+ * over what domains. It is computed during `renderChartWithEvidence`
10
+ * (`semiotic/server`) and returned alongside the SVG through the MCP
11
+ * `renderChart` tool, so repair loops can react to "this rendered zero data
12
+ * marks" without pixel inspection.
13
+ *
14
+ * Evidence reflects the *rendered scene*, never the input props — that is
15
+ * the point. A config can be valid and still render empty; evidence is how
16
+ * that difference becomes visible to a non-visual caller.
17
+ */
18
+ export interface RenderEvidence {
19
+ /** HOC component name as passed to renderChart. */
20
+ component: string;
21
+ frameType: "xy" | "ordinal" | "network" | "geo";
22
+ /** "ok" when the scene produced data marks; "empty" when it did not. */
23
+ status: "ok" | "empty";
24
+ /** True when zero data marks rendered. */
25
+ empty: boolean;
26
+ /** Total data-mark scene nodes (grid/axes/legend chrome never counts). */
27
+ markCount: number;
28
+ /** Tally of scene nodes by their scene `type` (point, line, rect, …). */
29
+ markCountByType: Record<string, number>;
30
+ /** Outer SVG dimensions. */
31
+ width: number;
32
+ height: number;
33
+ /** Resolved numeric x-domain (XY frames; time domains in epoch ms). */
34
+ xDomain?: [number, number];
35
+ /** Resolved numeric y/value domain (XY + ordinal frames). */
36
+ yDomain?: [number, number];
37
+ /** Ordinal category domain, in render order. */
38
+ categories?: string[];
39
+ /** Network node / edge counts. */
40
+ nodeCount?: number;
41
+ edgeCount?: number;
42
+ /** Number of legend entries rendered (when a legend rendered). */
43
+ legendItems?: number;
44
+ /** Number of annotations supplied to the render. */
45
+ annotationCount: number;
46
+ /** The accessible name the SVG carries (description ?? title ?? generated). */
47
+ ariaLabel: string;
48
+ /** Stable warning codes (EMPTY_SCENE, NO_SCALES). */
49
+ warnings: string[];
50
+ }
51
+ /**
52
+ * Internal mutable slot threaded through the frame renderers. Only
53
+ * `renderChartWithEvidence` allocates one; the public string-returning
54
+ * render APIs pass nothing and pay nothing.
55
+ */
56
+ export interface EvidenceSink {
57
+ evidence?: RenderEvidence;
58
+ }
59
+ /** Tally scene nodes by their `type` field. */
60
+ export declare function tallyByType(nodes: ReadonlyArray<{
61
+ type?: string;
62
+ }>): {
63
+ count: number;
64
+ byType: Record<string, number>;
65
+ };
66
+ /** Convert a d3 scale domain to a serializable [number, number], or undefined. */
67
+ export declare function numericDomain(domain: ReadonlyArray<unknown> | undefined): [number, number] | undefined;
68
+ interface BuildEvidenceInput {
69
+ frameType: RenderEvidence["frameType"];
70
+ width: number;
71
+ height: number;
72
+ marks: ReadonlyArray<{
73
+ type?: string;
74
+ }>;
75
+ /** Frame props type title/description as ReactNode; only string values
76
+ * contribute to the accessible name (matching what wrapSVG emits as
77
+ * <title>/<desc> text). */
78
+ title?: unknown;
79
+ description?: unknown;
80
+ annotations?: unknown;
81
+ xDomain?: [number, number];
82
+ yDomain?: [number, number];
83
+ categories?: string[];
84
+ nodeCount?: number;
85
+ edgeCount?: number;
86
+ legendItems?: number;
87
+ extraWarnings?: string[];
88
+ }
89
+ /** Assemble evidence from a computed scene. Component name is stamped later
90
+ * by `renderChartWithEvidence`, which knows the HOC-level name. */
91
+ export declare function buildEvidence(input: BuildEvidenceInput): RenderEvidence;
92
+ export {};
@@ -20,6 +20,7 @@ import type { StreamXYFrameProps } from "../stream/types";
20
20
  import type { StreamNetworkFrameProps } from "../stream/networkTypes";
21
21
  import type { StreamOrdinalFrameProps } from "../stream/ordinalTypes";
22
22
  import type { StreamGeoFrameProps } from "../stream/geoTypes";
23
+ import { type RenderEvidence } from "./renderEvidence";
23
24
  import { type ThemeInput } from "./themeResolver";
24
25
  import { CHART_CONFIGS } from "./serverChartConfigs";
25
26
  type FrameType = "xy" | "ordinal" | "network" | "geo";
@@ -60,7 +61,19 @@ interface RenderChartOptions {
60
61
  *
61
62
  * This is the primary API for AI/MCP workflows.
62
63
  */
63
- export declare function renderChart(component: ChartName, props: Datum, _options?: RenderChartOptions): string;
64
+ export declare function renderChart(component: ChartName, props: Datum, options?: RenderChartOptions): string;
65
+ /**
66
+ * Render a chart and return machine-readable evidence about what actually
67
+ * rendered — mark counts by scene type, resolved axis domains, emptiness,
68
+ * legend/annotation counts, and the accessible name. The evidence is computed
69
+ * from the same scene graph the SVG converter walks, so it is ground truth a
70
+ * non-visual caller (an agent repair loop, a CI assertion) can quote without
71
+ * pixel inspection. Exposed through the MCP `renderChart` tool response.
72
+ */
73
+ export declare function renderChartWithEvidence(component: ChartName, props: Datum, options?: RenderChartOptions): {
74
+ svg: string;
75
+ evidence: RenderEvidence;
76
+ };
64
77
  export interface RenderToImageOptions {
65
78
  /** Output format */
66
79
  format?: "png" | "jpeg";
@@ -7,6 +7,7 @@ import type { Datum } from "../charts/shared/datumTypes";
7
7
  */
8
8
  import * as React from "react";
9
9
  import type { SemioticTheme } from "../store/ThemeStore";
10
+ import { type AutoPlaceAnnotations } from "../recipes/annotationLayout";
10
11
  interface AnnotationScales {
11
12
  x?: (v: any) => number;
12
13
  y?: (v: any) => number;
@@ -30,6 +31,7 @@ interface AnnotationLayout {
30
31
  }
31
32
  export interface StaticAnnotationConfig {
32
33
  annotations?: Datum[];
34
+ autoPlaceAnnotations?: AutoPlaceAnnotations;
33
35
  scales: AnnotationScales;
34
36
  layout: AnnotationLayout;
35
37
  theme: SemioticTheme;