@pixerate/editor 0.165.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 (46) hide show
  1. package/dist/agent/index.cjs +34 -34
  2. package/dist/agent/index.js +5 -5
  3. package/dist/canvas/index.cjs +6 -6
  4. package/dist/canvas/index.js +2 -2
  5. package/dist/chart/controller.d.cts +29 -0
  6. package/dist/chart/controller.d.ts +29 -0
  7. package/dist/chart/index.cjs +301 -179
  8. package/dist/chart/index.d.cts +1 -0
  9. package/dist/chart/index.d.ts +1 -0
  10. package/dist/chart/index.js +132 -10
  11. package/dist/chart/layout-families.d.cts +7 -0
  12. package/dist/chart/layout-families.d.ts +7 -0
  13. package/dist/chart/layout-shared.d.cts +5 -0
  14. package/dist/chart/layout-shared.d.ts +5 -0
  15. package/dist/chart/race.d.cts +26 -0
  16. package/dist/chart/race.d.ts +26 -0
  17. package/dist/chart/schemas.d.cts +2 -0
  18. package/dist/chart/schemas.d.ts +2 -0
  19. package/dist/chart/spec.d.cts +1 -1
  20. package/dist/chart/spec.d.ts +1 -1
  21. package/dist/chart/types.d.cts +6 -2
  22. package/dist/chart/types.d.ts +6 -2
  23. package/dist/{chunk-FEU2XVQH.js → chunk-5UNQDC3Q.js} +5 -2
  24. package/dist/{chunk-64VWWR5U.cjs → chunk-6FYIFGBW.cjs} +16 -16
  25. package/dist/{chunk-UVXTOZ2B.cjs → chunk-BPX4Z3N3.cjs} +12 -3
  26. package/dist/{chunk-MKXK6E4O.cjs → chunk-CHLV7UFP.cjs} +51 -51
  27. package/dist/{chunk-X5W645RI.js → chunk-DFCAR7AW.js} +3 -3
  28. package/dist/{chunk-2ZRN43IN.js → chunk-FR432ROA.js} +12 -3
  29. package/dist/{chunk-ODFCS7HF.cjs → chunk-HXOBOHH2.cjs} +8 -8
  30. package/dist/{chunk-V5GSY3NC.js → chunk-ITANXMZD.js} +78 -2
  31. package/dist/{chunk-TVQW26AV.cjs → chunk-MZFZSVUJ.cjs} +26 -23
  32. package/dist/{chunk-N7NBGT2Y.js → chunk-NQQDGGXY.js} +2 -2
  33. package/dist/{chunk-Q25WAFTD.cjs → chunk-SZWVMB3B.cjs} +21 -18
  34. package/dist/{chunk-QO2T6KA5.cjs → chunk-UUUTEVX6.cjs} +116 -40
  35. package/dist/{chunk-IMRXC7OA.cjs → chunk-V5L2G22R.cjs} +153 -77
  36. package/dist/{chunk-2J5VLJHC.js → chunk-VB2CY6EG.js} +3 -3
  37. package/dist/{chunk-CRFSQWKQ.js → chunk-XNU45TYA.js} +4 -1
  38. package/dist/{chunk-FRBRLKNQ.js → chunk-YUFTVNLX.js} +78 -2
  39. package/dist/export/index.cjs +4 -4
  40. package/dist/export/index.js +3 -3
  41. package/dist/extensions/index.cjs +7 -7
  42. package/dist/extensions/index.js +6 -6
  43. package/dist/index.cjs +13 -13
  44. package/dist/index.js +7 -7
  45. package/package.json +1 -1
  46. package/skills/pixerate-chart/SKILL.md +20 -2
@@ -11,10 +11,10 @@ var _chunkYN6JKAUEcjs = require('./chunk-YN6JKAUE.cjs');
11
11
 
12
12
 
13
13
 
14
- var _chunkQ25WAFTDcjs = require('./chunk-Q25WAFTD.cjs');
14
+ var _chunkSZWVMB3Bcjs = require('./chunk-SZWVMB3B.cjs');
15
15
 
16
16
 
17
- var _chunkUVXTOZ2Bcjs = require('./chunk-UVXTOZ2B.cjs');
17
+ var _chunkBPX4Z3N3cjs = require('./chunk-BPX4Z3N3.cjs');
18
18
 
19
19
  // src/export/images.ts
