@opendata-ai/openchart-vanilla 9.0.0-rc.1 → 9.0.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 (41) hide show
  1. package/README.md +10 -0
  2. package/dist/{chunk-T6IPHUN4.js → chunk-42WVDS3V.js} +186 -38
  3. package/dist/chunk-42WVDS3V.js.map +1 -0
  4. package/dist/{chunk-46E3QB6O.js → chunk-6GRMMSQA.js} +2 -2
  5. package/dist/{chunk-A5C4VCUO.js → chunk-7XFFPRQ7.js} +13 -4
  6. package/dist/chunk-7XFFPRQ7.js.map +1 -0
  7. package/dist/chunk-E3ETKTJQ.js +130 -0
  8. package/dist/chunk-E3ETKTJQ.js.map +1 -0
  9. package/dist/{chunk-5ZLSMZRM.js → chunk-HQ5GADZ4.js} +9 -8
  10. package/dist/{chunk-5ZLSMZRM.js.map → chunk-HQ5GADZ4.js.map} +1 -1
  11. package/dist/{chunk-ERPYVYFW.js → chunk-NGNHQOXO.js} +1065 -972
  12. package/dist/chunk-NGNHQOXO.js.map +1 -0
  13. package/dist/{chunk-RBXIZJPE.js → chunk-OEJHSKFZ.js} +2 -2
  14. package/dist/{chunk-CMIJA63X.js → chunk-RWP23N4D.js} +3 -3
  15. package/dist/chunk-SKQAAHHR.js +533 -0
  16. package/dist/chunk-SKQAAHHR.js.map +1 -0
  17. package/dist/{chunk-NLKQ5AOA.js → chunk-XR4B3SPC.js} +70 -30
  18. package/dist/chunk-XR4B3SPC.js.map +1 -0
  19. package/dist/export-gif.js +4 -4
  20. package/dist/graph-3d/index.js +4 -4
  21. package/dist/index.d.ts +41 -51
  22. package/dist/index.js +85 -216
  23. package/dist/index.js.map +1 -1
  24. package/dist/simulation-worker.js +26 -26
  25. package/dist/static.d.ts +10 -21
  26. package/dist/static.js +417 -118
  27. package/dist/static.js.map +1 -1
  28. package/dist/story/index.js +7 -7
  29. package/dist/styles.css.map +1 -1
  30. package/package.json +4 -7
  31. package/dist/chunk-6YPRYQKD.js +0 -297
  32. package/dist/chunk-6YPRYQKD.js.map +0 -1
  33. package/dist/chunk-A5C4VCUO.js.map +0 -1
  34. package/dist/chunk-ERPYVYFW.js.map +0 -1
  35. package/dist/chunk-FFP5GXIP.js +0 -45
  36. package/dist/chunk-FFP5GXIP.js.map +0 -1
  37. package/dist/chunk-NLKQ5AOA.js.map +0 -1
  38. package/dist/chunk-T6IPHUN4.js.map +0 -1
  39. /package/dist/{chunk-46E3QB6O.js.map → chunk-6GRMMSQA.js.map} +0 -0
  40. /package/dist/{chunk-RBXIZJPE.js.map → chunk-OEJHSKFZ.js.map} +0 -0
  41. /package/dist/{chunk-CMIJA63X.js.map → chunk-RWP23N4D.js.map} +0 -0
@@ -2,8 +2,27 @@ import {
2
2
  XLINK_NS,
3
3
  applyTextStyle,
4
4
  createSVGElement,
5
+ defaultElementFactory,
5
6
  setAttrs
6
- } from "./chunk-FFP5GXIP.js";
7
+ } from "./chunk-E3ETKTJQ.js";
8
+
9
+ // src/svg-ids.ts
10
+ function createIdScope(prefix = "") {
11
+ let counter = 0;
12
+ return { prefix, next: (kind) => `${prefix ? `${prefix}-` : ""}${kind}-${counter++}` };
13
+ }
14
+ var pageIdScope = createIdScope();
15
+
16
+ // src/render-context.ts
17
+ function createRenderContext(opts = {}) {
18
+ return {
19
+ factory: opts.factory ?? defaultElementFactory,
20
+ ids: opts.ids ?? pageIdScope,
21
+ marks: { gradientMap: /* @__PURE__ */ new Map(), patternMap: /* @__PURE__ */ new Map(), surface: "" },
22
+ interactive: opts.interactive ?? true,
23
+ precision: opts.precision === void 0 ? 3 : opts.precision
24
+ };
25
+ }
7
26
 
8
27
  // src/motion/easing.ts
