@pixerate/editor 0.164.0 → 0.166.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 (146) hide show
  1. package/dist/agent/index.cjs +54 -39
  2. package/dist/agent/index.js +24 -9
  3. package/dist/animation/index.cjs +6 -5
  4. package/dist/animation/index.js +5 -4
  5. package/dist/animation-editor/index.cjs +65 -64
  6. package/dist/animation-editor/index.js +8 -7
  7. package/dist/bridge/cli.cjs +3 -3
  8. package/dist/bridge/cli.js +2 -2
  9. package/dist/bridge/index.cjs +3 -3
  10. package/dist/bridge/index.js +2 -2
  11. package/dist/canvas/index.cjs +89 -87
  12. package/dist/canvas/index.js +11 -9
  13. package/dist/chart/controller.d.cts +60 -2
  14. package/dist/chart/controller.d.ts +60 -2
  15. package/dist/chart/index.cjs +657 -163
  16. package/dist/chart/index.d.cts +3 -0
  17. package/dist/chart/index.d.ts +3 -0
  18. package/dist/chart/index.js +512 -18
  19. package/dist/chart/layout-families.d.cts +14 -0
  20. package/dist/chart/layout-families.d.ts +14 -0
  21. package/dist/chart/layout-shared.d.cts +5 -0
  22. package/dist/chart/layout-shared.d.ts +5 -0
  23. package/dist/chart/links.d.cts +34 -0
  24. package/dist/chart/links.d.ts +34 -0
  25. package/dist/chart/mermaid.d.cts +9 -6
  26. package/dist/chart/mermaid.d.ts +9 -6
  27. package/dist/chart/race.d.cts +26 -0
  28. package/dist/chart/race.d.ts +26 -0
  29. package/dist/chart/schemas.d.cts +5 -0
  30. package/dist/chart/schemas.d.ts +5 -0
  31. package/dist/chart/spec.d.cts +3 -2
  32. package/dist/chart/spec.d.ts +3 -2
  33. package/dist/chart/style.d.cts +33 -0
  34. package/dist/chart/style.d.ts +33 -0
  35. package/dist/chart/types.d.cts +28 -2
  36. package/dist/chart/types.d.ts +28 -2
  37. package/dist/{chunk-ZVNAMTFO.cjs → chunk-3FSUJIXN.cjs} +18 -174
  38. package/dist/{chunk-RQCMSEM5.cjs → chunk-4QUUHTGJ.cjs} +2 -2
  39. package/dist/{chunk-CIPIESX4.cjs → chunk-4ZC5QJE2.cjs} +3 -3
  40. package/dist/{chunk-S6X2QRVU.cjs → chunk-5UEFBM2M.cjs} +1 -138
  41. package/dist/{chunk-5FNGLV2D.js → chunk-5UNQDC3Q.js} +18 -3
  42. package/dist/{chunk-YSAGBIRW.cjs → chunk-6FYIFGBW.cjs} +16 -16
  43. package/dist/{chunk-QYZGBVNC.js → chunk-7272D3K2.js} +10 -8
  44. package/dist/{chunk-462WGGXX.cjs → chunk-AMX23CSN.cjs} +27 -16
  45. package/dist/{chunk-3VLOOO3G.js → chunk-BDIM6NVW.js} +1 -1
  46. package/dist/{chunk-R3P2M7HU.cjs → chunk-BPX4Z3N3.cjs} +355 -207
  47. package/dist/{chunk-D54JHQK2.cjs → chunk-CHLV7UFP.cjs} +51 -51
  48. package/dist/{chunk-OXERWBKE.js → chunk-DFCAR7AW.js} +3 -3
  49. package/dist/{chunk-GZ2FM3ZB.js → chunk-DKNEQX7T.js} +6 -162
  50. package/dist/{chunk-JCXMJUQO.cjs → chunk-EGZM52EO.cjs} +3 -3
  51. package/dist/{chunk-ES3UEVUT.cjs → chunk-EUIDTZNQ.cjs} +112 -110
  52. package/dist/{chunk-H3OEM3Q2.js → chunk-F6R67I3A.js} +1 -1
  53. package/dist/{chunk-3NEZJCBY.js → chunk-FR432ROA.js} +349 -201
  54. package/dist/chunk-HIDFL5LQ.js +484 -0
  55. package/dist/{chunk-22KLZZGH.cjs → chunk-HXOBOHH2.cjs} +8 -8
  56. package/dist/{chunk-MKTDELCD.js → chunk-I5MRJW7B.js} +1 -1
  57. package/dist/{chunk-SDHZG5TF.js → chunk-ILP77UD6.js} +160 -2
  58. package/dist/{chunk-Z4P2RBMJ.js → chunk-ITANXMZD.js} +177 -3
  59. package/dist/chunk-KGRZMHZB.js +204 -0
  60. package/dist/{chunk-SET6KJOP.js → chunk-LPIKXPBM.js} +1 -1
  61. package/dist/{chunk-BQWGN5WH.js → chunk-M2TPMYJE.js} +1 -1
  62. package/dist/{chunk-GTELFJRE.cjs → chunk-M5GLQQWG.cjs} +2 -2
  63. package/dist/{chunk-4VU4CP7R.js → chunk-MHLU6GRJ.js} +1 -138
  64. package/dist/{chunk-NZD2MZJC.cjs → chunk-MZFZSVUJ.cjs} +38 -23
  65. package/dist/{chunk-DAPQGA55.js → chunk-NQQDGGXY.js} +2 -2
  66. package/dist/chunk-O6OGNDND.js +164 -0
  67. package/dist/{chunk-PA3IMPPS.cjs → chunk-OVYQAYGH.cjs} +81 -81
  68. package/dist/{chunk-YXOW456B.js → chunk-PPEDZ5WR.js} +1 -1
  69. package/dist/{chunk-24M7VD6M.cjs → chunk-S4EIAIEW.cjs} +7 -7
  70. package/dist/{chunk-M4MIZPQI.cjs → chunk-SJ2CPTQC.cjs} +189 -15
  71. package/dist/{chunk-YGG7WDWT.cjs → chunk-SZWVMB3B.cjs} +24 -18
  72. package/dist/chunk-TFF2GTGN.cjs +153 -0
  73. package/dist/chunk-TTCJPX4U.cjs +204 -0
  74. package/dist/{chunk-SBQVEBSU.cjs → chunk-UUUTEVX6.cjs} +242 -68
  75. package/dist/{chunk-WI7QJA7A.cjs → chunk-UXETV2NC.cjs} +161 -3
  76. package/dist/{chunk-GKNEJ6EN.cjs → chunk-V5L2G22R.cjs} +321 -107
  77. package/dist/{chunk-TALQONZ5.js → chunk-VB2CY6EG.js} +3 -3
  78. package/dist/{chunk-QY4KUDMY.js → chunk-VRXXAXUT.js} +2 -2
  79. package/dist/chunk-VU6WQSMB.cjs +164 -0
  80. package/dist/{chunk-NHLYK3AX.js → chunk-XBQX76CT.js} +182 -8
  81. package/dist/{chunk-5AARIS3R.cjs → chunk-XCDGM7TD.cjs} +37 -37
  82. package/dist/{chunk-POR54B55.js → chunk-XNU45TYA.js} +7 -1
  83. package/dist/{chunk-EVXQNQND.js → chunk-XZB3TJ6K.js} +16 -5
  84. package/dist/chunk-YBAPT7NL.js +153 -0
  85. package/dist/{chunk-SZA42R4N.js → chunk-YUFTVNLX.js} +230 -16
  86. package/dist/chunk-Z2UQYMPS.cjs +484 -0
  87. package/dist/color/index.cjs +5 -3
  88. package/dist/color/index.js +12 -10
  89. package/dist/diagram/index.cjs +55 -243
  90. package/dist/diagram/index.js +12 -200
  91. package/dist/export/index.cjs +7 -6
  92. package/dist/export/index.js +6 -5
  93. package/dist/extensions/index.cjs +12 -9
  94. package/dist/extensions/index.js +11 -8
  95. package/dist/gradient/index.cjs +29 -27
  96. package/dist/gradient/index.js +6 -4
  97. package/dist/image-editor/index.cjs +644 -643
  98. package/dist/image-editor/index.js +7 -6
  99. package/dist/index.cjs +21 -18
  100. package/dist/index.js +14 -11
  101. package/dist/paint-editor/index.cjs +19 -18
  102. package/dist/paint-editor/index.js +7 -6
  103. package/dist/parameters/index.cjs +2 -2
  104. package/dist/parameters/index.js +1 -1
  105. package/dist/persistence/assetWrites.d.cts +22 -0
  106. package/dist/persistence/assetWrites.d.ts +22 -0
  107. package/dist/persistence/assets.d.cts +71 -0
  108. package/dist/persistence/assets.d.ts +71 -0
  109. package/dist/persistence/documentStore.d.cts +17 -1
  110. package/dist/persistence/documentStore.d.ts +17 -1
  111. package/dist/persistence/documentTools.d.cts +5 -1
  112. package/dist/persistence/documentTools.d.ts +5 -1
  113. package/dist/persistence/editorAutosave.d.cts +7 -0
  114. package/dist/persistence/editorAutosave.d.ts +7 -0
  115. package/dist/persistence/index.cjs +141 -21
  116. package/dist/persistence/index.js +130 -10
  117. package/dist/persistence/storage.d.cts +13 -1
  118. package/dist/persistence/storage.d.ts +13 -1
  119. package/dist/spreadsheet/index.cjs +3 -3
  120. package/dist/spreadsheet/index.js +2 -2
  121. package/dist/tokens/index.cjs +11 -3
  122. package/dist/tokens/index.d.cts +1 -0
  123. package/dist/tokens/index.d.ts +1 -0
  124. package/dist/tokens/index.js +10 -2
  125. package/dist/tokens/style.d.cts +36 -0
  126. package/dist/tokens/style.d.ts +36 -0
  127. package/dist/tools/index.cjs +15 -3
  128. package/dist/tools/index.d.cts +2 -0
  129. package/dist/tools/index.d.ts +2 -0
  130. package/dist/tools/index.js +14 -2
  131. package/dist/tools/style-tools.d.cts +19 -0
  132. package/dist/tools/style-tools.d.ts +19 -0
  133. package/dist/tools/style.d.cts +212 -0
  134. package/dist/tools/style.d.ts +212 -0
  135. package/dist/tools/view.d.cts +6 -0
  136. package/dist/tools/view.d.ts +6 -0
  137. package/dist/typography/index.cjs +8 -6
  138. package/dist/typography/index.js +5 -3
  139. package/dist/vector/index.cjs +953 -952
  140. package/dist/vector/index.js +7 -6
  141. package/dist/video-editor/index.cjs +8 -7
  142. package/dist/video-editor/index.js +6 -5
  143. package/package.json +1 -1
  144. package/skills/pixerate-chart/SKILL.md +20 -2
  145. package/dist/chunk-ERAGQL2N.cjs +0 -68
  146. package/dist/chunk-KMU6QJB7.js +0 -68
@@ -14,18 +14,18 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkNZD2MZJCcjs = require('../chunk-NZD2MZJC.cjs');
18
17
 
19
18
 
20
19
 
20
+ var _chunkMZFZSVUJcjs = require('../chunk-MZFZSVUJ.cjs');
21
21
 
22
22
 
23
23
 
24
24
 
25
- var _chunkYGG7WDWTcjs = require('../chunk-YGG7WDWT.cjs');
26
25
 
27
26
 
28
27
 
28
+ var _chunkSZWVMB3Bcjs = require('../chunk-SZWVMB3B.cjs');
29
29
 
30
30
 
31
31
 
@@ -44,10 +44,11 @@ var _chunkYGG7WDWTcjs = require('../chunk-YGG7WDWT.cjs');
44
44
 
45
45
 
46
46
 
47
- var _chunkGKNEJ6ENcjs = require('../chunk-GKNEJ6EN.cjs');
48
47
 
49
48
 
50
49
 
50
+ var _chunkV5L2G22Rcjs = require('../chunk-V5L2G22R.cjs');
51
+ require('../chunk-TTCJPX4U.cjs');
51
52
 
52
53
 
53
54
 
@@ -84,13 +85,13 @@ var _chunkGKNEJ6ENcjs = require('../chunk-GKNEJ6EN.cjs');
84
85
 
85
86
 
86
87
 
87
- var _chunkSBQVEBSUcjs = require('../chunk-SBQVEBSU.cjs');
88
88
 
89
89
 
90
90
 
91
91
 
92
92
 
93
93
 
94
+ var _chunkUUUTEVX6cjs = require('../chunk-UUUTEVX6.cjs');
94
95
 
95
96
 
96
97
 
@@ -170,7 +171,22 @@ var _chunkSBQVEBSUcjs = require('../chunk-SBQVEBSU.cjs');
170
171
 
171
172
 
172
173
 
173
- var _chunkR3P2M7HUcjs = require('../chunk-R3P2M7HU.cjs');
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+ var _chunkBPX4Z3N3cjs = require('../chunk-BPX4Z3N3.cjs');
189
+ require('../chunk-VU6WQSMB.cjs');
174
190
  require('../chunk-55AKPTLM.cjs');
175
191
 
176
192
 
@@ -188,11 +204,12 @@ var _chunkSWTUM32Hcjs = require('../chunk-SWTUM32H.cjs');
188
204
  var _chunkALNIFK5Gcjs = require('../chunk-ALNIFK5G.cjs');
189
205
 
190
206
 
191
- var _chunkM4MIZPQIcjs = require('../chunk-M4MIZPQI.cjs');
207
+ var _chunkSJ2CPTQCcjs = require('../chunk-SJ2CPTQC.cjs');
192
208
  require('../chunk-2BSBFBOA.cjs');
193
209
  require('../chunk-FJ2MSI43.cjs');
194
- require('../chunk-ES3UEVUT.cjs');
195
- require('../chunk-S6X2QRVU.cjs');
210
+ require('../chunk-EUIDTZNQ.cjs');
211
+ require('../chunk-TFF2GTGN.cjs');
212
+ require('../chunk-5UEFBM2M.cjs');
196
213
  require('../chunk-IPJ3TEYR.cjs');
197
214
 
198
215
  // src/chart/raster.ts
@@ -303,7 +320,7 @@ function chartFileName(spec, extension) {
303
320
  }
304
321
  async function downloadChartPng(spec, options = {}) {
305
322
  const { width = 800, height = 450, filename = chartFileName(spec, "png"), theme, ...raster } = options;
306
- const svg = _chunkGKNEJ6ENcjs.chartToSvg.call(void 0, spec, { width, height, theme });
323
+ const svg = _chunkV5L2G22Rcjs.chartToSvg.call(void 0, spec, { width, height, theme });
307
324
  const { url, width: w, height: h } = await svgToPngDataUrl(svg, { ...raster, width, height });
308
325
  const doc = _nullishCoalesce(raster.document, () => ( globalThis.document));
309
326
  const link = doc.createElement("a");
@@ -318,7 +335,7 @@ async function downloadChartPng(spec, options = {}) {
318
335
 
319
336
  // src/chart/recommend.ts
320
337
  var blank = (c) => c === null || c === void 0 || String(c).trim() === "";
321
- var isText = (c) => blank(c) || _chunkR3P2M7HUcjs.parseChartValue.call(void 0, c) === void 0;
338
+ var isText = (c) => blank(c) || _chunkBPX4Z3N3cjs.parseChartValue.call(void 0, c) === void 0;
322
339
  function analyzeChartTable(rows) {
323
340
  const grid = rows.filter((r) => r.some((c) => !blank(c)));
324
341
  const height = grid.length;
@@ -336,7 +353,7 @@ function analyzeChartTable(rows) {
336
353
  let anyPositive = false;
337
354
  for (let r = headerRow ? 1 : 0; r < height; r++)
338
355
  for (let c = labelColumn ? 1 : 0; c < width; c++) {
339
- const v = _chunkR3P2M7HUcjs.parseChartValue.call(void 0, cell(r, c));
356
+ const v = _chunkBPX4Z3N3cjs.parseChartValue.call(void 0, cell(r, c));
340
357
  if (typeof v !== "number") continue;
341
358
  anyNumber = true;
342
359
  if (v < 0) {
@@ -345,7 +362,7 @@ function analyzeChartTable(rows) {
345
362
  } else if (v > 0) anyPositive = true;
346
363
  }
347
364
  const labels = byRows ? _nullishCoalesce(_optionalChain([grid, 'access', _20 => _20[0], 'optionalAccess', _21 => _21.slice, 'call', _22 => _22(labelColumn ? 1 : 0)]), () => ( [])) : grid.slice(headerRow ? 1 : 0).map((r) => r[0]);
348
- const dates = (byRows ? headerRow : labelColumn) && labels.length > 1 && labels.filter((l) => !blank(l) && _chunkSBQVEBSUcjs.parseChartDate.call(void 0, String(l)) !== null).length >= labels.length * 0.8;
365
+ const dates = (byRows ? headerRow : labelColumn) && labels.length > 1 && labels.filter((l) => !blank(l) && _chunkUUUTEVX6cjs.parseChartDate.call(void 0, String(l)) !== null).length >= labels.length * 0.8;
349
366
  return {
350
367
  headerRow,
351
368
  labelColumn,
@@ -383,6 +400,7 @@ function recommendForShape(shape) {
383
400
  add("area", "Area", "Shows change over time with volume.");
384
401
  add("bar", "Column", "Compares each period.");
385
402
  if (shape.series > 1) add("area", "Stacked area", "Shows how the parts add up over time.", "stacked");
403
+ if (shape.series >= 5 && shape.points >= 3) add("barrace", "Bar race", "Many series over time: an animated ranking shows who leads when.");
386
404
  return out;
387
405
  }
388
406
  if (shape.series === 1) {
@@ -417,6 +435,7 @@ function recommendForShape(shape) {
417
435
  add("bar", "Stacked column", "Shows how the series add up.", "stacked");
418
436
  add("line", "Line", "Shows the series in order.");
419
437
  if (shape.points >= 3 && shape.series <= 6) add("radar", "Radar", "Compares several measures across the series.");
438
+ if (shape.nonNegative && shape.series >= 5 && shape.points >= 3) add("barrace", "Bar race", "Many series across ordered categories (such as years): an animated ranking shows who leads when.");
420
439
  if (shape.nonNegative && shape.series >= 3 && shape.series <= 7) add("likert", "Likert", "Survey answers per question (columns from most negative to most positive): shows agreement against disagreement.");
421
440
  }
422
441
  return out;
@@ -435,7 +454,7 @@ function chartFromTable(rows, options = {}) {
435
454
  if (xFromFirst) {
436
455
  table = table.map((r) => [r[1], ...r.slice(2)]);
437
456
  }
438
- const data = _chunkR3P2M7HUcjs.chartDataFromTable.call(void 0, table, { seriesIn: shape.byRows ? "rows" : "columns", header: true, xFromFirstColumn: xFromFirst });
457
+ const data = _chunkBPX4Z3N3cjs.chartDataFromTable.call(void 0, table, { seriesIn: shape.byRows ? "rows" : "columns", header: true, xFromFirstColumn: xFromFirst });
439
458
  return { type, stacking, categories: data.categories, series: data.series, issues: data.issues, shape };
440
459
  }
441
460
 
@@ -462,6 +481,12 @@ function createChartCommands(controller, options = {}) {
462
481
  if (index < 0 || index >= categories.length || !Number.isInteger(index)) fail(`There is no category ${JSON.stringify(ref)}; expected an index from 0 to ${categories.length - 1} or one of the labels.`);
463
482
  return index;
464
483
  };
484
+ const raceFrame = (time) => {
485
+ const cats = controller.getSpec().categories;
486
+ const frame = typeof time === "number" ? time : cats.indexOf(time);
487
+ if (!(Number.isFinite(frame) && frame >= 0 && frame <= cats.length - 1)) fail(`There is no time point ${JSON.stringify(time)}; expected an index from 0 to ${Math.max(0, cats.length - 1)} or a category label.`);
488
+ return frame;
489
+ };
465
490
  const object = (properties, required) => ({ type: "object", properties, ...required ? { required } : {}, additionalProperties: false });
466
491
  return [
467
492
  {
@@ -471,10 +496,10 @@ function createChartCommands(controller, options = {}) {
471
496
  readOnly: true,
472
497
  keywords: ["chart", "data", "spec", "get", "summary"],
473
498
  description: "Returns the chart spec, its data as a table (series names in the header row) and a summary: per-series min / max / mean / trend, axes as drawn, layout warnings and a colour check.",
474
- params: object({ width: _chunkNZD2MZJCcjs.WIDTH, height: _chunkNZD2MZJCcjs.HEIGHT }),
499
+ params: object({ width: _chunkMZFZSVUJcjs.WIDTH, height: _chunkMZFZSVUJcjs.HEIGHT }),
475
500
  run: (_ctx, params = {}) => {
476
501
  const spec = controller.getSpec();
477
- return { spec: controller.toJSON(), table: _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, spec), summary: _chunkGKNEJ6ENcjs.summarizeChart.call(void 0, controller.toJSON(), { width: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _25 => _25.width]), () => ( 640)), height: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _26 => _26.height]), () => ( 400)) }), issues: controller.getState().issues };
502
+ return { spec: controller.toJSON(), table: _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, spec), summary: _chunkV5L2G22Rcjs.summarizeChart.call(void 0, controller.toJSON(), { width: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _25 => _25.width]), () => ( 640)), height: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _26 => _26.height]), () => ( 400)) }), issues: controller.getState().issues };
478
503
  }
479
504
  },