20
20
  var DOCX_IMAGE_TYPES = {
@@ -1028,12 +1028,12 @@ var DocxBuilder = (_class2 = class {
1028
1028
  this.drop("node", "chart", "chart has no spec");
1029
1029
  return;
1030
1030
  }
1031
- const spec = _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, raw).spec;
1032
- const written = _chunkQ25WAFTDcjs.chartToOoxml.call(void 0, spec);
1031
+ const spec = _chunkBPX4Z3N3cjs.normalizeChartSpec.call(void 0, raw).spec;
1032
+ const written = _chunkSZWVMB3Bcjs.chartToOoxml.call(void 0, spec);
1033
1033
  for (const issue of written.issues) this.drop("node", "chart", issue);
1034
1034
  const name = `chart${this.charts.length + 1}.xml`;
1035
1035
  this.charts.push(written.xml);
1036
- const relId = this.rels.add(_chunkQ25WAFTDcjs.CHART_OOXML_RELATIONSHIP, `charts/${name}`);
1036
+ const relId = this.rels.add(_chunkSZWVMB3Bcjs.CHART_OOXML_RELATIONSHIP, `charts/${name}`);
1037
1037
  let width = _nullishCoalesce(pixelAttr(_optionalChain([node, 'access', _91 => _91.attrs, 'optionalAccess', _92 => _92.width])), () => ( MAX_IMAGE_WIDTH_PX));
1038
1038
  let height = _nullishCoalesce(pixelAttr(_optionalChain([node, 'access', _93 => _93.attrs, 'optionalAccess', _94 => _94.height])), () => ( 320));
1039
1039
  if (width > MAX_IMAGE_WIDTH_PX) {
@@ -1050,8 +1050,8 @@ var DocxBuilder = (_class2 = class {
1050
1050
  drawing.empty("wp:extent", { cx, cy }).empty("wp:effectExtent", { l: 0, t: 0, r: 0, b: 0 });
1051
1051
  drawing.empty("wp:docPr", { id, name: `Chart ${id}`, descr: title || void 0, title: title || void 0 });
1052
1052
  drawing.empty("wp:cNvGraphicFramePr");
1053
- drawing.open("a:graphic").open("a:graphicData", { uri: _chunkQ25WAFTDcjs.CHART_OOXML_NS });
1054
- drawing.empty("c:chart", { "xmlns:c": _chunkQ25WAFTDcjs.CHART_OOXML_NS, "r:id": relId });
1053
+ drawing.open("a:graphic").open("a:graphicData", { uri: _chunkSZWVMB3Bcjs.CHART_OOXML_NS });
1054
+ drawing.empty("c:chart", { "xmlns:c": _chunkSZWVMB3Bcjs.CHART_OOXML_NS, "r:id": relId });
1055
1055
  drawing.close("a:graphicData").close("a:graphic").close("wp:inline").close("w:drawing").close("w:r");
1056
1056
  this.report.written.paragraphs++;
1057
1057
  w.open("w:p");
@@ -1384,7 +1384,7 @@ var DocxBuilder = (_class2 = class {
1384
1384
  if (people) add("word/people.xml", people, `${CT_WML}people+xml`);
1385
1385
  parts.push({ name: "word/_rels/document.xml.rels", data: this.rels.xml() });
1386
1386
  for (const file of this.media) parts.push({ name: `word/media/${file.name}`, data: file.bytes });
1387
- this.charts.forEach((xml, i) => add(`word/charts/chart${i + 1}.xml`, xml, _chunkQ25WAFTDcjs.CHART_OOXML_CONTENT_TYPE));
1387
+ this.charts.forEach((xml, i) => add(`word/charts/chart${i + 1}.xml`, xml, _chunkSZWVMB3Bcjs.CHART_OOXML_CONTENT_TYPE));
1388
1388
  add("docProps/core.xml", this.coreXml(now), "application/vnd.openxmlformats-package.core-properties+xml");
1389
1389
  const app = new XmlWriter();
1390
1390
  app.open("Properties", { xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" });
@@ -12,7 +12,7 @@ import {
12
12
  chartTreeTotal,
13
13
  chartVariesColors,
14
14
  shadeChartColor
15
- } from "./chunk-2ZRN43IN.js";
15
+ } from "./chunk-FR432ROA.js";
16
16
  import {
17
17
  NumberFormat
18
18
  } from "./chunk-II2WIF5Z.js";
@@ -1677,6 +1677,38 @@ function trendlineLegendItems(spec, color) {
1677
1677
  );
1678
1678
  }
1679
1679
 
1680
+ // src/chart/race.ts
1681
+ function chartRaceValueAt(series, index) {
1682
+ for (let i = Math.min(index, series.values.length - 1); i >= 0; i--) {
1683
+ const v = series.values[i];
1684
+ if (v !== null && v !== void 0 && Number.isFinite(v)) return v;
1685
+ }
1686
+ return 0;
1687
+ }
1688
+ function chartRaceMoment(count, frame) {
1689
+ const last = Math.max(0, count - 1);
1690
+ const at = frame === null || frame === void 0 || !Number.isFinite(frame) ? last : Math.max(0, Math.min(last, frame));
1691
+ const from = Math.floor(at);
1692
+ const to = Math.min(last, from + 1);
1693
+ return { from, to, t: at - from, at };
1694
+ }
1695
+ function chartRaceRanking(spec, frame) {
1696
+ const visible = spec.series.filter((s) => !s.hidden);
1697
+ const { from, to, t } = chartRaceMoment(spec.categories.length, frame);
1698
+ const rankAt = (i) => {
1699
+ const order2 = visible.map((s, k) => ({ id: s.id, v: chartRaceValueAt(s, i), k })).sort((a, b) => b.v - a.v || a.k - b.k);
1700
+ return new Map(order2.map((o, r) => [o.id, r]));
1701
+ };
1702
+ const r0 = rankAt(from);
1703
+ const r1 = rankAt(to);
1704
+ const near = t < 0.5 ? r0 : r1;
1705
+ return visible.map((s) => {
1706
+ const a = chartRaceValueAt(s, from);
1707
+ const b = chartRaceValueAt(s, to);
1708
+ return { seriesId: s.id, name: s.name, value: a + (b - a) * t, position: r0.get(s.id) + (r1.get(s.id) - r0.get(s.id)) * t, rank: near.get(s.id) };
1709
+ }).sort((a, b) => a.position - b.position || b.value - a.value);
1710
+ }
1711
+
1680
1712
  // src/chart/layout-families.ts
1681
1713
  var sliceColor = (ctx, series, i) => series.pointColors?.[i] || chartSliceColor(ctx.spec, i);
1682
1714
  function layoutPie(ctx, area, series) {
@@ -2441,11 +2473,50 @@ function layoutSankey(ctx, area, series) {
2441
2473
  if (hidden) ctx.warn("labels-truncated", `${hidden} node label${hidden === 1 ? " was" : "s were"} shortened to fit between the columns.`);
2442
2474
  return { plot: area };
2443
2475
  }
2476
+ function layoutBarRace(ctx, area, frame) {
2477
+ const { spec, theme, marks, fs, measure } = ctx;
2478
+ const top = spec.raceTopN;
2479
+ const moment = chartRaceMoment(spec.categories.length, frame);
2480
+ const ranking = chartRaceRanking(spec, frame);
2481
+ const shown = ranking.filter((e) => e.position < top);
2482
+ const labelW = Math.min(area.width * 0.3, Math.max(0, ...ranking.map((e) => measure(e.name, fs)))) + 8;
2483
+ const tickH = spec.yAxis.show ? fs * 1.6 : 4;
2484
+ const plot = { x: area.x + labelW, y: area.y + tickH, width: Math.max(1, area.width - labelW - fs * 4), height: Math.max(1, area.height - tickH) };
2485
+ const lead = Math.max(1e-9, ...shown.map((e) => e.value));
2486
+ const max = spec.yAxis.max !== null && spec.yAxis.max > 0 ? spec.yAxis.max : lead * 1.08;
2487
+ const xOf = (v) => plot.x + Math.max(0, Math.min(max, v)) / max * plot.width;
2488
+ const ticks = niceScale(0, max, 5).ticks.filter((t) => t <= max);
2489
+ const axisTarget = { kind: "axis", axis: "y" };
2490
+ const format = spec.yAxis.format;
2491
+ ticks.forEach((t, k) => {
2492
+ if (spec.yAxis.gridlines) marks.push({ kind: "line", key: `grid-y-${k}`, role: "grid", x1: xOf(t), y1: plot.y, x2: xOf(t), y2: plot.y + plot.height, stroke: theme.grid, strokeWidth: 1 });
2493
+ if (spec.yAxis.show) marks.push({ kind: "text", key: `tick-y-${k}`, role: "tick-label", x: xOf(t), y: area.y, text: formatChartNumber(t, format, format.decimals ?? stepDecimals(ticks[1] - ticks[0] || 1)), anchor: "middle", baseline: "top", size: fs - 1, fill: theme.mutedText, target: axisTarget });
2494
+ });
2495
+ const label = spec.categories[moment.t < 0.5 ? moment.from : moment.to] ?? "";
2496
+ const timeSize = Math.min(theme.titleSize * 3, plot.height * 0.2, plot.width * 0.5 / Math.max(1, label.length * 0.6));
2497
+ marks.push({ kind: "text", key: "race-time", role: "race-time", x: plot.x + plot.width, y: plot.y + plot.height - 4, text: label, anchor: "end", baseline: "bottom", size: timeSize, weight: 700, fill: theme.mutedText, opacity: 0.55, target: { kind: "category", index: moment.t < 0.5 ? moment.from : moment.to } });
2498
+ const band = plot.height / top;
2499
+ const barH = Math.max(2, band * (1 - Math.min(0.8, spec.gapWidth)));
2500
+ const index = Math.round(moment.at);
2501
+ for (const e of shown) {
2502
+ const si = spec.series.findIndex((s2) => s2.id === e.seriesId);
2503
+ const s = spec.series[si];
2504
+ const y = plot.y + e.position * band + (band - barH) / 2;
2505
+ const target = { kind: "point", seriesId: e.seriesId, index };
2506
+ const selected = ctx.isSelected(target) || ctx.seriesSelected(e.seriesId);
2507
+ const width = Math.max(0, xOf(e.value) - plot.x);
2508
+ marks.push({ kind: "rect", key: `bar-${e.seriesId}`, role: "bar", x: plot.x, y, width, height: barH, fill: chartSeriesColor(spec, si), radius: Math.min(3, barH / 4), target, selected, ...selected ? { stroke: theme.selection, strokeWidth: 1.5 } : {} });
2509
+ marks.push({ kind: "text", key: `label-name-${e.seriesId}`, role: "tick-label", x: plot.x - 6, y: y + barH / 2, text: truncate(e.name, labelW - 8, fs, measure), anchor: "end", baseline: "middle", size: fs, fill: selected ? theme.selection : theme.text, target: { kind: "series", seriesId: e.seriesId } });
2510
+ if (s.dataLabels ?? true) marks.push({ kind: "text", key: `label-${e.seriesId}`, role: "data-label", x: plot.x + width + 5, y: y + barH / 2, text: formatChartNumber(e.value, s.format ?? format, (s.format ?? format).decimals ?? (Math.abs(e.value) >= 100 ? 0 : void 0)), anchor: "start", baseline: "middle", size: fs - 1, fill: theme.text, target });
2511
+ }
2512
+ if (ranking.length > top) ctx.warn("values-skipped", `The race shows the top ${top} of ${ranking.length} names at each moment (raceTopN).`);
2513
+ return { plot, valueScale: { axis: "x", domain: [0, max], range: [plot.x, plot.x + plot.width], ticks } };
2514
+ }
2444
2515
 
2445
2516
  // src/chart/layout.ts
2446
2517
  function legendItems(spec, ctx) {
2447
2518
  const family = chartFamily(spec);
2448
- if (spec.type === "funnel" || spec.type === "slope" || spec.type === "sankey") return [];
2519
+ if (spec.type === "funnel" || spec.type === "slope" || spec.type === "sankey" || spec.type === "barrace") return [];
2449
2520
  if (chartSpecColorsByCategory(spec)) {
2450
2521
  const first = spec.series.find((s) => !s.hidden);
2451
2522
  const seats = (i) => Math.max(0, Math.round(first?.values[i] ?? 0));
@@ -2585,6 +2656,8 @@ function layoutChart(spec, options) {
2585
2656
  return finish(layoutFunnel(ctx, area, visible[0]));
2586
2657
  case "treemap":
2587
2658
  return finish(spec.tree.length ? layoutTreemapTree(ctx, area, spec.series[0]) : layoutTreemap(ctx, area, visible[0]));
2659
+ case "barrace":
2660
+ return finish(layoutBarRace(ctx, area, options.raceFrame));
2588
2661
  case "sankey":
2589
2662
  if (!spec.links.length) {
2590
2663
  ctx.warn("type-fallback", "A Sankey diagram needs flows (set_chart_links); it is drawn as a bar chart until then.");
@@ -2794,6 +2867,9 @@ export {
2794
2867
  MAX_CHART_DATA_LABELS,
2795
2868
  MAX_CHART_LINE_POINTS,
2796
2869
  MAX_CHART_MARKERS,
2870
+ chartRaceValueAt,
2871
+ chartRaceMoment,
2872
+ chartRaceRanking,
2797
2873
  layoutChart,
2798
2874
  chartValueAtPoint,
2799
2875
  chartXAtPoint,
@@ -18,7 +18,7 @@
18
18
 
19
19
 
20
20
 
21
- var _chunkUVXTOZ2Bcjs = require('./chunk-UVXTOZ2B.cjs');
21
+ var _chunkBPX4Z3N3cjs = require('./chunk-BPX4Z3N3.cjs');
22
22
 
23
23
  // src/chart/schemas.ts
24
24
  var VALUE = { type: ["number", "string", "null"], description: 'A number, numeric text ("1,200", "12%", "$40", "(3)") or null for a gap.' };
@@ -30,7 +30,7 @@ var FORMAT = {
30
30
  type: "object",
31
31
  description: "How numbers are written on this axis or series.",
32
32
  properties: {
33
- style: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_NUMBER_STYLES], description: "number (default), percent (0.25 \u2192 25%), currency or compact (1.2K)." },
33
+ style: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_NUMBER_STYLES], description: "number (default), percent (0.25 \u2192 25%), currency or compact (1.2K)." },
34
34
  decimals: { type: "integer", minimum: 0, maximum: 10, description: "Fixed decimals (default: what the ticks need)." },
35
35
  currency: { type: "string", description: 'ISO currency code for style "currency", e.g. "EUR" (default USD).' },
36
36
  prefix: { type: "string", description: "Text before every number." },
@@ -50,10 +50,10 @@ var AXIS = (what) => ({
50
50
  step: { type: ["number", "null"], exclusiveMinimum: 0, description: "Fixed distance between ticks, or null for automatic." },
51
51
  gridlines: { type: "boolean", description: "Grid lines at each tick." },
52
52
  format: FORMAT,
53
- kind: { type: ["string", "null"], enum: [..._chunkUVXTOZ2Bcjs.CHART_AXIS_KINDS, null], description: 'Category axis only: "date" reads categories as dates and labels them by calendar steps.' },
53
+ kind: { type: ["string", "null"], enum: [..._chunkBPX4Z3N3cjs.CHART_AXIS_KINDS, null], description: 'Category axis only: "date" reads categories as dates and labels them by calendar steps.' },
54
54
  scale: {
55
55
  type: ["string", "null"],
56
- enum: [..._chunkUVXTOZ2Bcjs.CHART_AXIS_SCALES, null],
56
+ enum: [..._chunkBPX4Z3N3cjs.CHART_AXIS_SCALES, null],
57
57
  description: 'Value axes and the numeric x axis of scatter / bubble charts: "log" spaces ticks by powers of logBase (values of 0 or less are skipped; min and max must be above 0; not with percent stacking). "linear" or null is the default. Ignored on a category axis.'
58
58
  },
59
59
  logBase: { type: ["number", "null"], minimum: 2, maximum: 1e3, description: "Base of a log axis, 2 to 1000 (default 10; null resets)." },
@@ -62,7 +62,7 @@ var AXIS = (what) => ({
62
62
  additionalProperties: false
63
63
  });
64
64
  var TRENDLINE_PROPS = {
65
- type: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_TRENDLINE_TYPES], description: "Fit: linear, exponential, logarithmic, power, polynomial or moving-average." },
65
+ type: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_TRENDLINE_TYPES], description: "Fit: linear, exponential, logarithmic, power, polynomial or moving-average." },
66
66
  order: { type: "integer", minimum: 2, maximum: 6, description: "Polynomial order (default 2)." },
67
67
  period: { type: "integer", minimum: 2, description: "Moving-average period in points (default 2)." },
68
68
  forward: { type: "number", minimum: 0, description: "Extend the line this many x units past the last point (default 0)." },
@@ -77,7 +77,7 @@ var REFERENCE_COMMON = {
77
77
  label: { type: "string", description: 'Text written on it, e.g. "Target" (default none).' },
78
78
  axis: {
79
79
  type: "string",
80
- enum: [..._chunkUVXTOZ2Bcjs.CHART_REFERENCE_AXES],
80
+ enum: [..._chunkBPX4Z3N3cjs.CHART_REFERENCE_AXES],
81
81
  description: "Axis it is measured on: y (default) is the value axis, y2 the secondary value axis (needs a series there), x the numeric x axis of a scatter or bubble chart."
82
82
  },
83
83
  color: { type: "string", description: "CSS colour (default: the text colour)." }
@@ -93,7 +93,7 @@ var REFERENCE_BAND_PROPS = {
93
93
  };
94
94
  var REFERENCE_COMMON_PATCH = {
95
95
  label: { type: ["string", "null"], description: "Text written on it; null removes it." },
96
- axis: { type: ["string", "null"], enum: [..._chunkUVXTOZ2Bcjs.CHART_REFERENCE_AXES, null], description: "Axis it is measured on (y, y2 or x); null goes back to y." },
96
+ axis: { type: ["string", "null"], enum: [..._chunkBPX4Z3N3cjs.CHART_REFERENCE_AXES, null], description: "Axis it is measured on (y, y2 or x); null goes back to y." },
97
97
  color: { type: ["string", "null"], description: "CSS colour; null goes back to the text colour." }
98
98
  };
99
99
  var REFERENCE_LINE_PATCH = { value: REFERENCE_LINE_PROPS.value, ...REFERENCE_COMMON_PATCH };
@@ -119,6 +119,7 @@ var LINK_PROPS = {
119
119
  value: { type: "number", exclusiveMinimum: 0, description: "How much flows, above 0 (its width)." },
120
120
  color: { type: "string", description: "CSS colour (default: by sankeyLinkColor)." }
121
121
  };
122
+ var RACE_TIME = { type: ["string", "number"], description: 'Time point label (a category, e.g. "2023") or index from 0; an index may be fractional, 2.5 being halfway between the third and fourth time points.' };
122
123
  var LINK_INDEX = { type: "integer", minimum: 0, description: "Flow index (0 = first), as get_chart lists them in spec.links." };
123
124
  var ERROR_BARS = (what) => ({
124
125
  type: ["object", "null"],
@@ -126,13 +127,13 @@ var ERROR_BARS = (what) => ({
126
127
  properties: {
127
128
  type: {
128
129
  type: "string",
129
- enum: [..._chunkUVXTOZ2Bcjs.CHART_ERROR_BAR_TYPES],
130
+ enum: [..._chunkBPX4Z3N3cjs.CHART_ERROR_BAR_TYPES],
130
131
  description: "fixed: the same amount at every point; percent: a percentage of each value; stddev: value standard deviations of the series, drawn around the series mean (as Excel does); stderr: the standard error of the series at every point; custom: per-point plus / minus amounts."
131
132
  },
132
133
  value: { type: "number", minimum: 0, description: "Amount in data units for fixed (default 1), percent of each value for percent (default 5), number of standard deviations for stddev (default 1). Not for stderr or custom." },
133
134
  plus: { type: "array", items: VALUE, description: "custom only: amount above each point, one per category, in data units (0 or more; null for none)." },
134
135
  minus: { type: "array", items: VALUE, description: "custom only: amount below each point, one per category (default: the plus amounts)." },
135
- direction: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_ERROR_BAR_DIRECTIONS], description: "both (default), plus (only above) or minus (only below)." },
136
+ direction: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_ERROR_BAR_DIRECTIONS], description: "both (default), plus (only above) or minus (only below)." },
136
137
  cap: { type: "boolean", description: "Draw end caps (default true)." }
137
138
  },
138
139
  required: ["type"],
@@ -142,22 +143,22 @@ var SERIES_PROPS = {
142
143
  name: { type: "string", description: "Series name (legend and data grid header)." },
143
144
  values: { type: "array", items: VALUE, description: "One value per category, in category order (padded with gaps)." },
144
145
  color: { type: ["string", "null"], description: "CSS colour, or null for the palette colour." },
145
- type: { type: ["string", "null"], enum: [..._chunkUVXTOZ2Bcjs.CHART_SERIES_TYPES, null], description: "Draw this series as bar, line, area or scatter (a combo chart); null follows the chart type." },
146
+ type: { type: ["string", "null"], enum: [..._chunkBPX4Z3N3cjs.CHART_SERIES_TYPES, null], description: "Draw this series as bar, line, area or scatter (a combo chart); null follows the chart type." },
146
147
  hidden: { type: "boolean", description: "Hide the series (its data is kept)." },
147
148
  axis: { type: ["string", "null"], enum: ["primary", "secondary", null], description: "Value axis: secondary is drawn on the right with its own scale." },
148
149
  x: { type: ["array", "null"], items: VALUE, description: "Numeric x per category, for scatter and bubble charts." },
149
150
  sizes: { type: ["array", "null"], items: VALUE, description: "Bubble sizes per category (area is proportional to size)." },
150
151
  pointColors: { type: ["array", "null"], items: { type: ["string", "null"] }, description: "Colour per category (null keeps the series colour)." },
151
152
  callouts: { type: ["array", "null"], items: { type: ["string", "null"] }, description: "A label pinned to each point that matters, one per category (null: none); null removes them all. Bar, line, area and scatter charts. set_chart_callout sets one." },
152
- marker: { type: ["string", "null"], enum: [..._chunkUVXTOZ2Bcjs.CHART_MARKERS, null], description: "Point marker shape for line, area and scatter series." },
153
- curve: { type: ["string", "null"], enum: [..._chunkUVXTOZ2Bcjs.CHART_CURVES, null], description: "Line shape for this series: linear, smooth or step." },
153
+ marker: { type: ["string", "null"], enum: [..._chunkBPX4Z3N3cjs.CHART_MARKERS, null], description: "Point marker shape for line, area and scatter series." },
154
+ curve: { type: ["string", "null"], enum: [..._chunkBPX4Z3N3cjs.CHART_CURVES, null], description: "Line shape for this series: linear, smooth or step." },
154
155
  dataLabels: { type: ["boolean", "null"], description: "Value labels for this series (null follows the chart)." },
155
156
  format: { ...FORMAT, type: ["object", "null"], description: "How this series' labels are written (null follows the value axis)." },
156
157
  errorBars: ERROR_BARS("Error bars along the value axis (bar, line, area and scatter series; on stacked charts they sit on the stack top)."),
157
158
  xErrorBars: ERROR_BARS("Error bars along the x axis (scatter and bubble charts with numeric x values; amounts in x units).")
158
159
  };
159
160
  var CHART_UPDATE_PROPERTIES = {
160
- type: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_TYPES], description: "Chart type. slope joins each category from the first series (before) to the second (after); likert reads each category as a question and the series as answers from most negative to most positive; parliament draws the first series as seats; sunburst draws the grouped data (set_chart_tree) as rings, and a treemap with grouped data nests its groups; sankey draws the flows (set_chart_links)." },
161
+ type: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_TYPES], description: "Chart type. slope joins each category from the first series (before) to the second (after); likert reads each category as a question and the series as answers from most negative to most positive; parliament draws the first series as seats; sunburst draws the grouped data (set_chart_tree) as rings, and a treemap with grouped data nests its groups; sankey draws the flows (set_chart_links); barrace reads categories as time points and series as names, and animates their ranking." },
161
162
  title: { type: "string", description: 'Title ("" for none).' },
162
163
  subtitle: { type: "string", description: 'Subtitle ("" for none).' },
163
164
  xAxis: AXIS("Category axis (or numeric x axis of scatter / bubble charts)."),
@@ -166,15 +167,15 @@ var CHART_UPDATE_PROPERTIES = {
166
167
  legend: {
167
168
  type: "object",
168
169
  description: "Legend.",
169
- properties: { show: { type: "boolean", description: "Show the legend." }, position: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_LEGEND_POSITIONS], description: "Where the legend goes." } },
170
+ properties: { show: { type: "boolean", description: "Show the legend." }, position: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_LEGEND_POSITIONS], description: "Where the legend goes." } },
170
171
  additionalProperties: false
171
172
  },
172
- stacking: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_STACKINGS], description: "none, stacked, or percent (each category scaled to 100%)." },
173
- orientation: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_ORIENTATIONS], description: "horizontal draws bars sideways." },
174
- curve: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_CURVES], description: "Line shape: linear, smooth or step." },
173
+ stacking: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_STACKINGS], description: "none, stacked, or percent (each category scaled to 100%)." },
174
+ orientation: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_ORIENTATIONS], description: "horizontal draws bars sideways." },
175
+ curve: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_CURVES], description: "Line shape: linear, smooth or step." },
175
176
  points: { type: "boolean", description: "Dots on line and area series." },