9
28
  function linear(t) {
@@ -27,8 +46,8 @@ import {
27
46
  truncateToWidth,
28
47
  wrapText
29
48
  } from "@opendata-ai/openchart-core";
30
- function renderChromeElement(parent, element, className, chromeKey, measureText, uppercase = false) {
31
- const text = createSVGElement("text");
49
+ function renderChromeElement(parent, element, className, chromeKey, measureText, uppercase = false, ctx = createRenderContext()) {
50
+ const text = createSVGElement("text", ctx.factory);
32
51
  setAttrs(text, { x: element.x, y: element.y + textAscent(element.style.fontSize) });
33
52
  applyTextStyle(text, element.style);
34
53
  text.setAttribute("class", className);
@@ -63,7 +82,7 @@ function renderChromeElement(parent, element, className, chromeKey, measureText,
63
82
  } else {
64
83
  const lineHeight = element.style.fontSize * (element.style.lineHeight ?? 1.3);
65
84
  for (let i = 0; i < lines.length; i++) {
66
- const tspan = createSVGElement("tspan");
85
+ const tspan = createSVGElement("tspan", ctx.factory);
67
86
  setAttrs(tspan, { x: element.x, dy: i === 0 ? 0 : lineHeight });
68
87
  tspan.textContent = lines[i];
69
88
  text.appendChild(tspan);
@@ -71,12 +90,12 @@ function renderChromeElement(parent, element, className, chromeKey, measureText,
71
90
  }
72
91
  parent.appendChild(text);
73
92
  }
74
- function renderChrome(parent, layout) {
75
- const g = createSVGElement("g");
93
+ function renderChrome(parent, layout, interactive = true, ctx = createRenderContext()) {
94
+ const g = createSVGElement("g", ctx.factory);
76
95
  g.setAttribute("class", "oc-chrome");
77
96
  const { chrome, measureText } = layout;
78
97
  if (chrome.rule) {
79
- const rule = createSVGElement("rect");
98
+ const rule = createSVGElement("rect", ctx.factory);
80
99
  rule.setAttribute("class", "oc-chrome-rule");
81
100
  setAttrs(rule, {
82
101
  x: chrome.rule.x,
@@ -89,14 +108,14 @@ function renderChrome(parent, layout) {
89
108
  g.appendChild(rule);
90
109
  }
91
110
  if (chrome.eyebrow && chrome.rule) {
92
- renderChromeElement(g, chrome.eyebrow, "oc-eyebrow", "eyebrow", measureText, true);
111
+ renderChromeElement(g, chrome.eyebrow, "oc-eyebrow", "eyebrow", measureText, true, ctx);
93
112
  } else if (chrome.eyebrow) {
94
113
  const eyebrow = chrome.eyebrow;
95
114
  const dotR = 3;
96
115
  const dotGap = 8;
97
116
  const dotX = eyebrow.x + dotR;
98
117
  const dotY = eyebrow.y + eyebrow.style.fontSize * 0.42;
99
- const dot = createSVGElement("circle");
118
+ const dot = createSVGElement("circle", ctx.factory);
100
119
  dot.setAttribute("class", "oc-eyebrow-dot");
101
120
  setAttrs(dot, { cx: dotX, cy: dotY, r: dotR });
102
121
  dot.setAttribute("fill", eyebrow.style.fill ?? "currentColor");
@@ -105,13 +124,13 @@ function renderChrome(parent, layout) {
105
124
  ...eyebrow,
106
125
  x: eyebrow.x + dotR * 2 + dotGap
107
126
  };
108
- renderChromeElement(g, shifted, "oc-eyebrow", "eyebrow", measureText, true);
127
+ renderChromeElement(g, shifted, "oc-eyebrow", "eyebrow", measureText, true, ctx);
109
128
  }
110
129
  if (chrome.title) {
111
- renderChromeElement(g, chrome.title, "oc-title", "title", measureText);
130
+ renderChromeElement(g, chrome.title, "oc-title", "title", measureText, void 0, ctx);
112
131
  }
113
132
  if (chrome.subtitle) {
114
- renderChromeElement(g, chrome.subtitle, "oc-subtitle", "subtitle", measureText);
133
+ renderChromeElement(g, chrome.subtitle, "oc-subtitle", "subtitle", measureText, void 0, ctx);
115
134
  }
116
135
  const bottomOffset = layout.chrome.bottomAnchorY ?? layout.area.y + layout.area.height;
117
136
  const bandHeight = layout.chrome.noteBandHeight ?? computeNoteBandHeight(layout.chrome, layout.theme);
@@ -128,17 +147,17 @@ function renderChrome(parent, layout) {
128
147
  lineHeight: FOOTNOTE_LINE_HEIGHT,
129
148
  textAnchor: "start"
130
149
  };
131
- const list = createSVGElement("g");
150
+ const list = createSVGElement("g", ctx.factory);
132
151
  list.setAttribute("role", "list");
133
152
  list.setAttribute("aria-label", "Annotation notes, in source order");
134
153
  g.appendChild(list);
135
154
  for (let i = 0; i < chrome.footnotes.length; i++) {
136
155
  const f = chrome.footnotes[i];
137
156
  const y = bottomOffset + layout.theme.spacing.chartToFooter + textAscent(fontSize) + noteLine * lineHeight;
138
- const el = createSVGElement("text");
157
+ const el = createSVGElement("text", ctx.factory);
139
158
  el.setAttribute("class", "oc-footnotes");
140
159
  el.setAttribute("role", "listitem");
141
- if (!layout.a11y.hidden) el.setAttribute("tabindex", "0");
160
+ if (interactive && !layout.a11y.hidden) el.setAttribute("tabindex", "0");
142
161
  el.setAttribute(
143
162
  "aria-label",
144
163
  `${f.index}. ${f.text.replaceAll("**", "")}${f.subtitle ? `. ${f.subtitle.replaceAll("**", "")}` : ""}`
@@ -149,12 +168,12 @@ function renderChrome(parent, layout) {
149
168
  applyTextStyle(el, style);
150
169
  const lines = f.lines ?? [`${f.index}. ${f.text}`];
151
170
  lines.forEach((line, index) => {
152
- const span = createSVGElement("tspan");
171
+ const span = createSVGElement("tspan", ctx.factory);
153
172
  setAttrs(span, { x: pad, dy: index === 0 ? 0 : lineHeight });
154
173
  const runs = f.spans?.[index];
155
174
  if (runs) {
156
175
  for (const run of runs) {
157
- const part = createSVGElement("tspan");
176
+ const part = createSVGElement("tspan", ctx.factory);
158
177
  if (run.bold) part.setAttribute("font-weight", "700");
159
178
  part.textContent = run.text;
160
179
  span.appendChild(part);
@@ -169,7 +188,7 @@ function renderChrome(parent, layout) {
169
188
  let summaryLine = noteLine;
170
189
  for (const entry of chrome.seriesSummary ?? []) {
171
190
  const size = layout.theme.fonts.sizes.small;
172
- const el = createSVGElement("text");
191
+ const el = createSVGElement("text", ctx.factory);
173
192
  el.setAttribute("class", "oc-series-summary");
174
193
  el.setAttribute("data-series", entry.key);
175
194
  setAttrs(el, {
@@ -184,7 +203,7 @@ function renderChrome(parent, layout) {
184
203
  fill: entry.color
185
204
  });
186
205
  entry.lines.forEach((line, index) => {
187
- const span = createSVGElement("tspan");
206
+ const span = createSVGElement("tspan", ctx.factory);
188
207
  setAttrs(span, {
189
208
  x: layout.theme.spacing.padding,
190
209
  dy: index === 0 ? 0 : size * FOOTNOTE_LINE_HEIGHT
@@ -201,7 +220,9 @@ function renderChrome(parent, layout) {
201
220
  { ...chrome.source, y: bottomOffset + chrome.source.y + bandHeight },
202
221
  "oc-source",
203
222
  "source",
204
- measureText
223
+ measureText,
224
+ void 0,
225
+ ctx
205
226
  );
206
227
  }
207
228
  if (chrome.byline) {
@@ -210,7 +231,9 @@ function renderChrome(parent, layout) {
210
231
  { ...chrome.byline, y: bottomOffset + chrome.byline.y + bandHeight },
211
232
  "oc-byline",
212
233
  "byline",
213
- measureText
234
+ measureText,
235
+ void 0,
236
+ ctx
214
237
  );
215
238
  }
216
239
  if (chrome.footer) {
@@ -219,12 +242,22 @@ function renderChrome(parent, layout) {
219
242
  { ...chrome.footer, y: bottomOffset + chrome.footer.y + bandHeight },
220
243
  "oc-footer",
221
244
  "footer",
222
- measureText
245
+ measureText,
246
+ void 0,
247
+ ctx
223
248
  );
224
249
  }
225
250
  if (chrome.brand) {
226
251
  const brandY = bottomOffset + chrome.brand.y + bandHeight;
227
- renderChromeElement(g, { ...chrome.brand, y: brandY }, "oc-brand", "brand", measureText);
252
+ renderChromeElement(
253
+ g,
254
+ { ...chrome.brand, y: brandY },
255
+ "oc-brand",
256
+ "brand",
257
+ measureText,
258
+ void 0,
259
+ ctx
260
+ );
228
261
  }
229
262
  parent.appendChild(g);
230
263
  }
@@ -232,19 +265,21 @@ function renderChrome(parent, layout) {
232
265
  // src/renderers/brand.ts
233
266
  import { computeNoteBandHeight as computeNoteBandHeight2 } from "@opendata-ai/openchart-core";
234
267
  var BRAND_URL = "https://tryopendata.ai";
235
- function renderAttributionBrand(parent, chrome, bottomOffset, measureText, includeCustom = true) {
268
+ function renderAttributionBrand(parent, chrome, bottomOffset, measureText, includeCustom = true, ctx = createRenderContext()) {
236
269
  if (includeCustom && chrome.brand) {
237
270
  renderChromeElement(
238
271
  parent,
239
272
  { ...chrome.brand, y: bottomOffset + chrome.brand.y },
240
273
  "oc-brand",
241
274
  "brand",
242
- measureText
275
+ measureText,
276
+ void 0,
277
+ ctx
243
278
  );
244
279
  }
245
280
  const mark = chrome.watermark;
246
281
  if (!mark) return;
247
- const link = createSVGElement("a");
282
+ const link = createSVGElement("a", ctx.factory);
248
283
  link.setAttribute("href", BRAND_URL);
249
284
  link.setAttributeNS(XLINK_NS, "xlink:href", BRAND_URL);
250
285
  link.setAttribute("target", "_blank");
@@ -256,14 +291,16 @@ function renderAttributionBrand(parent, chrome, bottomOffset, measureText, inclu
256
291
  { ...mark, y: bottomOffset + mark.y },
257
292
  "oc-watermark",
258
293
  "watermark",
259
- measureText
294
+ measureText,
295
+ void 0,
296
+ ctx
260
297
  );
261
298
  parent.appendChild(link);
262
299
  }
263
- function renderBrand(parent, layout) {
300
+ function renderBrand(parent, layout, ctx = createRenderContext()) {
264
301
  const bandHeight = layout.chrome.noteBandHeight ?? computeNoteBandHeight2(layout.chrome, layout.theme);
265
302
  const bottomOffset = (layout.chrome.bottomAnchorY ?? layout.area.y + layout.area.height) + bandHeight;
266
- renderAttributionBrand(parent, layout.chrome, bottomOffset, layout.measureText, false);
303
+ renderAttributionBrand(parent, layout.chrome, bottomOffset, layout.measureText, false, ctx);
267
304
  }
268
305
 
269
306
  // src/theme-tokens.ts
@@ -432,6 +469,9 @@ function stampThemeProperties(el, theme, kind) {
432
469
  }
433
470
 
434
471
  export {
472
+ createIdScope,
473
+ pageIdScope,
474
+ createRenderContext,
435
475
  renderChromeElement,
436
476
  renderChrome,
437
477
  renderAttributionBrand,
@@ -445,4 +485,4 @@ export {
445
485
  clamp01,
446
486
  lerp
447
487
  };
448
- //# sourceMappingURL=chunk-NLKQ5AOA.js.map
488
+ //# sourceMappingURL=chunk-XR4B3SPC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/svg-ids.ts","../src/render-context.ts","../src/motion/easing.ts","../src/renderers/chrome.ts","../src/renderers/brand.ts","../src/theme-tokens.ts"],"sourcesContent":["/** A monotonic page scope prevents fragment-reference collisions across live charts. */\nexport interface IdScope {\n next(kind: string): string;\n readonly prefix: string;\n}\nexport function createIdScope(prefix = ''): IdScope {\n let counter = 0;\n return { prefix, next: (kind) => `${prefix ? `${prefix}-` : ''}${kind}-${counter++}` };\n}\nexport const pageIdScope = createIdScope();\n/** Compatibility entry point for one release; new renderers use their context. */\nexport function nextSvgId(kind: string): string {\n return pageIdScope.next(kind);\n}\n","import type { ResolvedAnimation } from '@opendata-ai/openchart-core';\nimport { defaultElementFactory, type ElementFactory } from './renderers/svg-dom';\nimport { type IdScope, pageIdScope } from './svg-ids';\n\nexport { createIdScope, type IdScope, pageIdScope } from './svg-ids';\nexport interface MarkRenderState {\n animation?: ResolvedAnimation;\n gradientMap: Map<string, string>;\n patternMap: Map<string, string>;\n surface: string;\n}\nexport interface RenderContext {\n factory: ElementFactory;\n ids: IdScope;\n marks: MarkRenderState;\n interactive: boolean;\n precision: number | null;\n}\nexport function createRenderContext(\n opts: {\n factory?: ElementFactory;\n ids?: IdScope;\n interactive?: boolean;\n precision?: number | null;\n } = {},\n): RenderContext {\n return {\n factory: opts.factory ?? defaultElementFactory,\n ids: opts.ids ?? pageIdScope,\n marks: { gradientMap: new Map(), patternMap: new Map(), surface: '' },\n interactive: opts.interactive ?? true,\n precision: opts.precision === undefined ? 3 : opts.precision,\n };\n}\n","/**\n * Shared easing and interpolation primitives.\n *\n * Single source of truth for the hand-rolled easings used by the canvas\n * scheduler (motion/tween.ts), the update-transition driver (transition.ts)\n * and the story tweens (story/tween.ts). No `d3-ease` dependency.\n */\n\n/** Linear (identity) easing. Required for stacked/segmented handoffs. */\nexport function linear(t: number): number {\n return t;\n}\n\n/** Cubic-out: decelerates into place. Maps to `'snappy'`. */\nexport function cubicOut(t: number): number {\n const f = 1 - t;\n return 1 - f * f * f;\n}\n\n/** Cubic-in-out: eases in and out. Maps to `'smooth'`. */\nexport function cubicInOut(t: number): number {\n return t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;\n}\n\nexport const clamp01 = (t: number): number => Math.min(1, Math.max(0, t));\n\nexport const lerp = (a: number, b: number, t: number): number => a + (b - a) * t;\n","import { createRenderContext, type RenderContext } from '../render-context';\n/**\n * Chrome rendering: title, subtitle, source, byline, footer.\n */\n\nimport type {\n ChartLayout,\n MeasureTextFn,\n ResolvedChromeElement,\n} from '@opendata-ai/openchart-core';\nimport {\n computeNoteBandHeight,\n FOOTNOTE_LINE_HEIGHT,\n textAscent,\n truncateToWidth,\n wrapText,\n} from '@opendata-ai/openchart-core';\nimport { applyTextStyle, createSVGElement, setAttrs } from './svg-dom';\n\nexport function renderChromeElement(\n parent: SVGElement,\n element: ResolvedChromeElement,\n className: string,\n chromeKey: string,\n measureText?: MeasureTextFn,\n uppercase = false,\n ctx: RenderContext = createRenderContext(),\n): void {\n const text = createSVGElement('text', ctx.factory);\n // element.y is the TOP of the text box; convert to the alphabetic baseline\n // here instead of relying on dominant-baseline:hanging, which WebKit\n // positions from different font metrics and never inherits into tspans.\n setAttrs(text, { x: element.x, y: element.y + textAscent(element.style.fontSize) });\n applyTextStyle(text, element.style);\n text.setAttribute('class', className);\n text.setAttribute('data-chrome-key', chromeKey);\n\n // happy-dom doesn't apply CSS text-transform inside SVG measurement, so\n // pre-uppercase the rendered text for elements that style as uppercase.\n // Browsers honor the CSS rule too, so this is double-applied harmlessly.\n const renderedText = uppercase ? element.text.toUpperCase() : element.text;\n\n const lines = wrapText(\n renderedText,\n element.style.fontSize,\n element.style.fontWeight,\n element.maxWidth,\n measureText,\n );\n\n // Cap wrapped output to maxLines, truncating the last kept line with an\n // ellipsis so it fits maxWidth. Only when the natural wrap exceeds the cap.\n let truncated = false;\n if (element.maxLines != null && lines.length > element.maxLines) {\n truncated = true;\n lines.length = element.maxLines;\n const lastIndex = element.maxLines - 1;\n const measure = measureText\n ? (text: string, fontSize: number, fontWeight?: number) =>\n measureText(text, fontSize, fontWeight).width\n : undefined;\n // Content was dropped, so the last kept line always gets an ellipsis.\n // Append it first, then shrink to fit maxWidth if the combined string\n // overflows.\n const withEllipsis = `${lines[lastIndex]}…`;\n lines[lastIndex] = truncateToWidth(\n withEllipsis,\n element.maxWidth,\n element.style.fontSize,\n element.style.fontWeight,\n measure,\n );\n }\n\n if (lines.length === 1 && !truncated) {\n text.textContent = renderedText;\n } else if (lines.length === 1) {\n text.textContent = lines[0];\n } else {\n const lineHeight = element.style.fontSize * (element.style.lineHeight ?? 1.3);\n for (let i = 0; i < lines.length; i++) {\n const tspan = createSVGElement('tspan', ctx.factory);\n setAttrs(tspan, { x: element.x, dy: i === 0 ? 0 : lineHeight });\n tspan.textContent = lines[i];\n text.appendChild(tspan);\n }\n }\n\n parent.appendChild(text);\n}\n\nexport function renderChrome(\n parent: SVGElement,\n layout: ChartLayout,\n interactive = true,\n ctx: RenderContext = createRenderContext(),\n): void {\n const g = createSVGElement('g', ctx.factory);\n g.setAttribute('class', 'oc-chrome');\n\n const { chrome, measureText } = layout;\n\n // Editorial rule: a short colored bar above the top chrome block.\n if (chrome.rule) {\n const rule = createSVGElement('rect', ctx.factory);\n rule.setAttribute('class', 'oc-chrome-rule');\n setAttrs(rule, {\n x: chrome.rule.x,\n y: chrome.rule.y,\n width: chrome.rule.width,\n height: chrome.rule.thickness,\n });\n rule.setAttribute('fill', chrome.rule.color);\n rule.setAttribute('shape-rendering', 'crispEdges');\n g.appendChild(rule);\n }\n\n // Top chrome: render at their stored y positions (already absolute)\n if (chrome.eyebrow && chrome.rule) {\n // The rule already carries the accent above the block; a dot as well is\n // two pieces of furniture saying the same thing.\n renderChromeElement(g, chrome.eyebrow, 'oc-eyebrow', 'eyebrow', measureText, true, ctx);\n } else if (chrome.eyebrow) {\n // Leading accent dot — matches the editorial design system mock.\n // eyebrow.y is the top of the text box. Visual center is roughly\n // y + fontSize * 0.55 (cap height).\n const eyebrow = chrome.eyebrow;\n const dotR = 3;\n const dotGap = 8;\n const dotX = eyebrow.x + dotR;\n const dotY = eyebrow.y + eyebrow.style.fontSize * 0.42;\n const dot = createSVGElement('circle', ctx.factory);\n dot.setAttribute('class', 'oc-eyebrow-dot');\n setAttrs(dot, { cx: dotX, cy: dotY, r: dotR });\n dot.setAttribute('fill', eyebrow.style.fill ?? 'currentColor');\n g.appendChild(dot);\n\n const shifted: ResolvedChromeElement = {\n ...eyebrow,\n x: eyebrow.x + dotR * 2 + dotGap,\n };\n renderChromeElement(g, shifted, 'oc-eyebrow', 'eyebrow', measureText, true, ctx);\n }\n if (chrome.title) {\n renderChromeElement(g, chrome.title, 'oc-title', 'title', measureText, undefined, ctx);\n }\n if (chrome.subtitle) {\n renderChromeElement(g, chrome.subtitle, 'oc-subtitle', 'subtitle', measureText, undefined, ctx);\n }\n\n const bottomOffset = layout.chrome.bottomAnchorY ?? layout.area.y + layout.area.height;\n\n // Footnotes from auto-thinned annotations, rendered above source/byline.\n // Each footnote gets its own line to avoid horizontal overflow.\n const bandHeight =\n layout.chrome.noteBandHeight ?? computeNoteBandHeight(layout.chrome, layout.theme);\n let noteLine = 0;\n if (chrome.footnotes && chrome.footnotes.length > 0) {\n const fontSize = layout.theme.fonts.sizes.small;\n const pad = layout.theme.spacing.padding;\n const lineHeight = fontSize * FOOTNOTE_LINE_HEIGHT;\n const style = {\n fontFamily: layout.theme.fonts.family,\n fontSize,\n fontWeight: layout.theme.fonts.weights.normal,\n fill: layout.theme.chrome.source.color,\n lineHeight: FOOTNOTE_LINE_HEIGHT,\n textAnchor: 'start' as const,\n };\n\n const list = createSVGElement('g', ctx.factory);\n list.setAttribute('role', 'list');\n list.setAttribute('aria-label', 'Annotation notes, in source order');\n g.appendChild(list);\n for (let i = 0; i < chrome.footnotes.length; i++) {\n const f = chrome.footnotes[i];\n const y =\n bottomOffset +\n layout.theme.spacing.chartToFooter +\n textAscent(fontSize) +\n noteLine * lineHeight;\n const el = createSVGElement('text', ctx.factory);\n el.setAttribute('class', 'oc-footnotes');\n el.setAttribute('role', 'listitem');\n if (interactive && !layout.a11y.hidden) el.setAttribute('tabindex', '0');\n el.setAttribute(\n 'aria-label',\n `${f.index}. ${f.text.replaceAll('**', '')}${f.subtitle ? `. ${f.subtitle.replaceAll('**', '')}` : ''}`,\n );\n if (f.specIndex !== undefined) el.setAttribute('data-note-spec-index', String(f.specIndex));\n if (f.id !== undefined) el.setAttribute('data-note-id', f.id);\n setAttrs(el, { x: pad, y });\n applyTextStyle(el, style);\n const lines = f.lines ?? [`${f.index}. ${f.text}`];\n lines.forEach((line, index) => {\n const span = createSVGElement('tspan', ctx.factory);\n setAttrs(span, { x: pad, dy: index === 0 ? 0 : lineHeight });\n const runs = f.spans?.[index];\n if (runs) {\n for (const run of runs) {\n const part = createSVGElement('tspan', ctx.factory);\n if (run.bold) part.setAttribute('font-weight', '700');\n part.textContent = run.text;\n span.appendChild(part);\n }\n } else span.textContent = line;\n el.appendChild(span);\n });\n noteLine += f.lines?.length ?? 1;\n list.appendChild(el);\n }\n }\n\n let summaryLine = noteLine;\n for (const entry of chrome.seriesSummary ?? []) {\n const size = layout.theme.fonts.sizes.small;\n const el = createSVGElement('text', ctx.factory);\n el.setAttribute('class', 'oc-series-summary');\n el.setAttribute('data-series', entry.key);\n setAttrs(el, {\n x: layout.theme.spacing.padding,\n y:\n bottomOffset +\n layout.theme.spacing.chartToFooter +\n textAscent(size) +\n summaryLine * size * FOOTNOTE_LINE_HEIGHT,\n });\n applyTextStyle(el, {\n fontFamily: layout.theme.fonts.family,\n fontSize: size,\n fontWeight: 500,\n lineHeight: FOOTNOTE_LINE_HEIGHT,\n fill: entry.color,\n });\n entry.lines.forEach((line, index) => {\n const span = createSVGElement('tspan', ctx.factory);\n setAttrs(span, {\n x: layout.theme.spacing.padding,\n dy: index === 0 ? 0 : size * FOOTNOTE_LINE_HEIGHT,\n });\n span.textContent = line;\n el.appendChild(span);\n });\n summaryLine += entry.lines.length;\n g.appendChild(el);\n }\n\n if (chrome.source) {\n renderChromeElement(\n g,\n { ...chrome.source, y: bottomOffset + chrome.source.y + bandHeight },\n 'oc-source',\n 'source',\n measureText,\n undefined,\n ctx,\n );\n }\n if (chrome.byline) {\n renderChromeElement(\n g,\n { ...chrome.byline, y: bottomOffset + chrome.byline.y + bandHeight },\n 'oc-byline',\n 'byline',\n measureText,\n undefined,\n ctx,\n );\n }\n if (chrome.footer) {\n renderChromeElement(\n g,\n { ...chrome.footer, y: bottomOffset + chrome.footer.y + bandHeight },\n 'oc-footer',\n 'footer',\n measureText,\n undefined,\n ctx,\n );\n }\n if (chrome.brand) {\n const brandY = bottomOffset + chrome.brand.y + bandHeight;\n renderChromeElement(\n g,\n { ...chrome.brand, y: brandY },\n 'oc-brand',\n 'brand',\n measureText,\n undefined,\n ctx,\n );\n }\n\n parent.appendChild(g);\n}\n","/** Shared measured attribution painting for SVG visualizations. */\nimport type { ChartLayout, MeasureTextFn, ResolvedChrome } from '@opendata-ai/openchart-core';\nimport { computeNoteBandHeight } from '@opendata-ai/openchart-core';\nimport { createRenderContext, type RenderContext } from '../render-context';\nimport { renderChromeElement } from './chrome';\nimport { createSVGElement, XLINK_NS } from './svg-dom';\n\nconst BRAND_URL = 'https://tryopendata.ai';\n\n/** Paint the exact portable footer mark resolved by computeChrome. */\nexport function renderAttributionBrand(\n parent: SVGElement,\n chrome: ResolvedChrome,\n bottomOffset: number,\n measureText?: MeasureTextFn,\n includeCustom = true,\n ctx: RenderContext = createRenderContext(),\n): void {\n if (includeCustom && chrome.brand) {\n renderChromeElement(\n parent,\n { ...chrome.brand, y: bottomOffset + chrome.brand.y },\n 'oc-brand',\n 'brand',\n measureText,\n undefined,\n ctx,\n );\n }\n const mark = chrome.watermark;\n if (!mark) return;\n const link = createSVGElement('a', ctx.factory);\n link.setAttribute('href', BRAND_URL);\n link.setAttributeNS(XLINK_NS, 'xlink:href', BRAND_URL);\n link.setAttribute('target', '_blank');\n link.setAttribute('rel', 'noopener');\n link.setAttribute('class', 'oc-chrome-ref');\n link.setAttribute('opacity', '0.55');\n renderChromeElement(\n link,\n { ...mark, y: bottomOffset + mark.y },\n 'oc-watermark',\n 'watermark',\n measureText,\n undefined,\n ctx,\n );\n parent.appendChild(link);\n}\n\nexport function renderBrand(\n parent: SVGElement,\n layout: ChartLayout,\n ctx: RenderContext = createRenderContext(),\n): void {\n const bandHeight =\n layout.chrome.noteBandHeight ?? computeNoteBandHeight(layout.chrome, layout.theme);\n const bottomOffset =\n (layout.chrome.bottomAnchorY ?? layout.area.y + layout.area.height) + bandHeight;\n renderAttributionBrand(parent, layout.chrome, bottomOffset, layout.measureText, false, ctx);\n}\n","/**\n * Project authored theme leaves to scoped CSS custom properties.\n *\n * Unauthored values remain in tokens.css / dark.css, leaving host CSS in\n * control. Derived neutral values follow authored text/background changes.\n */\n\nimport type { ResolvedTheme, ThemeConfig } from '@opendata-ai/openchart-core';\nimport { adaptForLightLineStroke, cssTokenDefault } from '@opendata-ai/openchart-core';\n\n/**\n * The opaque surface a theme paints on. A transparent theme background has no\n * color of its own, so it resolves to the static `--oc-bg` token for the mode --\n * the same value the engine's knockout strokes are cut in. Resolved once in\n * core, on `colors.neutral.surface`; this is a named read of it.\n */\nexport function resolvedSurface(theme: ResolvedTheme): string {\n return theme.colors.neutral.surface;\n}\n\ntype StyledElement = HTMLElement | SVGElement;\nconst stamped = new WeakMap<\n StyledElement,\n Map<string, { previous: string; priority: string; value: string }>\n>();\n\n/** Read the host cascade without an earlier authored token, then restore it synchronously. */\nexport function readWithoutThemeStamp<T>(el: StyledElement, name: string, read: () => T): T {\n const entry = stamped.get(el)?.get(name);\n const value = el.style.getPropertyValue(name);\n if (!entry || value !== entry.value) return read();\n const priority = el.style.getPropertyPriority(name);\n try {\n if (entry.previous) el.style.setProperty(name, entry.previous, entry.priority);\n else el.style.removeProperty(name);\n return read();\n } finally {\n el.style.setProperty(name, value, priority);\n }\n}\n\n/** Stamp only authored theme leaves. Defaults stay in CSS so host rules can override them. */\nexport function stampThemeProperties(\n el: StyledElement,\n theme: ResolvedTheme,\n kind?: 'table',\n): void {\n el.classList.toggle('oc-dark', theme.isDark);\n const accent = theme.colors.categorical[0] ?? cssTokenDefault('--oc-accent', 'light');\n const bg = resolvedSurface(theme);\n\n const n = theme.colors.neutral;\n\n const props: [string, string][] = [\n ['--oc-font-family', theme.fonts.family],\n ['--oc-font-mono', theme.fonts.mono],\n ['--oc-title-size', `${theme.chrome.title.fontSize}px`],\n ['--oc-title-weight', `${theme.chrome.title.fontWeight}`],\n ['--oc-subtitle-size', `${theme.chrome.subtitle.fontSize}px`],\n ['--oc-subtitle-weight', `${theme.chrome.subtitle.fontWeight}`],\n ['--oc-source-size', `${theme.chrome.source.fontSize}px`],\n ['--oc-source-weight', `${theme.chrome.source.fontWeight}`],\n ['--oc-body-size', `${theme.fonts.sizes.body}px`],\n ['--oc-endpoint-label-size', `${theme.fonts.sizes.endpointLabel}px`],\n ['--oc-endpoint-value-size', `${theme.fonts.sizes.endpointValue}px`],\n ['--oc-endpoint-entry-gap', `${theme.spacing.endpointEntryGap}px`],\n ['--oc-endpoint-value-gap', `${theme.spacing.endpointValueGap}px`],\n ['--oc-endpoint-column-gap', `${theme.spacing.endpointColumnGap}px`],\n ['--oc-eyebrow-size', `${theme.chrome.eyebrow.fontSize}px`],\n ['--oc-eyebrow-weight', `${theme.chrome.eyebrow.fontWeight}`],\n ['--oc-bg', bg],\n ['--oc-text', theme.colors.text],\n ['--oc-text-muted', theme.colors.axis],\n // Secondary grays are derived from the theme's own text/background pair\n // (ResolvedTheme.colors.neutral), so a warm or cool theme gets warm or\n // cool grays instead of zinc. One direction only: theme -> CSS.\n ['--oc-text-secondary', n.secondary],\n ['--oc-text-faint', n.faint],\n ['--oc-border', n.border],\n ['--oc-gray-100', n[100]],\n ['--oc-gray-200', n[200]],\n ['--oc-gray-300', n[300]],\n ['--oc-gray-400', n[400]],\n ['--oc-gray-600', n[600]],\n ['--oc-gray-800', n[800]],\n ['--oc-gridline', theme.colors.gridline],\n // --oc-axis is the hairline the axis line is drawn with, not the ink its\n // tick labels take (that is --oc-text-muted, above).\n ['--oc-axis', theme.colors.hairline],\n ['--oc-border-radius', `${theme.borderRadius}px`],\n ['--oc-accent', accent],\n ['--oc-accent-strong', adaptForLightLineStroke(accent)],\n ['--oc-positive', theme.colors.positive],\n ['--oc-negative', theme.colors.negative],\n ['--oc-space-2', `${theme.spacing.chromeGap * 2}px`],\n ['--oc-space-4', `${theme.spacing.padding}px`],\n ];\n\n const authored = theme._authored;\n const colors = authored?.colors && !Array.isArray(authored.colors) ? authored.colors : {};\n const neutralAuthored = colors.text !== undefined || colors.background !== undefined;\n const colorAuthored = (key: keyof Exclude<ThemeConfig['colors'], string[] | undefined>) =>\n colors[key] !== undefined;\n const chromeAuthored = (\n element: 'title' | 'subtitle' | 'source' | 'eyebrow',\n field: 'fontSize' | 'fontWeight',\n ) => {\n if (authored?.chrome?.[element]?.[field] !== undefined) return true;\n if (field === 'fontWeight' || element === 'eyebrow') return false;\n return authored?.fonts?.sizes?.[element === 'source' ? 'small' : element] !== undefined;\n };\n const paletteAuthored = Array.isArray(authored?.colors) || colors.categorical !== undefined;\n const enabled: Record<string, boolean> = {\n '--oc-font-family': authored?.fonts?.family !== undefined,\n '--oc-font-mono': authored?.fonts?.mono !== undefined,\n '--oc-title-size': chromeAuthored('title', 'fontSize'),\n '--oc-title-weight': chromeAuthored('title', 'fontWeight'),\n '--oc-subtitle-size': chromeAuthored('subtitle', 'fontSize'),\n '--oc-subtitle-weight': chromeAuthored('subtitle', 'fontWeight'),\n '--oc-source-size': chromeAuthored('source', 'fontSize'),\n '--oc-source-weight': chromeAuthored('source', 'fontWeight'),\n '--oc-body-size': authored?.fonts?.sizes?.body !== undefined,\n '--oc-endpoint-label-size': authored?.fonts?.sizes?.endpointLabel !== undefined,\n '--oc-endpoint-value-size': authored?.fonts?.sizes?.endpointValue !== undefined,\n '--oc-endpoint-entry-gap': authored?.spacing?.endpointEntryGap !== undefined,\n '--oc-endpoint-value-gap': authored?.spacing?.endpointValueGap !== undefined,\n '--oc-endpoint-column-gap': authored?.spacing?.endpointColumnGap !== undefined,\n '--oc-eyebrow-size': chromeAuthored('eyebrow', 'fontSize'),\n '--oc-eyebrow-weight': chromeAuthored('eyebrow', 'fontWeight'),\n '--oc-bg': colorAuthored('background'),\n '--oc-text': colorAuthored('text'),\n '--oc-text-muted': colorAuthored('axis') || (kind === 'table' && neutralAuthored),\n '--oc-text-secondary': neutralAuthored,\n '--oc-text-faint': neutralAuthored,\n '--oc-border': neutralAuthored || (kind === 'table' && colorAuthored('gridline')),\n '--oc-gridline': colorAuthored('gridline'),\n '--oc-axis': colorAuthored('hairline'),\n '--oc-border-radius': authored?.borderRadius !== undefined,\n '--oc-accent': paletteAuthored,\n '--oc-accent-strong': paletteAuthored,\n '--oc-positive': colorAuthored('positive'),\n '--oc-negative': colorAuthored('negative'),\n '--oc-space-2': authored?.spacing?.chromeGap !== undefined,\n '--oc-space-4': authored?.spacing?.padding !== undefined,\n };\n for (const key of [\n 'annotationLabel',\n 'annotationMuted',\n 'annotationLeader',\n 'annotationRule',\n 'annotationRangeFill',\n 'annotationMarkerFill',\n 'annotationPlate',\n ] as const) {\n const name = `--oc-${key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;\n props.push([name, theme.colors[key]]);\n enabled[name] =\n colorAuthored(key) ||\n ((key === 'annotationMarkerFill' || key === 'annotationPlate') && neutralAuthored);\n }\n for (const key of [\n 'gridlineZero',\n 'mapNoDataFill',\n 'mapNoDataHatch',\n 'mapInteriorBorder',\n 'mapOutlineBorder',\n ] as const) {\n const name = `--oc-${key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;\n if (theme.colors[key] !== undefined) props.push([name, theme.colors[key]]);\n enabled[name] = colorAuthored(key);\n }\n for (const level of [100, 200, 300, 400, 600, 800])\n enabled[`--oc-gray-${level}`] = neutralAuthored;\n if (kind === 'table') {\n if (!colorAuthored('axis')) props.find(([name]) => name === '--oc-text-muted')![1] = n[600];\n if (colorAuthored('gridline'))\n props.find(([name]) => name === '--oc-border')![1] = theme.colors.gridline;\n }\n const previous = stamped.get(el) ?? new Map();\n for (const [name, entry] of previous) {\n if (!enabled[name]) {\n // Do not erase a host change made since our last stamp.\n if (el.style.getPropertyValue(name) === entry.value) {\n if (entry.previous) el.style.setProperty(name, entry.previous, entry.priority);\n else el.style.removeProperty(name);\n }\n previous.delete(name);\n }\n }\n for (const [name, value] of props) {\n if (!enabled[name]) continue;\n const old = previous.get(name);\n previous.set(name, {\n previous: old?.previous ?? el.style.getPropertyValue(name),\n priority: old?.priority ?? el.style.getPropertyPriority(name),\n value,\n });\n el.style.setProperty(name, value);\n }\n stamped.set(el, previous);\n}\n"],"mappings":";;;;;;;;;AAKO,SAAS,cAAc,SAAS,IAAa;AAClD,MAAI,UAAU;AACd,SAAO,EAAE,QAAQ,MAAM,CAAC,SAAS,GAAG,SAAS,GAAG,MAAM,MAAM,EAAE,GAAG,IAAI,IAAI,SAAS,GAAG;AACvF;AACO,IAAM,cAAc,cAAc;;;ACSlC,SAAS,oBACd,OAKI,CAAC,GACU;AACf,SAAO;AAAA,IACL,SAAS,KAAK,WAAW;AAAA,IACzB,KAAK,KAAK,OAAO;AAAA,IACjB,OAAO,EAAE,aAAa,oBAAI,IAAI,GAAG,YAAY,oBAAI,IAAI,GAAG,SAAS,GAAG;AAAA,IACpE,aAAa,KAAK,eAAe;AAAA,IACjC,WAAW,KAAK,cAAc,SAAY,IAAI,KAAK;AAAA,EACrD;AACF;;;ACxBO,SAAS,OAAO,GAAmB;AACxC,SAAO;AACT;AAGO,SAAS,SAAS,GAAmB;AAC1C,QAAM,IAAI,IAAI;AACd,SAAO,IAAI,IAAI,IAAI;AACrB;AAGO,SAAS,WAAW,GAAmB;AAC5C,SAAO,IAAI,MAAM,IAAI,IAAI,IAAI,IAAI,KAAK,KAAK,IAAI,MAAM,IAAI;AAC3D;AAEO,IAAM,UAAU,CAAC,MAAsB,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;AAEjE,IAAM,OAAO,CAAC,GAAW,GAAW,MAAsB,KAAK,IAAI,KAAK;;;AChB/E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGA,SAAS,oBACd,QACA,SACA,WACA,WACA,aACA,YAAY,OACZ,MAAqB,oBAAoB,GACnC;AACN,QAAM,OAAO,iBAAiB,QAAQ,IAAI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oteBandHeight","computeNoteBandHeight"]}
@@ -6,10 +6,10 @@ import {
6
6
  exportGIF,
7
7
  isModuleNotFound,
8
8
  resolveRepeat
9
- } from "./chunk-CMIJA63X.js";
10
- import "./chunk-RBXIZJPE.js";
11
- import "./chunk-A5C4VCUO.js";
12
- import "./chunk-FFP5GXIP.js";
9
+ } from "./chunk-RWP23N4D.js";
10
+ import "./chunk-OEJHSKFZ.js";
11
+ import "./chunk-7XFFPRQ7.js";
12
+ import "./chunk-E3ETKTJQ.js";
13
13
  export {
14
14
  EASE_SMOOTH_SAMPLES,
15
15
  applyFrameState,
@@ -15,18 +15,18 @@ import {
15
15
  reheatAlpha,
16
16
  resolveHighlightTarget,
17
17
  seedNodePositions
18
- } from "../chunk-5ZLSMZRM.js";
18
+ } from "../chunk-HQ5GADZ4.js";
19
19
  import {
20
20
  AnimationScheduler,
21
21
  createTween,
22
22
  prefersReducedMotion,
23
23
  resolveEase
24
- } from "../chunk-46E3QB6O.js";
24
+ } from "../chunk-6GRMMSQA.js";
25
25
  import {
26
26
  linear,
27
27
  resolvedSurface
28
- } from "../chunk-NLKQ5AOA.js";
29
- import "../chunk-FFP5GXIP.js";
28
+ } from "../chunk-XR4B3SPC.js";
29
+ import "../chunk-E3ETKTJQ.js";
30
30
 
31
31
  // src/graph-3d/mount.ts
32
32
  import {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { ChartLayout, ChartSpec, CompileOptions, TableLayout, TableSpec, VizSpec } from '@opendata-ai/openchart-engine';
2
- import { BarListSpec, BarListLayout, ThemeConfig, DarkMode, ChartLayout, ChartSpec, LayerSpec, GraphSpec, GeoMapSpec, GeoMapLayout, DatasetBinding, DesignDiagnostic, GeoReaderSelection, GeoEntityRef, ReaderChangeMeta, DataRow, ReaderSelection, ReaderSliceSelection, ReaderSlice, RectMark, Mark, BarTableCell, CategoryTableCell, TableCell, FlagTableCell, HeatmapTableCell, ImageTableCell, SparklineTableCell, TextTableCell, SankeySpec, SankeyLayout, TableSpec, SortState, TableLayout, TileMapSpec, TileMapLayout, ResolvedYouDrawIt } from '@opendata-ai/openchart-core';
2
+ import { BarListSpec, BarListLayout, ThemeConfig, DarkMode, ChartLayout, ChartSpec, LayerSpec, GraphSpec, ResolvedAnimation, GeoMapSpec, GeoMapLayout, DatasetBinding, DesignDiagnostic, GeoReaderSelection, GeoEntityRef, ReaderChangeMeta, DataRow, ReaderSelection, ReaderSliceSelection, ReaderSlice, Mark, RectMark, BarTableCell, CategoryTableCell, TableCell, FlagTableCell, HeatmapTableCell, ImageTableCell, SparklineTableCell, TextTableCell, SankeySpec, SankeyLayout, TableSpec, SortState, TableLayout, TileMapSpec, TileMapLayout, ResolvedYouDrawIt } from '@opendata-ai/openchart-core';
3
3
  import { J as JPGExportOptions, S as SVGExportOptions, C as Camera, M as MountOptions, a as ChartInstance } from './mount-types-DeUCa2hy.js';
4
4
  export { E as ExportOptions, I as InteractionMode, P as PNGExportOptions, U as UpdateOptions, e as exportCSV, b as exportJPG, c as exportPNG, d as exportSVG, f as exportSVGWithFonts, r as resolveInteractionMode } from './mount-types-DeUCa2hy.js';
5
5
  import { G as GraphMountOptions, a as GraphInstance } from './renderer-registry-Bu22Roek.js';
@@ -188,13 +188,44 @@ declare function createGraph(container: HTMLElement, spec: GraphSpec, options?:
188
188
  declare function createSimulationWorker(): Worker;
189
189
 
190
190
  /**
191
- * Map camera utilities: zoom, pan, and focus for map visualizations.
191
+ * Shared SVG DOM helpers used across the per-concern renderers.
192
192
  *
193
- * Reuses the existing camera-math infrastructure from the scrollytelling
194
- * system. The camera transform is applied as an SVG `transform` attribute
195
- * on the `[data-oc-map-camera]` group, never as a CSS transform.
193
+ * Pure, stateless utilities. No layout/theme knowledge.
196
194
  */
197
195
 
196
+ interface ElementFactory {
197
+ svg(tag: string): SVGElement;
198
+ html(tag: string): HTMLElement;
199
+ text(data: string): Text;
200
+ }
201
+
202
+ /** A monotonic page scope prevents fragment-reference collisions across live charts. */
203
+ interface IdScope {
204
+ next(kind: string): string;
205
+ readonly prefix: string;
206
+ }
207
+ declare function createIdScope(prefix?: string): IdScope;
208
+
209
+ interface MarkRenderState {
210
+ animation?: ResolvedAnimation;
211
+ gradientMap: Map<string, string>;
212
+ patternMap: Map<string, string>;
213
+ surface: string;
214
+ }
215
+ interface RenderContext {
216
+ factory: ElementFactory;
217
+ ids: IdScope;
218
+ marks: MarkRenderState;
219
+ interactive: boolean;
220
+ precision: number | null;
221
+ }
222
+ declare function createRenderContext(opts?: {
223
+ factory?: ElementFactory;
224
+ ids?: IdScope;
225
+ interactive?: boolean;
226
+ precision?: number | null;
227
+ }): RenderContext;
228
+
198
229
  interface GeoMapCameraOptions {
199
230
  /** Explicit camera scope for an authored inset or the root view. */
200
231
  viewId?: string;
@@ -409,17 +440,7 @@ declare function createGeoReaderBinding(): {
409
440
  destroy(): void;
410
441
  };
411
442
 
412
- /**
413
- * Mark rendering: dispatches to per-mark-type sub-renderers (line, area, rect,
414
- * arc, point, text, rule, tick).
415
- *
416
- * Mark renderers read module-level animation and gradient state so their
417
- * signatures stay `(mark, index) => SVGElement`. Callers must invoke
418
- * `setMarkRenderState()` before `renderMarks()` and `resetMarkRenderState()`
419
- * after.
420
- */
421
-
422
- type MarkRenderer<T extends Mark> = (mark: T, index: number) => SVGElement;
443
+ type MarkRenderer<T extends Mark> = (mark: T, index: number, ctx: RenderContext) => SVGElement;
423
444
  /**
424
445
  * Register a mark renderer for a specific mark type.
425
446
  * Built-in renderers are registered below for all chart types.
@@ -523,17 +544,6 @@ interface SankeyInstance {
523
544
  */
524
545
  declare function createSankey(container: HTMLElement, spec: SankeySpec, options?: SankeyMountOptions): SankeyInstance;
525
546
 
526
- /**
527
- * SVG renderer: converts a ChartLayout into SVG DOM elements.
528
- *
529
- * Creates an <svg> element with viewBox matching layout dimensions,
530
- * renders chrome (title/subtitle/source), axes, marks, annotations,
531
- * and legend. All styling via inline SVG attributes from layout data.
532
- *
533
- * This file is the orchestrator only. Each rendering concern lives in its
534
- * own module under `./renderers/`.
535
- */
536
-
537
547
  /**
538
548
  * Render a compiled ChartLayout into an SVG element and append it to a container.
539
549
  *
@@ -545,6 +555,8 @@ declare function renderChartSVG(layout: ChartLayout, container: HTMLElement, opt
545
555
  animate?: boolean;
546
556
  crosshair?: boolean;
547
557
  canvasMarks?: boolean;
558
+ interactive?: boolean;
559
+ context?: RenderContext;
548
560
  }): SVGElement;
549
561
 
550
562
  /**
@@ -728,28 +740,6 @@ interface TileMapInstance {
728
740
  */
729
741
  declare function createTileMap(container: HTMLElement, spec: TileMapSpec, options?: TileMapMountOptions): TileMapInstance;
730
742
 
731
- /**
732
- * "You draw it" interaction layer: the DOM/SVG overlay for the `youDrawIt`
733
- * spec option (NYT-style draw-then-reveal engagement format).
734
- *
735
- * SVG-space elements (hatched drawing region, reader's guess path, reveal
736
- * clip rect, pointer-capture overlay) render inside the chart's own SVG so
737
- * they clip and scale with it. The prompt text and skip-to-reveal button are
738
- * a small HTML overlay positioned over the drawing region, following the
739
- * series-search precedent (`series-search.ts`): a native `<button>` gets
740
- * keyboard semantics for free instead of hand-rolling SVG focus handling.
741
- *
742
- * State (the reader's in-progress guess) lives in this module's closure,
743
- * matching mount.ts's per-instance-closure convention (StrictMode double-
744
- * mount safe): a fresh `createYouDrawIt()` call gets a fresh closure.
745
- *
746
- * The guess is a dense trail, not a set of snapped samples: one entry per
747
- * 1/TRAIL_RESOLUTION of the drawing region's width, holding a data-space y.
748
- * Storing it as (region fraction, data value) rather than pixels keeps the
749
- * drawing intact across resize re-renders. Per-sample values for `onReveal`
750
- * are interpolated from the trail on demand.
751
- */
752
-
753
743
  interface YouDrawItOptions {
754
744
  /** The chart container (`.oc-root`). Must be position: relative. */
755
745
  container: HTMLElement;
@@ -778,6 +768,6 @@ interface YouDrawItController {
778
768
  * across re-renders so the in-progress drawing survives; `update()` re-syncs
779
769
  * geometry and re-wires pointer capture after each render.
780
770
  */
781
- declare function createYouDrawIt(options: YouDrawItOptions): YouDrawItController;
771
+ declare function createYouDrawIt(options: YouDrawItOptions, ctx?: RenderContext): YouDrawItController;
782
772
 
783
- export { type BarListInstance, type BarListMountOptions, CANVAS_DEFAULT_UPDATE_MAX_MARKS, Camera, ChartInstance, type ChartReaderProps, type ChartReaderSelection, DEFAULT_UPDATE_MAX_MARKS, type GeoMapCameraChangeMeta, type GeoMapCameraOptions, type GeoMapInstance, type GeoMapMarkEvent, type GeoMapMountOptions, type GeoReaderController, type GeoReaderOptions, GraphInstance, GraphMountOptions, JPGExportOptions, type KeyboardNavOptions, MountOptions, type ReaderController, type ReaderPresentationOptions, type ReaderSetOptions, SVGExportOptions, type SankeyInstance, type SankeyMountOptions, type SliceReaderController, type SpecSequenceOptions, type TableInstance, type TableMountOptions, type TableState, type TextEditOverlayConfig, type TileMapInstance, type TileMapMountOptions, VECTOR_EXPORT_MAX_POINTS, type YouDrawItController, type YouDrawItOptions, attachKeyboardNav, createBarList, createChart, createChartReaderBinding, createGeoMap, createGeoReader, createGeoReaderBinding, createGraph, createReader, createSankey, createSimulationWorker, createTable, createTextEditOverlay, createTileMap, createYouDrawIt, exportSpecSequence, materializeCanvasModeSVG, observeResize, rectPathWithCorners, registerMarkRenderer, renderBarCell, renderCategoryCell, renderCell, renderChartSVG, renderFlagCell, renderHeatmapCell, renderImageCell, renderSparklineCell, renderTable, renderTextCell };
773
+ export { type BarListInstance, type BarListMountOptions, CANVAS_DEFAULT_UPDATE_MAX_MARKS, Camera, ChartInstance, type ChartReaderProps, type ChartReaderSelection, DEFAULT_UPDATE_MAX_MARKS, type ElementFactory, type GeoMapCameraChangeMeta, type GeoMapCameraOptions, type GeoMapInstance, type GeoMapMarkEvent, type GeoMapMountOptions, type GeoReaderController, type GeoReaderOptions, GraphInstance, GraphMountOptions, type IdScope, JPGExportOptions, type KeyboardNavOptions, type MarkRenderer, MountOptions, type ReaderController, type ReaderPresentationOptions, type ReaderSetOptions, type RenderContext, SVGExportOptions, type SankeyInstance, type SankeyMountOptions, type SliceReaderController, type SpecSequenceOptions, type TableInstance, type TableMountOptions, type TableState, type TextEditOverlayConfig, type TileMapInstance, type TileMapMountOptions, VECTOR_EXPORT_MAX_POINTS, type YouDrawItController, type YouDrawItOptions, attachKeyboardNav, createBarList, createChart, createChartReaderBinding, createGeoMap, createGeoReader, createGeoReaderBinding, createGraph, createIdScope, createReader, createRenderContext, createSankey, createSimulationWorker, createTable, createTextEditOverlay, createTileMap, createYouDrawIt, exportSpecSequence, materializeCanvasModeSVG, observeResize, rectPathWithCorners, registerMarkRenderer, renderBarCell, renderCategoryCell, renderCell, renderChartSVG, renderFlagCell, renderHeatmapCell, renderImageCell, renderSparklineCell, renderTable, renderTextCell };