480
505
  {
@@ -483,7 +508,7 @@ function createChartCommands(controller, options = {}) {
483
508
  label: "Change Chart\u2026",
484
509
  keywords: ["chart", "title", "axis", "legend", "stack", "style", "format", "type"],
485
510
  description: 'Changes chart presentation as one undo step: type, titles, axes (xAxis = categories, yAxis = values, yAxis2 = secondary values; reverse, and scale "log" on value axes), legend, stacking, orientation, curve, points, data labels, palette, donut hole, bar spacing, histogram bins, waterfall total, or radar rings and grid shape, note, highlight, reference lines and bands, or colour by category (varyColors). Invalid values change nothing and return why.',
486
- params: object(_chunkNZD2MZJCcjs.CHART_UPDATE_PROPERTIES),
511
+ params: object(_chunkMZFZSVUJcjs.CHART_UPDATE_PROPERTIES),
487
512
  run: (_ctx, params) => {
488
513
  check(controller.update(params));
489
514
  return { spec: controller.toJSON() };
@@ -497,11 +522,11 @@ function createChartCommands(controller, options = {}) {
497
522
  description: "Replaces the categories and series as one undo step. Each series has one value per category (padded with gaps).",
498
523
  params: object({
499
524
  categories: { type: "array", items: { type: "string" }, description: "Category labels in order." },
500
- series: { type: "array", description: "The new series.", items: object({ id: { type: "string", description: "Stable id (optional)." }, ..._chunkNZD2MZJCcjs.SERIES_PROPS }, ["name", "values"]) }
525
+ series: { type: "array", description: "The new series.", items: object({ id: { type: "string", description: "Stable id (optional)." }, ..._chunkMZFZSVUJcjs.SERIES_PROPS }, ["name", "values"]) }
501
526
  }),
502
527
  run: (_ctx, params) => {
503
528
  check(controller.setData(params));
504
- return { table: _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, controller.getSpec()) };
529
+ return { table: _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, controller.getSpec()) };
505
530
  }
506
531
  },
507
532
  {
@@ -510,10 +535,10 @@ function createChartCommands(controller, options = {}) {
510
535
  label: "Set Chart Values\u2026",
511
536
  keywords: ["chart", "value", "cell", "edit"],
512
537
  description: "Sets individual values as one undo step. Series by id or name; category by index or label.",
513
- params: object({ cells: { type: "array", minItems: 1, description: "Values to set.", items: object({ series: _chunkNZD2MZJCcjs.SERIES_REF, category: _chunkNZD2MZJCcjs.CATEGORY_REF, value: _chunkNZD2MZJCcjs.VALUE }, ["series", "category", "value"]) } }, ["cells"]),
538
+ params: object({ cells: { type: "array", minItems: 1, description: "Values to set.", items: object({ series: _chunkMZFZSVUJcjs.SERIES_REF, category: _chunkMZFZSVUJcjs.CATEGORY_REF, value: _chunkMZFZSVUJcjs.VALUE }, ["series", "category", "value"]) } }, ["cells"]),
514
539
  run: (_ctx, params) => {
515
540
  check(controller.setValues(params.cells.map((c) => ({ seriesId: resolveSeries(c.series).id, index: resolveCategory(c.category), value: c.value }))));
516
- return { table: _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, controller.getSpec()) };
541
+ return { table: _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, controller.getSpec()) };
517
542
  }
518
543
  },
519
544
  {
@@ -522,7 +547,7 @@ function createChartCommands(controller, options = {}) {
522
547
  label: "Add Series",
523
548
  keywords: ["chart", "series", "new"],
524
549
  description: "Adds a series (default: an empty one at the end). Returns its id.",
525
- params: object({ ..._chunkNZD2MZJCcjs.SERIES_PROPS, id: { type: "string", description: "Id to use (default series-N)." }, at: { type: "integer", minimum: 0, description: "Position (default: last)." } }),
550
+ params: object({ ..._chunkMZFZSVUJcjs.SERIES_PROPS, id: { type: "string", description: "Id to use (default series-N)." }, at: { type: "integer", minimum: 0, description: "Position (default: last)." } }),
526
551
  run: (_ctx, params = {}) => {
527
552
  const { at, ...input } = _nullishCoalesce(params, () => ( {}));
528
553
  const clean = Object.fromEntries(Object.entries(input).filter(([, v]) => v !== null));
@@ -537,7 +562,7 @@ function createChartCommands(controller, options = {}) {
537
562
  label: "Change Series\u2026",
538
563
  keywords: ["chart", "series", "rename", "colour", "color", "hide", "axis", "marker"],
539
564
  description: "Renames, recolours, hides, moves to the secondary axis or changes how a series is drawn, including error bars (null resets a field).",
540
- params: object({ series: _chunkNZD2MZJCcjs.SERIES_REF, ...Object.fromEntries(Object.entries(_chunkNZD2MZJCcjs.SERIES_PROPS).filter(([k]) => k !== "values")) }, ["series"]),
565
+ params: object({ series: _chunkMZFZSVUJcjs.SERIES_REF, ...Object.fromEntries(Object.entries(_chunkMZFZSVUJcjs.SERIES_PROPS).filter(([k]) => k !== "values")) }, ["series"]),
541
566
  run: (_ctx, params) => {
542
567
  const { series, ...patch } = params;
543
568
  const id = resolveSeries(series).id;
@@ -551,7 +576,7 @@ function createChartCommands(controller, options = {}) {
551
576
  label: "Delete Series",
552
577
  keywords: ["chart", "series", "remove"],
553
578
  description: "Deletes a series by id or name.",
554
- params: object({ series: _chunkNZD2MZJCcjs.SERIES_REF }, ["series"]),
579
+ params: object({ series: _chunkMZFZSVUJcjs.SERIES_REF }, ["series"]),
555
580
  run: (_ctx, params) => {
556
581
  check(controller.removeSeries(resolveSeries(params.series).id));
557
582
  return { series: seriesIds() };
@@ -576,7 +601,7 @@ function createChartCommands(controller, options = {}) {
576
601
  label: "Delete Category",
577
602
  keywords: ["chart", "category", "row", "remove"],
578
603
  description: "Deletes a category (and its values) by index or label.",
579
- params: object({ category: _chunkNZD2MZJCcjs.CATEGORY_REF }, ["category"]),
604
+ params: object({ category: _chunkMZFZSVUJcjs.CATEGORY_REF }, ["category"]),
580
605
  run: (_ctx, params) => {
581
606
  check(controller.removeCategory(resolveCategory(params.category)));
582
607
  return { categories: controller.getSpec().categories };
@@ -588,7 +613,7 @@ function createChartCommands(controller, options = {}) {
588
613
  label: "Add Trendline\u2026",
589
614
  keywords: ["chart", "trend", "regression", "fit", "forecast", "moving average"],
590
615
  description: "Fits a trendline to a series (linear, exponential, logarithmic, power, polynomial or moving average). Returns its index and the fit.",
591
- params: object({ series: _chunkNZD2MZJCcjs.SERIES_REF, ..._chunkNZD2MZJCcjs.TRENDLINE_PROPS }, ["series", "type"]),
616
+ params: object({ series: _chunkMZFZSVUJcjs.SERIES_REF, ..._chunkMZFZSVUJcjs.TRENDLINE_PROPS }, ["series", "type"]),
592
617
  run: (_ctx, params) => {
593
618
  const { series, ...line } = params;
594
619
  const result = controller.addTrendline(resolveSeries(series).id, line);
@@ -603,7 +628,7 @@ function createChartCommands(controller, options = {}) {
603
628
  label: "Delete Trendline",
604
629
  keywords: ["chart", "trend", "remove"],
605
630
  description: "Deletes a trendline from a series.",
606
- params: object({ series: _chunkNZD2MZJCcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index (0 = first)." } }, ["series", "index"]),
631
+ params: object({ series: _chunkMZFZSVUJcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index (0 = first)." } }, ["series", "index"]),
607
632
  run: (_ctx, params) => {
608
633
  check(controller.removeTrendline(resolveSeries(params.series).id, params.index));
609
634
  return { trendlines: _nullishCoalesce(_optionalChain([controller, 'access', _29 => _29.getSeries, 'call', _30 => _30(resolveSeries(params.series).id), 'optionalAccess', _31 => _31.trendlines]), () => ( [])) };
@@ -615,7 +640,7 @@ function createChartCommands(controller, options = {}) {
615
640
  label: "Add Reference Line\u2026",
616
641
  keywords: ["chart", "target", "goal", "threshold", "average", "reference", "line", "annotation"],
617
642
  description: "Draws a dashed line across the plot at one value (a target, floor or average). Returns its index.",
618
- params: object(_chunkNZD2MZJCcjs.REFERENCE_LINE_PROPS, ["value"]),
643
+ params: object(_chunkMZFZSVUJcjs.REFERENCE_LINE_PROPS, ["value"]),
619
644
  run: (_ctx, params) => {
620
645
  const result = controller.addReferenceLine(params);
621
646
  check(result);
@@ -628,7 +653,7 @@ function createChartCommands(controller, options = {}) {
628
653
  label: "Change Reference Line\u2026",
629
654
  keywords: ["chart", "target", "reference", "line", "annotation"],
630
655
  description: "Changes a reference line by index; label, axis and color take null to remove them.",
631
- params: object({ index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, "Reference line"), ..._chunkNZD2MZJCcjs.REFERENCE_LINE_PATCH }, ["index"]),
656
+ params: object({ index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, "Reference line"), ..._chunkMZFZSVUJcjs.REFERENCE_LINE_PATCH }, ["index"]),
632
657
  run: (_ctx, params) => {
633
658
  const { index, ...patch } = params;
634
659
  check(controller.updateReferenceLine(index, patch));
@@ -641,7 +666,7 @@ function createChartCommands(controller, options = {}) {
641
666
  label: "Delete Reference Line",
642
667
  keywords: ["chart", "target", "reference", "line", "remove"],
643
668
  description: "Deletes a reference line by index.",
644
- params: object({ index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, "Reference line") }, ["index"]),
669
+ params: object({ index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, "Reference line") }, ["index"]),
645
670
  run: (_ctx, params) => {
646
671
  check(controller.removeReferenceLine(params.index));
647
672
  return { referenceLines: controller.getSpec().referenceLines };
@@ -653,7 +678,7 @@ function createChartCommands(controller, options = {}) {
653
678
  label: "Add Reference Band\u2026",
654
679
  keywords: ["chart", "target", "range", "band", "reference", "shade", "annotation"],
655
680
  description: "Shades a band across the plot between two values (a target or normal range). Returns its index.",
656
- params: object(_chunkNZD2MZJCcjs.REFERENCE_BAND_PROPS, ["from", "to"]),
681
+ params: object(_chunkMZFZSVUJcjs.REFERENCE_BAND_PROPS, ["from", "to"]),
657
682
  run: (_ctx, params) => {
658
683
  const result = controller.addReferenceBand(params);
659
684
  check(result);
@@ -666,7 +691,7 @@ function createChartCommands(controller, options = {}) {
666
691
  label: "Change Reference Band\u2026",
667
692
  keywords: ["chart", "range", "band", "reference", "annotation"],
668
693
  description: "Changes a reference band by index; label, axis and color take null to remove them.",
669
- params: object({ index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, "Reference band"), ..._chunkNZD2MZJCcjs.REFERENCE_BAND_PATCH }, ["index"]),
694
+ params: object({ index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, "Reference band"), ..._chunkMZFZSVUJcjs.REFERENCE_BAND_PATCH }, ["index"]),
670
695
  run: (_ctx, params) => {
671
696
  const { index, ...patch } = params;
672
697
  check(controller.updateReferenceBand(index, patch));
@@ -679,7 +704,7 @@ function createChartCommands(controller, options = {}) {
679
704
  label: "Delete Reference Band",
680
705
  keywords: ["chart", "range", "band", "reference", "remove"],
681
706
  description: "Deletes a reference band by index.",
682
- params: object({ index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, "Reference band") }, ["index"]),
707
+ params: object({ index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, "Reference band") }, ["index"]),
683
708
  run: (_ctx, params) => {
684
709
  check(controller.removeReferenceBand(params.index));
685
710
  return { referenceBands: controller.getSpec().referenceBands };
@@ -691,7 +716,7 @@ function createChartCommands(controller, options = {}) {
691
716
  label: "Pin Label to Point\u2026",
692
717
  keywords: ["chart", "callout", "annotation", "label", "note", "point"],
693
718
  description: 'Pins a short label to one bar or point (label null or "" removes it).',
694
- params: object({ series: _chunkNZD2MZJCcjs.SERIES_REF, category: _chunkNZD2MZJCcjs.CATEGORY_REF, label: { type: ["string", "null"], description: "The label (a few words), or null to remove it." } }, ["series", "category", "label"]),
719
+ params: object({ series: _chunkMZFZSVUJcjs.SERIES_REF, category: _chunkMZFZSVUJcjs.CATEGORY_REF, label: { type: ["string", "null"], description: "The label (a few words), or null to remove it." } }, ["series", "category", "label"]),
695
720
  run: (_ctx, params) => {
696
721
  const series = resolveSeries(params.series);
697
722
  const index = resolveCategory(params.category);
@@ -719,10 +744,10 @@ function createChartCommands(controller, options = {}) {
719
744
  label: "Replace Grouped Data\u2026",
720
745
  keywords: ["chart", "tree", "hierarchy", "groups", "treemap", "sunburst", "nested"],
721
746
  description: "Replaces the data with groups of items (a tree) for treemaps and sunbursts; [] goes back to plain data.",
722
- params: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs: _chunkNZD2MZJCcjs.TREE_DEFS },
747
+ params: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs: _chunkMZFZSVUJcjs.TREE_DEFS },
723
748
  run: (_ctx, params) => {
724
749
  check(controller.setTree(params.tree));
725
- return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total: _chunkR3P2M7HUcjs.chartTreeTotal.call(void 0, n) })) };
750
+ return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total: _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, n) })) };
726
751
  }
727
752
  },
728
753
  {
@@ -758,7 +783,7 @@ function createChartCommands(controller, options = {}) {
758
783
  },
759
784
  required: ["node"],
760
785
  additionalProperties: false,
761
- $defs: _chunkNZD2MZJCcjs.TREE_DEFS
786
+ $defs: _chunkMZFZSVUJcjs.TREE_DEFS
762
787
  },
763
788
  run: (_ctx, params) => {
764
789
  const result = controller.addTreeNode(_nullishCoalesce(params.parent, () => ( [])), params.node, { at: params.at });
@@ -774,7 +799,7 @@ function createChartCommands(controller, options = {}) {
774
799
  description: "Renames a node, sets an item's value or sets a node's colour (null for the palette).",
775
800
  params: object(
776
801
  {
777
- path: _chunkNZD2MZJCcjs.TREE_PATH,
802
+ path: _chunkMZFZSVUJcjs.TREE_PATH,
778
803
  name: { type: "string", description: "New name." },
779
804
  value: { type: "number", minimum: 0, description: "Items only: the new amount." },
780
805
  color: { type: ["string", "null"], description: "CSS colour, or null for the palette colour." }
@@ -794,10 +819,135 @@ function createChartCommands(controller, options = {}) {
794
819
  label: "Delete Item or Group",
795
820
  keywords: ["chart", "tree", "group", "item", "remove", "delete"],
796
821
  description: "Deletes a node of the grouped data with everything under it.",
797
- params: object({ path: _chunkNZD2MZJCcjs.TREE_PATH }, ["path"]),
822
+ params: object({ path: _chunkMZFZSVUJcjs.TREE_PATH }, ["path"]),
798
823
  run: (_ctx, params) => {
799
824
  check(controller.removeTreeNode(params.path));
800
- return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total: _chunkR3P2M7HUcjs.chartTreeTotal.call(void 0, n) })) };
825
+ return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total: _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, n) })) };
826
+ }
827
+ },
828
+ {
829
+ ...base,
830
+ id: `${prefix}setLinks`,
831
+ label: "Replace Flows\u2026",
832
+ keywords: ["chart", "sankey", "flow", "links", "funnel", "budget"],
833
+ description: "Replaces the data with flows between named nodes for a Sankey diagram; [] goes back to plain data.",
834
+ params: object(
835
+ {
836
+ links: { type: "array", items: { type: "object", properties: _chunkMZFZSVUJcjs.LINK_PROPS, required: ["source", "target", "value"], additionalProperties: false }, description: "All the flows; [] removes them." },
837
+ nodes: { type: "array", items: { type: "string" }, description: "Node names in stacking order." }
838
+ },
839
+ ["links"]
840
+ ),
841
+ run: (_ctx, params) => {
842
+ check(controller.setLinks(params.links, { nodes: params.nodes }));
843
+ return { links: controller.getSpec().links, nodes: controller.getSpec().sankeyNodes };
844
+ }
845
+ },
846
+ {
847
+ ...base,
848
+ id: `${prefix}importLinksCsv`,
849
+ label: "Import Flows from CSV\u2026",
850
+ keywords: ["chart", "sankey", "flow", "csv", "import"],
851
+ description: "Replaces the data with flows from CSV / TSV rows of source, target and value.",
852
+ params: object(
853
+ {
854
+ csv: { type: "string", description: "CSV or TSV text." },
855
+ header: { type: ["boolean", "string"], enum: [true, false, "auto"], description: "The first row holds column names (default auto)." }
856
+ },
857
+ ["csv"]
858
+ ),
859
+ run: (_ctx, params) => {
860
+ check(controller.importLinksTable(_chunkN3KJFGXTcjs.parseCsv.call(void 0, params.csv, { delimiter: params.csv.includes(" ") ? " " : "," }), { header: params.header }));
861
+ return { links: controller.getSpec().links };
862
+ }
863
+ },
864
+ {
865
+ ...base,
866
+ id: `${prefix}addLink`,
867
+ label: "Add Flow\u2026",
868
+ keywords: ["chart", "sankey", "flow", "link", "add"],
869
+ description: "Adds a flow between two nodes. Returns its index.",
870
+ params: object(_chunkMZFZSVUJcjs.LINK_PROPS, ["source", "target", "value"]),
871
+ run: (_ctx, params) => {
872
+ const result = controller.addLink(params);
873
+ check(result);
874
+ return { index: result.index };
875
+ }
876
+ },
877
+ {
878
+ ...base,
879
+ id: `${prefix}updateLink`,
880
+ label: "Change Flow\u2026",
881
+ keywords: ["chart", "sankey", "flow", "link", "value"],
882
+ description: "Changes a flow by index (color null for the default).",
883
+ params: object({ index: _chunkMZFZSVUJcjs.LINK_INDEX, ..._chunkMZFZSVUJcjs.LINK_PROPS, color: { type: ["string", "null"], description: "CSS colour, or null for the default." } }, ["index"]),
884
+ run: (_ctx, params) => {
885
+ const { index, ...patch } = params;
886
+ check(controller.updateLink(index, patch));
887
+ return { link: controller.getSpec().links[index] };
888
+ }
889
+ },
890
+ {
891
+ ...base,
892
+ id: `${prefix}removeLink`,
893
+ label: "Delete Flow",
894
+ keywords: ["chart", "sankey", "flow", "link", "remove"],
895
+ description: "Deletes a flow by index.",
896
+ params: object({ index: _chunkMZFZSVUJcjs.LINK_INDEX }, ["index"]),
897
+ run: (_ctx, params) => {
898
+ check(controller.removeLink(params.index));
899
+ return { links: controller.getSpec().links };
900
+ }
901
+ },
902
+ {
903
+ ...base,
904
+ id: `${prefix}raceRanking`,
905
+ label: "Bar Race Ranking",
906
+ readOnly: true,
907
+ keywords: ["chart", "race", "ranking", "leader", "time"],
908
+ description: "Returns the top names of a bar race at a moment (default: the one shown).",
909
+ params: object({ time: _chunkMZFZSVUJcjs.RACE_TIME }),
910
+ run: (_ctx, params = {}) => {
911
+ const spec = controller.getSpec();
912
+ const frame = _optionalChain([params, 'optionalAccess', _36 => _36.time]) !== void 0 ? raceFrame(params.time) : _nullishCoalesce(controller.getState().raceFrame, () => ( spec.categories.length - 1));
913
+ return { frame, ranking: _chunkUUUTEVX6cjs.chartRaceRanking.call(void 0, spec, frame).slice(0, spec.raceTopN).map((e) => ({ rank: e.rank + 1, series: e.seriesId, name: e.name, value: e.value })) };
914
+ }
915
+ },
916
+ {
917
+ ...base,
918
+ id: `${prefix}setRaceFrame`,
919
+ label: "Show Bar Race Moment\u2026",
920
+ keywords: ["chart", "race", "frame", "time", "scrub"],
921
+ description: "Shows the bar race at a time point (null for the last) and stops playback. View state, not an undo step.",
922
+ params: object({ time: { ..._chunkMZFZSVUJcjs.RACE_TIME, type: ["string", "number", "null"], description: `${_chunkMZFZSVUJcjs.RACE_TIME.description} null shows the last time point.` } }, ["time"]),
923
+ run: (_ctx, params) => {
924
+ const frame = params.time === null ? null : raceFrame(params.time);
925
+ check(controller.setRaceFrame(frame));
926
+ return { frame };
927
+ }
928
+ },
929
+ {
930
+ ...base,
931
+ id: `${prefix}playRace`,
932
+ label: "Play Bar Race",
933
+ keywords: ["chart", "race", "play", "animate"],
934
+ description: "Plays the bar race from the moment shown, one time point every msPerStep ms.",
935
+ params: object({ msPerStep: { type: "number", minimum: 50, maximum: 1e4, description: "Milliseconds per time point (default 1000)." } }),
936
+ run: (_ctx, params = {}) => {
937
+ check(controller.playRace({ msPerStep: _optionalChain([params, 'optionalAccess', _37 => _37.msPerStep]) }));
938
+ return { playing: true };
939
+ }
940
+ },
941
+ {
942
+ ...base,
943
+ id: `${prefix}pauseRace`,
944
+ label: "Pause Bar Race",
945
+ keywords: ["chart", "race", "pause", "stop"],
946
+ description: "Pauses bar race playback where it is.",
947
+ enabled: () => controller.getState().racePlaying || "The race is not playing",
948
+ run: () => {
949
+ controller.pauseRace();
950
+ return { frame: controller.getState().raceFrame };
801
951
  }
802
952
  },
803
953
  {
@@ -807,8 +957,8 @@ function createChartCommands(controller, options = {}) {
807
957
  keywords: ["chart", "quick layout", "style", "colours", "colors", "monochrome", "theme"],
808
958
  description: "Applies a quick layout and / or colour scheme as one undo step.",
809
959
  params: object({
810
- layout: { type: "string", enum: _chunkGKNEJ6ENcjs.CHART_LAYOUT_PRESETS.map((p) => p.id), description: "Quick layout id." },
811
- colors: { type: "string", enum: _chunkGKNEJ6ENcjs.CHART_COLOR_SCHEMES.map((p) => p.id), description: "Colour scheme id." }
960
+ layout: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_LAYOUT_PRESETS.map((p) => p.id), description: "Quick layout id." },
961
+ colors: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_COLOR_SCHEMES.map((p) => p.id), description: "Colour scheme id." }
812
962
  }),
813
963
  run: (_ctx, params = {}) => {
814
964
  check(controller.applyPreset(_nullishCoalesce(params, () => ( {}))));
@@ -823,7 +973,7 @@ function createChartCommands(controller, options = {}) {
823
973
  description: "Swaps series and categories as one undo step.",
824
974
  run: () => {
825
975
  check(controller.transpose());
826
- return { table: _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, controller.getSpec()) };
976
+ return { table: _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, controller.getSpec()) };
827
977
  }
828
978
  },
829
979
  {
@@ -843,7 +993,7 @@ function createChartCommands(controller, options = {}) {
843
993
  run: (_ctx, params) => {
844
994
  const result = controller.importCsv(params.csv, { seriesIn: params.seriesIn, header: params.header });
845
995
  check(result);
846
- return { table: _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, controller.getSpec()), issues: _nullishCoalesce(result.issues, () => ( [])) };
996
+ return { table: _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, controller.getSpec()), issues: _nullishCoalesce(result.issues, () => ( [])) };
847
997
  }
848
998
  },
849
999
  {
@@ -851,11 +1001,11 @@ function createChartCommands(controller, options = {}) {
851
1001
  id: `${prefix}importMermaid`,
852
1002
  label: "Import Mermaid Chart\u2026",
853
1003
  keywords: ["chart", "mermaid", "markdown", "xychart", "pie", "radar", "import"],
854
- description: "Replaces the chart with Mermaid xychart-beta, pie or radar-beta text (one undo step). Unreadable lines are listed with line numbers.",
1004
+ description: "Replaces the chart with Mermaid xychart-beta, pie, radar-beta, sankey-beta or treemap-beta text (one undo step). Unreadable lines are listed with line numbers.",
855
1005
  params: object({ mermaid: { type: "string", description: "Mermaid text." } }, ["mermaid"]),
856
1006
  run: (_ctx, params) => {
857
- const read = _chunkGKNEJ6ENcjs.chartFromMermaid.call(void 0, params.mermaid);
858
- if (!read.family) fail(read.issues.map((i) => i.message).join(" ") || "Expected Mermaid starting with xychart-beta, pie or radar-beta.");
1007
+ const read = _chunkV5L2G22Rcjs.chartFromMermaid.call(void 0, params.mermaid);
1008
+ if (!read.family) fail(read.issues.map((i) => i.message).join(" ") || "Expected Mermaid starting with xychart-beta, pie, radar-beta, sankey-beta or treemap-beta.");
859
1009
  check(controller.update({ ...read.spec }, { label: "Import Mermaid chart" }));
860
1010
  return { spec: controller.toJSON(), issues: read.issues };
861
1011
  }
@@ -868,7 +1018,7 @@ function createChartCommands(controller, options = {}) {
868
1018
  keywords: ["chart", "mermaid", "markdown", "export"],
869
1019
  description: "Returns the chart as Mermaid text (with a round-trip comment unless meta is false).",
870
1020
  params: object({ meta: { type: "boolean", description: "Include the %% @pixerate round-trip comment (default true)." } }),
871
- run: (_ctx, params = {}) => ({ mermaid: _chunkGKNEJ6ENcjs.chartToMermaid.call(void 0, controller.toJSON(), { meta: _optionalChain([params, 'optionalAccess', _36 => _36.meta]) }) })
1021
+ run: (_ctx, params = {}) => ({ mermaid: _chunkV5L2G22Rcjs.chartToMermaid.call(void 0, controller.toJSON(), { meta: _optionalChain([params, 'optionalAccess', _38 => _38.meta]) }) })
872
1022
  },
873
1023
  {
874
1024
  ...base,
@@ -877,7 +1027,7 @@ function createChartCommands(controller, options = {}) {
877
1027
  readOnly: true,
878
1028
  keywords: ["chart", "office", "word", "powerpoint", "docx", "pptx", "xml", "export"],
879
1029
  description: "Returns the chart as a DrawingML chart part (c:chartSpace) and what could not be written.",
880
- run: () => _chunkYGG7WDWTcjs.chartToOoxml.call(void 0, controller.toJSON())
1030
+ run: () => _chunkSZWVMB3Bcjs.chartToOoxml.call(void 0, controller.toJSON())
881
1031
  },
882
1032
  {
883
1033
  ...base,
@@ -886,9 +1036,9 @@ function createChartCommands(controller, options = {}) {
886
1036
  readOnly: true,
887
1037
  keywords: ["chart", "svg", "export", "image"],
888
1038
  description: "Returns the chart drawn as a standalone, accessible SVG string (with <title> and <desc>).",
889
- params: object({ width: _chunkNZD2MZJCcjs.WIDTH, height: _chunkNZD2MZJCcjs.HEIGHT }),
1039
+ params: object({ width: _chunkMZFZSVUJcjs.WIDTH, height: _chunkMZFZSVUJcjs.HEIGHT }),
890
1040
  run: (_ctx, params = {}) => ({
891
- svg: _chunkGKNEJ6ENcjs.chartToSvg.call(void 0, controller.toJSON(), { width: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _37 => _37.width]), () => ( 640)), height: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _38 => _38.height]), () => ( 400)) })
1041
+ svg: _chunkV5L2G22Rcjs.chartToSvg.call(void 0, controller.toJSON(), { width: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _39 => _39.width]), () => ( 640)), height: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _40 => _40.height]), () => ( 400)) })
892
1042
  })