176
177
  dataLabels: { type: "boolean", description: "Value labels on bars, points and slices." },
177
- labelPosition: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_LABEL_POSITIONS], description: "Bar label position; auto drops labels that do not fit." },
178
+ labelPosition: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_LABEL_POSITIONS], description: "Bar label position; auto drops labels that do not fit." },
178
179
  palette: { type: "array", items: { type: "string" }, minItems: 1, description: "Series colours in order (CSS colours)." },
179
180
  innerRadius: { type: "number", minimum: 0, maximum: 0.9, description: "Donut hole as a fraction of the radius." },
180
181
  gapWidth: { type: "number", minimum: 0, maximum: 0.9, description: "Space between bar groups as a fraction of the category (default 0.28)." },
@@ -182,19 +183,20 @@ var CHART_UPDATE_PROPERTIES = {
182
183
  bins: { type: ["integer", "null"], minimum: 1, maximum: 500, description: "Histogram bin count, or null for \u221An." },
183
184
  showTotal: { type: "boolean", description: "Waterfall: append a total bar." },
184
185
  radarTicks: { type: ["integer", "null"], minimum: 1, maximum: 50, description: "Radar: number of evenly spaced rings from the value axis min to max, or null for round-number rings (default null)." },
185
- radarGraticule: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_RADAR_GRATICULES], description: "Radar: draw rings as polygons through the spokes or as circles (default polygon)." },
186
+ radarGraticule: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_RADAR_GRATICULES], description: "Radar: draw rings as polygons through the spokes or as circles (default polygon)." },
186
187
  note: { type: "string", description: 'A source or footnote written under the chart ("" for none).' },
187
188
  highlight: { type: "array", items: { type: "string" }, description: "Category labels and series names (or ids) to draw normally while the rest are muted; [] shows everything. highlight_chart checks the names." },
188
189
  referenceLines: { type: "array", items: { type: "object", properties: REFERENCE_LINE_PROPS, required: ["value"], additionalProperties: false }, description: "Replaces every reference line (targets, floors, averages across the plot). add_chart_reference_line adds one." },
189
190
  referenceBands: { type: "array", items: { type: "object", properties: REFERENCE_BAND_PROPS, required: ["from", "to"], additionalProperties: false }, description: "Replaces every reference band (target ranges across the plot). add_chart_reference_band adds one." },
190
191
  varyColors: { type: "boolean", description: "A one-series bar, line, area or scatter chart colours each category from the palette, and its legend lists the categories (default false)." },
191
- likertNeutral: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_LIKERT_NEUTRALS], description: "Likert with an odd number of answers: split (default) puts the middle answer across the centre line; separate draws it in its own column on the right." },
192
- likertSort: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_LIKERT_SORTS], description: "Likert: order the questions by agreement (positive), by disagreement (negative) or as given (none, default)." },
192
+ likertNeutral: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_LIKERT_NEUTRALS], description: "Likert with an odd number of answers: split (default) puts the middle answer across the centre line; separate draws it in its own column on the right." },
193
+ likertSort: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_LIKERT_SORTS], description: "Likert: order the questions by agreement (positive), by disagreement (negative) or as given (none, default)." },
193
194
  parliamentArc: { type: "number", minimum: 90, maximum: 360, description: "Parliament: sweep of the hemicycle in degrees (default 180)." },