893
1043
  },
894
1044
  {
@@ -900,7 +1050,7 @@ function createChartCommands(controller, options = {}) {
900
1050
  description: "Suggests chart types for the current data (or CSV), best first, each with a reason.",
901
1051
  params: object({ csv: { type: "string", description: "CSV text to analyse instead of the current data." } }),
902
1052
  run: (_ctx, params = {}) => ({
903
- recommendations: recommendChartTypes(_optionalChain([params, 'optionalAccess', _39 => _39.csv]) !== void 0 ? _chunkN3KJFGXTcjs.parseCsv.call(void 0, params.csv) : _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, controller.getSpec()))
1053
+ recommendations: recommendChartTypes(_optionalChain([params, 'optionalAccess', _41 => _41.csv]) !== void 0 ? _chunkN3KJFGXTcjs.parseCsv.call(void 0, params.csv) : _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, controller.getSpec()))
904
1054
  })
905
1055
  },
906
1056
  {
@@ -913,8 +1063,8 @@ function createChartCommands(controller, options = {}) {
913
1063
  run: () => {
914
1064
  const s = controller.getSpec();
915
1065
  const visible = s.series.filter((x) => !x.hidden);
916
- const colors = _chunkR3P2M7HUcjs.chartSpecColorsByCategory.call(void 0, s) ? s.categories.map((_, i) => _optionalChain([visible, 'access', _40 => _40[0], 'optionalAccess', _41 => _41.pointColors, 'optionalAccess', _42 => _42[i]]) || _chunkR3P2M7HUcjs.chartSliceColor.call(void 0, s, i)) : visible.map((x) => _chunkR3P2M7HUcjs.chartSeriesColor.call(void 0, s, s.series.indexOf(x)));
917
- return { colors, ..._chunkR3P2M7HUcjs.checkChartColors.call(void 0, colors) };
1066
+ const colors = _chunkBPX4Z3N3cjs.chartSpecColorsByCategory.call(void 0, s) ? s.categories.map((_, i) => _optionalChain([visible, 'access', _42 => _42[0], 'optionalAccess', _43 => _43.pointColors, 'optionalAccess', _44 => _44[i]]) || _chunkBPX4Z3N3cjs.chartSliceColor.call(void 0, s, i)) : visible.map((x) => _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, s, s.series.indexOf(x)));
1067
+ return { colors, ..._chunkBPX4Z3N3cjs.checkChartColors.call(void 0, colors) };
918
1068
  }
919
1069
  },
920
1070
  {
@@ -943,9 +1093,9 @@ function chartClientToScene(scene, box, clientX, clientY) {
943
1093
  return { x: (clientX - box.left) * sx, y: (clientY - box.top) * sy };
944
1094
  }
945
1095
  function canDragChartPoint(controller, scene, target) {
946
- if (_optionalChain([target, 'optionalAccess', _43 => _43.kind]) !== "point" || !scene.valueScale || scene.percent) return false;
1096
+ if (_optionalChain([target, 'optionalAccess', _45 => _45.kind]) !== "point" || !scene.valueScale || scene.percent) return false;
947
1097
  const spec = controller.getSpec();
948
- const family = _chunkR3P2M7HUcjs.chartFamily.call(void 0, spec);
1098
+ const family = _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec);
949
1099
  if (family !== "cartesian" && family !== "xy" && family !== "waterfall") return false;
950
1100
  const series = controller.getSeries(target.seriesId);
951
1101
  return !!series && !series.hidden && series.values[target.index] !== null;
@@ -954,7 +1104,7 @@ function snapChartDragValue(scene, value, options = {}) {
954
1104
  const scale = _nullishCoalesce(options.scale, () => ( scene.valueScale));
955
1105
  const tolerance = _nullishCoalesce(options.tolerancePx, () => ( 6));
956
1106
  if (scale) {
957
- const px = (v) => _chunkSBQVEBSUcjs.chartScaleToPixel.call(void 0, v, scale);
1107
+ const px = (v) => _chunkUUUTEVX6cjs.chartScaleToPixel.call(void 0, v, scale);
958
1108
  const at = px(value);
959
1109
  let best = null;
960
1110
  let bestDist = tolerance;
@@ -969,7 +1119,7 @@ function snapChartDragValue(scene, value, options = {}) {
969
1119
  }
970
1120
  if (best !== null) return best;
971
1121
  }
972
- return _chunkSBQVEBSUcjs.snapChartValue.call(void 0, scene, value, options.step, _optionalChain([scale, 'optionalAccess', _44 => _44.ticks]), _optionalChain([scale, 'optionalAccess', _45 => _45.logBase]));
1122
+ return _chunkUUUTEVX6cjs.snapChartValue.call(void 0, scene, value, options.step, _optionalChain([scale, 'optionalAccess', _46 => _46.ticks]), _optionalChain([scale, 'optionalAccess', _47 => _47.logBase]));
973
1123
  }
974
1124
  function startChartPointDrag(controller, scene, target, start, options = {}) {
975
1125
  if (!canDragChartPoint(controller, scene, target)) return null;
@@ -978,11 +1128,11 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
978
1128
  const series = controller.getSeries(seriesId);
979
1129
  const secondary = series.axis === "secondary" && !!scene.valueScale2;
980
1130
  const scale = secondary ? scene.valueScale2 : scene.valueScale;
981
- const xy = _chunkR3P2M7HUcjs.chartFamily.call(void 0, spec) === "xy" && !!scene.xScale;
1131
+ const xy = _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec) === "xy" && !!scene.xScale;
982
1132
  const startValue = _nullishCoalesce(series.values[index], () => ( 0));
983
- const startX = _nullishCoalesce(_optionalChain([series, 'access', _46 => _46.x, 'optionalAccess', _47 => _47[index]]), () => ( null));
984
- const startAt = _chunkSBQVEBSUcjs.chartValueAtPoint.call(void 0, scene, start, secondary);
985
- const startAtX = xy ? _chunkSBQVEBSUcjs.chartXAtPoint.call(void 0, scene, start) : void 0;
1133
+ const startX = _nullishCoalesce(_optionalChain([series, 'access', _48 => _48.x, 'optionalAccess', _49 => _49[index]]), () => ( null));
1134
+ const startAt = _chunkUUUTEVX6cjs.chartValueAtPoint.call(void 0, scene, start, secondary);
1135
+ const startAtX = xy ? _chunkUUUTEVX6cjs.chartXAtPoint.call(void 0, scene, start) : void 0;
986
1136
  if (startAt === void 0) return null;
987
1137
  const candidates = [0, startValue];
988
1138
  if (!xy) {
@@ -1000,7 +1150,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
1000
1150
  target: { seriesId, index },
1001
1151
  move(point, moveOptions = {}) {
1002
1152
  if (ended) return;
1003
- const at = _chunkSBQVEBSUcjs.chartValueAtPoint.call(void 0, scene, point, secondary);
1153
+ const at = _chunkUUUTEVX6cjs.chartValueAtPoint.call(void 0, scene, point, secondary);
1004
1154
  if (at === void 0) return;
1005
1155
  const factor = moveOptions.fine ? 0.1 : 1;
1006
1156
  const moved = (from, to, s, value) => s.logBase && value > 0 && from > 0 && to > 0 ? value * Math.pow(to / from, factor) : value + (to - from) * factor;
@@ -1008,7 +1158,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
1008
1158
  let moveX = false;
1009
1159
  let atX;
1010
1160
  if (xy && startX !== null && startAtX !== void 0) {
1011
- atX = _chunkSBQVEBSUcjs.chartXAtPoint.call(void 0, scene, point);
1161
+ atX = _chunkUUUTEVX6cjs.chartXAtPoint.call(void 0, scene, point);
1012
1162
  moveX = atX !== void 0;
1013
1163
  if (moveOptions.lockAxis) {
1014
1164
  if (Math.abs(point.x - start.x) >= Math.abs(point.y - start.y)) moveY = false;
@@ -1020,7 +1170,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
1020
1170
  if (moveOptions.fine) {
1021
1171
  if (s.logBase && !options.step) return v > 0 ? Number(v.toPrecision(3)) : v;
1022
1172
  const unit = options.step ? options.step / 10 : s.ticks.length > 1 ? (s.ticks[1] - s.ticks[0]) / 100 : void 0;
1023
- return _chunkSBQVEBSUcjs.snapChartValue.call(void 0, scene, v, unit, s.ticks);
1173
+ return _chunkUUUTEVX6cjs.snapChartValue.call(void 0, scene, v, unit, s.ticks);
1024
1174
  }
1025
1175
  return snapChartDragValue(scene, v, { candidates: c, tolerancePx: options.tolerancePx, step: options.step, scale: s });
1026
1176
  };
@@ -1031,7 +1181,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
1031
1181
  const xs = [..._nullishCoalesce(series.x, () => ( []))];
1032
1182
  xs[index] = x;
1033
1183
  controller.setValue(seriesId, index, y, { label });
1034
- if (x !== _optionalChain([controller, 'access', _48 => _48.getSeries, 'call', _49 => _49(seriesId), 'optionalAccess', _50 => _50.x, 'optionalAccess', _51 => _51[index]])) controller.updateSeries(seriesId, { x: xs });
1184
+ if (x !== _optionalChain([controller, 'access', _50 => _50.getSeries, 'call', _51 => _51(seriesId), 'optionalAccess', _52 => _52.x, 'optionalAccess', _53 => _53[index]])) controller.updateSeries(seriesId, { x: xs });
1035
1185
  } else controller.setValue(seriesId, index, y, { label });
1036
1186
  },
1037
1187
  end() {
@@ -1065,7 +1215,7 @@ function handleChartKey(controller, scene, event) {
1065
1215
  return true;
1066
1216
  case "ArrowLeft":
1067
1217
  case "ArrowRight": {
1068
- if (event.altKey || _optionalChain([selection, 'optionalAccess', _52 => _52.kind]) !== "point" && _optionalChain([selection, 'optionalAccess', _53 => _53.kind]) !== "category") return false;
1218
+ if (event.altKey || _optionalChain([selection, 'optionalAccess', _54 => _54.kind]) !== "point" && _optionalChain([selection, 'optionalAccess', _55 => _55.kind]) !== "category") return false;
1069
1219
  const n = spec.categories.length;
1070
1220
  const index = Math.max(0, Math.min(n - 1, selection.index + (event.key === "ArrowRight" ? 1 : -1)));
1071
1221
  controller.select({ ...selection, index });
@@ -1073,14 +1223,14 @@ function handleChartKey(controller, scene, event) {
1073
1223
  }
1074
1224
  case "ArrowUp":
1075
1225
  case "ArrowDown": {
1076
- if (_optionalChain([selection, 'optionalAccess', _54 => _54.kind]) !== "point" || _optionalChain([scene, 'optionalAccess', _55 => _55.percent])) return false;
1226
+ if (_optionalChain([selection, 'optionalAccess', _56 => _56.kind]) !== "point" || _optionalChain([scene, 'optionalAccess', _57 => _57.percent])) return false;
1077
1227
  const series = controller.getSeries(selection.seriesId);
1078
- const secondary = _optionalChain([series, 'optionalAccess', _56 => _56.axis]) === "secondary";
1079
- const scale = _nullishCoalesce((secondary ? _optionalChain([scene, 'optionalAccess', _57 => _57.valueScale2]) : null), () => ( _optionalChain([scene, 'optionalAccess', _58 => _58.valueScale])));
1080
- const ticks = _nullishCoalesce(_optionalChain([scale, 'optionalAccess', _59 => _59.ticks]), () => ( []));
1228
+ const secondary = _optionalChain([series, 'optionalAccess', _58 => _58.axis]) === "secondary";
1229
+ const scale = _nullishCoalesce((secondary ? _optionalChain([scene, 'optionalAccess', _59 => _59.valueScale2]) : null), () => ( _optionalChain([scene, 'optionalAccess', _60 => _60.valueScale])));
1230
+ const ticks = _nullishCoalesce(_optionalChain([scale, 'optionalAccess', _61 => _61.ticks]), () => ( []));
1081
1231
  const up = event.key === "ArrowUp";
1082
- const current = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _60 => _60.values, 'access', _61 => _61[selection.index]]), () => ( null));
1083
- if (_optionalChain([scale, 'optionalAccess', _62 => _62.logBase]) && current !== null && current > 0) {
1232
+ const current = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _62 => _62.values, 'access', _63 => _63[selection.index]]), () => ( null));
1233
+ if (_optionalChain([scale, 'optionalAccess', _64 => _64.logBase]) && current !== null && current > 0) {
1084
1234
  const power = event.shiftKey ? 1 : event.altKey ? 0.01 : 0.1;
1085
1235
  const next = Number((current * Math.pow(scale.logBase, up ? power : -power)).toPrecision(event.altKey ? 4 : 3));
1086
1236
  controller.nudgeValue(selection.seriesId, selection.index, next - current);
@@ -1108,22 +1258,22 @@ function describeChartSelection(controller, selection = controller.getState().se
1108
1258
  case "legend":
1109
1259
  return "Legend";
1110
1260
  case "axis":
1111
- return selection.axis === "x" ? _chunkR3P2M7HUcjs.chartFamily.call(void 0, spec) === "xy" ? "X axis" : "Category axis" : selection.axis === "y" ? "Value axis" : "Secondary value axis";
1261
+ return selection.axis === "x" ? _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec) === "xy" ? "X axis" : "Category axis" : selection.axis === "y" ? "Value axis" : "Secondary value axis";
1112
1262
  case "series":
1113
- return `Series "${_nullishCoalesce(_optionalChain([controller, 'access', _63 => _63.getSeries, 'call', _64 => _64(selection.seriesId), 'optionalAccess', _65 => _65.name]), () => ( selection.seriesId))}"`;
1263
+ return `Series "${_nullishCoalesce(_optionalChain([controller, 'access', _65 => _65.getSeries, 'call', _66 => _66(selection.seriesId), 'optionalAccess', _67 => _67.name]), () => ( selection.seriesId))}"`;
1114
1264
  case "category":
1115
1265
  return `Category "${_nullishCoalesce(spec.categories[selection.index], () => ( selection.index))}"`;
1116
1266
  case "trendline": {
1117
1267
  const series = controller.getSeries(selection.seriesId);
1118
- const line = _optionalChain([series, 'optionalAccess', _66 => _66.trendlines, 'optionalAccess', _67 => _67[selection.index]]);
1119
- return `${line ? line.type.replace("-", " ") : "Trendline"} trendline on "${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _68 => _68.name]), () => ( selection.seriesId))}"`;
1268
+ const line = _optionalChain([series, 'optionalAccess', _68 => _68.trendlines, 'optionalAccess', _69 => _69[selection.index]]);
1269
+ return `${line ? line.type.replace("-", " ") : "Trendline"} trendline on "${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _70 => _70.name]), () => ( selection.seriesId))}"`;
1120
1270
  }
1121
1271
  case "point": {
1122
1272
  const series = controller.getSeries(selection.seriesId);
1123
- const value = _optionalChain([series, 'optionalAccess', _69 => _69.values, 'access', _70 => _70[selection.index]]);
1124
- const x = _optionalChain([series, 'optionalAccess', _71 => _71.x, 'optionalAccess', _72 => _72[selection.index]]);
1125
- if (x !== void 0 && x !== null && _chunkR3P2M7HUcjs.chartFamily.call(void 0, spec) === "xy") return `${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _73 => _73.name]), () => ( selection.seriesId))}: (${x}, ${_nullishCoalesce(value, () => ( "blank"))})`;
1126
- return `${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _74 => _74.name]), () => ( selection.seriesId))} \xB7 ${_nullishCoalesce(spec.categories[selection.index], () => ( selection.index))}: ${_nullishCoalesce(value, () => ( "blank"))}`;
1273
+ const value = _optionalChain([series, 'optionalAccess', _71 => _71.values, 'access', _72 => _72[selection.index]]);
1274
+ const x = _optionalChain([series, 'optionalAccess', _73 => _73.x, 'optionalAccess', _74 => _74[selection.index]]);
1275
+ if (x !== void 0 && x !== null && _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec) === "xy") return `${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _75 => _75.name]), () => ( selection.seriesId))}: (${x}, ${_nullishCoalesce(value, () => ( "blank"))})`;
1276
+ return `${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _76 => _76.name]), () => ( selection.seriesId))} \xB7 ${_nullishCoalesce(spec.categories[selection.index], () => ( selection.index))}: ${_nullishCoalesce(value, () => ( "blank"))}`;
1127
1277
  }
1128
1278
  }
1129
1279
  }
@@ -1170,7 +1320,7 @@ var CHART_PRESENCE_COLORS = _chunkSWTUM32Hcjs.PRESENCE_COLORS;
1170
1320
  var realChartClock = _chunkSWTUM32Hcjs.realPresenceClock;
1171
1321
  var createInstantChartClock = _chunkSWTUM32Hcjs.createInstantPresenceClock;