194
195
  parliamentMajority: { type: ["integer", "null"], minimum: 1, description: "Parliament: seats needed for a majority, drawn as a dashed line (null: half of the seats plus one)." },
195
196
  parliamentLabel: { type: "string", description: 'Parliament: caption under the seat total ("" writes "seats").' },
196
197
  sunburstLabel: { type: "string", description: 'Sunburst: caption under the total in the centre ("" for none).' },
197
- sankeyLinkColor: { type: "string", enum: [..._chunkUVXTOZ2Bcjs.CHART_SANKEY_LINK_COLORS], description: "Sankey: colour each flow by its source node (default), its target node, or grey." },
198
+ sankeyLinkColor: { type: "string", enum: [..._chunkBPX4Z3N3cjs.CHART_SANKEY_LINK_COLORS], description: "Sankey: colour each flow by its source node (default), its target node, or grey." },
199
+ raceTopN: { type: "integer", minimum: 1, maximum: 30, description: "Bar race: how many bars each moment shows (default 10)." },
198
200
  sankeyNodes: { type: "array", items: { type: "string" }, description: "Sankey: node names in the order to stack them within their columns (reorder to untangle crossing flows); nodes left out follow in the order the flows name them." }
199
201
  };
200
202
 
@@ -216,4 +218,5 @@ var CHART_UPDATE_PROPERTIES = {
216
218
 
217
219
 
218
220
 
219
- exports.VALUE = VALUE; exports.SERIES_REF = SERIES_REF; exports.CATEGORY_REF = CATEGORY_REF; exports.WIDTH = WIDTH; exports.HEIGHT = HEIGHT; exports.TRENDLINE_PROPS = TRENDLINE_PROPS; exports.REFERENCE_LINE_PROPS = REFERENCE_LINE_PROPS; exports.REFERENCE_BAND_PROPS = REFERENCE_BAND_PROPS; exports.REFERENCE_LINE_PATCH = REFERENCE_LINE_PATCH; exports.REFERENCE_BAND_PATCH = REFERENCE_BAND_PATCH; exports.REFERENCE_INDEX = REFERENCE_INDEX; exports.TREE_DEFS = TREE_DEFS; exports.TREE_PATH = TREE_PATH; exports.LINK_PROPS = LINK_PROPS; exports.LINK_INDEX = LINK_INDEX; exports.SERIES_PROPS = SERIES_PROPS; exports.CHART_UPDATE_PROPERTIES = CHART_UPDATE_PROPERTIES;
221
+
222
+ exports.VALUE = VALUE; exports.SERIES_REF = SERIES_REF; exports.CATEGORY_REF = CATEGORY_REF; exports.WIDTH = WIDTH; exports.HEIGHT = HEIGHT; exports.TRENDLINE_PROPS = TRENDLINE_PROPS; exports.REFERENCE_LINE_PROPS = REFERENCE_LINE_PROPS; exports.REFERENCE_BAND_PROPS = REFERENCE_BAND_PROPS; exports.REFERENCE_LINE_PATCH = REFERENCE_LINE_PATCH; exports.REFERENCE_BAND_PATCH = REFERENCE_BAND_PATCH; exports.REFERENCE_INDEX = REFERENCE_INDEX; exports.TREE_DEFS = TREE_DEFS; exports.TREE_PATH = TREE_PATH; exports.LINK_PROPS = LINK_PROPS; exports.RACE_TIME = RACE_TIME; exports.LINK_INDEX = LINK_INDEX; exports.SERIES_PROPS = SERIES_PROPS; exports.CHART_UPDATE_PROPERTIES = CHART_UPDATE_PROPERTIES;
@@ -11,10 +11,10 @@ import {
11
11
  CHART_OOXML_NS,
12
12
  CHART_OOXML_RELATIONSHIP,
13
13
  chartToOoxml
14
- } from "./chunk-CRFSQWKQ.js";
14
+ } from "./chunk-XNU45TYA.js";
15
15
  import {
16
16
  normalizeChartSpec
17
- } from "./chunk-2ZRN43IN.js";
17
+ } from "./chunk-FR432ROA.js";
18
18
 