1172
1322
  function chartPointAnchor(scene, seriesId, index) {
1173
- const mark = scene.marks.find((m) => (m.role === "bar" || m.role === "point") && _optionalChain([m, 'access', _75 => _75.target, 'optionalAccess', _76 => _76.kind]) === "point" && m.target.seriesId === seriesId && m.target.index === index);
1323
+ const mark = scene.marks.find((m) => (m.role === "bar" || m.role === "point") && _optionalChain([m, 'access', _77 => _77.target, 'optionalAccess', _78 => _78.kind]) === "point" && m.target.seriesId === seriesId && m.target.index === index);
1174
1324
  if (!mark) return null;
1175
1325
  if (mark.kind === "rect") return { x: mark.x + mark.width / 2, y: mark.y };
1176
1326
  if (mark.kind === "circle") return { x: mark.cx, y: mark.cy };
@@ -1196,10 +1346,10 @@ function planChartCommand(spec, scene, command, speed = 1) {
1196
1346
  case "setValue": {
1197
1347
  const at = chartPointAnchor(scene, command.seriesId, command.index);
1198
1348
  const series = spec.series.find((s) => s.id === command.seriesId);
1199
- const from = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _77 => _77.values, 'access', _78 => _78[command.index]]), () => ( 0));
1200
- const scale = _optionalChain([series, 'optionalAccess', _79 => _79.axis]) === "secondary" ? _nullishCoalesce(scene.valueScale2, () => ( scene.valueScale)) : scene.valueScale;
1349
+ const from = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _79 => _79.values, 'access', _80 => _80[command.index]]), () => ( 0));
1350
+ const scale = _optionalChain([series, 'optionalAccess', _81 => _81.axis]) === "secondary" ? _nullishCoalesce(scene.valueScale2, () => ( scene.valueScale)) : scene.valueScale;
1201
1351
  if (at && scale) {
1202
- const px = _chunkSBQVEBSUcjs.linearMap.call(void 0, command.value, scale.domain, scale.range);
1352
+ const px = _chunkUUUTEVX6cjs.linearMap.call(void 0, command.value, scale.domain, scale.range);
1203
1353
  const to = scale.axis === "y" ? { x: at.x, y: px } : { x: px, y: at.y };
1204
1354
  steps.push({ type: "move", to: at, ms: ms(380) }, { type: "press" }, { type: "drag", to, ms: ms(520), from, value: command.value }, { type: "release" });
1205
1355
  } else steps.push({ type: "drag", to: { x: scene.plot.x + scene.plot.width / 2, y: scene.plot.y + scene.plot.height / 2 }, ms: ms(200), from, value: command.value });
@@ -1209,12 +1359,12 @@ function planChartCommand(spec, scene, command, speed = 1) {
1209
1359
  case "select": {
1210
1360
  const sel = command.selection;
1211
1361
  let to = null;
1212
- if (_optionalChain([sel, 'optionalAccess', _80 => _80.kind]) === "point") to = chartPointAnchor(scene, sel.seriesId, sel.index);
1362
+ if (_optionalChain([sel, 'optionalAccess', _82 => _82.kind]) === "point") to = chartPointAnchor(scene, sel.seriesId, sel.index);
1213
1363
  else if (sel) {
1214
1364
  const m = scene.marks.find((x) => x.target && JSON.stringify(x.target) === JSON.stringify(sel));
1215
- if (_optionalChain([m, 'optionalAccess', _81 => _81.kind]) === "text") to = { x: m.x, y: m.y };
1216
- else if (_optionalChain([m, 'optionalAccess', _82 => _82.kind]) === "rect") to = { x: m.x + m.width / 2, y: m.y + m.height / 2 };
1217
- else if (_optionalChain([m, 'optionalAccess', _83 => _83.kind]) === "circle") to = { x: m.cx, y: m.cy };
1365
+ if (_optionalChain([m, 'optionalAccess', _83 => _83.kind]) === "text") to = { x: m.x, y: m.y };
1366
+ else if (_optionalChain([m, 'optionalAccess', _84 => _84.kind]) === "rect") to = { x: m.x + m.width / 2, y: m.y + m.height / 2 };
1367
+ else if (_optionalChain([m, 'optionalAccess', _85 => _85.kind]) === "circle") to = { x: m.cx, y: m.cy };
1218
1368
  }
1219
1369
  if (to) steps.push({ type: "move", to, ms: ms(380) }, { type: "press" }, { type: "release" });
1220
1370
  steps.push({ type: "commit" });
@@ -1296,7 +1446,7 @@ var ChartDirector = class {
1296
1446
  if (command.kind !== "setValue") break;
1297
1447
  const stale2 = this.stale(command);
1298
1448
  if (stale2) return { ok: false, command, message: stale2 };
1299
- const label = `${_nullishCoalesce(_optionalChain([this, 'access', _84 => _84.presence, 'access', _85 => _85.getState, 'call', _86 => _86(), 'access', _87 => _87.actors, 'access', _88 => _88.find, 'call', _89 => _89((a) => a.id === id), 'optionalAccess', _90 => _90.name]), () => ( "Agent"))}: edit value`;
1449
+ const label = `${_nullishCoalesce(_optionalChain([this, 'access', _86 => _86.presence, 'access', _87 => _87.getState, 'call', _88 => _88(), 'access', _89 => _89.actors, 'access', _90 => _90.find, 'call', _91 => _91((a) => a.id === id), 'optionalAccess', _92 => _92.name]), () => ( "Agent"))}: edit value`;
1300
1450
  await this.move(id, where(), step.to, step.ms, (e) => {
1301
1451
  const v = step.from + (step.value - step.from) * e;
1302
1452
  this.controller.setValue(command.seriesId, command.index, Number(v.toPrecision(12)), { label });
@@ -1366,6 +1516,11 @@ function planChartToolPlayback(tool, args) {
1366
1516
  case "add_chart_tree_node":
1367
1517
  case "update_chart_tree_node":
1368
1518
  case "remove_chart_tree_node":
1519
+ case "set_chart_links":
1520
+ case "import_chart_links_csv":
1521
+ case "add_chart_link":
1522
+ case "update_chart_link":
1523
+ case "remove_chart_link":
1369
1524
  case "import_chart_csv":
1370
1525
  case "import_chart_mermaid":
1371
1526
  case "import_chart_ooxml":
@@ -1392,6 +1547,10 @@ function planChartToolPlayback(tool, args) {
1392
1547
  return click(control("series.callout"));
1393
1548
  case "highlight_chart":
1394
1549
  return click(control("highlight"));
1550
+ case "set_chart_race_frame":
1551
+ return click(control("raceFrame"));
1552
+ case "play_chart_race":
1553
+ return click({ kind: "action", id: "race-play" });
1395
1554
  case "render_chart":
1396
1555
  return [{ type: "target", ref: { kind: "action", id: "download-png" } }];
1397
1556
  case "undo_chart":
@@ -1450,19 +1609,36 @@ function createChartToolProvider(controller, options = {}) {
1450
1609
  fail2(`There is no category ${JSON.stringify(ref)}; expected an index from 0 to ${categories.length - 1} or one of ${categories.slice(0, 20).map((c) => JSON.stringify(c)).join(", ")}.`);
1451
1610
  return index;
1452
1611
  };
1453
- const table = () => _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, spec());
1612
+ const table = () => _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, spec());
1454
1613
  const treeTable = () => {
1455
- const rows = _chunkR3P2M7HUcjs.chartTreeToRows.call(void 0, spec().tree);
1456
- const depth = _chunkR3P2M7HUcjs.chartTreeDepth.call(void 0, spec().tree);
1614
+ const rows = _chunkBPX4Z3N3cjs.chartTreeToRows.call(void 0, spec().tree);
1615
+ const depth = _chunkBPX4Z3N3cjs.chartTreeDepth.call(void 0, spec().tree);
1457
1616
  return [[...Array.from({ length: depth }, (_, k) => k === 0 ? "Group" : k === depth - 1 ? "Item" : `Level ${k + 1}`), "Value"], ...rows.map((r) => [...r.path, ...Array(depth - r.path.length).fill(""), r.value])];
1458
1617
  };
1459
- const treeSummary = () => ({ tree: spec().tree, groups: spec().tree.map((n) => ({ name: n.name, total: _chunkR3P2M7HUcjs.chartTreeTotal.call(void 0, n) })), depth: _chunkR3P2M7HUcjs.chartTreeDepth.call(void 0, spec().tree) });
1618
+ const raceFrameOf = (time) => {
1619
+ const cats = spec().categories;
1620
+ const frame = typeof time === "number" ? time : cats.indexOf(time);
1621
+ if (!(Number.isFinite(frame) && frame >= 0 && frame <= cats.length - 1))
1622
+ fail2(`There is no time point ${JSON.stringify(time)}; expected an index from 0 to ${Math.max(0, cats.length - 1)} or one of ${cats.slice(0, 20).map((c) => JSON.stringify(c)).join(", ")}.`);
1623
+ return frame;
1624
+ };
1625
+ const raceAt = (frame) => {
1626
+ const s = spec();
1627
+ const at = _nullishCoalesce(frame, () => ( s.categories.length - 1));
1628
+ return {
1629
+ frame: at,
1630
+ time: _nullishCoalesce(s.categories[Math.round(at)], () => ( null)),
1631
+ ranking: _chunkUUUTEVX6cjs.chartRaceRanking.call(void 0, s, at).slice(0, s.raceTopN).map((e) => ({ rank: e.rank + 1, series: e.seriesId, name: e.name, value: e.value }))
1632
+ };
1633
+ };
1634
+ const linksSummary = () => ({ links: spec().links, nodes: spec().sankeyNodes.map((name, i) => ({ name, value: _chunkBPX4Z3N3cjs.chartSankeyNodeValues.call(void 0, spec().links, spec().sankeyNodes)[i] })) });
1635
+ const treeSummary = () => ({ tree: spec().tree, groups: spec().tree.map((n) => ({ name: n.name, total: _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, n) })), depth: _chunkBPX4Z3N3cjs.chartTreeDepth.call(void 0, spec().tree) });
1460
1636
  const Parser = () => _nullishCoalesce(options.DOMParser, () => ( globalThis.DOMParser));
1461
1637
  const getChart = {
1462
1638
  name: "get_chart",
1463
1639
  title: "Read the chart",
1464
1640
  description: "Returns the chart spec (type, titles, axes, legend, series with ids and settings), its data as a table (header row of series names, then one row per category), grouped data as treeTable (path of names to each item, then its value) when the chart has a tree, the current selection, and a summary at the given size: per-series min / max / mean / trend, the axes as drawn, layout warnings (hidden labels, thinned lines), a colour check and a plain-language description. Use the series ids and category indexes it returns with the write tools.",
1465
- inputSchema: { type: "object", properties: { width: _chunkNZD2MZJCcjs.WIDTH, height: _chunkNZD2MZJCcjs.HEIGHT }, additionalProperties: false },
1641
+ inputSchema: { type: "object", properties: { width: _chunkMZFZSVUJcjs.WIDTH, height: _chunkMZFZSVUJcjs.HEIGHT }, additionalProperties: false },
1466
1642
  annotations: { title: "Read the chart", ...READ },
1467
1643
  handler: ({ width = size.width, height = size.height }) => {
1468
1644
  const reason = readOnlyReason();
@@ -1470,7 +1646,7 @@ function createChartToolProvider(controller, options = {}) {
1470
1646
  spec: controller.toJSON(),
1471
1647
  table: table(),
1472
1648
  selection: controller.getState().selection,
1473
- summary: _chunkGKNEJ6ENcjs.summarizeChart.call(void 0, controller.toJSON(), { width, height }),
1649
+ summary: _chunkV5L2G22Rcjs.summarizeChart.call(void 0, controller.toJSON(), { width, height }),
1474
1650
  ...spec().tree.length ? { treeTable: treeTable() } : {},
1475
1651
  issues: controller.getState().issues,
1476
1652
  ...reason ? { readOnly: reason } : {}
@@ -1484,17 +1660,19 @@ function createChartToolProvider(controller, options = {}) {
1484
1660
  inputSchema: {
1485
1661
  type: "object",
1486
1662
  properties: {
1487
- width: _chunkNZD2MZJCcjs.WIDTH,
1488
- height: _chunkNZD2MZJCcjs.HEIGHT,
1489
- format: { type: "string", enum: ["svg", "png"], description: "svg (default): the SVG document as text. png: an image to look at (only when the host can rasterize; costs image tokens)." }
1663
+ width: _chunkMZFZSVUJcjs.WIDTH,
1664
+ height: _chunkMZFZSVUJcjs.HEIGHT,
1665
+ format: { type: "string", enum: ["svg", "png"], description: "svg (default): the SVG document as text. png: an image to look at (only when the host can rasterize; costs image tokens)." },
1666
+ time: { ..._chunkMZFZSVUJcjs.RACE_TIME, description: `Bar race only: the moment to draw (default: the one shown). ${_chunkMZFZSVUJcjs.RACE_TIME.description}` }
1490
1667
  },
1491
1668
  additionalProperties: false
1492
1669
  },
1493
1670
  annotations: { title: "Render the chart", ...READ },
1494
- handler: async ({ width = size.width, height = size.height, format = "svg" }) => {
1671
+ handler: async ({ width = size.width, height = size.height, format = "svg", time }) => {
1495
1672
  const json = controller.toJSON();
1496
- const scene = _chunkSBQVEBSUcjs.layoutChart.call(void 0, json, { width, height, selection: null });
1497
- const svg = _chunkGKNEJ6ENcjs.chartSceneToSvg.call(void 0, scene, { ariaLabel: json.title || void 0, description: _chunkGKNEJ6ENcjs.describeChart.call(void 0, json) });
1673
+ const raceFrame = time !== void 0 ? raceFrameOf(time) : controller.getState().raceFrame;
1674
+ const scene = _chunkUUUTEVX6cjs.layoutChart.call(void 0, json, { width, height, selection: null, raceFrame });
1675
+ const svg = _chunkV5L2G22Rcjs.chartSceneToSvg.call(void 0, scene, { ariaLabel: json.title || void 0, description: _chunkV5L2G22Rcjs.describeChart.call(void 0, json) });
1498
1676
  const warnings = scene.warnings;
1499
1677
  if (format === "png") {
1500
1678
  if (!options.rasterize) fail2('This host cannot rasterize charts; call render_chart with format "svg", or get_chart for the layout warnings.');
@@ -1528,8 +1706,8 @@ function createChartToolProvider(controller, options = {}) {
1528
1706
  handler: ({ colors, surface }) => {
1529
1707
  const s = spec();
1530
1708
  const visible = s.series.filter((x) => !x.hidden);
1531
- const own = _chunkR3P2M7HUcjs.chartSpecColorsByCategory.call(void 0, s) ? s.categories.map((_, i) => _optionalChain([visible, 'access', _91 => _91[0], 'optionalAccess', _92 => _92.pointColors, 'optionalAccess', _93 => _93[i]]) || _chunkR3P2M7HUcjs.chartSliceColor.call(void 0, s, i)) : visible.map((x) => _chunkR3P2M7HUcjs.chartSeriesColor.call(void 0, s, s.series.indexOf(x)));
1532
- return { colors: _nullishCoalesce(colors, () => ( own)), ..._chunkR3P2M7HUcjs.checkChartColors.call(void 0, _nullishCoalesce(colors, () => ( own)), { surface }) };
1709
+ const own = _chunkBPX4Z3N3cjs.chartSpecColorsByCategory.call(void 0, s) ? s.categories.map((_, i) => _optionalChain([visible, 'access', _93 => _93[0], 'optionalAccess', _94 => _94.pointColors, 'optionalAccess', _95 => _95[i]]) || _chunkBPX4Z3N3cjs.chartSliceColor.call(void 0, s, i)) : visible.map((x) => _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, s, s.series.indexOf(x)));
1710
+ return { colors: _nullishCoalesce(colors, () => ( own)), ..._chunkBPX4Z3N3cjs.checkChartColors.call(void 0, _nullishCoalesce(colors, () => ( own)), { surface }) };
1533
1711
  }
1534
1712
  };
1535
1713
  const recommend = {
@@ -1551,21 +1729,29 @@ function createChartToolProvider(controller, options = {}) {
1551
1729
  description: "Returns a trendline's fitted coefficients (in x for category charts, x = 1, 2, 3, \u2026), R\xB2, equation and the number of points, or the moving-average points.",
1552
1730
  inputSchema: {
1553
1731
  type: "object",
1554
- properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index on the series (0 = first)." } },
1732
+ properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index on the series (0 = first)." } },
1555
1733
  required: ["series", "index"],
1556
1734
  additionalProperties: false
1557
1735
  },
1558
1736
  annotations: { title: "Read a trendline fit", ...READ },
1559
1737
  handler: ({ series, index }) => {
1560
1738
  const s = seriesById(series);
1561
- const line = _optionalChain([s, 'access', _94 => _94.trendlines, 'optionalAccess', _95 => _95[index]]);
1562
- if (!line) fail2(`"${s.name}" has no trendline ${index}; it has ${_nullishCoalesce(_optionalChain([s, 'access', _96 => _96.trendlines, 'optionalAccess', _97 => _97.length]), () => ( 0))}.`);
1739
+ const line = _optionalChain([s, 'access', _96 => _96.trendlines, 'optionalAccess', _97 => _97[index]]);
1740
+ if (!line) fail2(`"${s.name}" has no trendline ${index}; it has ${_nullishCoalesce(_optionalChain([s, 'access', _98 => _98.trendlines, 'optionalAccess', _99 => _99.length]), () => ( 0))}.`);
1563
1741
  if (line.type === "moving-average") return { trendline: line, points: controller.trendlineMovingAverage(s.id, index) };
1564
1742
  const fit = controller.trendlineFit(s.id, index);
1565
1743
  if (!fit) fail2(`The ${line.type} trendline on "${s.name}" cannot be fitted: it needs more points (and positive values for log, exponential and power fits).`);
1566
1744
  return { trendline: line, coefficients: fit.coefficients, r2: fit.r2, equation: fit.equation, points: fit.points };
1567
1745
  }
1568
1746
  };
1747
+ const raceRanking = {
1748
+ name: "get_chart_race_ranking",
1749
+ title: "Read a bar race ranking",
1750
+ description: "Returns who leads a bar race at a moment without changing what is shown: the top raceTopN names with their rank, series id and value (eased between time points). Defaults to the moment shown. Works for any chart, reading categories as time points and series as names.",
1751
+ inputSchema: { type: "object", properties: { time: _chunkMZFZSVUJcjs.RACE_TIME }, additionalProperties: false },
1752
+ annotations: { title: "Read a bar race ranking", ...READ },
1753
+ handler: ({ time }) => raceAt(time !== void 0 ? raceFrameOf(time) : controller.getState().raceFrame)
1754
+ };
1569
1755
  const listPresets = {
1570
1756
  name: "list_chart_presets",
1571
1757
  title: "List chart presets",
@@ -1573,17 +1759,17 @@ function createChartToolProvider(controller, options = {}) {
1573
1759
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
1574
1760
  annotations: { title: "List chart presets", ...READ },
1575
1761
  handler: () => ({
1576
- layouts: _chunkGKNEJ6ENcjs.CHART_LAYOUT_PRESETS.map(({ id, label, description }) => ({ id, label, description })),
1577
- colorSchemes: _chunkGKNEJ6ENcjs.CHART_COLOR_SCHEMES.map(({ id, label, description, palette }) => ({ id, label, description, palette }))
1762
+ layouts: _chunkV5L2G22Rcjs.CHART_LAYOUT_PRESETS.map(({ id, label, description }) => ({ id, label, description })),
1763
+ colorSchemes: _chunkV5L2G22Rcjs.CHART_COLOR_SCHEMES.map(({ id, label, description, palette }) => ({ id, label, description, palette }))
1578
1764
  })
1579
1765
  };
1580
1766
  const exportMermaid = {
1581
1767
  name: "export_chart_mermaid",
1582
1768
  title: "Export chart as Mermaid",
1583
- description: 'Returns the chart as Mermaid text (xychart-beta, pie or radar-beta) for Markdown or chat. With meta (default true) one "%% @pixerate {\u2026}" comment keeps what Mermaid cannot express, so import_chart_mermaid gets the chart back exactly.',
1769
+ description: 'Returns the chart as Mermaid text for Markdown or chat: xychart-beta, pie or radar-beta, sankey-beta for Sankey diagrams with flows, treemap-beta for treemaps and sunbursts (with their levels). With meta (default true) one "%% @pixerate {\u2026}" comment keeps what Mermaid cannot express, so import_chart_mermaid gets the chart back exactly.',
1584
1770
  inputSchema: { type: "object", properties: { meta: { type: "boolean", description: "Include the round-trip comment (default true)." } }, additionalProperties: false },
1585
1771
  annotations: { title: "Export chart as Mermaid", ...READ },
1586
- handler: ({ meta = true }) => ({ mermaid: _chunkGKNEJ6ENcjs.chartToMermaid.call(void 0, controller.toJSON(), { meta }) })
1772
+ handler: ({ meta = true }) => ({ mermaid: _chunkV5L2G22Rcjs.chartToMermaid.call(void 0, controller.toJSON(), { meta }) })
1587
1773
  };
1588
1774
  const exportOoxml = {
1589
1775
  name: "export_chart_ooxml",
@@ -1591,7 +1777,7 @@ function createChartToolProvider(controller, options = {}) {
1591
1777
  description: "Returns the chart as a DrawingML chart part (c:chartSpace) for Word or PowerPoint files, with what could not be written as sentences.",
1592
1778
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
1593
1779
  annotations: { title: "Export chart as Office XML", ...READ },
1594
- handler: () => _chunkYGG7WDWTcjs.chartToOoxml.call(void 0, controller.toJSON())
1780
+ handler: () => _chunkSZWVMB3Bcjs.chartToOoxml.call(void 0, controller.toJSON())
1595
1781
  };
1596
1782
  const updateChart = {
1597
1783
  name: "update_chart",
@@ -1599,7 +1785,7 @@ function createChartToolProvider(controller, options = {}) {
1599
1785
  description: 'Changes how the chart looks, as one undo step: type, titles, axes (xAxis = categories or numeric x, yAxis = values, yAxis2 = secondary values; each can be reversed, and value axes can be logarithmic with scale "log"), legend, stacking, orientation, curve, points, data labels and their position, palette, donut hole, bar spacing, histogram bins, waterfall total, radar rings (radarTicks) and grid shape (radarGraticule), note, highlight, reference lines and bands (whole lists), and varyColors. All-or-nothing: invalid values change nothing and come back as sentences. Returns the new spec.',
1600
1786
  inputSchema: {
1601
1787
  type: "object",
1602
- properties: _chunkNZD2MZJCcjs.CHART_UPDATE_PROPERTIES,
1788
+ properties: _chunkMZFZSVUJcjs.CHART_UPDATE_PROPERTIES,
1603
1789
  additionalProperties: false
1604
1790
  },
1605
1791
  annotations: { title: "Change chart presentation", ...WRITE_IDEMPOTENT },
@@ -1620,7 +1806,7 @@ function createChartToolProvider(controller, options = {}) {
1620
1806
  series: {
1621
1807
  type: "array",
1622
1808
  description: "The new series (replaces all).",
1623
- items: { type: "object", properties: { id: { type: "string", description: "Stable id (optional)." }, ..._chunkNZD2MZJCcjs.SERIES_PROPS }, required: ["name", "values"], additionalProperties: false }
1809
+ items: { type: "object", properties: { id: { type: "string", description: "Stable id (optional)." }, ..._chunkMZFZSVUJcjs.SERIES_PROPS }, required: ["name", "values"], additionalProperties: false }
1624
1810
  }
1625
1811
  },
1626
1812
  additionalProperties: false
@@ -1643,7 +1829,7 @@ function createChartToolProvider(controller, options = {}) {
1643
1829
  type: "array",
1644
1830
  minItems: 1,
1645
1831
  description: "Values to set.",
1646
- items: { type: "object", properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, category: _chunkNZD2MZJCcjs.CATEGORY_REF, value: _chunkNZD2MZJCcjs.VALUE }, required: ["series", "category", "value"], additionalProperties: false }
1832
+ items: { type: "object", properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, category: _chunkMZFZSVUJcjs.CATEGORY_REF, value: _chunkMZFZSVUJcjs.VALUE }, required: ["series", "category", "value"], additionalProperties: false }
1647
1833
  }
1648
1834
  },
1649
1835
  required: ["cells"],
@@ -1652,7 +1838,7 @@ function createChartToolProvider(controller, options = {}) {
1652
1838
  annotations: { title: "Set chart values", ...WRITE_IDEMPOTENT },
1653
1839
  handler: async ({ cells }) => {
1654
1840
  const resolved = cells.map((c) => ({ seriesId: seriesById(c.series).id, index: categoryIndex(c.category), value: c.value }));
1655
- const parsed = resolved.map((c) => _chunkR3P2M7HUcjs.parseChartValue.call(void 0, c.value));
1841
+ const parsed = resolved.map((c) => _chunkBPX4Z3N3cjs.parseChartValue.call(void 0, c.value));
1656
1842
  const bad = resolved.find((_, i) => parsed[i] === void 0);
1657
1843
  if (bad) fail2(`"${String(bad.value)}" is not a number; pass a number, numeric text or null for a gap. Nothing was changed.`);
1658
1844
  if (options.director && parsed.every((v) => typeof v === "number")) {
@@ -1669,7 +1855,7 @@ function createChartToolProvider(controller, options = {}) {
1669
1855
  description: "Adds a series (values padded to the categories) and selects it. Returns its id and stored values.",
1670
1856
  inputSchema: {
1671
1857
  type: "object",
1672
- properties: { ..._chunkNZD2MZJCcjs.SERIES_PROPS, id: { type: "string", description: "Id to use (default: series-N)." }, at: { type: "integer", minimum: 0, description: "Position (default: last)." } },
1858
+ properties: { ..._chunkMZFZSVUJcjs.SERIES_PROPS, id: { type: "string", description: "Id to use (default: series-N)." }, at: { type: "integer", minimum: 0, description: "Position (default: last)." } },
1673
1859
  required: ["name"],
1674
1860
  additionalProperties: false
1675
1861
  },
@@ -1687,7 +1873,7 @@ function createChartToolProvider(controller, options = {}) {
1687
1873
  description: "Renames, recolours, hides, moves to the secondary axis or changes how a series is drawn (marker, curve, labels, format, x values, bubble sizes, point colours, error bars). null resets a field. Values change with set_chart_values. Returns the series.",
1688
1874
  inputSchema: {
1689
1875
  type: "object",
1690
- properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, ...Object.fromEntries(Object.entries(_chunkNZD2MZJCcjs.SERIES_PROPS).filter(([k]) => k !== "values")) },
1876
+ properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, ...Object.fromEntries(Object.entries(_chunkMZFZSVUJcjs.SERIES_PROPS).filter(([k]) => k !== "values")) },
1691
1877
  required: ["series"],
1692
1878
  additionalProperties: false
1693
1879
  },
@@ -1703,7 +1889,7 @@ function createChartToolProvider(controller, options = {}) {
1703
1889
  name: "remove_chart_series",
1704
1890
  title: "Delete a series",
1705
1891
  description: "Deletes a series and its values. Returns the remaining series ids.",
1706
- inputSchema: { type: "object", properties: { series: _chunkNZD2MZJCcjs.SERIES_REF }, required: ["series"], additionalProperties: false },
1892
+ inputSchema: { type: "object", properties: { series: _chunkMZFZSVUJcjs.SERIES_REF }, required: ["series"], additionalProperties: false },
1707
1893
  annotations: { title: "Delete a series", ...DESTRUCTIVE },
1708
1894
  handler: ({ series }) => {
1709
1895
  resolve(controller.removeSeries(seriesById(series).id));
@@ -1729,7 +1915,7 @@ function createChartToolProvider(controller, options = {}) {
1729
1915
  name: "remove_chart_category",
1730
1916
  title: "Delete a category",
1731
1917
  description: "Deletes a category and its value in every series. Returns the remaining categories.",
1732
- inputSchema: { type: "object", properties: { category: _chunkNZD2MZJCcjs.CATEGORY_REF }, required: ["category"], additionalProperties: false },
1918
+ inputSchema: { type: "object", properties: { category: _chunkMZFZSVUJcjs.CATEGORY_REF }, required: ["category"], additionalProperties: false },
1733
1919
  annotations: { title: "Delete a category", ...DESTRUCTIVE },
1734
1920
  handler: ({ category }) => {
1735
1921
  resolve(controller.removeCategory(categoryIndex(category)));
@@ -1767,13 +1953,13 @@ function createChartToolProvider(controller, options = {}) {
1767
1953
  const importMermaid = {
1768
1954
  name: "import_chart_mermaid",
1769
1955
  title: "Import a Mermaid chart",
1770
- description: 'Replaces the chart with Mermaid xychart-beta, pie or radar-beta text as one undo step (a "%% @pixerate" comment from export_chart_mermaid restores everything else). Lines that cannot be read are skipped and listed with their line numbers. Returns the spec.',
1956
+ description: 'Replaces the chart with Mermaid xychart-beta, pie, radar-beta, sankey-beta or treemap-beta text as one undo step (a "%% @pixerate" comment from export_chart_mermaid restores everything else). Lines that cannot be read are skipped and listed with their line numbers. Returns the spec.',
1771
1957
  inputSchema: { type: "object", properties: { mermaid: { type: "string", description: "Mermaid text, optionally inside a ```mermaid fence." } }, required: ["mermaid"], additionalProperties: false },
1772
1958
  annotations: { title: "Import a Mermaid chart", ...DESTRUCTIVE },
1773
1959
  handler: ({ mermaid }) => {
1774
1960
  const fenced = /```(?:mermaid)?\s*\n([\s\S]*?)```/.exec(mermaid);
1775
- const read = _chunkGKNEJ6ENcjs.chartFromMermaid.call(void 0, fenced ? fenced[1] : mermaid);
1776
- if (!read.family) fail2(read.issues.map((i) => i.message).join(" ") || "Expected Mermaid starting with xychart-beta, pie or radar-beta.");
1961
+ const read = _chunkV5L2G22Rcjs.chartFromMermaid.call(void 0, fenced ? fenced[1] : mermaid);
1962
+ if (!read.family) fail2(read.issues.map((i) => i.message).join(" ") || "Expected Mermaid starting with xychart-beta, pie, radar-beta, sankey-beta or treemap-beta.");
1777
1963
  resolve(controller.update({ ...read.spec }, { label: "Import Mermaid chart" }));
1778
1964
  return { spec: controller.toJSON(), issues: read.issues };
1779
1965
  }
@@ -1785,7 +1971,7 @@ function createChartToolProvider(controller, options = {}) {
1785
1971
  inputSchema: { type: "object", properties: { xml: { type: "string", description: "The chart part XML, e.g. word/charts/chart1.xml." } }, required: ["xml"], additionalProperties: false },
1786
1972
  annotations: { title: "Import an Office chart", ...DESTRUCTIVE },
1787
1973
  handler: ({ xml }) => {
1788
- const read = _chunkYGG7WDWTcjs.chartFromOoxml.call(void 0, xml, { DOMParser: Parser() });
1974
+ const read = _chunkSZWVMB3Bcjs.chartFromOoxml.call(void 0, xml, { DOMParser: Parser() });
1789
1975
  if (read.issues.some((i) => i.path === "" || i.path === "plotArea")) fail2(read.issues.map((i) => i.message).join(" "));
1790
1976
  resolve(controller.update({ ...read.spec }, { label: "Import Office chart" }));
1791
1977
  return { spec: controller.toJSON(), issues: read.issues.map((i) => i.message), unsupported: read.unsupported, lossless: read.lossless };
@@ -1795,7 +1981,7 @@ function createChartToolProvider(controller, options = {}) {
1795
1981
  name: "add_chart_trendline",
1796
1982
  title: "Add a trendline",
1797
1983
  description: "Fits a trendline to a series and draws it (unstacked bar, line, area, scatter and bubble charts). Returns its index and the fit: coefficients, R\xB2 and equation.",
1798
- inputSchema: { type: "object", properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, ..._chunkNZD2MZJCcjs.TRENDLINE_PROPS }, required: ["series", "type"], additionalProperties: false },
1984
+ inputSchema: { type: "object", properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, ..._chunkMZFZSVUJcjs.TRENDLINE_PROPS }, required: ["series", "type"], additionalProperties: false },
1799
1985
  annotations: { title: "Add a trendline", ...WRITE },
1800
1986
  handler: ({ series, ...line }) => {
1801
1987
  const s = seriesById(series);
@@ -1809,7 +1995,7 @@ function createChartToolProvider(controller, options = {}) {
1809
1995
  description: "Deletes a trendline from a series. Returns the series' remaining trendlines.",
1810
1996
  inputSchema: {
1811
1997
  type: "object",
1812
- properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index on the series (0 = first)." } },
1998
+ properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index on the series (0 = first)." } },
1813
1999
  required: ["series", "index"],
1814
2000
  additionalProperties: false
1815
2001
  },
@@ -1817,7 +2003,7 @@ function createChartToolProvider(controller, options = {}) {
1817
2003
  handler: ({ series, index }) => {
1818
2004
  const s = seriesById(series);
1819
2005
  resolve(controller.removeTrendline(s.id, index));
1820
- return { series: s.id, trendlines: _nullishCoalesce(_optionalChain([controller, 'access', _98 => _98.getSeries, 'call', _99 => _99(s.id), 'optionalAccess', _100 => _100.trendlines]), () => ( [])) };
2006
+ return { series: s.id, trendlines: _nullishCoalesce(_optionalChain([controller, 'access', _100 => _100.getSeries, 'call', _101 => _101(s.id), 'optionalAccess', _102 => _102.trendlines]), () => ( [])) };
1821
2007
  }
1822
2008
  };
1823
2009
  const referenceTools = (what) => {
@@ -1828,7 +2014,7 @@ function createChartToolProvider(controller, options = {}) {
1828
2014
  name: `add_chart_reference_${what}`,
1829
2015
  title: `Add a reference ${what}`,
1830
2016
  description: what === "line" ? "Draws a dashed line across the plot at one value: a target, a floor, an average (bar, line, area, scatter and bubble charts). The axis grows to keep it in view. Returns its index and the reference lines." : "Shades a band across the plot between two values: a target or normal range (bar, line, area, scatter and bubble charts), drawn under the data. The axis grows to keep it in view. Returns its index and the reference bands.",
1831
- inputSchema: { type: "object", properties: what === "line" ? _chunkNZD2MZJCcjs.REFERENCE_LINE_PROPS : _chunkNZD2MZJCcjs.REFERENCE_BAND_PROPS, required: what === "line" ? ["value"] : ["from", "to"], additionalProperties: false },
2017
+ inputSchema: { type: "object", properties: what === "line" ? _chunkMZFZSVUJcjs.REFERENCE_LINE_PROPS : _chunkMZFZSVUJcjs.REFERENCE_BAND_PROPS, required: what === "line" ? ["value"] : ["from", "to"], additionalProperties: false },
1832
2018
  annotations: { title: `Add a reference ${what}`, ...WRITE },
1833
2019
  handler: (args) => {
1834
2020
  const result = resolve(what === "line" ? controller.addReferenceLine(args) : controller.addReferenceBand(args));
@@ -1839,7 +2025,7 @@ function createChartToolProvider(controller, options = {}) {
1839
2025
  name: `update_chart_reference_${what}`,
1840
2026
  title: `Change a reference ${what}`,
1841
2027
  description: `Changes a reference ${what} by index (all-or-nothing); label, axis and color take null to remove them. Returns the ${what} as stored.`,
1842
- inputSchema: { type: "object", properties: { index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, Kind), ...what === "line" ? _chunkNZD2MZJCcjs.REFERENCE_LINE_PATCH : _chunkNZD2MZJCcjs.REFERENCE_BAND_PATCH }, required: ["index"], additionalProperties: false },
2028
+ inputSchema: { type: "object", properties: { index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, Kind), ...what === "line" ? _chunkMZFZSVUJcjs.REFERENCE_LINE_PATCH : _chunkMZFZSVUJcjs.REFERENCE_BAND_PATCH }, required: ["index"], additionalProperties: false },
1843
2029
  annotations: { title: `Change a reference ${what}`, ...WRITE_IDEMPOTENT },
1844
2030
  handler: ({ index, ...patch }) => {
1845
2031
  if (!Object.keys(patch).length) fail2(`Nothing to change: pass at least one field besides index, e.g. {"index": ${index}, "label": "Target"}.`);
@@ -1851,7 +2037,7 @@ function createChartToolProvider(controller, options = {}) {
1851
2037
  name: `remove_chart_reference_${what}`,
1852
2038
  title: `Delete a reference ${what}`,
1853
2039
  description: `Deletes a reference ${what} by index; the ones after it move up one. Returns the reference ${what}s left.`,
1854
- inputSchema: { type: "object", properties: { index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, Kind) }, required: ["index"], additionalProperties: false },
2040
+ inputSchema: { type: "object", properties: { index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, Kind) }, required: ["index"], additionalProperties: false },
1855
2041
  annotations: { title: `Delete a reference ${what}`, ...DESTRUCTIVE },
1856
2042
  handler: ({ index }) => {
1857
2043
  resolve(what === "line" ? controller.removeReferenceLine(index) : controller.removeReferenceBand(index));
@@ -1868,7 +2054,7 @@ function createChartToolProvider(controller, options = {}) {
1868
2054
  description: 'Pins a short label to one bar or point, with a leader line, to say why it matters ("Record quarter", "Launch"); label null or "" removes it. Bar, line, area, scatter and bubble charts; the point must have a value. Selects the point and returns the series id, category index and label.',
1869
2055
  inputSchema: {
1870
2056
  type: "object",
1871
- properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, category: _chunkNZD2MZJCcjs.CATEGORY_REF, label: { type: ["string", "null"], description: "The label (keep it to a few words), or null to remove it." } },
2057
+ properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, category: _chunkMZFZSVUJcjs.CATEGORY_REF, label: { type: ["string", "null"], description: "The label (keep it to a few words), or null to remove it." } },
1872
2058
  required: ["series", "category", "label"],
1873
2059
  additionalProperties: false
1874
2060
  },
@@ -1877,7 +2063,7 @@ function createChartToolProvider(controller, options = {}) {
1877
2063
  const s = seriesById(series);
1878
2064
  const index = categoryIndex(category);
1879
2065
  resolve(controller.setCallout(s.id, index, label));
1880
- return { series: s.id, index, category: spec().categories[index], label: _nullishCoalesce(_optionalChain([controller, 'access', _101 => _101.getSeries, 'call', _102 => _102(s.id), 'optionalAccess', _103 => _103.callouts, 'optionalAccess', _104 => _104[index]]), () => ( null)) };
2066
+ return { series: s.id, index, category: spec().categories[index], label: _nullishCoalesce(_optionalChain([controller, 'access', _103 => _103.getSeries, 'call', _104 => _104(s.id), 'optionalAccess', _105 => _105.callouts, 'optionalAccess', _106 => _106[index]]), () => ( null)) };
1881
2067
  }
1882
2068
  };
1883
2069
  const highlight = {
@@ -1901,7 +2087,7 @@ function createChartToolProvider(controller, options = {}) {
1901
2087
  name: "set_chart_tree",
1902
2088
  title: "Replace grouped data",
1903
2089
  description: `Replaces the chart's data with groups of items (a tree) for treemaps and sunbursts, as one undo step: items {"name", "value"} and groups {"name", "children"}, up to 6 levels, names unique among siblings. The top-level groups become the categories and their totals the first series, so other chart types draw the totals. [] goes back to plain data (the totals stay as values). Returns the tree, each group's total and the depth.`,
1904
- inputSchema: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs: _chunkNZD2MZJCcjs.TREE_DEFS },
2090
+ inputSchema: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs: _chunkMZFZSVUJcjs.TREE_DEFS },
1905
2091
  annotations: { title: "Replace grouped data", ...WRITE_IDEMPOTENT },
1906
2092
  handler: ({ tree }) => {
1907
2093
  resolve(controller.setTree(tree));
@@ -1940,13 +2126,13 @@ function createChartToolProvider(controller, options = {}) {
1940
2126
  },
1941
2127
  required: ["node"],
1942
2128
  additionalProperties: false,
1943
- $defs: _chunkNZD2MZJCcjs.TREE_DEFS
2129
+ $defs: _chunkMZFZSVUJcjs.TREE_DEFS
1944
2130
  },
1945
2131
  annotations: { title: "Add an item or group", ...WRITE },
1946
2132
  handler: ({ parent = [], node, at }) => {
1947
2133
  const result = resolve(controller.addTreeNode(parent, node, { at }));
1948
- const group = parent.length ? _chunkR3P2M7HUcjs.findChartTreeNode.call(void 0, spec().tree, parent) : null;
1949
- return { path: result.path, parentTotal: group ? _chunkR3P2M7HUcjs.chartTreeTotal.call(void 0, group) : spec().tree.reduce((t, n) => t + _chunkR3P2M7HUcjs.chartTreeTotal.call(void 0, n), 0) };
2134
+ const group = parent.length ? _chunkBPX4Z3N3cjs.findChartTreeNode.call(void 0, spec().tree, parent) : null;
2135
+ return { path: result.path, parentTotal: group ? _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, group) : spec().tree.reduce((t, n) => t + _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, n), 0) };
1950
2136
  }
1951
2137
  };
1952
2138
  const updateTreeNode = {
@@ -1956,7 +2142,7 @@ function createChartToolProvider(controller, options = {}) {
1956
2142
  inputSchema: {
1957
2143
  type: "object",
1958
2144
  properties: {
1959
- path: _chunkNZD2MZJCcjs.TREE_PATH,
2145
+ path: _chunkMZFZSVUJcjs.TREE_PATH,
1960
2146
  name: { type: "string", description: "New name (unique among its siblings)." },
1961
2147
  value: { type: "number", minimum: 0, description: "Items only: the new amount." },
1962
2148
  color: { type: ["string", "null"], description: "CSS colour, or null for the palette colour." }
@@ -1968,20 +2154,119 @@ function createChartToolProvider(controller, options = {}) {
1968
2154
  handler: ({ path, ...patch }) => {
1969
2155
  if (!Object.keys(patch).length) fail2("Nothing to change: pass name, value or color with the path.");
1970
2156
  const result = resolve(controller.updateTreeNode(path, patch));
1971
- return { path: result.path, node: _chunkR3P2M7HUcjs.findChartTreeNode.call(void 0, spec().tree, result.path) };
2157
+ return { path: result.path, node: _chunkBPX4Z3N3cjs.findChartTreeNode.call(void 0, spec().tree, result.path) };
1972
2158
  }
1973
2159
  };
1974
2160
  const removeTreeNode = {
1975
2161
  name: "remove_chart_tree_node",
1976
2162
  title: "Delete an item or group",
1977
2163
  description: "Deletes a node of the grouped data with everything under it (a group left empty becomes an item with value 0). Returns the group totals left.",
1978
- inputSchema: { type: "object", properties: { path: _chunkNZD2MZJCcjs.TREE_PATH }, required: ["path"], additionalProperties: false },
2164
+ inputSchema: { type: "object", properties: { path: _chunkMZFZSVUJcjs.TREE_PATH }, required: ["path"], additionalProperties: false },
1979
2165
  annotations: { title: "Delete an item or group", ...DESTRUCTIVE },
1980
2166
  handler: ({ path }) => {
1981
2167
  resolve(controller.removeTreeNode(path));
1982
2168
  return { groups: treeSummary().groups };
1983
2169
  }
1984
2170
  };
2171
+ const setLinks = {
2172
+ name: "set_chart_links",
2173
+ title: "Replace the flows",
2174
+ description: `Replaces the chart's data with flows between named nodes for a Sankey diagram, as one undo step: each {"source", "target", "value"} with a value above 0. Flows only go forwards (no loops) and a source-target pair appears once. The nodes become the categories and how much passes through each the first series. nodes (optional) sets the stacking order. [] goes back to plain data. Returns the flows and each node's throughput.`,
2175
+ inputSchema: {
2176
+ type: "object",
2177
+ properties: {
2178
+ links: { type: "array", items: { type: "object", properties: _chunkMZFZSVUJcjs.LINK_PROPS, required: ["source", "target", "value"], additionalProperties: false }, description: "All the flows; [] removes them." },
2179
+ nodes: { type: "array", items: { type: "string" }, description: "Node names in stacking order (default: as the flows first name them)." }
2180
+ },
2181
+ required: ["links"],
2182
+ additionalProperties: false
2183
+ },
2184
+ annotations: { title: "Replace the flows", ...WRITE_IDEMPOTENT },
2185
+ handler: ({ links, nodes }) => {
2186
+ resolve(controller.setLinks(links, { nodes }));
2187
+ return linksSummary();
2188
+ }
2189
+ };
2190
+ const importLinksCsv = {
2191
+ name: "import_chart_links_csv",
2192
+ title: "Import flows from CSV",
2193
+ description: "Replaces the data with flows from CSV or TSV rows of source, target and value (as Mermaid sankey-beta and spreadsheets write them). One undo step. Returns the flows and each node's throughput.",
2194
+ inputSchema: {
2195
+ type: "object",
2196
+ properties: {
2197
+ csv: { type: "string", description: 'CSV or TSV text, e.g. "Website,Signup,120\\nSignup,Paid,30".' },
2198
+ header: { type: ["boolean", "string"], enum: [true, false, "auto"], description: "The first row holds column names (default auto: when its third cell is not a number)." }
2199
+ },
2200
+ required: ["csv"],
2201
+ additionalProperties: false
2202
+ },
2203
+ annotations: { title: "Import flows from CSV", ...WRITE },
2204
+ handler: ({ csv, header }) => {
2205
+ resolve(controller.importLinksTable(_chunkN3KJFGXTcjs.parseCsv.call(void 0, csv, { delimiter: csv.includes(" ") ? " " : "," }), { header }));
2206
+ return linksSummary();
2207
+ }
2208
+ };
2209
+ const addLink = {
2210
+ name: "add_chart_link",
2211
+ title: "Add a flow",
2212
+ description: "Adds a flow from one node to another (new names add nodes). Refused when the pair exists already or it would close a loop. Returns its index and the throughput of its two nodes.",
2213
+ inputSchema: { type: "object", properties: _chunkMZFZSVUJcjs.LINK_PROPS, required: ["source", "target", "value"], additionalProperties: false },
2214
+ annotations: { title: "Add a flow", ...WRITE },
2215
+ handler: (args) => {
2216
+ const result = resolve(controller.addLink(args));
2217
+ const s = spec();
2218
+ const through = (n) => _nullishCoalesce(_optionalChain([s, 'access', _107 => _107.series, 'access', _108 => _108[0], 'optionalAccess', _109 => _109.values, 'access', _110 => _110[s.sankeyNodes.indexOf(n)]]), () => ( 0));
2219
+ const link = s.links[result.index];
2220
+ return { index: result.index, link, nodes: [link.source, link.target].map((name) => ({ name, value: through(name) })) };
2221
+ }
2222
+ };
2223
+ const updateLink = {
2224
+ name: "update_chart_link",
2225
+ title: "Change a flow",
2226
+ description: "Changes a flow by index: its source, target, value or colour (null goes back to the default). Checked like a new flow. Returns the flow as stored.",
2227
+ inputSchema: { type: "object", properties: { index: _chunkMZFZSVUJcjs.LINK_INDEX, ..._chunkMZFZSVUJcjs.LINK_PROPS, color: { type: ["string", "null"], description: "CSS colour, or null for the default." } }, required: ["index"], additionalProperties: false },
2228
+ annotations: { title: "Change a flow", ...WRITE_IDEMPOTENT },
2229
+ handler: ({ index, ...patch }) => {
2230
+ if (!Object.keys(patch).length) fail2(`Nothing to change: pass source, target, value or color with the index, e.g. {"index": ${index}, "value": 40}.`);
2231
+ resolve(controller.updateLink(index, patch));
2232
+ return { index, link: spec().links[index] };
2233
+ }
2234
+ };
2235
+ const removeLink = {
2236
+ name: "remove_chart_link",
2237
+ title: "Delete a flow",
2238
+ description: "Deletes a flow by index; the ones after it move up one, and nodes no flow uses any more go. Returns the flows left.",
2239
+ inputSchema: { type: "object", properties: { index: _chunkMZFZSVUJcjs.LINK_INDEX }, required: ["index"], additionalProperties: false },
2240
+ annotations: { title: "Delete a flow", ...DESTRUCTIVE },
2241
+ handler: ({ index }) => {
2242
+ resolve(controller.removeLink(index));
2243
+ return { links: spec().links };
2244
+ }
2245
+ };
2246
+ const setRaceFrame = {
2247
+ name: "set_chart_race_frame",
2248
+ title: "Show a bar race moment",
2249
+ description: "Shows the bar race at a time point (or between two), and stops playback. This is view state like the selection: it is not an undo step and is not saved in the chart. Returns the moment and the ranking shown.",
2250
+ inputSchema: { type: "object", properties: { time: { ..._chunkMZFZSVUJcjs.RACE_TIME, type: ["string", "number", "null"], description: `${_chunkMZFZSVUJcjs.RACE_TIME.description} null shows the last time point.` } }, required: ["time"], additionalProperties: false },
2251
+ annotations: { title: "Show a bar race moment", ...WRITE_IDEMPOTENT },
2252
+ handler: ({ time }) => {
2253
+ const frame = time === null ? null : raceFrameOf(time);
2254
+ resolve(controller.setRaceFrame(frame));
2255
+ return raceAt(frame);
2256
+ }
2257
+ };
2258
+ const playRace = {
2259
+ name: "play_chart_race",
2260
+ title: "Play the bar race",
2261
+ description: "Starts playing the bar race for the user from the moment shown (from the start when it is at the end), one time point every msPerStep ms, and returns at once. set_chart_race_frame stops it. Nothing in the chart changes.",
2262
+ inputSchema: { type: "object", properties: { msPerStep: { type: "number", minimum: 50, maximum: 1e4, description: "Milliseconds per time point (default 1000)." } }, additionalProperties: false },
2263
+ annotations: { title: "Play the bar race", ...WRITE },
2264
+ handler: ({ msPerStep }) => {
2265
+ resolve(controller.playRace({ msPerStep }));
2266
+ const n = spec().categories.length;
2267
+ return { playing: true, from: _nullishCoalesce(controller.getState().raceFrame, () => ( 0)), durationMs: Math.round((n - 1 - (_nullishCoalesce(controller.getState().raceFrame, () => ( 0)))) * (_nullishCoalesce(msPerStep, () => ( 1e3)))) };
2268
+ }
2269
+ };
1985
2270
  const applyPreset = {
1986
2271
  name: "apply_chart_preset",
1987
2272
  title: "Apply a chart style",
@@ -1989,8 +2274,8 @@ function createChartToolProvider(controller, options = {}) {
1989
2274
  inputSchema: {
1990
2275
  type: "object",
1991
2276
  properties: {
1992
- layout: { type: "string", enum: _chunkGKNEJ6ENcjs.CHART_LAYOUT_PRESETS.map((p) => p.id), description: "Quick layout id." },
1993
- colors: { type: "string", enum: _chunkGKNEJ6ENcjs.CHART_COLOR_SCHEMES.map((p) => p.id), description: "Colour scheme id." }
2277
+ layout: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_LAYOUT_PRESETS.map((p) => p.id), description: "Quick layout id." },
2278
+ colors: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_COLOR_SCHEMES.map((p) => p.id), description: "Colour scheme id." }
1994
2279
  },
1995
2280
  additionalProperties: false
1996
2281
  },
@@ -2019,8 +2304,8 @@ function createChartToolProvider(controller, options = {}) {
2019
2304
  type: "object",
2020
2305
  properties: {
2021
2306
  kind: { type: "string", enum: ["none", "chart", "title", "subtitle", "legend", "axis", "series", "point", "category", "trendline"], description: "What to select." },
2022
- series: { ..._chunkNZD2MZJCcjs.SERIES_REF, description: "Series id or name (series, point, trendline)." },
2023
- category: { ..._chunkNZD2MZJCcjs.CATEGORY_REF, description: "Category index or label (point, category)." },
2307
+ series: { ..._chunkMZFZSVUJcjs.SERIES_REF, description: "Series id or name (series, point, trendline)." },
2308
+ category: { ..._chunkMZFZSVUJcjs.CATEGORY_REF, description: "Category index or label (point, category)." },
2024
2309
  axis: { type: "string", enum: ["x", "y", "y2"], description: "Axis (axis)." },
2025
2310
  index: { type: "integer", minimum: 0, description: "Trendline index (trendline)." }
2026
2311
  },
@@ -2078,20 +2363,20 @@ function createChartToolProvider(controller, options = {}) {
2078
2363
  to: { type: "object", description: "End, as fractions of the chart.", properties: { x: { type: "number", minimum: 0, maximum: 1, description: "Fraction of the width." }, y: { type: "number", minimum: 0, maximum: 1, description: "Fraction of the height." } }, required: ["x", "y"], additionalProperties: false },
2079
2364
  fine: { type: "boolean", description: "Move a tenth as far (Alt)." },
2080
2365
  lockAxis: { type: "boolean", description: "Scatter charts: change only the axis moved along most (Shift)." },
2081
- width: _chunkNZD2MZJCcjs.WIDTH,
2082
- height: _chunkNZD2MZJCcjs.HEIGHT
2366
+ width: _chunkMZFZSVUJcjs.WIDTH,
2367
+ height: _chunkMZFZSVUJcjs.HEIGHT
2083
2368
  },
2084
2369
  required: ["from", "to"],
2085
2370
  additionalProperties: false
2086
2371
  },
2087
2372
  annotations: { title: "Drag a chart point", ...WRITE },
2088
2373
  handler: ({ from, to, fine, lockAxis, width = size.width, height = size.height }) => {
2089
- const scene = _chunkSBQVEBSUcjs.layoutChart.call(void 0, controller.toJSON(), { width, height });
2374
+ const scene = _chunkUUUTEVX6cjs.layoutChart.call(void 0, controller.toJSON(), { width, height });
2090
2375
  const start = { x: from.x * width, y: from.y * height };
2091
2376
  const target = chartHitTest(scene, start);
2092
- if (_optionalChain([target, 'optionalAccess', _105 => _105.kind]) !== "point") fail2(`There is no bar or point at (${from.x}, ${from.y}); ${target ? `that is the ${target.kind}` : "that is outside the chart"}. Use render_chart to find marks.`);
2377
+ if (_optionalChain([target, 'optionalAccess', _111 => _111.kind]) !== "point") fail2(`There is no bar or point at (${from.x}, ${from.y}); ${target ? `that is the ${target.kind}` : "that is outside the chart"}. Use render_chart to find marks.`);
2093
2378
  const t = target;
2094
- const before = _nullishCoalesce(_optionalChain([controller, 'access', _106 => _106.getSeries, 'call', _107 => _107(t.seriesId), 'optionalAccess', _108 => _108.values, 'access', _109 => _109[t.index]]), () => ( null));
2379
+ const before = _nullishCoalesce(_optionalChain([controller, 'access', _112 => _112.getSeries, 'call', _113 => _113(t.seriesId), 'optionalAccess', _114 => _114.values, 'access', _115 => _115[t.index]]), () => ( null));
2095
2380
  const session = startChartPointDrag(controller, scene, t, start);
2096
2381
  if (!session) fail2("That point cannot be dragged here (percent-stacked charts, pies and gaps cannot be dragged).");
2097
2382
  session.move({ x: to.x * width, y: to.y * height }, { fine, lockAxis });
@@ -2116,10 +2401,10 @@ function createChartToolProvider(controller, options = {}) {
2116
2401
  },
2117
2402
  annotations: { title: "Press a key on the chart", ...DESTRUCTIVE },
2118
2403
  handler: ({ key: k, shift, alt }) => {
2119
- const scene = _chunkSBQVEBSUcjs.layoutChart.call(void 0, controller.toJSON(), size);
2404
+ const scene = _chunkUUUTEVX6cjs.layoutChart.call(void 0, controller.toJSON(), size);
2120
2405
  const used = handleChartKey(controller, scene, { key: k, shiftKey: shift, altKey: alt });
2121
2406
  const sel = controller.getState().selection;
2122
- const value = _optionalChain([sel, 'optionalAccess', _110 => _110.kind]) === "point" ? _nullishCoalesce(_optionalChain([controller, 'access', _111 => _111.getSeries, 'call', _112 => _112(sel.seriesId), 'optionalAccess', _113 => _113.values, 'access', _114 => _114[sel.index]]), () => ( null)) : void 0;
2407
+ const value = _optionalChain([sel, 'optionalAccess', _116 => _116.kind]) === "point" ? _nullishCoalesce(_optionalChain([controller, 'access', _117 => _117.getSeries, 'call', _118 => _118(sel.seriesId), 'optionalAccess', _119 => _119.values, 'access', _120 => _120[sel.index]]), () => ( null)) : void 0;
2123
2408
  return { used, selection: sel, ...value !== void 0 ? { value } : {} };
2124
2409
  }
2125
2410
  };
@@ -2147,7 +2432,7 @@ function createChartToolProvider(controller, options = {}) {
2147
2432
  return { redone, ...redone ? { label } : {} };
2148
2433
  }
2149
2434
  };
2150
- const reads = [getChart, renderChart, checkColors, recommend, getTrendline, listPresets, exportMermaid, exportOoxml];
2435
+ const reads = [getChart, renderChart, checkColors, recommend, getTrendline, raceRanking, listPresets, exportMermaid, exportOoxml];
2151
2436
  const writes = [
2152
2437
  updateChart,
2153
2438
  setData,
@@ -2174,6 +2459,13 @@ function createChartToolProvider(controller, options = {}) {
2174
2459
  addTreeNode,
2175
2460
  updateTreeNode,
2176
2461
  removeTreeNode,
2462
+ setLinks,
2463
+ importLinksCsv,
2464
+ addLink,
2465
+ updateLink,
2466
+ removeLink,
2467
+ setRaceFrame,
2468
+ playRace,
2177
2469
  applyPreset,
2178
2470
  transpose,
2179
2471
  select,
@@ -2186,7 +2478,7 @@ function createChartToolProvider(controller, options = {}) {
2186
2478
  id: _nullishCoalesce(options.id, () => ( "chart")),
2187
2479
  namespace: options.namespace,
2188
2480
  title: "Chart editor",
2189
- description: "One chart: its spec, data and values, series and categories, trendlines, reference lines and bands, callouts, highlight, grouped data and presets, CSV, Mermaid and OOXML import, rendering and colour checks.",
2481
+ description: "One chart: its spec, data and values, series and categories, trendlines, reference lines and bands, callouts, highlight, grouped data, flows, bar race playback and presets, CSV, Mermaid and OOXML import, rendering and colour checks.",
2190
2482
  skill: "pixerate-chart",
2191
2483
  tools: () => {
2192
2484
  if (readOnlyReason()) return reads;
@@ -2260,12 +2552,12 @@ var ChartStream = (_class = class {
2260
2552
  if (format === "json") {
2261
2553
  const value = complete ? safeParse(text) : parsePartialChartJson(text);
2262
2554
  if (value !== void 0) {
2263
- const read = _chunkR3P2M7HUcjs.normalizeChartSpec.call(void 0, value);
2555
+ const read = _chunkBPX4Z3N3cjs.normalizeChartSpec.call(void 0, value);
2264
2556
  spec = read.spec;
2265
2557
  issues = complete ? read.issues : [];
2266
2558
  }
2267
2559
  } else {
2268
- const read = _chunkGKNEJ6ENcjs.chartFromMermaid.call(void 0, text, { partial: !complete });
2560
+ const read = _chunkV5L2G22Rcjs.chartFromMermaid.call(void 0, text, { partial: !complete });
2269
2561
  if (read.family) {
2270
2562
  spec = read.spec;
2271
2563
  issues = complete ? read.issues : [];
@@ -2362,7 +2654,7 @@ function elements(root, localName) {
2362
2654
  }
2363
2655
  function relId(el, localName = "id") {
2364
2656
  for (const a of Array.from(el.attributes)) {
2365
- if (a.localName === localName && (_optionalChain([a, 'access', _115 => _115.namespaceURI, 'optionalAccess', _116 => _116.includes, 'call', _117 => _117("relationships")]) || a.prefix === "r")) return a.value;
2657
+ if (a.localName === localName && (_optionalChain([a, 'access', _121 => _121.namespaceURI, 'optionalAccess', _122 => _122.includes, 'call', _123 => _123("relationships")]) || a.prefix === "r")) return a.value;
2366
2658
  }
2367
2659
  return void 0;
2368
2660
  }
@@ -2381,17 +2673,17 @@ async function readRels(r, partPath) {
2381
2673
  const id = rel.getAttribute("Id");
2382
2674
  if (!id) continue;
2383
2675
  const target = _nullishCoalesce(rel.getAttribute("Target"), () => ( ""));
2384
- const external = _optionalChain([rel, 'access', _118 => _118.getAttribute, 'call', _119 => _119("TargetMode"), 'optionalAccess', _120 => _120.toLowerCase, 'call', _121 => _121()]) === "external";
2676
+ const external = _optionalChain([rel, 'access', _124 => _124.getAttribute, 'call', _125 => _125("TargetMode"), 'optionalAccess', _126 => _126.toLowerCase, 'call', _127 => _127()]) === "external";
2385
2677
  rels.set(id, { type: _nullishCoalesce(rel.getAttribute("Type"), () => ( "")), target: external ? target : resolvePartPath(dirname(partPath), target), external });
2386
2678
  }
2387
2679
  return rels;
2388
2680
  }
2389
- var isChartRef = (el) => el.localName === "chart" && (el.namespaceURI === _chunkYGG7WDWTcjs.CHART_OOXML_NS || el.namespaceURI === STRICT_CHART_NS || el.namespaceURI === CHARTEX_NS);
2681
+ var isChartRef = (el) => el.localName === "chart" && (el.namespaceURI === _chunkSZWVMB3Bcjs.CHART_OOXML_NS || el.namespaceURI === STRICT_CHART_NS || el.namespaceURI === CHARTEX_NS);
2390
2682
  function frameName(ref) {
2391
2683
  for (let el = ref.parentElement; el; el = el.parentElement) {
2392
2684
  if (el.localName === "graphicFrame") {
2393
2685
  const nv = elements(el, "cNvPr")[0];
2394
- return _optionalChain([nv, 'optionalAccess', _122 => _122.getAttribute, 'call', _123 => _123("name")]) || void 0;
2686
+ return _optionalChain([nv, 'optionalAccess', _128 => _128.getAttribute, 'call', _129 => _129("name")]) || void 0;
2395
2687
  }
2396
2688
  }
2397
2689
  return void 0;
@@ -2405,7 +2697,7 @@ async function chartsInPart(r, root, rels, place) {
2405
2697
  const entry = r.zip.get(rel.target);
2406
2698
  if (!entry) continue;
2407
2699
  r.seen.add(rel.target);
2408
- const read = _chunkYGG7WDWTcjs.chartFromOoxml.call(void 0, await r.zip.readText(entry), { DOMParser: r.Parser });
2700
+ const read = _chunkSZWVMB3Bcjs.chartFromOoxml.call(void 0, await r.zip.readText(entry), { DOMParser: r.Parser });
2409
2701
  const name = frameName(ref);
2410
2702
  r.charts.push({
2411
2703
  id: `chart-${r.charts.length + 1}`,
@@ -2427,8 +2719,8 @@ function columnName(index) {
2427
2719
  return name;
2428
2720
  }
2429
2721
  function anchorCell(marker) {
2430
- const col = Number(_optionalChain([firstChild, 'call', _124 => _124(marker, "col"), 'optionalAccess', _125 => _125.textContent]));
2431
- const row = Number(_optionalChain([firstChild, 'call', _126 => _126(marker, "row"), 'optionalAccess', _127 => _127.textContent]));
2722
+ const col = Number(_optionalChain([firstChild, 'call', _130 => _130(marker, "col"), 'optionalAccess', _131 => _131.textContent]));
2723
+ const row = Number(_optionalChain([firstChild, 'call', _132 => _132(marker, "row"), 'optionalAccess', _133 => _133.textContent]));
2432
2724
  return Number.isInteger(col) && Number.isInteger(row) && col >= 0 && row >= 0 ? `${columnName(col)}${row + 1}` : void 0;
2433
2725
  }
2434
2726
  function drawingPlace(ref) {
@@ -2591,7 +2883,7 @@ function createOfficeChartToolProvider(options = {}) {
2591
2883
  description: "Lists the Office files the user opened that charts can be read from. Returns their names and sizes in bytes.",
2592
2884
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
2593
2885
  annotations: { title: "List open files", ...READ2 },
2594
- handler: () => ({ files: (_nullishCoalesce(_optionalChain([options, 'access', _128 => _128.files, 'optionalCall', _129 => _129()]), () => ( []))).map((f) => ({ name: f.name, bytes: f.data.byteLength })) })
2886
+ handler: () => ({ files: (_nullishCoalesce(_optionalChain([options, 'access', _134 => _134.files, 'optionalCall', _135 => _135()]), () => ( []))).map((f) => ({ name: f.name, bytes: f.data.byteLength })) })
2595
2887
  };
2596
2888
  const listCharts = {
2597
2889
  name: "list_file_charts",
@@ -2642,7 +2934,7 @@ function createOfficeChartToolProvider(options = {}) {
2642
2934
 
2643
2935
  // src/chart/editorDocument.ts
2644
2936
  function createChartEditorDocument(controller) {
2645
- return _chunkM4MIZPQIcjs.defineEditorDocument.call(void 0, {
2937
+ return _chunkSJ2CPTQCcjs.defineEditorDocument.call(void 0, {
2646
2938
  kind: "chart",
2647
2939
  get: () => controller.toJSON(),
2648
2940
  load: (document, { history }) => {
@@ -2670,6 +2962,208 @@ function createChartEditorDocument(controller) {
2670
2962
  });
2671
2963
  }
2672
2964
 
2965
+ // src/chart/style.ts
2966
+ var CHART_TYPES3 = ["bar", "line", "area", "scatter", "bubble", "pie", "donut", "radar", "waterfall", "histogram", "box", "funnel", "treemap"];
2967
+ var COLOR = { type: "string", minLength: 1, description: 'A CSS colour (hex or rgb()), or a { "$token": ... } reference.' };
2968
+ function chartColors(spec) {
2969
+ const out = [];
2970
+ const visible = spec.series.map((s, i) => ({ s, i })).filter(({ s }) => !s.hidden);
2971
+ if (_chunkBPX4Z3N3cjs.chartColorsByCategory.call(void 0, spec.type)) {
2972
+ const first = visible[0];
2973
+ spec.categories.forEach((name, index) => {
2974
+ const color = _optionalChain([first, 'optionalAccess', _136 => _136.s, 'access', _137 => _137.pointColors, 'optionalAccess', _138 => _138[index]]) || _chunkBPX4Z3N3cjs.chartSliceColor.call(void 0, spec, index);
2975
+ out.push({ color, label: `Slice "${name}"`, target: first ? { kind: "point", seriesId: first.s.id, index } : { kind: "category", index } });
2976
+ });
2977
+ return out;
2978
+ }
2979
+ for (const { s, i } of visible) {
2980
+ out.push({ color: _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, i), label: `Series "${s.name}"`, target: { kind: "series", seriesId: s.id } });
2981
+ _optionalChain([s, 'access', _139 => _139.pointColors, 'optionalAccess', _140 => _140.forEach, 'call', _141 => _141((c, index) => {
2982
+ if (c) out.push({ color: c, label: `Point ${index + 1} of "${s.name}"`, target: { kind: "point", seriesId: s.id, index } });
2983
+ })]);
2984
+ }
2985
+ return out;
2986
+ }
2987
+ var paletteOf = (profile) => {
2988
+ const palette = profile.palette;
2989
+ if (!_optionalChain([palette, 'optionalAccess', _142 => _142.length])) throw new Error("the profile has no palette.");
2990
+ return palette;
2991
+ };
2992
+ var paletteOnly = {
2993
+ id: "palette-only",
2994
+ description: "Every series, slice and point colour comes from the house palette (or a lighter or darker shade the chart cycles to once the palette runs out).",
2995
+ optionsSchema: {
2996
+ type: "object",
2997
+ properties: { tolerance: { type: "number", minimum: 0, maximum: 1, description: "Largest OKLab distance still counted as the same colour (default 0.02)." } },
2998
+ additionalProperties: false
2999
+ },
3000
+ run(spec, profile, { tolerance = 0.02 }) {
3001
+ const palette = paletteOf(profile);
3002
+ const allowed = palette.flatMap((c) => _chunkBPX4Z3N3cjs.CHART_PALETTE_SHADES.map((t) => _chunkBPX4Z3N3cjs.shadeChartColor.call(void 0, c, t))).map((c) => ({ c, rgb: _chunkBPX4Z3N3cjs.parseChartColor.call(void 0, c) }));
3003
+ return chartColors(spec).flatMap(({ color, label, target }) => {
3004
+ const rgb = _chunkBPX4Z3N3cjs.parseChartColor.call(void 0, color);
3005
+ if (!rgb) return [];
3006
+ let best = { c: palette[0], d: Infinity };
3007
+ for (const a of allowed) {
3008
+ if (!a.rgb) continue;
3009
+ const d = _chunkBPX4Z3N3cjs.chartColorDistance.call(void 0, rgb, a.rgb);
3010
+ if (d < best.d) best = { c: a.c, d };
3011
+ }
3012
+ if (best.d <= tolerance) return [];
3013
+ const nearest = palette.map((c) => ({ c, d: _chunkBPX4Z3N3cjs.parseChartColor.call(void 0, c) ? _chunkBPX4Z3N3cjs.chartColorDistance.call(void 0, rgb, _chunkBPX4Z3N3cjs.parseChartColor.call(void 0, c)) : Infinity })).sort((a, b) => a.d - b.d)[0].c;
3014
+ return [{ severity: "error", message: `${label} uses ${color}, which is not in the house palette; use ${nearest} or another palette colour (${palette.join(", ")}).`, target }];
3015
+ });
3016
+ }
3017
+ };
3018
+ var distinguishable = {
3019
+ id: "distinguishable",
3020
+ description: "Series (or slice) colours can be told apart with normal vision and with protanopia, deuteranopia and tritanopia.",
3021
+ optionsSchema: {
3022
+ type: "object",
3023
+ properties: { minDistance: { type: "number", minimum: 0, maximum: 1, description: "Smallest OKLab distance between two colours after simulation (default 0.08)." } },
3024
+ additionalProperties: false
3025
+ },
3026
+ run(spec, _profile, { minDistance = 0.08 }) {
3027
+ const colors = chartColors(spec).filter((c) => c.target.kind !== "point" || _chunkBPX4Z3N3cjs.chartColorsByCategory.call(void 0, spec.type));
3028
+ const result = _chunkBPX4Z3N3cjs.checkChartColors.call(void 0, colors.map((c) => c.color), { minDistance, minContrast: 0 });
3029
+ const findings = [];
3030
+ for (const [vision, pair] of Object.entries(result.closest)) {
3031
+ if (!pair || pair.distance >= minDistance) continue;
3032
+ const who = vision === "normal" ? "" : ` with ${vision}`;
3033
+ findings.push({
3034
+ severity: "warning",
3035
+ message: `${colors[pair.a].label} (${pair.colors[0]}) and ${colors[pair.b].label} (${pair.colors[1]}) are hard to tell apart${who} (distance ${pair.distance}, want ${minDistance}); give the second another palette colour.`,
3036
+ target: colors[pair.b].target
3037
+ });
3038
+ }
3039
+ return findings;
3040
+ }
3041
+ };
3042
+ var minContrast = {
3043
+ id: "min-contrast",
3044
+ description: "Marks stand out from the background: each series or slice colour against the profile theme's background (or surface, default white).",
3045
+ optionsSchema: {
3046
+ type: "object",
3047
+ properties: { ratio: { type: "number", minimum: 1, maximum: 21, description: "Smallest contrast ratio (default 3, the WCAG ratio for graphics)." } },
3048
+ additionalProperties: false
3049
+ },
3050
+ run(spec, profile, { ratio = 3 }) {
3051
+ const theme = _nullishCoalesce(profile.theme, () => ( {}));
3052
+ const background = theme.background && theme.background !== "transparent" ? theme.background : _nullishCoalesce(theme.surface, () => ( "#ffffff"));
3053
+ return chartColors(spec).flatMap(({ color, label, target }) => {
3054
+ const r = _chunkBPX4Z3N3cjs.chartContrastRatio.call(void 0, color, background);
3055
+ if (r === null || r >= ratio) return [];
3056
+ return [{ severity: "warning", message: `${label} (${color}) has contrast ${Math.round(r * 100) / 100}:1 against the background ${background}; want at least ${ratio}:1, so use a darker or lighter palette colour.`, target }];
3057
+ });
3058
+ }
3059
+ };
3060
+ var allowedType = {
3061
+ id: "allowed-type",
3062
+ description: "The chart is one of the chart types the house style allows.",
3063
+ optionsSchema: {
3064
+ type: "object",
3065
+ properties: { types: { type: "array", items: { type: "string", enum: [...CHART_TYPES3] }, minItems: 1, description: "Allowed chart types." } },
3066
+ required: ["types"],
3067
+ additionalProperties: false
3068
+ },
3069
+ run(spec, _profile, { types }) {
3070
+ const allowed = types;
3071
+ if (allowed.includes(spec.type)) return [];
3072
+ return [{ severity: "error", message: `This is a ${spec.type} chart; the house style allows ${allowed.join(", ")}. Change the type with update_chart.`, target: { kind: "chart" } }];
3073
+ }
3074
+ };
3075
+ var chartStyleDomain = {
3076
+ id: "chart",
3077
+ title: "Charts",
3078
+ description: "The house palette and theme for charts, which colour schemes and layouts are allowed, defaults for new charts, and the checks to run.",
3079
+ profileSchema: {
3080
+ type: "object",
3081
+ properties: {
3082
+ palette: { type: "array", items: COLOR, minItems: 1, description: "Series colours in order." },
3083
+ colorSchemes: { type: "array", items: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_COLOR_SCHEMES.map((s) => s.id) }, description: "Colour scheme ids allowed besides the palette (empty: none)." },
3084
+ layouts: { type: "array", items: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_LAYOUT_PRESETS.map((p) => p.id) }, description: "Layout preset ids allowed." },
3085
+ theme: {
3086
+ type: "object",
3087
+ properties: {
3088
+ background: COLOR,
3089
+ surface: COLOR,
3090
+ text: COLOR,
3091
+ mutedText: COLOR,
3092
+ grid: COLOR,
3093
+ axis: COLOR,
3094
+ positive: COLOR,
3095
+ negative: COLOR,
3096
+ fontFamily: { type: "string", minLength: 1, description: "CSS font family." },
3097
+ fontSize: { type: "number", minimum: 6, maximum: 48, description: "Body text size in px." },
3098
+ titleSize: { type: "number", minimum: 6, maximum: 72, description: "Title size in px." }
3099
+ },
3100
+ additionalProperties: false,
3101
+ description: "Colours and type to draw charts with."
3102
+ },
3103
+ defaults: {
3104
+ type: "object",
3105
+ properties: {
3106
+ dataLabels: { type: "boolean", description: "Value labels on." },
3107
+ points: { type: "boolean", description: "Dots on lines." },
3108
+ curve: { type: "string", enum: ["linear", "smooth", "step"], description: "Line interpolation." },
3109
+ stacking: { type: "string", enum: ["none", "stacked", "percent"], description: "Stacking." },
3110
+ orientation: { type: "string", enum: ["vertical", "horizontal"], description: "Bar direction." },
3111
+ labelPosition: { type: "string", enum: ["auto", "inside", "outside", "center"], description: "Bar label position." }
3112
+ },
3113
+ additionalProperties: false,
3114
+ description: "Spec values new charts start from."
3115
+ }
3116
+ },
3117
+ additionalProperties: false
3118
+ },
3119
+ checks: [paletteOnly, distinguishable, minContrast, allowedType]
3120
+ };
3121
+ function chartStylePatch(profile) {
3122
+ const p = profile;
3123
+ return { ..._nullishCoalesce(p.defaults, () => ( {})), ..._optionalChain([p, 'access', _143 => _143.palette, 'optionalAccess', _144 => _144.length]) ? { palette: [...p.palette] } : {} };
3124
+ }
3125
+ function createChartStyleToolProvider(controller, styles, options = {}) {
3126
+ if (!styles.domains.some((d) => d.id === "chart")) throw new Error('The style resolver has no "chart" domain; add chartStyleDomain to its domains.');
3127
+ const check2 = {
3128
+ name: "check_chart_style",
3129
+ title: "Check chart house style",
3130
+ description: 'Checks the chart against the house style (see get_style with domain "chart"): runs the checks its profile turns on (palette-only, distinguishable, min-contrast, allowed-type). Returns findings with a severity, a sentence saying how to fix it, a target selection (series id or point) for update_chart_series or update_chart, and the layer that asked for it; plus the checks that ran and the ones skipped with the reason. Check after a batch of edits and again after fixing.',
3131
+ inputSchema: { type: "object", properties: {}, additionalProperties: false },
3132
+ annotations: { title: "Check chart house style", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
3133
+ handler: async () => {
3134
+ const { style, ...report } = await styles.check("chart", controller.getSpec());
3135
+ return {
3136
+ ...report,
3137
+ ok: report.findings.length === 0,
3138
+ ...style.skills.length ? {} : { note: "No house style applies to charts." },
3139
+ ...style.issues.length ? { issues: style.issues } : {}
3140
+ };
3141
+ }
3142
+ };
3143
+ return {
3144
+ id: _nullishCoalesce(options.id, () => ( "chart-style")),
3145
+ namespace: _nullishCoalesce(options.namespace, () => ( "chart")),
3146
+ title: "Chart house style",
3147
+ description: "Check a chart against the house style.",
3148
+ skill: "pixerate-chart",
3149
+ tools: [check2]
3150
+ };
3151
+ }
3152
+
3153
+
3154
+
3155
+
3156
+
3157
+
3158
+
3159
+
3160
+
3161
+
3162
+
3163
+
3164
+
3165
+
3166
+
2673
3167
 
2674
3168
 
2675
3169
 
@@ -2862,4 +3356,4 @@ function createChartEditorDocument(controller) {
2862
3356
 
2863
3357
 
2864
3358
 
2865
- exports.CHART_AXIS_KINDS = _chunkR3P2M7HUcjs.CHART_AXIS_KINDS; exports.CHART_AXIS_SCALES = _chunkR3P2M7HUcjs.CHART_AXIS_SCALES; exports.CHART_COLOR_SCHEMES = _chunkGKNEJ6ENcjs.CHART_COLOR_SCHEMES; exports.CHART_CURVES = _chunkR3P2M7HUcjs.CHART_CURVES; exports.CHART_DATE_STEPS = _chunkSBQVEBSUcjs.CHART_DATE_STEPS; exports.CHART_ERROR_BAR_DIRECTIONS = _chunkR3P2M7HUcjs.CHART_ERROR_BAR_DIRECTIONS; exports.CHART_ERROR_BAR_LABELS = _chunkR3P2M7HUcjs.CHART_ERROR_BAR_LABELS; exports.CHART_ERROR_BAR_TYPES = _chunkR3P2M7HUcjs.CHART_ERROR_BAR_TYPES; exports.CHART_LABEL_POSITIONS = _chunkR3P2M7HUcjs.CHART_LABEL_POSITIONS; exports.CHART_LAYOUT_PRESETS = _chunkGKNEJ6ENcjs.CHART_LAYOUT_PRESETS; exports.CHART_LEGEND_POSITIONS = _chunkR3P2M7HUcjs.CHART_LEGEND_POSITIONS; exports.CHART_LIKERT_NEUTRALS = _chunkR3P2M7HUcjs.CHART_LIKERT_NEUTRALS; exports.CHART_LIKERT_SORTS = _chunkR3P2M7HUcjs.CHART_LIKERT_SORTS; exports.CHART_MARKERS = _chunkR3P2M7HUcjs.CHART_MARKERS; exports.CHART_MERMAID_META_PREFIX = _chunkGKNEJ6ENcjs.CHART_MERMAID_META_PREFIX; exports.CHART_NUMBER_STYLES = _chunkR3P2M7HUcjs.CHART_NUMBER_STYLES; exports.CHART_OOXML_CONTENT_TYPE = _chunkYGG7WDWTcjs.CHART_OOXML_CONTENT_TYPE; exports.CHART_OOXML_NS = _chunkYGG7WDWTcjs.CHART_OOXML_NS; exports.CHART_OOXML_RELATIONSHIP = _chunkYGG7WDWTcjs.CHART_OOXML_RELATIONSHIP; exports.CHART_ORIENTATIONS = _chunkR3P2M7HUcjs.CHART_ORIENTATIONS; exports.CHART_PALETTE_SHADES = _chunkR3P2M7HUcjs.CHART_PALETTE_SHADES; exports.CHART_PRESENCE_COLORS = CHART_PRESENCE_COLORS; exports.CHART_RADAR_GRATICULES = _chunkR3P2M7HUcjs.CHART_RADAR_GRATICULES; exports.CHART_RASTER_MAX_SIZE = CHART_RASTER_MAX_SIZE; exports.CHART_REFERENCE_AXES = _chunkR3P2M7HUcjs.CHART_REFERENCE_AXES; exports.CHART_SERIES_TYPES = _chunkR3P2M7HUcjs.CHART_SERIES_TYPES; exports.CHART_STACKINGS = _chunkR3P2M7HUcjs.CHART_STACKINGS; exports.CHART_TRENDLINE_TYPES = _chunkR3P2M7HUcjs.CHART_TRENDLINE_TYPES; exports.CHART_TYPES = _chunkR3P2M7HUcjs.CHART_TYPES; exports.CHART_TYPE_LABELS = _chunkR3P2M7HUcjs.CHART_TYPE_LABELS; exports.CSS_VARIABLE_CHART_THEME = _chunkR3P2M7HUcjs.CSS_VARIABLE_CHART_THEME; exports.ChartController = _chunkGKNEJ6ENcjs.ChartController; exports.ChartDirector = ChartDirector; exports.ChartPresence = ChartPresence; exports.ChartStream = ChartStream; exports.DEFAULT_CHART_PALETTE = _chunkR3P2M7HUcjs.DEFAULT_CHART_PALETTE; exports.DEFAULT_CHART_THEME = _chunkR3P2M7HUcjs.DEFAULT_CHART_THEME; exports.MAX_CHART_DATA_LABELS = _chunkSBQVEBSUcjs.MAX_CHART_DATA_LABELS; exports.MAX_CHART_LINE_POINTS = _chunkSBQVEBSUcjs.MAX_CHART_LINE_POINTS; exports.MAX_CHART_MARKERS = _chunkSBQVEBSUcjs.MAX_CHART_MARKERS; exports.MAX_CHART_TREE_DEPTH = _chunkR3P2M7HUcjs.MAX_CHART_TREE_DEPTH; exports.MAX_CHART_TREE_NODES = _chunkR3P2M7HUcjs.MAX_CHART_TREE_NODES; exports.OfficeChartsError = OfficeChartsError; exports.RENDER_CHART_INSTRUCTIONS = RENDER_CHART_INSTRUCTIONS; exports.addChartTreeRow = _chunkR3P2M7HUcjs.addChartTreeRow; exports.analyzeChartTable = analyzeChartTable; exports.blendChartScenes = blendChartScenes; exports.canDragChartPoint = canDragChartPoint; exports.chartBoxStats = _chunkSBQVEBSUcjs.chartBoxStats; exports.chartClientToScene = chartClientToScene; exports.chartColorDistance = _chunkR3P2M7HUcjs.chartColorDistance; exports.chartColorInputValue = _chunkR3P2M7HUcjs.chartColorInputValue; exports.chartColorsByCategory = _chunkR3P2M7HUcjs.chartColorsByCategory; exports.chartContrastRatio = _chunkR3P2M7HUcjs.chartContrastRatio; exports.chartDataFromTable = _chunkR3P2M7HUcjs.chartDataFromTable; exports.chartDataToTable = _chunkR3P2M7HUcjs.chartDataToTable; exports.chartDateLabels = _chunkSBQVEBSUcjs.chartDateLabels; exports.chartDateToSerial = _chunkSBQVEBSUcjs.chartDateToSerial; exports.chartErrorAmounts = _chunkR3P2M7HUcjs.chartErrorAmounts; exports.chartErrorBarsOfType = _chunkR3P2M7HUcjs.chartErrorBarsOfType; exports.chartFamily = _chunkR3P2M7HUcjs.chartFamily; exports.chartFileName = chartFileName; exports.chartFormatToCode = _chunkYGG7WDWTcjs.chartFormatToCode; exports.chartFromMermaid = _chunkGKNEJ6ENcjs.chartFromMermaid; exports.chartFromOoxml = _chunkYGG7WDWTcjs.chartFromOoxml; exports.chartFromTable = chartFromTable; exports.chartHistogram = _chunkSBQVEBSUcjs.chartHistogram; exports.chartHitTest = chartHitTest; exports.chartLikertColor = _chunkR3P2M7HUcjs.chartLikertColor; exports.chartLuminance = _chunkR3P2M7HUcjs.chartLuminance; exports.chartMermaidFamily = _chunkGKNEJ6ENcjs.chartMermaidFamily; exports.chartMovingAverage = _chunkSBQVEBSUcjs.chartMovingAverage; exports.chartPointAnchor = chartPointAnchor; exports.chartPointColor = _chunkR3P2M7HUcjs.chartPointColor; exports.chartPointRef = chartPointRef; exports.chartPresetPatch = _chunkGKNEJ6ENcjs.chartPresetPatch; exports.chartQuantile = _chunkSBQVEBSUcjs.chartQuantile; exports.chartRasterSize = chartRasterSize; exports.chartRgbToHex = _chunkR3P2M7HUcjs.chartRgbToHex; exports.chartRgbToOklab = _chunkR3P2M7HUcjs.chartRgbToOklab; exports.chartScaleFromPixel = _chunkSBQVEBSUcjs.chartScaleFromPixel; exports.chartScaleToPixel = _chunkSBQVEBSUcjs.chartScaleToPixel; exports.chartSceneToDomSpec = _chunkGKNEJ6ENcjs.chartSceneToDomSpec; exports.chartSceneToSvg = _chunkGKNEJ6ENcjs.chartSceneToSvg; exports.chartSerialToDate = _chunkSBQVEBSUcjs.chartSerialToDate; exports.chartSeriesColor = _chunkR3P2M7HUcjs.chartSeriesColor; exports.chartSeriesType = _chunkR3P2M7HUcjs.chartSeriesType; exports.chartSliceColor = _chunkR3P2M7HUcjs.chartSliceColor; exports.chartSpecColorsByCategory = _chunkR3P2M7HUcjs.chartSpecColorsByCategory; exports.chartSquarify = _chunkSBQVEBSUcjs.chartSquarify; exports.chartSupportsTrendlines = _chunkSBQVEBSUcjs.chartSupportsTrendlines; exports.chartTextBaseline = _chunkGKNEJ6ENcjs.chartTextBaseline; exports.chartTextOn = _chunkR3P2M7HUcjs.chartTextOn; exports.chartTextTransform = _chunkGKNEJ6ENcjs.chartTextTransform; exports.chartToMermaid = _chunkGKNEJ6ENcjs.chartToMermaid; exports.chartToOoxml = _chunkYGG7WDWTcjs.chartToOoxml; exports.chartToSvg = _chunkGKNEJ6ENcjs.chartToSvg; exports.chartTreeColumnLabels = _chunkR3P2M7HUcjs.chartTreeColumnLabels; exports.chartTreeDepth = _chunkR3P2M7HUcjs.chartTreeDepth; exports.chartTreeFromRows = _chunkR3P2M7HUcjs.chartTreeFromRows; exports.chartTreeFromSeries = _chunkR3P2M7HUcjs.chartTreeFromSeries; exports.chartTreeFromTable = _chunkR3P2M7HUcjs.chartTreeFromTable; exports.chartTreeToRows = _chunkR3P2M7HUcjs.chartTreeToRows; exports.chartTreeTotal = _chunkR3P2M7HUcjs.chartTreeTotal; exports.chartTrendlineName = _chunkSBQVEBSUcjs.chartTrendlineName; exports.chartValueAtPoint = _chunkSBQVEBSUcjs.chartValueAtPoint; exports.chartVariesColors = _chunkR3P2M7HUcjs.chartVariesColors; exports.chartXAtPoint = _chunkSBQVEBSUcjs.chartXAtPoint; exports.checkChartColors = _chunkR3P2M7HUcjs.checkChartColors; exports.cloneChartSeries = _chunkR3P2M7HUcjs.cloneChartSeries; exports.cloneChartSpec = _chunkR3P2M7HUcjs.cloneChartSpec; exports.cloneChartTree = _chunkR3P2M7HUcjs.cloneChartTree; exports.compileChartFormatCode = _chunkSBQVEBSUcjs.compileChartFormatCode; exports.contrastingTextColor = _chunkSBQVEBSUcjs.contrastingTextColor; exports.createChartCommands = createChartCommands; exports.createChartController = _chunkGKNEJ6ENcjs.createChartController; exports.createChartEditorDocument = createChartEditorDocument; exports.createChartRasterizer = createChartRasterizer; exports.createChartSpec = _chunkR3P2M7HUcjs.createChartSpec; exports.createChartToolProvider = createChartToolProvider; exports.createInstantChartClock = createInstantChartClock; exports.createOfficeChartToolProvider = createOfficeChartToolProvider; exports.cyclePaletteColor = _chunkR3P2M7HUcjs.cyclePaletteColor; exports.decimateChartPoints = _chunkSBQVEBSUcjs.decimateChartPoints; exports.defaultChartAxis = _chunkR3P2M7HUcjs.defaultChartAxis; exports.defaultChartErrorBarValue = _chunkR3P2M7HUcjs.defaultChartErrorBarValue; exports.describeChart = _chunkGKNEJ6ENcjs.describeChart; exports.describeChartErrorBars = _chunkR3P2M7HUcjs.describeChartErrorBars; exports.describeChartSelection = describeChartSelection; exports.describeOfficeChartPlace = describeOfficeChartPlace; exports.downloadChartPng = downloadChartPng; exports.easeChartTween = easeChartTween; exports.estimateChartTextWidth = _chunkSBQVEBSUcjs.estimateChartTextWidth; exports.extractDocxCharts = extractDocxCharts; exports.extractOfficeCharts = extractOfficeCharts; exports.extractPptxCharts = extractPptxCharts; exports.extractXlsxCharts = extractXlsxCharts; exports.findChartTreeNode = _chunkR3P2M7HUcjs.findChartTreeNode; exports.findMermaidCharts = _chunkGKNEJ6ENcjs.findMermaidCharts; exports.fitChartTrendline = _chunkSBQVEBSUcjs.fitChartTrendline; exports.formatChartAmountList = _chunkR3P2M7HUcjs.formatChartAmountList; exports.formatChartDate = _chunkSBQVEBSUcjs.formatChartDate; exports.formatChartNumber = _chunkSBQVEBSUcjs.formatChartNumber; exports.formatChartValueWithCode = _chunkSBQVEBSUcjs.formatChartValueWithCode; exports.handleChartKey = handleChartKey; exports.isCartesianChart = _chunkR3P2M7HUcjs.isCartesianChart; exports.isXyChart = _chunkR3P2M7HUcjs.isXyChart; exports.layoutChart = _chunkSBQVEBSUcjs.layoutChart; exports.layoutSparkline = _chunkGKNEJ6ENcjs.layoutSparkline; exports.linearMap = _chunkSBQVEBSUcjs.linearMap; exports.locateChartPoint = locateChartPoint; exports.monochromeChartPalette = _chunkGKNEJ6ENcjs.monochromeChartPalette; exports.niceLogScale = _chunkSBQVEBSUcjs.niceLogScale; exports.niceScale = _chunkSBQVEBSUcjs.niceScale; exports.niceStep = _chunkSBQVEBSUcjs.niceStep; exports.normalizeChartAxis = _chunkR3P2M7HUcjs.normalizeChartAxis; exports.normalizeChartErrorBars = _chunkR3P2M7HUcjs.normalizeChartErrorBars; exports.normalizeChartReferenceBand = _chunkR3P2M7HUcjs.normalizeChartReferenceBand; exports.normalizeChartReferenceLine = _chunkR3P2M7HUcjs.normalizeChartReferenceLine; exports.normalizeChartSpec = _chunkR3P2M7HUcjs.normalizeChartSpec; exports.normalizeChartTree = _chunkR3P2M7HUcjs.normalizeChartTree; exports.normalizeChartTrendline = _chunkR3P2M7HUcjs.normalizeChartTrendline; exports.normalizeChartValues = _chunkR3P2M7HUcjs.normalizeChartValues; exports.parseChartAmountList = _chunkR3P2M7HUcjs.parseChartAmountList; exports.parseChartColor = _chunkR3P2M7HUcjs.parseChartColor; exports.parseChartDate = _chunkSBQVEBSUcjs.parseChartDate; exports.parseChartValue = _chunkR3P2M7HUcjs.parseChartValue; exports.parsePartialChartJson = parsePartialChartJson; exports.planChartCommand = planChartCommand; exports.planChartToolPlayback = planChartToolPlayback; exports.rasterizeChartSvg = rasterizeChartSvg; exports.realChartClock = realChartClock; exports.recommendChartTypes = recommendChartTypes; exports.recommendForShape = recommendForShape; exports.removeChartTreeRow = _chunkR3P2M7HUcjs.removeChartTreeRow; exports.resolveChartSvgPaints = resolveChartSvgPaints; exports.sameChartSelection = _chunkSBQVEBSUcjs.sameChartSelection; exports.setChartTreeRowName = _chunkR3P2M7HUcjs.setChartTreeRowName; exports.setChartTreeRowValue = _chunkR3P2M7HUcjs.setChartTreeRowValue; exports.shadeChartColor = _chunkR3P2M7HUcjs.shadeChartColor; exports.simulateChartVision = _chunkR3P2M7HUcjs.simulateChartVision; exports.snapChartDragValue = snapChartDragValue; exports.snapChartValue = _chunkSBQVEBSUcjs.snapChartValue; exports.sparklineToSvg = _chunkGKNEJ6ENcjs.sparklineToSvg; exports.startChartPointDrag = startChartPointDrag; exports.stepDecimals = _chunkSBQVEBSUcjs.stepDecimals; exports.suggestChartReferences = _chunkSBQVEBSUcjs.suggestChartReferences; exports.summarizeChart = _chunkGKNEJ6ENcjs.summarizeChart; exports.summarizeChartSeries = _chunkSBQVEBSUcjs.summarizeChartSeries; exports.trendNumberText = _chunkSBQVEBSUcjs.trendNumberText; exports.uniqueChartSeriesId = _chunkR3P2M7HUcjs.uniqueChartSeriesId; exports.withChartPlayback = withChartPlayback;
3359
+ exports.CHART_AXIS_KINDS = _chunkBPX4Z3N3cjs.CHART_AXIS_KINDS; exports.CHART_AXIS_SCALES = _chunkBPX4Z3N3cjs.CHART_AXIS_SCALES; exports.CHART_COLOR_SCHEMES = _chunkV5L2G22Rcjs.CHART_COLOR_SCHEMES; exports.CHART_CURVES = _chunkBPX4Z3N3cjs.CHART_CURVES; exports.CHART_DATE_STEPS = _chunkUUUTEVX6cjs.CHART_DATE_STEPS; exports.CHART_ERROR_BAR_DIRECTIONS = _chunkBPX4Z3N3cjs.CHART_ERROR_BAR_DIRECTIONS; exports.CHART_ERROR_BAR_LABELS = _chunkBPX4Z3N3cjs.CHART_ERROR_BAR_LABELS; exports.CHART_ERROR_BAR_TYPES = _chunkBPX4Z3N3cjs.CHART_ERROR_BAR_TYPES; exports.CHART_LABEL_POSITIONS = _chunkBPX4Z3N3cjs.CHART_LABEL_POSITIONS; exports.CHART_LAYOUT_PRESETS = _chunkV5L2G22Rcjs.CHART_LAYOUT_PRESETS; exports.CHART_LEGEND_POSITIONS = _chunkBPX4Z3N3cjs.CHART_LEGEND_POSITIONS; exports.CHART_LIKERT_NEUTRALS = _chunkBPX4Z3N3cjs.CHART_LIKERT_NEUTRALS; exports.CHART_LIKERT_SORTS = _chunkBPX4Z3N3cjs.CHART_LIKERT_SORTS; exports.CHART_MARKERS = _chunkBPX4Z3N3cjs.CHART_MARKERS; exports.CHART_MERMAID_META_PREFIX = _chunkV5L2G22Rcjs.CHART_MERMAID_META_PREFIX; exports.CHART_NUMBER_STYLES = _chunkBPX4Z3N3cjs.CHART_NUMBER_STYLES; exports.CHART_OOXML_CONTENT_TYPE = _chunkSZWVMB3Bcjs.CHART_OOXML_CONTENT_TYPE; exports.CHART_OOXML_NS = _chunkSZWVMB3Bcjs.CHART_OOXML_NS; exports.CHART_OOXML_RELATIONSHIP = _chunkSZWVMB3Bcjs.CHART_OOXML_RELATIONSHIP; exports.CHART_ORIENTATIONS = _chunkBPX4Z3N3cjs.CHART_ORIENTATIONS; exports.CHART_PALETTE_SHADES = _chunkBPX4Z3N3cjs.CHART_PALETTE_SHADES; exports.CHART_PRESENCE_COLORS = CHART_PRESENCE_COLORS; exports.CHART_RADAR_GRATICULES = _chunkBPX4Z3N3cjs.CHART_RADAR_GRATICULES; exports.CHART_RASTER_MAX_SIZE = CHART_RASTER_MAX_SIZE; exports.CHART_REFERENCE_AXES = _chunkBPX4Z3N3cjs.CHART_REFERENCE_AXES; exports.CHART_SANKEY_LINK_COLORS = _chunkBPX4Z3N3cjs.CHART_SANKEY_LINK_COLORS; exports.CHART_SERIES_TYPES = _chunkBPX4Z3N3cjs.CHART_SERIES_TYPES; exports.CHART_STACKINGS = _chunkBPX4Z3N3cjs.CHART_STACKINGS; exports.CHART_TRENDLINE_TYPES = _chunkBPX4Z3N3cjs.CHART_TRENDLINE_TYPES; exports.CHART_TYPES = _chunkBPX4Z3N3cjs.CHART_TYPES; exports.CHART_TYPE_LABELS = _chunkBPX4Z3N3cjs.CHART_TYPE_LABELS; exports.CSS_VARIABLE_CHART_THEME = _chunkBPX4Z3N3cjs.CSS_VARIABLE_CHART_THEME; exports.ChartController = _chunkV5L2G22Rcjs.ChartController; exports.ChartDirector = ChartDirector; exports.ChartPresence = ChartPresence; exports.ChartStream = ChartStream; exports.DEFAULT_CHART_PALETTE = _chunkBPX4Z3N3cjs.DEFAULT_CHART_PALETTE; exports.DEFAULT_CHART_THEME = _chunkBPX4Z3N3cjs.DEFAULT_CHART_THEME; exports.MAX_CHART_DATA_LABELS = _chunkUUUTEVX6cjs.MAX_CHART_DATA_LABELS; exports.MAX_CHART_LINE_POINTS = _chunkUUUTEVX6cjs.MAX_CHART_LINE_POINTS; exports.MAX_CHART_LINKS = _chunkBPX4Z3N3cjs.MAX_CHART_LINKS; exports.MAX_CHART_MARKERS = _chunkUUUTEVX6cjs.MAX_CHART_MARKERS; exports.MAX_CHART_TREE_DEPTH = _chunkBPX4Z3N3cjs.MAX_CHART_TREE_DEPTH; exports.MAX_CHART_TREE_NODES = _chunkBPX4Z3N3cjs.MAX_CHART_TREE_NODES; exports.OfficeChartsError = OfficeChartsError; exports.RENDER_CHART_INSTRUCTIONS = RENDER_CHART_INSTRUCTIONS; exports.addChartLink = _chunkBPX4Z3N3cjs.addChartLink; exports.addChartTreeRow = _chunkBPX4Z3N3cjs.addChartTreeRow; exports.analyzeChartTable = analyzeChartTable; exports.blendChartScenes = blendChartScenes; exports.canDragChartPoint = canDragChartPoint; exports.chartBoxStats = _chunkUUUTEVX6cjs.chartBoxStats; exports.chartClientToScene = chartClientToScene; exports.chartColorDistance = _chunkBPX4Z3N3cjs.chartColorDistance; exports.chartColorInputValue = _chunkBPX4Z3N3cjs.chartColorInputValue; exports.chartColorsByCategory = _chunkBPX4Z3N3cjs.chartColorsByCategory; exports.chartContrastRatio = _chunkBPX4Z3N3cjs.chartContrastRatio; exports.chartDataFromTable = _chunkBPX4Z3N3cjs.chartDataFromTable; exports.chartDataToTable = _chunkBPX4Z3N3cjs.chartDataToTable; exports.chartDateLabels = _chunkUUUTEVX6cjs.chartDateLabels; exports.chartDateToSerial = _chunkUUUTEVX6cjs.chartDateToSerial; exports.chartErrorAmounts = _chunkBPX4Z3N3cjs.chartErrorAmounts; exports.chartErrorBarsOfType = _chunkBPX4Z3N3cjs.chartErrorBarsOfType; exports.chartFamily = _chunkBPX4Z3N3cjs.chartFamily; exports.chartFileName = chartFileName; exports.chartFormatToCode = _chunkSZWVMB3Bcjs.chartFormatToCode; exports.chartFromMermaid = _chunkV5L2G22Rcjs.chartFromMermaid; exports.chartFromOoxml = _chunkSZWVMB3Bcjs.chartFromOoxml; exports.chartFromTable = chartFromTable; exports.chartHistogram = _chunkUUUTEVX6cjs.chartHistogram; exports.chartHitTest = chartHitTest; exports.chartLikertColor = _chunkBPX4Z3N3cjs.chartLikertColor; exports.chartLinksFromTable = _chunkBPX4Z3N3cjs.chartLinksFromTable; exports.chartLuminance = _chunkBPX4Z3N3cjs.chartLuminance; exports.chartMermaidFamily = _chunkV5L2G22Rcjs.chartMermaidFamily; exports.chartMovingAverage = _chunkUUUTEVX6cjs.chartMovingAverage; exports.chartPointAnchor = chartPointAnchor; exports.chartPointColor = _chunkBPX4Z3N3cjs.chartPointColor; exports.chartPointRef = chartPointRef; exports.chartPresetPatch = _chunkV5L2G22Rcjs.chartPresetPatch; exports.chartQuantile = _chunkUUUTEVX6cjs.chartQuantile; exports.chartRaceMoment = _chunkUUUTEVX6cjs.chartRaceMoment; exports.chartRaceRanking = _chunkUUUTEVX6cjs.chartRaceRanking; exports.chartRaceValueAt = _chunkUUUTEVX6cjs.chartRaceValueAt; exports.chartRasterSize = chartRasterSize; exports.chartRgbToHex = _chunkBPX4Z3N3cjs.chartRgbToHex; exports.chartRgbToOklab = _chunkBPX4Z3N3cjs.chartRgbToOklab; exports.chartSankeyNodeValues = _chunkBPX4Z3N3cjs.chartSankeyNodeValues; exports.chartSankeyNodes = _chunkBPX4Z3N3cjs.chartSankeyNodes; exports.chartScaleFromPixel = _chunkUUUTEVX6cjs.chartScaleFromPixel; exports.chartScaleToPixel = _chunkUUUTEVX6cjs.chartScaleToPixel; exports.chartSceneToDomSpec = _chunkV5L2G22Rcjs.chartSceneToDomSpec; exports.chartSceneToSvg = _chunkV5L2G22Rcjs.chartSceneToSvg; exports.chartSerialToDate = _chunkUUUTEVX6cjs.chartSerialToDate; exports.chartSeriesColor = _chunkBPX4Z3N3cjs.chartSeriesColor; exports.chartSeriesType = _chunkBPX4Z3N3cjs.chartSeriesType; exports.chartSliceColor = _chunkBPX4Z3N3cjs.chartSliceColor; exports.chartSpecColorsByCategory = _chunkBPX4Z3N3cjs.chartSpecColorsByCategory; exports.chartSquarify = _chunkUUUTEVX6cjs.chartSquarify; exports.chartStyleDomain = chartStyleDomain; exports.chartStylePatch = chartStylePatch; exports.chartSupportsTrendlines = _chunkUUUTEVX6cjs.chartSupportsTrendlines; exports.chartTextBaseline = _chunkV5L2G22Rcjs.chartTextBaseline; exports.chartTextOn = _chunkBPX4Z3N3cjs.chartTextOn; exports.chartTextTransform = _chunkV5L2G22Rcjs.chartTextTransform; exports.chartToMermaid = _chunkV5L2G22Rcjs.chartToMermaid; exports.chartToOoxml = _chunkSZWVMB3Bcjs.chartToOoxml; exports.chartToSvg = _chunkV5L2G22Rcjs.chartToSvg; exports.chartTreeColumnLabels = _chunkBPX4Z3N3cjs.chartTreeColumnLabels; exports.chartTreeDepth = _chunkBPX4Z3N3cjs.chartTreeDepth; exports.chartTreeFromRows = _chunkBPX4Z3N3cjs.chartTreeFromRows; exports.chartTreeFromSeries = _chunkBPX4Z3N3cjs.chartTreeFromSeries; exports.chartTreeFromTable = _chunkBPX4Z3N3cjs.chartTreeFromTable; exports.chartTreeToRows = _chunkBPX4Z3N3cjs.chartTreeToRows; exports.chartTreeTotal = _chunkBPX4Z3N3cjs.chartTreeTotal; exports.chartTrendlineName = _chunkUUUTEVX6cjs.chartTrendlineName; exports.chartValueAtPoint = _chunkUUUTEVX6cjs.chartValueAtPoint; exports.chartVariesColors = _chunkBPX4Z3N3cjs.chartVariesColors; exports.chartXAtPoint = _chunkUUUTEVX6cjs.chartXAtPoint; exports.checkChartColors = _chunkBPX4Z3N3cjs.checkChartColors; exports.cloneChartSeries = _chunkBPX4Z3N3cjs.cloneChartSeries; exports.cloneChartSpec = _chunkBPX4Z3N3cjs.cloneChartSpec; exports.cloneChartTree = _chunkBPX4Z3N3cjs.cloneChartTree; exports.compileChartFormatCode = _chunkUUUTEVX6cjs.compileChartFormatCode; exports.contrastingTextColor = _chunkUUUTEVX6cjs.contrastingTextColor; exports.createChartCommands = createChartCommands; exports.createChartController = _chunkV5L2G22Rcjs.createChartController; exports.createChartEditorDocument = createChartEditorDocument; exports.createChartRasterizer = createChartRasterizer; exports.createChartSpec = _chunkBPX4Z3N3cjs.createChartSpec; exports.createChartStyleToolProvider = createChartStyleToolProvider; exports.createChartToolProvider = createChartToolProvider; exports.createInstantChartClock = createInstantChartClock; exports.createOfficeChartToolProvider = createOfficeChartToolProvider; exports.cyclePaletteColor = _chunkBPX4Z3N3cjs.cyclePaletteColor; exports.decimateChartPoints = _chunkUUUTEVX6cjs.decimateChartPoints; exports.defaultChartAxis = _chunkBPX4Z3N3cjs.defaultChartAxis; exports.defaultChartErrorBarValue = _chunkBPX4Z3N3cjs.defaultChartErrorBarValue; exports.describeChart = _chunkV5L2G22Rcjs.describeChart; exports.describeChartErrorBars = _chunkBPX4Z3N3cjs.describeChartErrorBars; exports.describeChartSelection = describeChartSelection; exports.describeOfficeChartPlace = describeOfficeChartPlace; exports.downloadChartPng = downloadChartPng; exports.easeChartTween = easeChartTween; exports.estimateChartTextWidth = _chunkUUUTEVX6cjs.estimateChartTextWidth; exports.extractDocxCharts = extractDocxCharts; exports.extractOfficeCharts = extractOfficeCharts; exports.extractPptxCharts = extractPptxCharts; exports.extractXlsxCharts = extractXlsxCharts; exports.findChartTreeNode = _chunkBPX4Z3N3cjs.findChartTreeNode; exports.findMermaidCharts = _chunkV5L2G22Rcjs.findMermaidCharts; exports.fitChartTrendline = _chunkUUUTEVX6cjs.fitChartTrendline; exports.formatChartAmountList = _chunkBPX4Z3N3cjs.formatChartAmountList; exports.formatChartDate = _chunkUUUTEVX6cjs.formatChartDate; exports.formatChartNumber = _chunkUUUTEVX6cjs.formatChartNumber; exports.formatChartValueWithCode = _chunkUUUTEVX6cjs.formatChartValueWithCode; exports.handleChartKey = handleChartKey; exports.isCartesianChart = _chunkBPX4Z3N3cjs.isCartesianChart; exports.isXyChart = _chunkBPX4Z3N3cjs.isXyChart; exports.layoutChart = _chunkUUUTEVX6cjs.layoutChart; exports.layoutSparkline = _chunkV5L2G22Rcjs.layoutSparkline; exports.linearMap = _chunkUUUTEVX6cjs.linearMap; exports.locateChartPoint = locateChartPoint; exports.monochromeChartPalette = _chunkV5L2G22Rcjs.monochromeChartPalette; exports.niceLogScale = _chunkUUUTEVX6cjs.niceLogScale; exports.niceScale = _chunkUUUTEVX6cjs.niceScale; exports.niceStep = _chunkUUUTEVX6cjs.niceStep; exports.normalizeChartAxis = _chunkBPX4Z3N3cjs.normalizeChartAxis; exports.normalizeChartErrorBars = _chunkBPX4Z3N3cjs.normalizeChartErrorBars; exports.normalizeChartLinks = _chunkBPX4Z3N3cjs.normalizeChartLinks; exports.normalizeChartReferenceBand = _chunkBPX4Z3N3cjs.normalizeChartReferenceBand; exports.normalizeChartReferenceLine = _chunkBPX4Z3N3cjs.normalizeChartReferenceLine; exports.normalizeChartSpec = _chunkBPX4Z3N3cjs.normalizeChartSpec; exports.normalizeChartTree = _chunkBPX4Z3N3cjs.normalizeChartTree; exports.normalizeChartTrendline = _chunkBPX4Z3N3cjs.normalizeChartTrendline; exports.normalizeChartValues = _chunkBPX4Z3N3cjs.normalizeChartValues; exports.parseChartAmountList = _chunkBPX4Z3N3cjs.parseChartAmountList; exports.parseChartColor = _chunkBPX4Z3N3cjs.parseChartColor; exports.parseChartDate = _chunkUUUTEVX6cjs.parseChartDate; exports.parseChartValue = _chunkBPX4Z3N3cjs.parseChartValue; exports.parsePartialChartJson = parsePartialChartJson; exports.planChartCommand = planChartCommand; exports.planChartToolPlayback = planChartToolPlayback; exports.rasterizeChartSvg = rasterizeChartSvg; exports.realChartClock = realChartClock; exports.recommendChartTypes = recommendChartTypes; exports.recommendForShape = recommendForShape; exports.removeChartTreeRow = _chunkBPX4Z3N3cjs.removeChartTreeRow; exports.resolveChartSvgPaints = resolveChartSvgPaints; exports.sameChartSelection = _chunkUUUTEVX6cjs.sameChartSelection; exports.setChartLinkField = _chunkBPX4Z3N3cjs.setChartLinkField; exports.setChartTreeRowName = _chunkBPX4Z3N3cjs.setChartTreeRowName; exports.setChartTreeRowValue = _chunkBPX4Z3N3cjs.setChartTreeRowValue; exports.shadeChartColor = _chunkBPX4Z3N3cjs.shadeChartColor; exports.simulateChartVision = _chunkBPX4Z3N3cjs.simulateChartVision; exports.snapChartDragValue = snapChartDragValue; exports.snapChartValue = _chunkUUUTEVX6cjs.snapChartValue; exports.sparklineToSvg = _chunkV5L2G22Rcjs.sparklineToSvg; exports.startChartPointDrag = startChartPointDrag; exports.stepDecimals = _chunkUUUTEVX6cjs.stepDecimals; exports.suggestChartReferences = _chunkUUUTEVX6cjs.suggestChartReferences; exports.summarizeChart = _chunkV5L2G22Rcjs.summarizeChart; exports.summarizeChartSeries = _chunkUUUTEVX6cjs.summarizeChartSeries; exports.trendNumberText = _chunkUUUTEVX6cjs.trendNumberText; exports.uniqueChartSeriesId = _chunkBPX4Z3N3cjs.uniqueChartSeriesId; exports.withChartPlayback = withChartPlayback;