19
19
  // src/export/images.ts
20
20
  var DOCX_IMAGE_TYPES = {
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkUVXTOZ2Bcjs = require('./chunk-UVXTOZ2B.cjs');
11
+ var _chunkBPX4Z3N3cjs = require('./chunk-BPX4Z3N3.cjs');
12
12
 
13
13
  // src/chart/ooxml.ts
14
14
  var CHART_OOXML_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
@@ -111,11 +111,11 @@ function chartFromOoxml(xml, options = {}) {
111
111
  try {
112
112
  doc = new (parser(options))().parseFromString(xml, "application/xml");
113
113
  } catch (error) {
114
- return { spec: _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
114
+ return { spec: _chunkBPX4Z3N3cjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
115
115
  }
116
116
  const root = doc.documentElement;
117
117
  if (!root || root.localName !== "chartSpace" || doc.getElementsByTagName("parsererror").length) {
118
- return { spec: _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: "This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element." }], unsupported, lossless: false };
118
+ return { spec: _chunkBPX4Z3N3cjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: "This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element." }], unsupported, lossless: false };
119
119
  }
120
120
  if (_optionalChain([root, 'access', _14 => _14.namespaceURI, 'optionalAccess', _15 => _15.includes, 'call', _16 => _16("chartex")]) || kid(root, "chartData")) return readChartex(root, issues, unsupported);
121
121
  const chart = kid(root, "chart");
@@ -280,7 +280,7 @@ function chartFromOoxml(xml, options = {}) {
280
280
  }
281
281
  if (!types.length) {
282
282
  issues.push({ path: "plotArea", message: unsupported.length ? `The chart type is not supported: ${unsupported.join(", ")}.` : "The chart has no plot groups." });
283
- return { spec: _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
283
+ return { spec: _chunkBPX4Z3N3cjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
284
284
  }
285
285
  const first = types[0];
286
286
  const combo = types.some((t) => t !== first);
@@ -290,14 +290,14 @@ function chartFromOoxml(xml, options = {}) {
290
290
  if (!combo) {
291
291
  for (const s of series) if (s.axis) issues.push({ path: "series", message: `"${s.name}" is on a second value axis.` });
292
292
  }
293
- if (types.some((t) => !_chunkUVXTOZ2Bcjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
293
+ if (types.some((t) => !_chunkBPX4Z3N3cjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
294
294
  input.series = series;
295
295
  input.categories = categories.length ? categories : Array.from({ length: Math.max(0, ...series.map((s) => s.values.length)) }, (_, i) => `${i + 1}`);
296
296
  input.stacking = stacking;
297
297
  input.orientation = orientation;
298
298
  input.dataLabels = dataLabels;
299
299
  input.points = points || first !== "line";
300
- if (bool(val(groups[0], "varyColors")) && !combo && _chunkUVXTOZ2Bcjs.isCartesianChart.call(void 0, first) && series.length === 1) input.varyColors = true;
300
+ if (bool(val(groups[0], "varyColors")) && !combo && _chunkBPX4Z3N3cjs.isCartesianChart.call(void 0, first) && series.length === 1) input.varyColors = true;
301
301
  const readAxis = (a, fallback) => {
302
302
  const axis = { ...fallback, format: {} };
303
303
  if (!a) return axis;
@@ -324,12 +324,12 @@ function chartFromOoxml(xml, options = {}) {
324
324
  };
325
325
  const xy = first === "scatter" || first === "bubble";
326
326
  const catAxis = _nullishCoalesce(_nullishCoalesce(kid(plot, "catAx"), () => ( kid(plot, "dateAx"))), () => ( (xy ? valAxes.find((a) => !vertical(a)) : void 0)));
327
- input.xAxis = readAxis(catAxis, _chunkUVXTOZ2Bcjs.defaultChartAxis.call(void 0, false));
327
+ input.xAxis = readAxis(catAxis, _chunkBPX4Z3N3cjs.defaultChartAxis.call(void 0, false));
328
328
  if (kid(plot, "dateAx")) input.xAxis.kind = "date";
329
- input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunkUVXTOZ2Bcjs.defaultChartAxis.call(void 0, true));
329
+ input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunkBPX4Z3N3cjs.defaultChartAxis.call(void 0, true));
330
330
  const secondaryAxis = valAxes.find((a) => a !== primaryAxis && (xy ? vertical(a) && a !== primaryAxis : true) && a !== catAxis);
331
- if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunkUVXTOZ2Bcjs.defaultChartAxis.call(void 0, false));
332
- const { spec, issues: specIssues } = _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, input);
331
+ if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunkBPX4Z3N3cjs.defaultChartAxis.call(void 0, false));
332
+ const { spec, issues: specIssues } = _chunkBPX4Z3N3cjs.normalizeChartSpec.call(void 0, input);
333
333
  issues.push(...specIssues);
334
334
  const uniq = [...new Set(unsupported)];
335
335
  return { spec, issues, unsupported: uniq, lossless: uniq.length === 0 && specIssues.length === 0 };
@@ -382,7 +382,7 @@ function readChartex(root, issues, unsupported) {
382
382
  const type = layouts[layout];
383
383
  if (!type) {
384
384
  issues.push({ path: "plotArea", message: `The chart layout "${layout || "unknown"}" is not supported.` });
385
- return { spec: _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
385
+ return { spec: _chunkBPX4Z3N3cjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
386
386
  }
387
387
  if (layout === "paretoLine") unsupported.push("pareto line");
388
388
  const series = [];
@@ -409,18 +409,18 @@ function readChartex(root, issues, unsupported) {
409
409
  const first = data.get(_nullishCoalesce(_optionalChain([kid, 'call', _35 => _35(seriesEls[0], "dataId"), 'optionalAccess', _36 => _36.getAttribute, 'call', _37 => _37("val")]), () => ( "0")));
410
410
  if ((type === "treemap" || type === "sunburst") && _optionalChain([first, 'optionalAccess', _38 => _38.paths])) {
411
411
  const treeIssues = [];
412
- input.tree = _chunkUVXTOZ2Bcjs.chartTreeFromRows.call(void 0, first.paths.map((path2, i) => ({ path: path2, value: _nullishCoalesce(first.values[i], () => ( 0)) })), treeIssues);
412
+ input.tree = _chunkBPX4Z3N3cjs.chartTreeFromRows.call(void 0, first.paths.map((path2, i) => ({ path: path2, value: _nullishCoalesce(first.values[i], () => ( 0)) })), treeIssues);
413
413
  for (const t of treeIssues) issues.push({ path: "chartData", message: t.message });
414
414
  }
415
- const { spec, issues: specIssues } = _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, input);
415
+ const { spec, issues: specIssues } = _chunkBPX4Z3N3cjs.normalizeChartSpec.call(void 0, input);
416
416
  issues.push(...specIssues);
417
417
  return { spec, issues, unsupported, lossless: unsupported.length === 0 && specIssues.length === 0 };
418
418
  }
419
419
  var esc = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
420
420
  var hex = (color) => {
421
421
  if (!color) return null;
422
- const rgb = _chunkUVXTOZ2Bcjs.parseChartColor.call(void 0, color);
423
- return rgb ? _chunkUVXTOZ2Bcjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
422
+ const rgb = _chunkBPX4Z3N3cjs.parseChartColor.call(void 0, color);
423
+ return rgb ? _chunkBPX4Z3N3cjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
424
424
  };
425
425
  var fillXml = (color, line = false) => {
426
426
  const h = hex(color);
@@ -464,7 +464,7 @@ function errBarsXml(bars, dir) {
464
464
  var MARKER_OUT = { circle: "circle", square: "square", diamond: "diamond", triangle: "triangle", cross: "x", none: "none" };
465
465
  function chartToOoxml(spec) {
466
466
  const issues = [];
467
- const family = _chunkUVXTOZ2Bcjs.chartFamily.call(void 0, spec);
467
+ const family = _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec);
468
468
  let type = spec.type;
469
469
  if (family === "waterfall" || family === "histogram" || family === "box" || family === "funnel") {
470
470
  issues.push(`${spec.type} charts are written as bar charts: DrawingML has no ${spec.type} type (Office 2016 stores it as chartex).`);
@@ -475,6 +475,9 @@ function chartToOoxml(spec) {
475
475
  } else if (family === "sunburst") {
476
476
  issues.push(`Sunburst charts are written as doughnut charts of the ${spec.tree.length ? "top-level group totals" : "values"}: DrawingML has no sunburst type (Office 2016 stores it as chartex).`);
477
477
  type = "donut";
478
+ } else if (family === "barrace") {
479
+ issues.push("Bar chart races are written as clustered bar charts of every name at every time point: DrawingML has no animation.");
480
+ type = "bar";
478
481
  } else if (family === "sankey") {
479
482
  issues.push("Sankey diagrams are written as bar charts of how much passes through each node: DrawingML has no flows.");
480
483
  type = "bar";
@@ -502,7 +505,7 @@ function chartToOoxml(spec) {
502
505
  const ids = { cat: 500000001, val: 500000002, cat2: 500000003, val2: 500000004 };
503
506
  const xy = family === "xy" || type === "scatter" || type === "bubble";
504
507
  const pieLike = type === "pie" || type === "donut";
505
- const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunkUVXTOZ2Bcjs.chartSeriesType.call(void 0, { type }, s);
508
+ const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunkBPX4Z3N3cjs.chartSeriesType.call(void 0, { type }, s);
506
509
  const groups = [];
507
510
  visible.forEach((s) => {
508
511
  const kind = typed(s);
@@ -565,7 +568,7 @@ function chartToOoxml(spec) {
565
568
  return `<c:ser>${parts.join("")}</c:ser>`;
566
569
  };
567
570
  const dLbls = `<c:dLbls><c:showLegendKey val="0"/><c:showVal val="${spec.dataLabels ? 1 : 0}"/><c:showCatName val="0"/><c:showSerName val="0"/><c:showPercent val="0"/><c:showBubbleSize val="0"/></c:dLbls>`;
568
- const vary = _chunkUVXTOZ2Bcjs.chartVariesColors.call(void 0, spec) ? 1 : 0;
571
+ const vary = _chunkBPX4Z3N3cjs.chartVariesColors.call(void 0, spec) ? 1 : 0;
569
572
  const groupXml = groups.map((g) => {
570
573
  const axes2 = g.secondary ? `<c:axId val="${ids.cat2}"/><c:axId val="${ids.val2}"/>` : `<c:axId val="${ids.cat}"/><c:axId val="${ids.val}"/>`;
571
574
  const sers = g.series.map(({ s, index }) => serXml(g.kind, s, index)).join("");