ooxml-core 1.18.0 → 1.19.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 (82) hide show
  1. package/dist/{PptxHandler-X6AO6LKJ.mjs → PptxHandler-5GBBVJCR.mjs} +2 -2
  2. package/dist/{PptxHandler-5X4VOWAO.mjs → PptxHandler-H43MAMTO.mjs} +1 -1
  3. package/dist/{PptxHandler-4AHDZDA5.cjs → PptxHandler-ZHPGBSAF.cjs} +2 -2
  4. package/dist/{PresentationBuilder-UY3S4YE2.mjs → PresentationBuilder-7ZSUKCX5.mjs} +1 -1
  5. package/dist/{PresentationBuilder-LRX55PXA.mjs → PresentationBuilder-IJW42L3R.mjs} +2 -2
  6. package/dist/{PresentationBuilder-MJB4LIFS.cjs → PresentationBuilder-O4H4MMWB.cjs} +4 -4
  7. package/dist/automation/index.cjs +535 -266
  8. package/dist/automation/index.mjs +535 -266
  9. package/dist/chart/axis-range-auto.d.ts +10 -0
  10. package/dist/chart/axis-range-auto.d.ts.map +1 -0
  11. package/dist/chart/axis-range-types.d.ts +27 -0
  12. package/dist/chart/axis-range-types.d.ts.map +1 -0
  13. package/dist/chart/axis-range.d.ts +37 -0
  14. package/dist/chart/axis-range.d.ts.map +1 -0
  15. package/dist/chart/axis-ticks.d.ts +8 -0
  16. package/dist/chart/axis-ticks.d.ts.map +1 -0
  17. package/dist/chart/index.cjs +815 -165
  18. package/dist/chart/index.d.ts +6 -0
  19. package/dist/chart/index.d.ts.map +1 -1
  20. package/dist/chart/index.mjs +795 -166
  21. package/dist/chart/line-dash.d.ts +2 -0
  22. package/dist/chart/line-dash.d.ts.map +1 -0
  23. package/dist/chart/marker-shape.d.ts +70 -0
  24. package/dist/chart/marker-shape.d.ts.map +1 -0
  25. package/dist/chart/render/chart-svg-axes.d.ts +9 -0
  26. package/dist/chart/render/chart-svg-axes.d.ts.map +1 -0
  27. package/dist/chart/render/chart-svg-cartesian.d.ts.map +1 -1
  28. package/dist/chart/render/chart-svg-markers.d.ts +6 -0
  29. package/dist/chart/render/chart-svg-markers.d.ts.map +1 -0
  30. package/dist/chart/render/chart-svg-radial.d.ts.map +1 -1
  31. package/dist/chart/render/chart-svg-xy.d.ts.map +1 -1
  32. package/dist/chart/render/chart-view-axes.d.ts +30 -0
  33. package/dist/chart/render/chart-view-axes.d.ts.map +1 -0
  34. package/dist/chart/render/chart-view-markers.d.ts +27 -0
  35. package/dist/chart/render/chart-view-markers.d.ts.map +1 -0
  36. package/dist/chart/render/chart-view-series.d.ts.map +1 -1
  37. package/dist/chart/render/chart-view.d.ts +4 -1
  38. package/dist/chart/render/chart-view.d.ts.map +1 -1
  39. package/dist/chart/render/index.d.ts +2 -0
  40. package/dist/chart/render/index.d.ts.map +1 -1
  41. package/dist/chart/render/summary-from-space.d.ts.map +1 -1
  42. package/dist/chart/render/summary.d.ts +6 -1
  43. package/dist/chart/render/summary.d.ts.map +1 -1
  44. package/dist/{chunk-7NWQUCGX.mjs → chunk-3XFPCZKB.mjs} +1 -1
  45. package/dist/{chunk-Z5Y53IZD.mjs → chunk-75GLSRZE.mjs} +4 -4
  46. package/dist/{chunk-LT7RCEHY.mjs → chunk-BIVNVDAH.mjs} +1 -1
  47. package/dist/{chunk-I5ZE3VLI.mjs → chunk-QBJRB6WW.mjs} +1 -1
  48. package/dist/{chunk-U7IDT6VT.mjs → chunk-RUZEMWDI.mjs} +1 -1
  49. package/dist/docx/index.cjs +695 -168
  50. package/dist/docx/index.mjs +695 -168
  51. package/dist/docx/layout/index.cjs +697 -170
  52. package/dist/docx/layout/index.mjs +697 -170
  53. package/dist/docx/ui/index.cjs +704 -177
  54. package/dist/docx/ui/index.mjs +704 -177
  55. package/dist/index.cjs +912 -262
  56. package/dist/index.mjs +912 -262
  57. package/dist/pptx/automation/index.cjs +54 -0
  58. package/dist/pptx/automation/index.mjs +5 -5
  59. package/dist/pptx/cli/index.cjs +54 -0
  60. package/dist/pptx/cli/index.mjs +4 -4
  61. package/dist/pptx/converter/index.mjs +2 -2
  62. package/dist/pptx/editor/render/slide-operations.cjs +1 -1
  63. package/dist/pptx/editor/render/slide-operations.mjs +1 -1
  64. package/dist/pptx/index.cjs +54 -0
  65. package/dist/pptx/index.mjs +5 -5
  66. package/dist/teams/index.cjs +71 -5
  67. package/dist/teams/index.mjs +71 -5
  68. package/dist/visio/index.cjs +483 -214
  69. package/dist/visio/index.mjs +483 -214
  70. package/dist/visio/ui/index.cjs +504 -235
  71. package/dist/visio/ui/index.mjs +504 -235
  72. package/dist/xlsx/edit/chart-colors.d.ts.map +1 -1
  73. package/dist/xlsx/index.cjs +818 -281
  74. package/dist/xlsx/index.mjs +818 -281
  75. package/dist/xlsx/load/index.cjs +58 -5
  76. package/dist/xlsx/load/index.mjs +58 -5
  77. package/dist/xlsx/read/chart.d.ts.map +1 -1
  78. package/dist/xlsx/ui/index.cjs +835 -298
  79. package/dist/xlsx/ui/index.mjs +835 -298
  80. package/package.json +1 -1
  81. /package/dist/{chunk-C363NN2C.mjs → chunk-H6TNNXJK.mjs} +0 -0
  82. /package/dist/{chunk-R4BCOQHB.cjs → chunk-MHMVD23Y.cjs} +0 -0
@@ -279,8 +279,8 @@ function createWorksheet(name, sheetId) {
279
279
  preserved: /* @__PURE__ */ new Map()
280
280
  };
281
281
  }
282
- function createWorkbook(options = {}) {
283
- const names = options.sheets?.length ? options.sheets : ["Sheet1"];
282
+ function createWorkbook(options2 = {}) {
283
+ const names = options2.sheets?.length ? options2.sheets : ["Sheet1"];
284
284
  return {
285
285
  sheets: names.map((name, index3) => createWorksheet(name, index3 + 1)),
286
286
  styles: [defaultCellStyle()],
@@ -1681,15 +1681,15 @@ function renderAbs(v, section, generalWidth) {
1681
1681
  }
1682
1682
  return { text: text4, zero: general === "0" };
1683
1683
  }
1684
- function hashFill(options) {
1685
- const width = options.width ?? 0;
1686
- const one2 = options.measure ? options.measure("#") : 1;
1684
+ function hashFill(options2) {
1685
+ const width = options2.width ?? 0;
1686
+ const one2 = options2.measure ? options2.measure("#") : 1;
1687
1687
  return "#".repeat(Math.max(1, Math.floor(one2 > 0 ? width / one2 : width)));
1688
1688
  }
1689
- function fitNumber(value2, format, options) {
1690
- const date1904 = options.date1904 ?? false;
1691
- const width = options.width ?? 0;
1692
- const fits = (text4) => (options.measure ? options.measure(text4) : text4.length) <= width;
1689
+ function fitNumber(value2, format, options2) {
1690
+ const date1904 = options2.date1904 ?? false;
1691
+ const width = options2.width ?? 0;
1692
+ const fits = (text4) => (options2.measure ? options2.measure(text4) : text4.length) <= width;
1693
1693
  const first2 = formatNumber(value2, format, date1904);
1694
1694
  if (fits(first2.text) || first2.text === OVERFLOW_TEXT) return first2;
1695
1695
  const choice = chooseSection(compileFormat(format), value2);
@@ -1700,7 +1700,7 @@ function fitNumber(value2, format, options) {
1700
1700
  if (fits(next.text)) return next;
1701
1701
  }
1702
1702
  }
1703
- const fill = hashFill(options);
1703
+ const fill = hashFill(options2);
1704
1704
  return first2.color ? { text: fill, color: first2.color } : { text: fill };
1705
1705
  }
1706
1706
  function formatNumber(value2, format, date1904, generalWidth) {
@@ -1722,13 +1722,13 @@ function formatNumber(value2, format, date1904, generalWidth) {
1722
1722
  const minus = value2 < 0 && !abs2 && !zero;
1723
1723
  return result(minus ? `-${text4}` : text4, section);
1724
1724
  }
1725
- function formatValue(value2, format, options = {}) {
1725
+ function formatValue(value2, format, options2 = {}) {
1726
1726
  if (value2 === null) return { text: "" };
1727
1727
  if (typeof value2 === "boolean") return { text: value2 ? "TRUE" : "FALSE" };
1728
1728
  if (typeof value2 === "string") return formatText(value2, compileFormat(format).text);
1729
1729
  if (isCellError(value2)) return { text: value2.error };
1730
- if (options.width !== void 0) return fitNumber(value2, format, options);
1731
- return formatNumber(value2, format, options.date1904 ?? false);
1730
+ if (options2.width !== void 0) return fitNumber(value2, format, options2);
1731
+ return formatNumber(value2, format, options2.date1904 ?? false);
1732
1732
  }
1733
1733
  function isDateFormat(format) {
1734
1734
  return compileFormat(format).isDate;
@@ -1939,7 +1939,7 @@ function parseFractionInput(text4) {
1939
1939
  numFmt: den < 10 ? "# ?/?" : "# ??/??"
1940
1940
  };
1941
1941
  }
1942
- function parseCellInput(text4, options = {}) {
1942
+ function parseCellInput(text4, options2 = {}) {
1943
1943
  if (text4 === "") return { value: null };
1944
1944
  if (text4.startsWith("=") && text4.length > 1) return { value: null, formula: text4.slice(1) };
1945
1945
  if (text4.startsWith("'")) return { value: text4.slice(1) };
@@ -1950,7 +1950,7 @@ function parseCellInput(text4, options = {}) {
1950
1950
  if (upper2 === "TRUE" || upper2 === "FALSE") return { value: upper2 === "TRUE" };
1951
1951
  if (isErrorCode(upper2)) return { value: cellError(upper2) };
1952
1952
  }
1953
- const parsed = parseNumberInput(trimmed2) ?? parseFractionInput(trimmed2) ?? parseDateTimeInput(trimmed2, options.date1904 ?? false);
1953
+ const parsed = parseNumberInput(trimmed2) ?? parseFractionInput(trimmed2) ?? parseDateTimeInput(trimmed2, options2.date1904 ?? false);
1954
1954
  if (!parsed) return { value: text4 };
1955
1955
  return parsed.numFmt ? { value: parsed.value, numFmt: parsed.numFmt } : { value: parsed.value };
1956
1956
  }
@@ -3501,7 +3501,7 @@ var int = (value2) => Math.trunc(num(value2));
3501
3501
  var optNum = (args, i2, fallback) => i2 < args.length ? num(args[i2]) : fallback;
3502
3502
  var optBool = (args, i2, fallback) => i2 < args.length ? bool(args[i2]) : fallback;
3503
3503
  var omitted = (args, i2) => i2 >= args.length || args[i2] === null;
3504
- function collectNumbers(ctx, args, options = {}) {
3504
+ function collectNumbers(ctx, args, options2 = {}) {
3505
3505
  const out = [];
3506
3506
  for (const arg of args) {
3507
3507
  ctx.forEach(arg, (value2, kind) => {
@@ -3510,7 +3510,7 @@ function collectNumbers(ctx, args, options = {}) {
3510
3510
  return;
3511
3511
  }
3512
3512
  if (isError(value2)) {
3513
- if (options.ignoreErrors) return;
3513
+ if (options2.ignoreErrors) return;
3514
3514
  throw new ErrorSignal(value2);
3515
3515
  }
3516
3516
  if (kind === "direct") {
@@ -3518,7 +3518,7 @@ function collectNumbers(ctx, args, options = {}) {
3518
3518
  else out.push(toNumber(value2));
3519
3519
  return;
3520
3520
  }
3521
- if (options.includeAll) {
3521
+ if (options2.includeAll) {
3522
3522
  if (typeof value2 === "boolean") out.push(value2 ? 1 : 0);
3523
3523
  else if (typeof value2 === "string") out.push(0);
3524
3524
  }
@@ -8483,11 +8483,11 @@ var SUM_FUNCTIONS = [
8483
8483
  255,
8484
8484
  (args, ctx) => {
8485
8485
  const code = int(args[0]);
8486
- const options = int(args[1]);
8487
- if (code < 1 || code > 19 || options < 0 || options > 7) fail(ERR.VALUE);
8488
- const skipNested = options <= 3;
8489
- const skipHidden = options === 1 || options === 3 || options === 5 || options === 7;
8490
- const skipErrors = options === 2 || options === 3 || options === 6 || options === 7;
8486
+ const options2 = int(args[1]);
8487
+ if (code < 1 || code > 19 || options2 < 0 || options2 > 7) fail(ERR.VALUE);
8488
+ const skipNested = options2 <= 3;
8489
+ const skipHidden = options2 === 1 || options2 === 3 || options2 === 5 || options2 === 7;
8490
+ const skipErrors = options2 === 2 || options2 === 3 || options2 === 6 || options2 === 7;
8491
8491
  if (code >= 14) {
8492
8492
  if (args.length !== 4) fail(ERR.VALUE);
8493
8493
  const values2 = subtotalValues(ctx, [args[2] ?? null], skipHidden, skipErrors, skipNested);
@@ -11774,11 +11774,11 @@ function checkXmlLimits(xml, label2, limits = {}) {
11774
11774
  throw new Error(`${label2} XML exceeds the nesting depth limit of ${maxDepth}`);
11775
11775
  }
11776
11776
  }
11777
- function parseXml(xml, options = {}) {
11778
- const label2 = options.label ?? "OOXML";
11777
+ function parseXml(xml, options2 = {}) {
11778
+ const label2 = options2.label ?? "OOXML";
11779
11779
  if (/<!DOCTYPE|<!ENTITY/i.test(xml))
11780
11780
  throw new Error(`${label2} XML with DTD or entity declarations is not supported`);
11781
- checkXmlLimits(xml, label2, options.limits);
11781
+ checkXmlLimits(xml, label2, options2.limits);
11782
11782
  let parseError = "";
11783
11783
  let parsed;
11784
11784
  try {
@@ -11992,7 +11992,7 @@ var pivotColumnFields = (pivot) => [
11992
11992
  // i18n/locale.ts
11993
11993
  var SUPPORTED_OFFICE_LOCALES = ["en", "fr", "de", "es", "zh-CN"];
11994
11994
  var DEFAULT_REJECTED_SUBTAGS = ["hant", "tw", "hk", "mo"];
11995
- function normalizeLocale(input, supported, fallback, options = {}) {
11995
+ function normalizeLocale(input, supported, fallback, options2 = {}) {
11996
11996
  const parts = (input ?? "").trim().toLowerCase().split(/[-_]/).filter(Boolean);
11997
11997
  const language = parts[0];
11998
11998
  if (!language) return fallback;
@@ -12001,7 +12001,7 @@ function normalizeLocale(input, supported, fallback, options = {}) {
12001
12001
  if (exact) return exact;
12002
12002
  const base = find3(language);
12003
12003
  if (base) return base;
12004
- const rejected = options.rejectedSubtags ?? DEFAULT_REJECTED_SUBTAGS;
12004
+ const rejected = options2.rejectedSubtags ?? DEFAULT_REJECTED_SUBTAGS;
12005
12005
  if (parts.slice(1).some((part) => rejected.includes(part))) return fallback;
12006
12006
  return supported.find((item) => item.toLowerCase().split("-")[0] === language && item.includes("-")) ?? fallback;
12007
12007
  }
@@ -12201,8 +12201,8 @@ function trimmedCaptions(caps) {
12201
12201
  }
12202
12202
  return Object.keys(out).length ? out : void 0;
12203
12203
  }
12204
- function authoredCaptions(options) {
12205
- const own = options.captions ?? localizedPivotCaptions(options.locale);
12204
+ function authoredCaptions(options2) {
12205
+ const own = options2.captions ?? localizedPivotCaptions(options2.locale);
12206
12206
  return own && Object.keys(own).length ? structuredClone(own) : void 0;
12207
12207
  }
12208
12208
 
@@ -14724,9 +14724,9 @@ var Deferred = class {
14724
14724
  };
14725
14725
  var MAX_NESTED_COMPUTE = 40;
14726
14726
  var EngineHost = class {
14727
- constructor(workbook, options) {
14727
+ constructor(workbook, options2) {
14728
14728
  this.workbook = workbook;
14729
- this.options = options;
14729
+ this.options = options2;
14730
14730
  }
14731
14731
  workbook;
14732
14732
  options;
@@ -15823,8 +15823,8 @@ var Engine = class extends EngineStructure {
15823
15823
  return [...this.cycles].map(({ sheet, row: row2, col }) => ({ sheet, row: row2, col }));
15824
15824
  }
15825
15825
  };
15826
- function createCalcEngine(workbook, options = {}) {
15827
- return new Engine(workbook, options);
15826
+ function createCalcEngine(workbook, options2 = {}) {
15827
+ return new Engine(workbook, options2);
15828
15828
  }
15829
15829
 
15830
15830
  // xlsx/formula/ref-text.ts
@@ -19359,8 +19359,8 @@ function rgbToHsl(r, g2, b) {
19359
19359
  }
19360
19360
  return { h: h2, s: clampUnitInterval(s), l: clampUnitInterval(l) };
19361
19361
  }
19362
- function hslToRgb(h2, s, l, roundChannel = Math.round, options) {
19363
- const sC = options?.clampSaturation === false ? s : clampUnitInterval(s);
19362
+ function hslToRgb(h2, s, l, roundChannel = Math.round, options2) {
19363
+ const sC = options2?.clampSaturation === false ? s : clampUnitInterval(s);
19364
19364
  const lC = clampUnitInterval(l);
19365
19365
  const hN = (h2 % 360 + 360) % 360;
19366
19366
  const c2 = (1 - Math.abs(2 * lC - 1)) * sC;
@@ -19858,13 +19858,13 @@ var APPLIED = /* @__PURE__ */ new Set([
19858
19858
  "lumMod",
19859
19859
  "lumOff"
19860
19860
  ]);
19861
- function resolveDrawingColor(color, theme2, options) {
19861
+ function resolveDrawingColor(color, theme2, options2) {
19862
19862
  const base = baseHex(color, theme2);
19863
19863
  const rgb2 = base ? hexToRgbChannels(base) : null;
19864
19864
  if (!rgb2) return void 0;
19865
- if (options?.transformOrder === "document") {
19865
+ if (options2?.transformOrder === "document") {
19866
19866
  const value2 = orderedColorTransforms(rgb2, color.transforms);
19867
- const round4 = options.hslRounding === "halfDown" ? (channel) => Math.ceil(channel - 0.5) : Math.round;
19867
+ const round4 = options2.hslRounding === "halfDown" ? (channel) => Math.ceil(channel - 0.5) : Math.round;
19868
19868
  return {
19869
19869
  hex: `#${toHex(round4(value2.r))}${toHex(round4(value2.g))}${toHex(round4(value2.b))}`,
19870
19870
  alpha: value2.alpha,
@@ -19915,7 +19915,7 @@ function resolveDrawingColor(color, theme2, options) {
19915
19915
  if (lumMod !== void 0) hsl.l = clampUnitInterval(hsl.l * lumMod);
19916
19916
  const lumOff = parseDrawingFraction(find3("lumOff"));
19917
19917
  if (lumOff !== void 0) hsl.l = clampUnitInterval(hsl.l + lumOff);
19918
- const round4 = options?.hslRounding === "halfDown" ? (value2) => Math.ceil(value2 - 0.5) : Math.round;
19918
+ const round4 = options2?.hslRounding === "halfDown" ? (value2) => Math.ceil(value2 - 0.5) : Math.round;
19919
19919
  ({ r, g: g2, b } = hslToRgb(hsl.h, hsl.s, hsl.l, round4));
19920
19920
  }
19921
19921
  let alpha = parseDrawingPercent(find3("alpha")) ?? 1;
@@ -21661,7 +21661,7 @@ function resolveInnerRect(fillToRect, focalPoint) {
21661
21661
  function lerpEdge(inner2, outer, t) {
21662
21662
  return inner2 + (outer - inner2) * t;
21663
21663
  }
21664
- function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options) {
21664
+ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options2) {
21665
21665
  if (stops.length === 0) {
21666
21666
  return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"/>';
21667
21667
  }
@@ -21670,7 +21670,7 @@ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options) {
21670
21670
  const rects = [];
21671
21671
  const alphaRects = [];
21672
21672
  const masked = sorted2.some((stop) => (stop.opacity ?? 1) < 1);
21673
- const bands = options?.bands;
21673
+ const bands = options2?.bands;
21674
21674
  if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
21675
21675
  for (let i2 = bands; i2 >= 0; i2 -= 1) {
21676
21676
  const t = i2 / bands;
@@ -23409,6 +23409,191 @@ function parseChartSpace(source2) {
23409
23409
  return { chartSpace, issues: context.issues };
23410
23410
  }
23411
23411
 
23412
+ // chart/marker-shape.ts
23413
+ var CHART_PX_PER_PT = 4 / 3;
23414
+ var DEFAULT_MARKER_OUTLINE_PT = 0.75;
23415
+ var AUTOMATIC_MARKER_CYCLE = [
23416
+ "diamond",
23417
+ "square",
23418
+ "triangle",
23419
+ "x",
23420
+ "star",
23421
+ "circle",
23422
+ "plus",
23423
+ "dot",
23424
+ "dash"
23425
+ ];
23426
+ function automaticMarkerSymbol(seriesIdx) {
23427
+ const length = AUTOMATIC_MARKER_CYCLE.length;
23428
+ const normalized = (Math.trunc(seriesIdx) % length + length) % length;
23429
+ return AUTOMATIC_MARKER_CYCLE[Number.isFinite(normalized) ? normalized : 0];
23430
+ }
23431
+ function markerRadius(size, defaultRadius) {
23432
+ if (size === void 0 || !Number.isFinite(size) || size <= 0) {
23433
+ return defaultRadius;
23434
+ }
23435
+ return size / 2;
23436
+ }
23437
+ function polygonPoints(vertices) {
23438
+ return vertices.map(([x, y]) => `${x.toFixed(2)},${y.toFixed(2)}`).join(" ");
23439
+ }
23440
+ function starVertices(cx2, cy, r) {
23441
+ const inner2 = r * 0.5;
23442
+ const out = [];
23443
+ for (let i2 = 0; i2 < 10; i2++) {
23444
+ const radius = i2 % 2 === 0 ? r : inner2;
23445
+ const angle = -Math.PI / 2 + Math.PI * i2 / 5;
23446
+ out.push([cx2 + radius * Math.cos(angle), cy + radius * Math.sin(angle)]);
23447
+ }
23448
+ return out;
23449
+ }
23450
+ function rectPolygon(x, y, w, h2) {
23451
+ return polygonPoints([
23452
+ [x, y],
23453
+ [x + w, y],
23454
+ [x + w, y + h2],
23455
+ [x, y + h2]
23456
+ ]);
23457
+ }
23458
+ function buildMarkerPrimitive(input) {
23459
+ const { symbol, cx: cx2, cy, fill } = input;
23460
+ const part = input.part === void 0 ? {} : { part: input.part };
23461
+ if (symbol === "none") {
23462
+ return null;
23463
+ }
23464
+ const r = markerRadius(input.size, input.defaultRadius);
23465
+ const outline = input.stroke ? {
23466
+ stroke: input.stroke,
23467
+ strokeWidth: input.strokeWidth ?? DEFAULT_MARKER_OUTLINE_PT * CHART_PX_PER_PT
23468
+ } : void 0;
23469
+ const polygonStroke = outline ?? { stroke: fill, strokeWidth: 0 };
23470
+ const lineStroke = input.stroke ?? fill;
23471
+ switch (symbol) {
23472
+ case "square":
23473
+ case "dash": {
23474
+ const h2 = symbol === "dash" ? r * 0.64 : r * 2;
23475
+ const y = cy - h2 / 2;
23476
+ if (outline) {
23477
+ return {
23478
+ kind: "polygon",
23479
+ points: rectPolygon(cx2 - r, y, r * 2, h2),
23480
+ fill,
23481
+ ...outline,
23482
+ ...part
23483
+ };
23484
+ }
23485
+ return { kind: "rect", x: cx2 - r, y, w: r * 2, h: h2, fill, ...part };
23486
+ }
23487
+ case "diamond":
23488
+ return {
23489
+ kind: "polygon",
23490
+ points: polygonPoints([
23491
+ [cx2, cy - r],
23492
+ [cx2 + r, cy],
23493
+ [cx2, cy + r],
23494
+ [cx2 - r, cy]
23495
+ ]),
23496
+ fill,
23497
+ ...polygonStroke,
23498
+ ...part
23499
+ };
23500
+ case "triangle":
23501
+ return {
23502
+ kind: "polygon",
23503
+ points: polygonPoints([
23504
+ [cx2, cy - r],
23505
+ [cx2 + r * 0.9, cy + r * 0.75],
23506
+ [cx2 - r * 0.9, cy + r * 0.75]
23507
+ ]),
23508
+ fill,
23509
+ ...polygonStroke,
23510
+ ...part
23511
+ };
23512
+ case "star":
23513
+ return {
23514
+ kind: "polygon",
23515
+ points: polygonPoints(starVertices(cx2, cy, r)),
23516
+ fill,
23517
+ ...polygonStroke,
23518
+ ...part
23519
+ };
23520
+ case "plus":
23521
+ return {
23522
+ kind: "path",
23523
+ d: `M${(cx2 - r).toFixed(2)},${cy.toFixed(2)} L${(cx2 + r).toFixed(2)},${cy.toFixed(2)} M${cx2.toFixed(2)},${(cy - r).toFixed(2)} L${cx2.toFixed(2)},${(cy + r).toFixed(2)}`,
23524
+ fill: "none",
23525
+ stroke: lineStroke,
23526
+ strokeWidth: Math.max(1, r * 0.4),
23527
+ ...part
23528
+ };
23529
+ case "x":
23530
+ return {
23531
+ kind: "path",
23532
+ d: `M${(cx2 - r).toFixed(2)},${(cy - r).toFixed(2)} L${(cx2 + r).toFixed(2)},${(cy + r).toFixed(2)} M${(cx2 + r).toFixed(2)},${(cy - r).toFixed(2)} L${(cx2 - r).toFixed(2)},${(cy + r).toFixed(2)}`,
23533
+ fill: "none",
23534
+ stroke: lineStroke,
23535
+ strokeWidth: Math.max(1, r * 0.4),
23536
+ ...part
23537
+ };
23538
+ case "dot":
23539
+ return { kind: "circle", cx: cx2, cy, r: Math.max(r * 0.6, 1), fill, ...part, ...outline };
23540
+ default:
23541
+ return { kind: "circle", cx: cx2, cy, r, fill, ...part, ...outline };
23542
+ }
23543
+ }
23544
+
23545
+ // chart/render/chart-view-markers.ts
23546
+ function summaryMarkers(source2, group2, seriesPosition) {
23547
+ if (!["line", "scatter", "radar"].includes(group2.kind)) return {};
23548
+ const enabled = group2.kind === "line" ? group2.marker === true : group2.kind === "radar" ? group2.radarStyle === "marker" : !["line", "smooth", "none"].includes(group2.scatterStyle ?? "marker");
23549
+ const symbol = source2.marker?.symbol;
23550
+ const marker3 = {
23551
+ ...source2.marker,
23552
+ symbol: symbol && symbol !== "auto" ? symbol : source2.marker || enabled ? automaticMarkerSymbol(source2.index ?? seriesPosition) : "none"
23553
+ };
23554
+ const pointMarkers = {};
23555
+ for (const point of source2.dataPoints) {
23556
+ if (point.index === void 0 || !point.marker) continue;
23557
+ const override = point.marker;
23558
+ pointMarkers[point.index] = {
23559
+ ...marker3,
23560
+ ...override,
23561
+ ...override.symbol === "auto" || !source2.marker && override.symbol === void 0 ? { symbol: automaticMarkerSymbol(source2.index ?? seriesPosition) } : {},
23562
+ ...marker3.spPr || override.spPr ? {
23563
+ spPr: {
23564
+ ...marker3.spPr,
23565
+ ...override.spPr,
23566
+ ...marker3.spPr?.line || override.spPr?.line ? { line: { ...marker3.spPr?.line, ...override.spPr?.line } } : {}
23567
+ }
23568
+ } : {}
23569
+ };
23570
+ }
23571
+ return { marker: marker3, ...Object.keys(pointMarkers).length ? { pointMarkers } : {} };
23572
+ }
23573
+ function seriesMarkerViews(source2, drawingColor) {
23574
+ const fillColor = (fill) => fill?.kind === "none" ? "none" : fill?.kind === "solid" ? drawingColor(fill.color) : void 0;
23575
+ const resolve3 = (marker3) => {
23576
+ const fill = fillColor(marker3.spPr?.fill);
23577
+ const stroke = fillColor(marker3.spPr?.line?.fill);
23578
+ const width = marker3.spPr?.line?.widthEmu;
23579
+ return {
23580
+ ...marker3.symbol !== void 0 ? { symbol: marker3.symbol } : {},
23581
+ ...marker3.size !== void 0 ? { size: marker3.size } : {},
23582
+ ...fill !== void 0 ? { fill } : {},
23583
+ ...stroke !== void 0 ? { stroke } : {},
23584
+ ...width !== void 0 ? { strokeWidth: width / 9525 } : {}
23585
+ };
23586
+ };
23587
+ return {
23588
+ ...source2.marker ? { marker: resolve3(source2.marker) } : {},
23589
+ ...source2.pointMarkers ? {
23590
+ pointMarkers: Object.fromEntries(
23591
+ Object.entries(source2.pointMarkers).map(([i2, marker3]) => [i2, resolve3(marker3)])
23592
+ )
23593
+ } : {}
23594
+ };
23595
+ }
23596
+
23412
23597
  // chart/render/summary-analysis.ts
23413
23598
  function summaryTrendline(source2) {
23414
23599
  const kind = chartTrendlineKind(source2.trendlineType);
@@ -23683,6 +23868,9 @@ function formatChartNumberWithColor(value2, formatCode) {
23683
23868
  return void 0;
23684
23869
  }
23685
23870
  }
23871
+ function formatChartNumber(value2, formatCode) {
23872
+ return formatChartNumberWithColor(value2, formatCode)?.text;
23873
+ }
23686
23874
 
23687
23875
  // chart/data-label-text.ts
23688
23876
  var DATA_LABEL_SEPARATOR = ", ";
@@ -23731,17 +23919,17 @@ function composeDataLabelText(input) {
23731
23919
  }
23732
23920
 
23733
23921
  // chart/render/summary-labels.ts
23734
- function level(options, custom) {
23922
+ function level(options2, custom) {
23735
23923
  const out = {};
23736
- if (options.deleted !== void 0) out.deleted = options.deleted;
23737
- if (options.showValue !== void 0) out.showValue = options.showValue;
23738
- if (options.showCategoryName !== void 0) out.showCategory = options.showCategoryName;
23739
- if (options.showSeriesName !== void 0) out.showSeriesName = options.showSeriesName;
23740
- if (options.showPercent !== void 0) out.showPercent = options.showPercent;
23741
- if (options.showBubbleSize !== void 0) out.showBubbleSize = options.showBubbleSize;
23742
- if (options.separator !== void 0) out.separator = options.separator;
23743
- if (options.position) out.position = options.position;
23744
- if (options.numberFormat?.formatCode) out.numberFormat = options.numberFormat.formatCode;
23924
+ if (options2.deleted !== void 0) out.deleted = options2.deleted;
23925
+ if (options2.showValue !== void 0) out.showValue = options2.showValue;
23926
+ if (options2.showCategoryName !== void 0) out.showCategory = options2.showCategoryName;
23927
+ if (options2.showSeriesName !== void 0) out.showSeriesName = options2.showSeriesName;
23928
+ if (options2.showPercent !== void 0) out.showPercent = options2.showPercent;
23929
+ if (options2.showBubbleSize !== void 0) out.showBubbleSize = options2.showBubbleSize;
23930
+ if (options2.separator !== void 0) out.separator = options2.separator;
23931
+ if (options2.position) out.position = options2.position;
23932
+ if (options2.numberFormat?.formatCode) out.numberFormat = options2.numberFormat.formatCode;
23745
23933
  if (custom?.text !== void 0) out.text = custom.text;
23746
23934
  return out;
23747
23935
  }
@@ -23848,7 +24036,10 @@ function extraGroups(chartSpace, firstType) {
23848
24036
  const type = group2.kind === "bar" ? "column" : group2.kind;
23849
24037
  const entry3 = {
23850
24038
  chartType: type,
23851
- series: group2.series.map((source2) => chartSummarySeries(source2, type, group2.dataLabels)),
24039
+ series: group2.series.map((source2, index3) => ({
24040
+ ...chartSummarySeries(source2, type, group2.dataLabels),
24041
+ ...summaryMarkers(source2, group2, index3)
24042
+ })),
23852
24043
  secondary: valueAxisId(chartSpace, group2.axisIds) !== primary
23853
24044
  };
23854
24045
  if (group2.grouping && GROUPINGS.has(group2.grouping))
@@ -23866,13 +24057,16 @@ function chartSummaryFromSpace(chartSpace, extras = {}) {
23866
24057
  const group2 = chartSpace.plotArea.groups[0];
23867
24058
  let chartType = group2 ? GROUP_TYPES[group2.kind] : "column";
23868
24059
  if (chartType === "bar" && group2?.barDirection !== "bar") chartType = "column";
23869
- const series = (group2?.series ?? []).map(
23870
- (source2) => chartSummarySeries(source2, chartType, group2?.dataLabels)
23871
- );
24060
+ const series = (group2?.series ?? []).map((source2, index3) => ({
24061
+ ...chartSummarySeries(source2, chartType, group2?.dataLabels),
24062
+ ...group2 ? summaryMarkers(source2, group2, index3) : {}
24063
+ }));
23872
24064
  const summary = {
23873
24065
  chartType,
23874
24066
  series,
23875
- showLegend: chartSpace.legend !== void 0
24067
+ showLegend: chartSpace.legend !== void 0,
24068
+ axes: chartSpace.plotArea.axes,
24069
+ axisIds: group2?.axisIds ?? []
23876
24070
  };
23877
24071
  const combined = extraGroups(chartSpace, chartType);
23878
24072
  if (combined.length) summary.extraGroups = combined;
@@ -23955,6 +24149,8 @@ function parseChart(xml, anchor, partName, name) {
23955
24149
  showLegend: summary.showLegend,
23956
24150
  partName
23957
24151
  };
24152
+ if (summary.axes) object.axes = summary.axes;
24153
+ if (summary.axisIds) object.axisIds = summary.axisIds;
23958
24154
  if (summary.grouping) object.grouping = summary.grouping;
23959
24155
  if (summary.barGapWidth !== void 0) object.barGapWidth = summary.barGapWidth;
23960
24156
  if (summary.barOverlap !== void 0) object.barOverlap = summary.barOverlap;
@@ -24733,9 +24929,9 @@ function readPrintOptions(node2) {
24733
24929
  for (const key of KEYS) if (boolAttr(node2, key)) out[key] = true;
24734
24930
  return Object.keys(out).length ? out : void 0;
24735
24931
  }
24736
- function printOptionsXml(options) {
24737
- if (!options) return "";
24738
- const attrs2 = KEYS.filter((key) => options[key]).map((key) => ` ${key}="1"`);
24932
+ function printOptionsXml(options2) {
24933
+ if (!options2) return "";
24934
+ const attrs2 = KEYS.filter((key) => options2[key]).map((key) => ` ${key}="1"`);
24739
24935
  return attrs2.length ? `<printOptions${attrs2.join("")}/>` : "";
24740
24936
  }
24741
24937
 
@@ -25274,12 +25470,12 @@ Reply:
25274
25470
 
25275
25471
  // chart/bar-cluster-geometry.ts
25276
25472
  var DEFAULT_BAR_GAP_WIDTH = 150;
25277
- function assertBarClusterOptions(options) {
25473
+ function assertBarClusterOptions(options2) {
25278
25474
  for (const [field, min, max] of [
25279
25475
  ["barGapWidth", 0, 500],
25280
25476
  ["barOverlap", -100, 100]
25281
25477
  ]) {
25282
- const value2 = options[field];
25478
+ const value2 = options2[field];
25283
25479
  if (value2 !== void 0 && (!Number.isInteger(value2) || value2 < min || value2 > max))
25284
25480
  throw new RangeError(`${field} must be an integer from ${min} to ${max}`);
25285
25481
  }
@@ -25730,8 +25926,8 @@ function titleXml(context, title) {
25730
25926
  chartTextXml(context, tx, false) + layoutXml(context, title.layout) + valXml("overlay", title.overlay) + shapePropertiesXml(context, title.spPr) + textBodyXml(context, title.txPr) + raw(context, title.extLst)
25731
25927
  );
25732
25928
  }
25733
- function labelOptionsXml(context, options) {
25734
- return numberFormatXml(options.numberFormat) + shapePropertiesXml(context, options.spPr) + textBodyXml(context, options.txPr) + valXml("dLblPos", options.position) + valXml("showLegendKey", options.showLegendKey) + valXml("showVal", options.showValue) + valXml("showCatName", options.showCategoryName) + valXml("showSerName", options.showSeriesName) + valXml("showPercent", options.showPercent) + valXml("showBubbleSize", options.showBubbleSize) + (options.separator === void 0 ? "" : textElement("separator", options.separator));
25929
+ function labelOptionsXml(context, options2) {
25930
+ return numberFormatXml(options2.numberFormat) + shapePropertiesXml(context, options2.spPr) + textBodyXml(context, options2.txPr) + valXml("dLblPos", options2.position) + valXml("showLegendKey", options2.showLegendKey) + valXml("showVal", options2.showValue) + valXml("showCatName", options2.showCategoryName) + valXml("showSerName", options2.showSeriesName) + valXml("showPercent", options2.showPercent) + valXml("showBubbleSize", options2.showBubbleSize) + (options2.separator === void 0 ? "" : textElement("separator", options2.separator));
25735
25931
  }
25736
25932
  function labelXml(context, label2) {
25737
25933
  return elementXml(
@@ -25901,7 +26097,7 @@ function styleXml(context, space) {
25901
26097
  );
25902
26098
  }
25903
26099
  var relationship = (local, id, content2 = "") => id === void 0 ? "" : elementXml(local, content2, ` r:id="${escapeAttribute(id)}"`);
25904
- function writeChartSpace(space, options = {}) {
26100
+ function writeChartSpace(space, options2 = {}) {
25905
26101
  const bindings = new Map(CHART_ROOT_BINDINGS);
25906
26102
  for (const { prefix, uri } of space.namespaceDeclarations ?? [])
25907
26103
  if (!bindings.has(prefix) && /^[A-Za-z_][\w.-]*$/.test(prefix)) bindings.set(prefix, uri);
@@ -25916,7 +26112,7 @@ function writeChartSpace(space, options = {}) {
25916
26112
  space.externalDataRelId,
25917
26113
  valXml("autoUpdate", space.externalDataAutoUpdate)
25918
26114
  ) + raw(context, space.printSettings) + relationship("userShapes", space.userShapesRelId) + raw(context, space.extLst);
25919
- const breakAfter = options.declarationBreak ?? "\r\n";
26115
+ const breakAfter = options2.declarationBreak ?? "\r\n";
25920
26116
  return `${DECLARATION3}${breakAfter}<c:chartSpace${declarations}>${body}</c:chartSpace>`;
25921
26117
  }
25922
26118
 
@@ -26101,6 +26297,14 @@ function chartColorPalettePatch(chart, id) {
26101
26297
  if (!previous) return copy;
26102
26298
  const previousChoice = chartPaletteSeriesColorChoice(previous, index3, chart.series.length);
26103
26299
  const nextChoice = chartPaletteSeriesColorChoice(next, index3, chart.series.length);
26300
+ for (const marker3 of [copy.marker, ...Object.values(copy.pointMarkers ?? {})]) {
26301
+ const shape2 = marker3?.spPr;
26302
+ if (!shape2) continue;
26303
+ for (const paint2 of [shape2, shape2.line]) {
26304
+ if (paint2?.fill?.kind === "solid" && sameChartColor(paint2.fill.color, previousChoice))
26305
+ paint2.fill = { kind: "solid", color: structuredClone(nextChoice) };
26306
+ }
26307
+ }
26104
26308
  const fill = recolorGradient(copy.fill, previousChoice, nextChoice);
26105
26309
  if (fill) copy.fill = fill;
26106
26310
  if (sameChartColor(
@@ -26506,10 +26710,10 @@ var PackageWriter = class {
26506
26710
  async build() {
26507
26711
  const zip = new JSZip2__default.default();
26508
26712
  const date = new Date(Date.UTC(1980, 0, 1));
26509
- const options = { date, createFolders: false };
26510
- zip.file("[Content_Types].xml", this.contentTypesXml(), options);
26713
+ const options2 = { date, createFolders: false };
26714
+ zip.file("[Content_Types].xml", this.contentTypesXml(), options2);
26511
26715
  const names = [...this.parts.keys()].sort((a2, b) => rank2(a2) - rank2(b) || a2.localeCompare(b));
26512
- for (const name of names) zip.file(name, this.parts.get(name) ?? "", options);
26716
+ for (const name of names) zip.file(name, this.parts.get(name) ?? "", options2);
26513
26717
  return zip.generateAsync({
26514
26718
  type: "uint8array",
26515
26719
  compression: "DEFLATE",
@@ -33372,15 +33576,15 @@ function pasteAt(ctx, s, at, payload, request) {
33372
33576
  function pasteSelection(ctx, sheet, selection, payload, request) {
33373
33577
  const dest = normalizeRange(selection);
33374
33578
  const clip = typeof payload === "string" ? { tsv: payload, html: "", cells: cellsFromText(ctx.workbook, payload) } : payload;
33375
- const options = resolvePasteOptions(request);
33376
- if (options.mode === "widths")
33377
- return pasteWidths(ctx, sheet, dest, clip.cells, options.transpose, !!clip.cut);
33378
- const height = options.transpose ? clip.cells.cols : clip.cells.rows;
33379
- const width = options.transpose ? clip.cells.rows : clip.cells.cols;
33579
+ const options2 = resolvePasteOptions(request);
33580
+ if (options2.mode === "widths")
33581
+ return pasteWidths(ctx, sheet, dest, clip.cells, options2.transpose, !!clip.cut);
33582
+ const height = options2.transpose ? clip.cells.cols : clip.cells.rows;
33583
+ const width = options2.transpose ? clip.cells.rows : clip.cells.cols;
33380
33584
  const rows = dest.end.row - dest.start.row + 1;
33381
33585
  const cols = dest.end.col - dest.start.col + 1;
33382
33586
  if (clip.cut || !height || !width || rows === 1 && cols === 1 || dest.start.row === 0 && dest.end.row === MAX_ROW || dest.start.col === 0 && dest.end.col === MAX_COL)
33383
- return pasteAt(ctx, sheet, dest.start, clip, options);
33587
+ return pasteAt(ctx, sheet, dest.start, clip, options2);
33384
33588
  if (rows % height || cols % width)
33385
33589
  throw new RangeError("The copy and paste areas are not compatible sizes.");
33386
33590
  if (rows * cols > 25e4) throw new RangeError("The selected paste area is too large.");
@@ -33400,16 +33604,16 @@ function pasteSelection(ctx, sheet, selection, payload, request) {
33400
33604
  () => {
33401
33605
  for (let row2 = dest.start.row; row2 <= dest.end.row; row2 += height)
33402
33606
  for (let col = dest.start.col; col <= dest.end.col; col += width)
33403
- pasteAt(tileContext, sheet, { row: row2, col }, tileClip, options);
33404
- if (["all", "formats", "noBorders", "mergeFormats"].includes(options.mode))
33607
+ pasteAt(tileContext, sheet, { row: row2, col }, tileClip, options2);
33608
+ if (["all", "formats", "noBorders", "mergeFormats"].includes(options2.mode))
33405
33609
  pasteConditionalFormats(
33406
33610
  sheetAt(ctx.workbook, sheet),
33407
33611
  dest,
33408
33612
  clip.cells,
33409
- options.transpose,
33410
- options.skipBlanks,
33613
+ options2.transpose,
33614
+ options2.skipBlanks,
33411
33615
  void 0,
33412
- options.mode === "mergeFormats"
33616
+ options2.mode === "mergeFormats"
33413
33617
  );
33414
33618
  return dest;
33415
33619
  },
@@ -33876,7 +34080,7 @@ function numberInputText(value2, numFmt, date1904 = false) {
33876
34080
  if (/%/.test(numFmt.replace(/"[^"]*"|\\./g, ""))) return `${plainNumber(value2 * 100)}%`;
33877
34081
  return plainNumber(value2);
33878
34082
  }
33879
- function formulaBarText(workbook, cell, options = {}) {
34083
+ function formulaBarText(workbook, cell, options2 = {}) {
33880
34084
  if (!cell) return "";
33881
34085
  if (cell.formula !== void 0) return `=${cell.formula}`;
33882
34086
  const value2 = cell.value;
@@ -33890,7 +34094,7 @@ function formulaBarText(workbook, cell, options = {}) {
33890
34094
  workbook.date1904
33891
34095
  );
33892
34096
  const text4 = cell.richText?.length ? cell.richText.map((run2) => run2.text).join("") : value2;
33893
- if (text4 === "" || options.quote === false) return text4;
34097
+ if (text4 === "" || options2.quote === false) return text4;
33894
34098
  const parsed = parseCellInput(text4, { date1904: workbook.date1904 });
33895
34099
  const literal2 = parsed.formula === void 0 && parsed.value === text4;
33896
34100
  return literal2 ? text4 : `'${text4}`;
@@ -34521,9 +34725,9 @@ var SessionCalculator = class {
34521
34725
  // xlsx/edit/goal-solver.ts
34522
34726
  var DEFAULT_GOAL_ITERATIONS = 100;
34523
34727
  var DEFAULT_GOAL_MAX_CHANGE = 1e-3;
34524
- function solveGoal(f6, goal, start, options = {}) {
34525
- const maxIterations = options.maxIterations ?? DEFAULT_GOAL_ITERATIONS;
34526
- const tolerance = options.maxChange ?? DEFAULT_GOAL_MAX_CHANGE;
34728
+ function solveGoal(f6, goal, start, options2 = {}) {
34729
+ const maxIterations = options2.maxIterations ?? DEFAULT_GOAL_ITERATIONS;
34730
+ const tolerance = options2.maxChange ?? DEFAULT_GOAL_MAX_CHANGE;
34527
34731
  let iterations = 0;
34528
34732
  let best;
34529
34733
  let negative;
@@ -35030,10 +35234,10 @@ function columnOverrides(sheet, mdw, defaultPx) {
35030
35234
  }
35031
35235
  return out;
35032
35236
  }
35033
- function createGridMetrics(sheet, options = {}) {
35034
- const zoom = zoomPercent(options.zoom ?? sheet.view.zoom);
35237
+ function createGridMetrics(sheet, options2 = {}) {
35238
+ const zoom = zoomPercent(options2.zoom ?? sheet.view.zoom);
35035
35239
  const factor = zoom / 100;
35036
- const mdw = options.mdw ?? DEFAULT_MAX_DIGIT_WIDTH;
35240
+ const mdw = options2.mdw ?? DEFAULT_MAX_DIGIT_WIDTH;
35037
35241
  const scale2 = (px) => px > 0 ? Math.max(1, Math.round(px * factor)) : 0;
35038
35242
  const defaultColPx = defaultColumnPixels(sheet.defaultColWidth, mdw);
35039
35243
  const colOverrides = [...columnOverrides(sheet, mdw, defaultColPx)].map(
@@ -35055,8 +35259,8 @@ function createGridMetrics(sheet, options = {}) {
35055
35259
  for (const merge2 of sheet.merges) lastColUsed = Math.max(lastColUsed, merge2.end.col);
35056
35260
  for (const info of sheet.columns)
35057
35261
  if (info.max < MAX_COL) lastColUsed = Math.max(lastColUsed, info.max);
35058
- const lastRow = Math.min(MAX_ROW, lastRowUsed + (options.extraRows ?? 50));
35059
- const lastCol = Math.min(MAX_COL, lastColUsed + (options.extraCols ?? 20));
35262
+ const lastRow = Math.min(MAX_ROW, lastRowUsed + (options2.extraRows ?? 50));
35263
+ const lastCol = Math.min(MAX_COL, lastColUsed + (options2.extraCols ?? 20));
35060
35264
  return {
35061
35265
  zoom,
35062
35266
  lastRow,
@@ -35283,37 +35487,37 @@ function writePivot(ctx, s, pivot, old, label2, inside2) {
35283
35487
  );
35284
35488
  }
35285
35489
  var startRow = (range, offset2) => range.start.row + offset2;
35286
- function createPivotTable(ctx, s, destination, options) {
35287
- const data = pivotSourceData(ctx.workbook, s, options.source);
35288
- const name = options.name ?? uniqueName(ctx);
35490
+ function createPivotTable(ctx, s, destination, options2) {
35491
+ const data = pivotSourceData(ctx.workbook, s, options2.source);
35492
+ const name = options2.name ?? uniqueName(ctx);
35289
35493
  checkName2(ctx, name);
35290
- const aggregate3 = options.aggregate ?? "sum";
35291
- const captions = authoredCaptions(options);
35494
+ const aggregate3 = options2.aggregate ?? "sum";
35495
+ const captions = authoredCaptions(options2);
35292
35496
  const pivot = {
35293
35497
  ...data,
35294
35498
  ...captions ? { captions } : {},
35295
35499
  name,
35296
- rowField: options.rowField,
35297
- layout: options.layout ?? "tabular",
35298
- subtotalPosition: options.subtotalPosition ?? (options.layout && options.layout !== "tabular" ? "top" : "bottom"),
35299
- ...options.secondRowField ? { secondRowField: options.secondRowField } : {},
35300
- ...options.secondRowField && options.moreRowFields?.length ? { moreRowFields: [...options.moreRowFields] } : {},
35301
- ...options.fieldSubtotals?.length ? { fieldSubtotals: normalizedFieldSubtotals(options.fieldSubtotals) } : {},
35302
- ...options.dateGroups?.length ? { dateGroups: structuredClone(options.dateGroups) } : {},
35500
+ rowField: options2.rowField,
35501
+ layout: options2.layout ?? "tabular",
35502
+ subtotalPosition: options2.subtotalPosition ?? (options2.layout && options2.layout !== "tabular" ? "top" : "bottom"),
35503
+ ...options2.secondRowField ? { secondRowField: options2.secondRowField } : {},
35504
+ ...options2.secondRowField && options2.moreRowFields?.length ? { moreRowFields: [...options2.moreRowFields] } : {},
35505
+ ...options2.fieldSubtotals?.length ? { fieldSubtotals: normalizedFieldSubtotals(options2.fieldSubtotals) } : {},
35506
+ ...options2.dateGroups?.length ? { dateGroups: structuredClone(options2.dateGroups) } : {},
35303
35507
  ...ctx.workbook.date1904 ? { date1904: true } : {},
35304
- ...options.subtotals !== void 0 ? { subtotals: options.subtotals } : {},
35305
- ...options.repeatLabels !== void 0 ? { repeatLabels: options.repeatLabels } : {},
35306
- valueField: options.valueField,
35508
+ ...options2.subtotals !== void 0 ? { subtotals: options2.subtotals } : {},
35509
+ ...options2.repeatLabels !== void 0 ? { repeatLabels: options2.repeatLabels } : {},
35510
+ valueField: options2.valueField,
35307
35511
  aggregate: aggregate3,
35308
- valueCaption: pivotCaption(aggregate3, options.valueField, { captions }),
35309
- ...options.pageFilter !== void 0 ? { pageFilter: structuredClone(options.pageFilter) } : {},
35310
- ...options.fieldGroups?.length ? { fieldGroups: structuredClone(options.fieldGroups) } : {},
35311
- ...options.valuesAxis !== void 0 ? { valuesAxis: options.valuesAxis } : {},
35312
- ...options.valuesPosition !== void 0 ? { valuesPosition: options.valuesPosition } : {},
35313
- ...options.additionalValues ? { additionalValues: normalizedPivotMeasures(options.additionalValues, { captions }) } : {},
35512
+ valueCaption: pivotCaption(aggregate3, options2.valueField, { captions }),
35513
+ ...options2.pageFilter !== void 0 ? { pageFilter: structuredClone(options2.pageFilter) } : {},
35514
+ ...options2.fieldGroups?.length ? { fieldGroups: structuredClone(options2.fieldGroups) } : {},
35515
+ ...options2.valuesAxis !== void 0 ? { valuesAxis: options2.valuesAxis } : {},
35516
+ ...options2.valuesPosition !== void 0 ? { valuesPosition: options2.valuesPosition } : {},
35517
+ ...options2.additionalValues ? { additionalValues: normalizedPivotMeasures(options2.additionalValues, { captions }) } : {},
35314
35518
  location: { start: { ...destination }, end: { ...destination } },
35315
- ...options.columnField ? { columnField: options.columnField } : {},
35316
- ...options.columnField && options.moreColumnFields?.length ? { moreColumnFields: [...options.moreColumnFields] } : {}
35519
+ ...options2.columnField ? { columnField: options2.columnField } : {},
35520
+ ...options2.columnField && options2.moreColumnFields?.length ? { moreColumnFields: [...options2.moreColumnFields] } : {}
35317
35521
  };
35318
35522
  if (pivot.dateGroups) reconcileDateAxes(pivot);
35319
35523
  const dates = pivotDateFieldsOf(ctx.workbook, s, pivot);
@@ -39019,8 +39223,8 @@ function hashBytes(password, { algorithmName, saltValue, spinCount }, limits) {
39019
39223
  if (!digest || !salt || !isValidSpinCount(spinCount, limits.maxSpinCount)) return void 0;
39020
39224
  return spinPasswordHash(password, salt, spinCount ?? 0, digest);
39021
39225
  }
39022
- function hashPassword(password, options, limits = {}) {
39023
- const bytes = hashBytes(password, options, limits);
39226
+ function hashPassword(password, options2, limits = {}) {
39227
+ const bytes = hashBytes(password, options2, limits);
39024
39228
  return bytes && encodeBase64(bytes);
39025
39229
  }
39026
39230
  function verifyPasswordHash(password, hash, limits = {}) {
@@ -39321,7 +39525,7 @@ function displayText2(value2, style2, numFmt, workbook, sheet) {
39321
39525
  });
39322
39526
  return formatted.color ? { text: formatted.text, color: formatted.color } : { text: formatted.text };
39323
39527
  }
39324
- function cellView(workbook, sheetIndex2, row2, col, cf, options = {}) {
39528
+ function cellView(workbook, sheetIndex2, row2, col, cf, options2 = {}) {
39325
39529
  const sheet = workbook.sheets[sheetIndex2];
39326
39530
  if (!sheet) throw new RangeError(`No sheet at index ${sheetIndex2}`);
39327
39531
  const cell = getCell(sheet, row2, col);
@@ -39360,10 +39564,10 @@ function cellView(workbook, sheetIndex2, row2, col, cf, options = {}) {
39360
39564
  vAlign: alignment.vertical ?? "bottom",
39361
39565
  wrap: wrap3,
39362
39566
  shrink,
39363
- indentPx: indentable ? (alignment.indent ?? 0) * (options.indentPx ?? INDENT_PX_PER_LEVEL) : 0,
39567
+ indentPx: indentable ? (alignment.indent ?? 0) * (options2.indentPx ?? INDENT_PX_PER_LEVEL) : 0,
39364
39568
  rotation,
39365
39569
  isNumber,
39366
- overflow: (formulaText !== void 0 || typeof value2 === "string" && value2 !== "") && !wrap3 && !shrink && rotation === 0 && !vertical && hAlign !== "fill" && !(options.merged ?? sheet.merges.some((m) => rangeContains(m, { row: row2, col }))),
39570
+ overflow: (formulaText !== void 0 || typeof value2 === "string" && value2 !== "") && !wrap3 && !shrink && rotation === 0 && !vertical && hAlign !== "fill" && !(options2.merged ?? sheet.merges.some((m) => rangeContains(m, { row: row2, col }))),
39367
39571
  hasComment: sheet.comments.some((c2) => c2.address.row === row2 && c2.address.col === col),
39368
39572
  hasHyperlink: false,
39369
39573
  validationList: sheet.dataValidations.some(
@@ -39923,7 +40127,7 @@ function asNumber(value2) {
39923
40127
  return Number(value2);
39924
40128
  return void 0;
39925
40129
  }
39926
- function listValidationOptions(workbook, sheet, row2, col, options = {}) {
40130
+ function listValidationOptions(workbook, sheet, row2, col, options2 = {}) {
39927
40131
  const dv = validationAt(workbook, sheet, row2, col);
39928
40132
  if (!dv || dv.type !== "list" || dv.showDropDown === false || dv.formula1 === void 0)
39929
40133
  return void 0;
@@ -39932,7 +40136,7 @@ function listValidationOptions(workbook, sheet, row2, col, options = {}) {
39932
40136
  workbook,
39933
40137
  sheet,
39934
40138
  relativeTo(dv, dv.formula1, at),
39935
- options.evaluate ?? defaultEvaluate(workbook),
40139
+ options2.evaluate ?? defaultEvaluate(workbook),
39936
40140
  at
39937
40141
  );
39938
40142
  return items?.map((item) => item.text);
@@ -39993,11 +40197,11 @@ function check2(workbook, dv, value2, at, evaluate) {
39993
40197
  if (dv.type === "whole" && !Number.isInteger(n2)) return false;
39994
40198
  return compare(operator, n2, a2, b);
39995
40199
  }
39996
- function validateCellInput(workbook, sheet, row2, col, value2, options = {}) {
40200
+ function validateCellInput(workbook, sheet, row2, col, value2, options2 = {}) {
39997
40201
  const dv = validationAt(workbook, sheet, row2, col);
39998
40202
  if (!dv || dv.type === "none" || dv.showErrorMessage !== true) return { ok: true };
39999
40203
  if (value2 === null || value2 === "") return dv.allowBlank === false ? failure(dv) : { ok: true };
40000
- const evaluate = options.evaluate ?? defaultEvaluate(workbook);
40204
+ const evaluate = options2.evaluate ?? defaultEvaluate(workbook);
40001
40205
  return check2(workbook, dv, value2, { sheet, row: row2, col }, evaluate) ? { ok: true } : failure(dv);
40002
40206
  }
40003
40207
  function failure(dv) {
@@ -40011,10 +40215,10 @@ function failure(dv) {
40011
40215
  }
40012
40216
 
40013
40217
  // xlsx/edit/session.ts
40014
- function createEditSession(workbook, options = {}) {
40218
+ function createEditSession(workbook, options2 = {}) {
40015
40219
  const calc = createCalcEngine(workbook);
40016
- const autoRecalc = options.recalc ?? true;
40017
- const history = new History(options.historyLimit ?? 100);
40220
+ const autoRecalc = options2.recalc ?? true;
40221
+ const history = new History(options2.historyLimit ?? 100);
40018
40222
  const listeners = /* @__PURE__ */ new Set();
40019
40223
  let open;
40020
40224
  const emit = (change) => {
@@ -40113,8 +40317,8 @@ function createEditSession(workbook, options = {}) {
40113
40317
  return result2;
40114
40318
  };
40115
40319
  const ctx = { workbook, calc, run: run2 };
40116
- if (options.defaultSheetBase) ctx.defaultSheetBase = options.defaultSheetBase;
40117
- const autoRows = options.autoRowHeight ?? true;
40320
+ if (options2.defaultSheetBase) ctx.defaultSheetBase = options2.defaultSheetBase;
40321
+ const autoRows = options2.autoRowHeight ?? true;
40118
40322
  const refitRows = (current) => {
40119
40323
  const { sheet: s, kind, ranges } = current;
40120
40324
  if (!autoRows || s === void 0 || !ranges.length || !current.step.entries.length) return;
@@ -40122,7 +40326,7 @@ function createEditSession(workbook, options = {}) {
40122
40326
  const sheet = workbook.sheets[s];
40123
40327
  if (!sheet) return;
40124
40328
  try {
40125
- autoGrowRows(ctx, s, rowsToRefit(sheet, ranges), options.measureText);
40329
+ autoGrowRows(ctx, s, rowsToRefit(sheet, ranges), options2.measureText);
40126
40330
  } catch (error) {
40127
40331
  const message = `Row height update failed: ${error instanceof Error ? error.message : String(error)}`;
40128
40332
  if (!workbook.warnings.includes(message)) workbook.warnings.push(message);
@@ -40185,7 +40389,7 @@ function createEditSession(workbook, options = {}) {
40185
40389
  setDefinedName: (name) => setDefinedName(ctx, name),
40186
40390
  deleteDefinedName: (name, localSheet) => deleteDefinedName(ctx, name, localSheet),
40187
40391
  setDrawingAnchor: (s, index3, anchor) => setDrawingAnchor(ctx, s, index3, anchor),
40188
- createPivotTable: (s, destination, options2) => createPivotTable(ctx, s, destination, options2),
40392
+ createPivotTable: (s, destination, options3) => createPivotTable(ctx, s, destination, options3),
40189
40393
  refreshPivotTable: (s, name, patch3) => refreshPivotTable(ctx, s, name, patch3),
40190
40394
  deletePivotTable: (s, name) => deletePivotTable(ctx, s, name),
40191
40395
  setSlicerSelection: (cache3, keys) => setSlicerSelection(ctx, cache3, keys),
@@ -40235,8 +40439,8 @@ function createEditSession(workbook, options = {}) {
40235
40439
  setDocumentProperties: (patch3) => setDocumentProperties(ctx, patch3),
40236
40440
  setAutoRecalc: (enabled) => setCalcMode(ctx, enabled ? "auto" : "manual"),
40237
40441
  autoRecalc: () => autoRecalc && calcModeOf(workbook) === "auto",
40238
- calculateNow(options2) {
40239
- calculator.now(options2?.full ?? false);
40442
+ calculateNow(options3) {
40443
+ calculator.now(options3?.full ?? false);
40240
40444
  emit({ kind: "cells", label: "Calculate now", structural: false });
40241
40445
  },
40242
40446
  prepareCalculation: (opts) => calculator.prepare(opts?.timeRemaining),
@@ -40337,17 +40541,17 @@ function formatCursorLabel(userName, maxChars = MAX_LABEL_CHARS) {
40337
40541
  }
40338
40542
 
40339
40543
  // xlsx/layout/remote-selections.ts
40340
- function layoutRemoteSelections(metrics, peers, options) {
40341
- const tagHeight = options.tagHeight ?? 16;
40544
+ function layoutRemoteSelections(metrics, peers, options2) {
40545
+ const tagHeight = options2.tagHeight ?? 16;
40342
40546
  const boxes = [];
40343
40547
  for (const peer of peers) {
40344
- if (peer.sheet !== options.sheet) continue;
40548
+ if (peer.sheet !== options2.sheet) continue;
40345
40549
  const { start, end } = peer.range;
40346
40550
  const top = Math.min(start.row, end.row);
40347
40551
  const left2 = Math.min(start.col, end.col);
40348
- if (top > options.maxRow || left2 > options.maxCol) continue;
40349
- const bottom = Math.min(Math.max(start.row, end.row), options.maxRow);
40350
- const right2 = Math.min(Math.max(start.col, end.col), options.maxCol);
40552
+ if (top > options2.maxRow || left2 > options2.maxCol) continue;
40553
+ const bottom = Math.min(Math.max(start.row, end.row), options2.maxRow);
40554
+ const right2 = Math.min(Math.max(start.col, end.col), options2.maxCol);
40351
40555
  const x = metrics.colLeft(left2);
40352
40556
  const y = metrics.rowTop(top);
40353
40557
  const w = metrics.colLeft(right2 + 1) - x;
@@ -40360,7 +40564,7 @@ function layoutRemoteSelections(metrics, peers, options) {
40360
40564
  w,
40361
40565
  h: h2,
40362
40566
  color: peer.userColor,
40363
- label: formatCursorLabel(peer.userName, options.maxLabelChars),
40567
+ label: formatCursorLabel(peer.userName, options2.maxLabelChars),
40364
40568
  name: peer.userName,
40365
40569
  tag: y < tagHeight ? "inside" : "above"
40366
40570
  });
@@ -40457,14 +40661,14 @@ function dataBarAppearance(rule, workbook) {
40457
40661
  }
40458
40662
 
40459
40663
  // xlsx/layout/data-bar-geometry.ts
40460
- function dataBarGeometry(value2, low, high, options) {
40461
- const lo = options.autoMin ? Math.min(0, low) : low;
40462
- const hi = options.autoMax ? Math.max(0, high) : high;
40664
+ function dataBarGeometry(value2, low, high, options2) {
40665
+ const lo = options2.autoMin ? Math.min(0, low) : low;
40666
+ const hi = options2.autoMax ? Math.max(0, high) : high;
40463
40667
  const clamp = (v) => Math.max(0, Math.min(1, v));
40464
- const minimum = options.minLength;
40465
- const delta = options.maxLength - minimum;
40668
+ const minimum = options2.minLength;
40669
+ const delta = options2.maxLength - minimum;
40466
40670
  const interpolate = (ratio, offset2 = minimum) => clamp(offset2 + clamp(ratio) * delta);
40467
- if (options.axis === "none") {
40671
+ if (options2.axis === "none") {
40468
40672
  const ratio = hi > lo ? clamp((value2 - lo) / (hi - lo)) : 0.5;
40469
40673
  return {
40470
40674
  start: 0,
@@ -40472,7 +40676,7 @@ function dataBarGeometry(value2, low, high, options) {
40472
40676
  reverse: false
40473
40677
  };
40474
40678
  }
40475
- if (options.axis === "middle") {
40679
+ if (options2.axis === "middle") {
40476
40680
  const span3 = Math.max(Math.abs(lo), Math.abs(hi));
40477
40681
  const fraction2 = interpolate(span3 > 0 ? Math.abs(value2) / span3 : 0) / 2;
40478
40682
  return { start: value2 < 0 ? 0.5 - fraction2 : 0.5, fraction: fraction2, axis: 0.5, reverse: value2 < 0 };
@@ -40484,7 +40688,7 @@ function dataBarGeometry(value2, low, high, options) {
40484
40688
  }
40485
40689
  if (hi <= 0) {
40486
40690
  const fraction2 = hi > lo ? interpolate((hi - value2) / (hi - lo), hi === 0 ? minimum / 2 : minimum) : interpolate(0.5);
40487
- const axis2 = hi === 0 ? (1 + options.maxLength - minimum) / 2 : options.maxLength;
40691
+ const axis2 = hi === 0 ? (1 + options2.maxLength - minimum) / 2 : options2.maxLength;
40488
40692
  return {
40489
40693
  start: axis2 - fraction2,
40490
40694
  fraction: fraction2,
@@ -40492,7 +40696,7 @@ function dataBarGeometry(value2, low, high, options) {
40492
40696
  reverse: true
40493
40697
  };
40494
40698
  }
40495
- const axis = (1 - options.maxLength + minimum) / 2 + -lo / (hi - lo) * delta;
40699
+ const axis = (1 - options2.maxLength + minimum) / 2 + -lo / (hi - lo) * delta;
40496
40700
  const bounded = Math.max(lo, Math.min(hi, value2));
40497
40701
  const fraction = interpolate(Math.abs(bounded) / (hi - lo), minimum / 2);
40498
40702
  return { start: bounded < 0 ? axis - fraction : axis, fraction, axis, reverse: bounded < 0 };
@@ -40598,10 +40802,10 @@ function valueText(value2) {
40598
40802
 
40599
40803
  // xlsx/layout/cf-evaluator.ts
40600
40804
  var GRAPHIC_RULES = /* @__PURE__ */ new Set(["colorScale", "dataBar", "iconSet"]);
40601
- function createConditionalFormatEvaluator(workbook, sheetIndex2, evaluate, options = {}) {
40805
+ function createConditionalFormatEvaluator(workbook, sheetIndex2, evaluate, options2 = {}) {
40602
40806
  const sheet = workbook.sheets[sheetIndex2];
40603
40807
  if (!sheet) return { at: () => void 0 };
40604
- const translate = options.translate ?? translateFormula;
40808
+ const translate = options2.translate ?? translateFormula;
40605
40809
  const entries = [];
40606
40810
  let order = 0;
40607
40811
  for (const format of sheet.conditionalFormats)
@@ -40621,7 +40825,7 @@ function createConditionalFormatEvaluator(workbook, sheetIndex2, evaluate, optio
40621
40825
  let todaySerial;
40622
40826
  const today = () => {
40623
40827
  if (todaySerial !== void 0) return todaySerial;
40624
- let serial = options.today?.();
40828
+ let serial = options2.today?.();
40625
40829
  if (serial === void 0) {
40626
40830
  const anchor = { sheet: sheetIndex2, row: 0, col: 0 };
40627
40831
  let raw2 = null;
@@ -41072,14 +41276,14 @@ function* units(raw2) {
41072
41276
  exp2++;
41073
41277
  }
41074
41278
  }
41075
- function niceScale(dataMin, dataMax, options = {}) {
41076
- const maxIntervals = Math.max(1, options.maxIntervals ?? 10);
41279
+ function niceScale(dataMin, dataMax, options2 = {}) {
41280
+ const maxIntervals = Math.max(1, options2.maxIntervals ?? 10);
41077
41281
  let lo = Number.isFinite(dataMin) ? dataMin : 0;
41078
41282
  let hi = Number.isFinite(dataMax) ? dataMax : 0;
41079
41283
  if (lo > hi) [lo, hi] = [hi, lo];
41080
41284
  if (lo === hi) {
41081
41285
  if (lo === 0) hi = 1;
41082
- else if (options.noZero) {
41286
+ else if (options2.noZero) {
41083
41287
  const pad7 = Math.abs(lo) * 0.1 || 1;
41084
41288
  lo -= pad7;
41085
41289
  hi += pad7;
@@ -41088,7 +41292,7 @@ function niceScale(dataMin, dataMax, options = {}) {
41088
41292
  }
41089
41293
  let fixedLo = false;
41090
41294
  let fixedHi = false;
41091
- if (!options.noZero) {
41295
+ if (!options2.noZero) {
41092
41296
  if (lo >= 0 && hi - lo >= hi / 6) {
41093
41297
  lo = 0;
41094
41298
  fixedLo = true;
@@ -41128,6 +41332,202 @@ function formatAxisValue(value2, percent2 = false) {
41128
41332
  return `${v < 0 ? "-" : ""}${grouped}${frac ? `.${frac}` : ""}`;
41129
41333
  }
41130
41334
 
41335
+ // chart/axis-range.ts
41336
+ function computeLogValueRange(series, logBase) {
41337
+ const allValues = series.flatMap((item) => item.values).filter((value2) => value2 !== null && Number.isFinite(value2) && value2 > 0);
41338
+ if (allValues.length === 0) {
41339
+ return { min: 1, max: logBase, span: 1, logScale: true, logBase };
41340
+ }
41341
+ const dataMin = Math.min(...allValues);
41342
+ const dataMax = Math.max(...allValues);
41343
+ const logMin = Math.floor(Math.log(dataMin) / Math.log(logBase));
41344
+ const logMax = Math.ceil(Math.log(dataMax) / Math.log(logBase));
41345
+ const min = logBase ** logMin;
41346
+ const max = logBase ** Math.max(logMax, logMin + 1);
41347
+ return {
41348
+ min,
41349
+ max,
41350
+ span: Math.max(Math.log(max) / Math.log(logBase) - Math.log(min) / Math.log(logBase), 1),
41351
+ logScale: true,
41352
+ logBase
41353
+ };
41354
+ }
41355
+ function withAxisBounds(automatic, axis, logBase) {
41356
+ const validMin = typeof axis?.min === "number" && Number.isFinite(axis.min) && (!logBase || axis.min > 0) ? axis.min : void 0;
41357
+ const validMax = typeof axis?.max === "number" && Number.isFinite(axis.max) && (!logBase || axis.max > 0) ? axis.max : void 0;
41358
+ const min = validMin ?? automatic.min;
41359
+ let max = validMax ?? automatic.max;
41360
+ const majorUnit = validMin === void 0 && validMax === void 0 ? automatic.majorUnit : void 0;
41361
+ if (max <= min) {
41362
+ max = logBase ? min * logBase : min + 1;
41363
+ }
41364
+ const span3 = logBase ? Math.log(max) / Math.log(logBase) - Math.log(min) / Math.log(logBase) : max - min;
41365
+ return {
41366
+ min,
41367
+ max,
41368
+ span: Math.max(span3, Number.EPSILON),
41369
+ ...majorUnit !== void 0 ? { majorUnit } : {},
41370
+ ...logBase ? { logScale: true, logBase } : {},
41371
+ ...axis?.orientation === "maxMin" ? { reverseOrder: true } : {}
41372
+ };
41373
+ }
41374
+
41375
+ // chart/axis-ticks.ts
41376
+ var LOG_EXPONENT_TOLERANCE = 1e-12;
41377
+ function generateLogTicks(range) {
41378
+ if (!range.logScale || !range.logBase) {
41379
+ return [];
41380
+ }
41381
+ const base = range.logBase;
41382
+ const logMin = Math.log(range.min) / Math.log(base);
41383
+ const logMax = Math.log(range.max) / Math.log(base);
41384
+ const firstExponent = Math.ceil(logMin - LOG_EXPONENT_TOLERANCE);
41385
+ const lastExponent = Math.floor(logMax + LOG_EXPONENT_TOLERANCE);
41386
+ if (lastExponent < firstExponent) {
41387
+ return range.min === range.max ? [range.min] : [range.min, range.max];
41388
+ }
41389
+ return Array.from(
41390
+ { length: lastExponent - firstExponent + 1 },
41391
+ (_unused, index3) => base ** (firstExponent + index3)
41392
+ );
41393
+ }
41394
+ function generateIntervalTicks(range, unit) {
41395
+ if (!Number.isFinite(unit) || unit <= 0 || range.logScale) {
41396
+ return [];
41397
+ }
41398
+ const tolerance = Math.max(1, Math.abs(range.min), Math.abs(range.max)) * 1e-12;
41399
+ const first2 = Math.ceil((range.min - tolerance) / unit);
41400
+ const last = Math.floor((range.max + tolerance) / unit);
41401
+ const count2 = Math.min(Math.max(last - first2 + 1, 0), 2e3);
41402
+ return Array.from({ length: count2 }, (_, index3) => (first2 + index3) * unit);
41403
+ }
41404
+ function generateAxisTicks(range, axis, defaultIntervals) {
41405
+ if (range.logScale && range.logBase) {
41406
+ return generateLogTicks(range);
41407
+ }
41408
+ const explicit = generateIntervalTicks(range, axis?.majorUnit ?? 0);
41409
+ if (explicit.length > 0) {
41410
+ return explicit;
41411
+ }
41412
+ const automatic = generateIntervalTicks(range, range.majorUnit ?? 0);
41413
+ if (automatic.length > 0) {
41414
+ return automatic;
41415
+ }
41416
+ return Array.from(
41417
+ { length: defaultIntervals + 1 },
41418
+ (_, index3) => range.min + range.span / defaultIntervals * index3
41419
+ );
41420
+ }
41421
+ function generateMinorAxisTicks(range, axis) {
41422
+ const minor = generateIntervalTicks(range, axis?.minorUnit ?? 0);
41423
+ if (minor.length === 0) {
41424
+ return [];
41425
+ }
41426
+ const majorUnit = axis?.majorUnit;
41427
+ if (!majorUnit || !Number.isFinite(majorUnit) || majorUnit <= 0) {
41428
+ return minor;
41429
+ }
41430
+ const tolerance = Math.max(1, Math.abs(range.min), Math.abs(range.max)) * 1e-10;
41431
+ return minor.filter(
41432
+ (value2) => Math.abs(value2 / majorUnit - Math.round(value2 / majorUnit)) > tolerance
41433
+ );
41434
+ }
41435
+
41436
+ // chart/render/chart-view-axes.ts
41437
+ function chartAxisRatio(value2, scale2, axis) {
41438
+ const range = axis?.range;
41439
+ const ratio = range?.logScale ? Math.log(Math.max(value2, range.min) / range.min) / Math.log(range.max / range.min) : (value2 - scale2.min) / (scale2.max - scale2.min || 1);
41440
+ return range?.reverseOrder ? 1 - ratio : ratio;
41441
+ }
41442
+ function chartAxisLabels(axis) {
41443
+ return axis?.source.deleted !== true && axis?.source.tickLabelPosition !== "none";
41444
+ }
41445
+ function options(axis) {
41446
+ return {
41447
+ ...axis.scaling,
41448
+ ...axis.scaling.logBase === void 0 ? {} : { logScale: true },
41449
+ ...axis.majorUnit === void 0 ? {} : { majorUnit: axis.majorUnit },
41450
+ ...axis.minorUnit === void 0 ? {} : { minorUnit: axis.minorUnit }
41451
+ };
41452
+ }
41453
+ function applyChartAxes(model, chart, color) {
41454
+ if (!chart.axes?.length) return;
41455
+ const axes2 = chart.axes;
41456
+ const linked = axes2.filter((axis) => axis.id !== void 0 && chart.axisIds?.includes(axis.id));
41457
+ const candidates = linked.length ? linked : axes2;
41458
+ const xy = model.type === "scatter" || model.type === "bubble";
41459
+ const value2 = candidates.find((axis) => axis.kind === "val" && !["b", "t"].includes(axis.position ?? "")) ?? candidates.find((axis) => axis.kind === "val");
41460
+ const category = candidates.find(
41461
+ (axis) => xy ? axis.kind === "val" && axis !== value2 : axis.kind === "cat" || axis.kind === "date"
41462
+ );
41463
+ const secondary = axes2.find((axis) => axis.kind === "val" && axis !== value2 && axis !== category);
41464
+ const paint2 = (shape2) => {
41465
+ const ln2 = shape2?.line;
41466
+ const fill = ln2?.fill;
41467
+ const resolved = fill?.kind === "none" ? "none" : color(fill?.kind === "solid" ? fill.color : void 0);
41468
+ return {
41469
+ ...resolved === void 0 ? {} : { color: resolved },
41470
+ ...ln2?.widthEmu === void 0 ? {} : { width: ln2.widthEmu / EMU_PER_PIXEL },
41471
+ ...ln2?.dash === void 0 ? {} : { dash: ln2.dash }
41472
+ };
41473
+ };
41474
+ const bind = (axis, scale2, values2) => {
41475
+ const opts = options(axis);
41476
+ const automatic = opts.logScale ? computeLogValueRange(
41477
+ [{ values: values2 ?? [] }],
41478
+ opts.logBase && Number.isFinite(opts.logBase) && opts.logBase > 1 ? opts.logBase : 10
41479
+ ) : {
41480
+ min: scale2?.min ?? 0,
41481
+ max: scale2?.max ?? 1,
41482
+ span: (scale2?.max ?? 1) - (scale2?.min ?? 0),
41483
+ ...scale2 ? { majorUnit: scale2.majorUnit } : {}
41484
+ };
41485
+ const logBase = automatic.logBase;
41486
+ const range = withAxisBounds(automatic, opts, logBase);
41487
+ if (scale2) {
41488
+ scale2.min = range.min;
41489
+ scale2.max = range.max;
41490
+ scale2.ticks = generateAxisTicks(range, opts, 5);
41491
+ }
41492
+ return {
41493
+ source: axis,
41494
+ range,
41495
+ minorTicks: generateMinorAxisTicks(range, opts),
41496
+ line: paint2(axis.spPr),
41497
+ majorGrid: paint2(axis.majorGridlinesSpPr),
41498
+ minorGrid: paint2(axis.minorGridlinesSpPr)
41499
+ };
41500
+ };
41501
+ const out = {};
41502
+ if (value2)
41503
+ out.value = bind(
41504
+ value2,
41505
+ model.valueAxis,
41506
+ [
41507
+ ...model.series,
41508
+ ...model.extraGroups?.filter((g2) => !g2.secondary).flatMap((g2) => g2.series) ?? []
41509
+ ].flatMap((s) => s.values)
41510
+ );
41511
+ if (category)
41512
+ out.category = bind(
41513
+ category,
41514
+ model.xAxis ?? {
41515
+ min: 0,
41516
+ max: Math.max(1, model.categories.length - 1),
41517
+ majorUnit: 1,
41518
+ ticks: []
41519
+ },
41520
+ model.series.flatMap((s) => s.xValues ?? [])
41521
+ );
41522
+ if (secondary)
41523
+ out.secondary = bind(
41524
+ secondary,
41525
+ model.secondaryAxis,
41526
+ model.extraGroups?.filter((g2) => g2.secondary).flatMap((g2) => g2.series.flatMap((s) => s.values))
41527
+ );
41528
+ model.axes = out;
41529
+ }
41530
+
41131
41531
  // chart/treemap-squarify.ts
41132
41532
  function worstAspectRatio(areas, side) {
41133
41533
  const sum3 = areas.reduce((total2, area) => total2 + area, 0);
@@ -41600,15 +42000,15 @@ function seriesName(series, index3, evaluateRef) {
41600
42000
  const fromRef = resolveRef(series.nameRef, evaluateRef)?.map(toText2).filter((t) => t !== "").join(" ");
41601
42001
  return fromRef || series.name || `Series${index3 + 1}`;
41602
42002
  }
41603
- function seriesContext(chart, theme2, options) {
42003
+ function seriesContext(chart, theme2, options2) {
41604
42004
  const scheme = chartColorScheme(theme2);
41605
42005
  const resolver = { scheme: (name) => scheme[name] };
41606
42006
  return {
41607
42007
  theme: theme2,
41608
42008
  scheme,
41609
42009
  palette: chart.colorPalette === void 0 ? void 0 : findChartColorPalette(chart.colorPalette),
41610
- evaluateRef: options.evaluateRef ?? (() => []),
41611
- seriesColor: options.seriesColor,
42010
+ evaluateRef: options2.evaluateRef ?? (() => []),
42011
+ seriesColor: options2.seriesColor,
41612
42012
  drawingColor: (color) => color && drawingColorCss(resolveDrawingColor(color, resolver, { transformOrder: "document" })),
41613
42013
  gradient: (fill) => fill?.kind === "gradient" ? resolveChartGradient(
41614
42014
  fill,
@@ -41634,7 +42034,11 @@ function seriesView(ctx, s, index3, total2, categoriesOf) {
41634
42034
  })
41635
42035
  );
41636
42036
  if (Object.keys(points).length) view.pointGradients = points;
41637
- Object.assign(view, analysisView(s, color, ctx.drawingColor));
42037
+ Object.assign(
42038
+ view,
42039
+ analysisView(s, color, ctx.drawingColor),
42040
+ seriesMarkerViews(s, ctx.drawingColor)
42041
+ );
41638
42042
  return view;
41639
42043
  }
41640
42044
 
@@ -41940,14 +42344,14 @@ function scottBinCount(values2, min, max) {
41940
42344
  const width = 3.49 * sd * values2.length ** (-1 / 3);
41941
42345
  return Math.max(1, Math.ceil((max - min) / width));
41942
42346
  }
41943
- function computeHistogramBins(values2, options, format = String) {
41944
- const closed = options.intervalClosed ?? "l";
42347
+ function computeHistogramBins(values2, options2, format = String) {
42348
+ const closed = options2.intervalClosed ?? "l";
41945
42349
  const finite2 = values2.map((value2, sourceIndex) => ({ value: value2, sourceIndex })).filter((item) => Number.isFinite(item.value));
41946
42350
  if (finite2.length === 0) {
41947
42351
  return [];
41948
42352
  }
41949
- const underflow = typeof options.underflow === "number" ? options.underflow : void 0;
41950
- const overflow = typeof options.overflow === "number" ? options.overflow : void 0;
42353
+ const underflow = typeof options2.underflow === "number" ? options2.underflow : void 0;
42354
+ const overflow = typeof options2.overflow === "number" ? options2.overflow : void 0;
41951
42355
  const under = underflow === void 0 ? [] : finite2.filter(
41952
42356
  (item) => closed === "r" ? item.value <= underflow : item.value < underflow
41953
42357
  );
@@ -41964,8 +42368,8 @@ function computeHistogramBins(values2, options, format = String) {
41964
42368
  if (regular.length > 0) {
41965
42369
  const min = Math.min(...regular.map((item) => item.value));
41966
42370
  const max = Math.max(...regular.map((item) => item.value));
41967
- const requestedSize = options.binSize && options.binSize > 0 ? options.binSize : void 0;
41968
- const requestedCount = options.binCount && options.binCount > 0 ? options.binCount : void 0;
42371
+ const requestedSize = options2.binSize && options2.binSize > 0 ? options2.binSize : void 0;
42372
+ const requestedCount = options2.binCount && options2.binCount > 0 ? options2.binCount : void 0;
41969
42373
  const start = requestedSize ? Math.floor(min / requestedSize) * requestedSize : min;
41970
42374
  const count2 = requestedSize ? Math.max(
41971
42375
  closed === "l" ? Math.floor((max - start) / requestedSize) + 1 : Math.ceil((max - start) / requestedSize),
@@ -42016,9 +42420,9 @@ function aggregateByCategory(values2, rawCategories) {
42016
42420
  }
42017
42421
 
42018
42422
  // chart/waterfall.ts
42019
- function buildWaterfallSteps(values2, options) {
42423
+ function buildWaterfallSteps(values2, options2) {
42020
42424
  const subtotalIndices = new Set(
42021
- options?.subtotalIndices ?? (values2.length > 0 ? [values2.length - 1] : [])
42425
+ options2?.subtotalIndices ?? (values2.length > 0 ? [values2.length - 1] : [])
42022
42426
  );
42023
42427
  const steps = [];
42024
42428
  let runningTotal = 0;
@@ -42102,11 +42506,11 @@ function histogramView(chart, model) {
42102
42506
  const first2 = model.series[0];
42103
42507
  if (!first2) return;
42104
42508
  const raw2 = first2.values.map((v) => v ?? Number.NaN);
42105
- const options = chart.histogram ?? {};
42106
- const bins = options.aggregateByCategory ? aggregateByCategory(
42509
+ const options2 = chart.histogram ?? {};
42510
+ const bins = options2.aggregateByCategory ? aggregateByCategory(
42107
42511
  first2.values.map((v) => v ?? 0),
42108
42512
  model.categories
42109
- ) : computeHistogramBins(raw2, options, formatAxisValue);
42513
+ ) : computeHistogramBins(raw2, options2, formatAxisValue);
42110
42514
  model.categories = bins.map((bin) => bin.label);
42111
42515
  first2.values = bins.map((bin) => bin.value);
42112
42516
  model.barGapWidth = 0;
@@ -42130,11 +42534,11 @@ var SUPPORTED = /* @__PURE__ */ new Set([
42130
42534
  "treemap",
42131
42535
  "sunburst"
42132
42536
  ]);
42133
- function chartSummaryView(chart, theme2, options = {}) {
42537
+ function chartSummaryView(chart, theme2, options2 = {}) {
42134
42538
  const type = chart.chartType;
42135
42539
  const radial = type === "pie" || type === "doughnut";
42136
42540
  const byPoint = radial || type === "treemap" || type === "sunburst";
42137
- const ctx = seriesContext(chart, theme2, options);
42541
+ const ctx = seriesContext(chart, theme2, options2);
42138
42542
  const { palette, scheme, drawingColor } = ctx;
42139
42543
  const grouping = chart.grouping ?? (type === "bar" || type === "column" ? "clustered" : "standard");
42140
42544
  const rawCategories = [];
@@ -42220,6 +42624,7 @@ function chartSummaryView(chart, theme2, options = {}) {
42220
42624
  else if (!byPoint) model.valueAxis = valueAxis(model);
42221
42625
  applyDataLabels(model, chart.series, extra);
42222
42626
  chartExtraAxes(model);
42627
+ applyChartAxes(model, chart, ctx.drawingColor);
42223
42628
  return model;
42224
42629
  }
42225
42630
 
@@ -42251,18 +42656,18 @@ function chartSampleVariance(values2) {
42251
42656
  const mean2 = values2.reduce((sum3, value2) => sum3 + value2, 0) / count2;
42252
42657
  return values2.reduce((sum3, value2) => sum3 + (value2 - mean2) ** 2, 0) / Math.max(count2 - 1, 1);
42253
42658
  }
42254
- function chartErrorBarAmount(options, values2, displayIndex, sourceIndex, side) {
42255
- switch (options.valueType) {
42659
+ function chartErrorBarAmount(options2, values2, displayIndex, sourceIndex, side) {
42660
+ switch (options2.valueType) {
42256
42661
  case "fixedVal":
42257
- return options.value ?? 0;
42662
+ return options2.value ?? 0;
42258
42663
  case "percentage":
42259
- return Math.abs(values2[displayIndex] ?? 0) * ((options.value ?? 0) / 100);
42664
+ return Math.abs(values2[displayIndex] ?? 0) * ((options2.value ?? 0) / 100);
42260
42665
  case "stdDev":
42261
- return Math.sqrt(chartSampleVariance(values2)) * (options.value ?? 1);
42666
+ return Math.sqrt(chartSampleVariance(values2)) * (options2.value ?? 1);
42262
42667
  case "stdErr":
42263
42668
  return Math.sqrt(chartSampleVariance(values2) / Math.max(values2.length, 1));
42264
42669
  case "cust":
42265
- return side === "plus" ? options.customPlus?.[sourceIndex] ?? 0 : options.customMinus?.[sourceIndex] ?? 0;
42670
+ return side === "plus" ? options2.customPlus?.[sourceIndex] ?? 0 : options2.customMinus?.[sourceIndex] ?? 0;
42266
42671
  }
42267
42672
  }
42268
42673
 
@@ -42399,13 +42804,13 @@ var noFit = () => ({
42399
42804
  rSquared: 0,
42400
42805
  coefficients: []
42401
42806
  });
42402
- function fitModel(options, xVals, yVals) {
42807
+ function fitModel(options2, xVals, yVals) {
42403
42808
  const xs = [...xVals];
42404
42809
  const ys = [...yVals];
42405
- switch (options.kind) {
42810
+ switch (options2.kind) {
42406
42811
  case "linear": {
42407
42812
  const reg = computeLinearRegression(xs, ys);
42408
- const fixed2 = options.intercept;
42813
+ const fixed2 = options2.intercept;
42409
42814
  const slope = fixed2 !== void 0 ? ys.reduce((s, y, i2) => s + (y - fixed2) * xs[i2], 0) / xs.reduce((s, x) => s + x * x, 0) : reg.slope;
42410
42815
  const b = fixed2 ?? reg.intercept;
42411
42816
  return {
@@ -42455,7 +42860,7 @@ function fitModel(options, xVals, yVals) {
42455
42860
  };
42456
42861
  }
42457
42862
  case "polynomial": {
42458
- const order = Math.min(options.order ?? 2, 6);
42863
+ const order = Math.min(options2.order ?? 2, 6);
42459
42864
  const coeffs = fitPolynomial(xs, ys, order);
42460
42865
  const evaluate = (x) => coeffs.reduce((s, c2, i2) => s + c2 * x ** i2, 0);
42461
42866
  return {
@@ -42469,11 +42874,11 @@ function fitModel(options, xVals, yVals) {
42469
42874
  return void 0;
42470
42875
  }
42471
42876
  }
42472
- function fitChartTrendline(options, xVals, yVals) {
42877
+ function fitChartTrendline(options2, xVals, yVals) {
42473
42878
  const count2 = yVals.length;
42474
42879
  if (count2 < 2) return noFit();
42475
- if (options.kind === "movingAvg") {
42476
- const period = options.period ?? 2;
42880
+ if (options2.kind === "movingAvg") {
42881
+ const period = options2.period ?? 2;
42477
42882
  const points2 = [];
42478
42883
  for (let i2 = period - 1; i2 < count2; i2++) {
42479
42884
  let sum3 = 0;
@@ -42482,10 +42887,10 @@ function fitChartTrendline(options, xVals, yVals) {
42482
42887
  }
42483
42888
  return { points: points2, equation: `${period}-period moving average`, rSquared: 0, coefficients: [] };
42484
42889
  }
42485
- const model = fitModel(options, xVals, yVals);
42890
+ const model = fitModel(options2, xVals, yVals);
42486
42891
  if (!model) return noFit();
42487
- const startX = Math.min(...xVals) - (options.backward ?? 0);
42488
- const endX = Math.max(...xVals) + (options.forward ?? 0);
42892
+ const startX = Math.min(...xVals) - (options2.backward ?? 0);
42893
+ const endX = Math.max(...xVals) + (options2.forward ?? 0);
42489
42894
  const steps = Math.max(Math.ceil((endX - startX) * 4), 20);
42490
42895
  const points = [];
42491
42896
  for (let step2 = 0; step2 <= steps; step2++) {
@@ -42662,7 +43067,7 @@ function chartTextAttributes(model, part, fallbackSize = FONT_SIZE) {
42662
43067
  function chartStroke(model, part) {
42663
43068
  const entry3 = model.appearance?.[part];
42664
43069
  return {
42665
- color: entry3?.axisVisible === false ? "none" : entry3?.lineColor ?? (part === "gridlineMajor" ? GRID_COLOR : AXIS_COLOR),
43070
+ color: entry3?.axisVisible === false ? "none" : entry3?.lineColor ?? (part.startsWith("gridline") ? GRID_COLOR : AXIS_COLOR),
42666
43071
  width: entry3?.lineWidth === void 0 ? 1 : chartPointsToPixels(entry3.lineWidth)
42667
43072
  };
42668
43073
  }
@@ -42953,19 +43358,102 @@ function scatterAnalysis(model, px, py, out) {
42953
43358
  });
42954
43359
  }
42955
43360
 
43361
+ // chart/render/chart-svg-markers.ts
43362
+ function chartMarkerRadius(series, index3, defaultRadius = 3) {
43363
+ const marker3 = { ...series.marker, ...series.pointMarkers?.[index3] };
43364
+ if (marker3.symbol === "none") return 0;
43365
+ const radius = markerRadius(marker3.size, defaultRadius);
43366
+ return marker3.symbol === "dot" ? Math.max(radius * 0.6, 1) : radius;
43367
+ }
43368
+ function chartSeriesMarkerSvg(series, index3, cx2, cy, defaultRadius = 3) {
43369
+ const marker3 = { ...series.marker, ...series.pointMarkers?.[index3] };
43370
+ const primitive = buildMarkerPrimitive({
43371
+ ...marker3,
43372
+ symbol: marker3.symbol,
43373
+ size: marker3.size,
43374
+ cx: cx2,
43375
+ cy,
43376
+ fill: marker3.fill ?? series.pointColors?.[index3] ?? series.color,
43377
+ defaultRadius
43378
+ });
43379
+ if (!primitive) return "";
43380
+ let geometry;
43381
+ switch (primitive.kind) {
43382
+ case "circle":
43383
+ geometry = `cx="${n(primitive.cx)}" cy="${n(primitive.cy)}" r="${n(primitive.r)}"`;
43384
+ break;
43385
+ case "rect":
43386
+ geometry = `x="${n(primitive.x)}" y="${n(primitive.y)}" width="${n(primitive.w)}" height="${n(primitive.h)}"`;
43387
+ break;
43388
+ case "path":
43389
+ geometry = `d="${esc(primitive.d)}"`;
43390
+ break;
43391
+ case "polygon":
43392
+ geometry = `points="${esc(primitive.points)}"`;
43393
+ break;
43394
+ }
43395
+ const outline = primitive.stroke ? ` stroke="${esc(primitive.stroke)}" stroke-width="${n(primitive.strokeWidth ?? 1)}"` : "";
43396
+ const filter2 = series.shadowFilter ? ` filter="${esc(series.shadowFilter)}"` : "";
43397
+ return `<${primitive.kind} ${geometry} fill="${esc(primitive.fill)}"${outline}${filter2}/>`;
43398
+ }
43399
+
43400
+ // chart/line-dash.ts
43401
+ function chartLineDashArray(style2, width) {
43402
+ if (!style2 || style2 === "solid") {
43403
+ return void 0;
43404
+ }
43405
+ const unit = Math.max(width, 1);
43406
+ if (style2 === "dot" || style2 === "sysDot") {
43407
+ return `${unit} ${unit * 2}`;
43408
+ }
43409
+ if (style2 === "lgDash") {
43410
+ return `${unit * 6} ${unit * 3}`;
43411
+ }
43412
+ return `${unit * 3} ${unit * 2}`;
43413
+ }
43414
+
43415
+ // chart/render/chart-svg-axes.ts
43416
+ function axisTickText(value2, axis, percent2 = false) {
43417
+ return formatChartNumber(value2, axis?.source.numberFormat?.formatCode) ?? formatAxisValue(value2, percent2);
43418
+ }
43419
+ function axisLine(model, axis, part, x1, y1, x2, y2) {
43420
+ if (axis?.source.deleted) return "";
43421
+ return styledAxisLine(x1, y1, x2, y2, axis?.line, chartStroke(model, part));
43422
+ }
43423
+ function styledAxisLine(x1, y1, x2, y2, paint2, fallback) {
43424
+ const color = paint2?.color ?? fallback.color;
43425
+ const width = paint2?.width ?? fallback.width;
43426
+ if (color === "none" || width === 0) return "";
43427
+ const dash = chartLineDashArray(paint2?.dash, width);
43428
+ return line2(x1, y1, x2, y2, esc(color), width).replace(
43429
+ "/>",
43430
+ dash ? ` stroke-dasharray="${dash}"/>` : "/>"
43431
+ );
43432
+ }
43433
+ function axisGridlines(model, axis, ticks, position, plot2, vertical) {
43434
+ const draw2 = (values2, paint2, minor2) => {
43435
+ const fallback = chartStroke(model, minor2 ? "gridlineMinor" : "gridlineMajor");
43436
+ return values2.map((value2) => {
43437
+ const p = position(value2);
43438
+ return vertical ? styledAxisLine(p, plot2.y, p, plot2.y + plot2.h, paint2, fallback) : styledAxisLine(plot2.x, p, plot2.x + plot2.w, p, paint2, fallback);
43439
+ }).join("");
43440
+ };
43441
+ const major = !axis || axis.source.majorGridlines ? draw2(ticks, axis?.majorGrid, false) : "";
43442
+ const minor = axis?.source.minorGridlines ? draw2(axis.minorTicks, axis.minorGrid, true) : "";
43443
+ return major + minor;
43444
+ }
43445
+
42956
43446
  // chart/render/chart-svg-cartesian.ts
42957
43447
  function cartesianAxes(model, area, out) {
42958
43448
  const scale2 = model.valueAxis;
42959
43449
  if (!scale2) return void 0;
42960
- const labels = scale2.ticks.map((t) => formatAxisValue(t, scale2.percent));
43450
+ const labels = scale2.ticks.map((t) => axisTickText(t, model.axes?.value, scale2.percent));
42961
43451
  const valueAttrs = chartTextAttributes(model, "valueAxis");
42962
43452
  const categoryAttrs = chartTextAttributes(model, "categoryAxis");
42963
43453
  const valueSize = valueAttrs.size ?? 10;
42964
43454
  const categorySize = categoryAttrs.size ?? 10;
42965
- const grid = chartStroke(model, "gridlineMajor");
42966
- const axis = chartStroke(model, "categoryAxis");
42967
- const valueLabels = model.appearance?.valueAxis?.labelsVisible !== false;
42968
- const categoryLabels = model.appearance?.categoryAxis?.labelsVisible !== false;
43455
+ const valueLabels = chartAxisLabels(model.axes?.value) && model.appearance?.valueAxis?.labelsVisible !== false;
43456
+ const categoryLabels = chartAxisLabels(model.axes?.category) && model.appearance?.categoryAxis?.labelsVisible !== false;
42969
43457
  const labelW = valueLabels ? Math.max(...labels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
42970
43458
  const horizontal = model.horizontal;
42971
43459
  const cats = Math.max(1, model.categories.length);
@@ -42974,7 +43462,7 @@ function cartesianAxes(model, area, out) {
42974
43462
  Math.max(...model.categories.map((c2) => textWidth(c2, categorySize)), 8) + 6
42975
43463
  );
42976
43464
  const second = horizontal ? void 0 : model.secondaryAxis;
42977
- const secondLabels = second?.ticks.map((t) => formatAxisValue(t, second.percent)) ?? [];
43465
+ const secondLabels = second?.ticks.map((t) => axisTickText(t, model.axes?.secondary, second.percent)) ?? [];
42978
43466
  const secondW = second ? valueLabels ? Math.max(...secondLabels.map((l) => textWidth(l, valueSize)), 8) + 8 : 4 : 0;
42979
43467
  const plot2 = horizontal ? {
42980
43468
  x: area.x + catW,
@@ -42987,29 +43475,47 @@ function cartesianAxes(model, area, out) {
42987
43475
  w: Math.max(1, area.w - labelW - 4 - secondW),
42988
43476
  h: Math.max(1, area.h - Math.max(20, categorySize * 1.5))
42989
43477
  };
42990
- const span3 = scale2.max - scale2.min || 1;
42991
- const value2 = horizontal ? (v) => plot2.x + (v - scale2.min) / span3 * plot2.w : (v) => plot2.y + plot2.h - (v - scale2.min) / span3 * plot2.h;
43478
+ const value2 = horizontal ? (v) => plot2.x + chartAxisRatio(v, scale2, model.axes?.value) * plot2.w : (v) => plot2.y + plot2.h - chartAxisRatio(v, scale2, model.axes?.value) * plot2.h;
42992
43479
  const bandSize = (horizontal ? plot2.h : plot2.w) / cats;
42993
- const band = horizontal ? (i2) => plot2.y + plot2.h - bandSize * (i2 + 0.5) : (i2) => plot2.x + bandSize * (i2 + 0.5);
43480
+ const index3 = (i2) => model.axes?.category?.range.reverseOrder ? cats - 1 - i2 : i2;
43481
+ const band = horizontal ? (i2) => plot2.y + plot2.h - bandSize * (index3(i2) + 0.5) : (i2) => plot2.x + bandSize * (index3(i2) + 0.5);
42994
43482
  out.push(chartAreaRect(model, "plotArea", plot2));
43483
+ out.push(axisGridlines(model, model.axes?.value, scale2.ticks, value2, plot2, horizontal));
43484
+ if (model.axes?.category?.source.majorGridlines || model.axes?.category?.source.minorGridlines)
43485
+ out.push(
43486
+ axisGridlines(
43487
+ model,
43488
+ model.axes.category,
43489
+ model.categories.map((_, i2) => i2),
43490
+ band,
43491
+ plot2,
43492
+ !horizontal
43493
+ )
43494
+ );
42995
43495
  scale2.ticks.forEach((t, i2) => {
42996
43496
  const p = value2(t);
42997
43497
  const label2 = labels[i2] ?? "";
42998
43498
  if (horizontal) {
42999
- out.push(line2(p, plot2.y, p, plot2.y + plot2.h, grid.color, grid.width));
43000
43499
  if (valueLabels)
43001
43500
  out.push(
43002
43501
  text3(p, plot2.y + plot2.h + valueSize + 2, label2, { anchor: "middle", ...valueAttrs })
43003
43502
  );
43004
43503
  } else {
43005
- out.push(line2(plot2.x, p, plot2.x + plot2.w, p, grid.color, grid.width));
43006
43504
  if (valueLabels)
43007
43505
  out.push(text3(plot2.x - 4, p + valueSize * 0.3, label2, { anchor: "end", ...valueAttrs }));
43008
43506
  }
43009
43507
  });
43010
- const zero = value2(Math.min(Math.max(0, scale2.min), scale2.max));
43011
- if (horizontal) out.push(line2(zero, plot2.y, zero, plot2.y + plot2.h, axis.color, axis.width));
43012
- else out.push(line2(plot2.x, zero, plot2.x + plot2.w, zero, axis.color, axis.width));
43508
+ const source2 = model.axes?.value?.source;
43509
+ const crossing = source2?.crosses === "max" ? scale2.max : source2?.crosses === "min" ? scale2.min : source2?.crossesAt ?? 0;
43510
+ const zero = value2(Math.min(Math.max(crossing, scale2.min), scale2.max));
43511
+ if (horizontal)
43512
+ out.push(
43513
+ axisLine(model, model.axes?.category, "categoryAxis", zero, plot2.y, zero, plot2.y + plot2.h)
43514
+ );
43515
+ else
43516
+ out.push(
43517
+ axisLine(model, model.axes?.category, "categoryAxis", plot2.x, zero, plot2.x + plot2.w, zero)
43518
+ );
43013
43519
  const step2 = Math.max(
43014
43520
  1,
43015
43521
  Math.ceil(cats / Math.max(1, Math.floor((horizontal ? plot2.h : plot2.w) / 14)))
@@ -43034,20 +43540,23 @@ function cartesianAxes(model, area, out) {
43034
43540
  });
43035
43541
  const frame = { plot: plot2, value: value2, band, bandSize };
43036
43542
  if (second) {
43037
- const secondSpan = second.max - second.min || 1;
43038
- frame.secondary = (v) => plot2.y + plot2.h - (v - second.min) / secondSpan * plot2.h;
43039
- const secondAxis = chartStroke(model, "valueAxis");
43543
+ frame.secondary = (v) => plot2.y + plot2.h - chartAxisRatio(v, second, model.axes?.secondary) * plot2.h;
43040
43544
  out.push(
43041
- line2(
43545
+ axisLine(
43546
+ model,
43547
+ model.axes?.secondary,
43548
+ "valueAxis",
43042
43549
  plot2.x + plot2.w,
43043
43550
  plot2.y,
43044
43551
  plot2.x + plot2.w,
43045
- plot2.y + plot2.h,
43046
- secondAxis.color,
43047
- secondAxis.width
43552
+ plot2.y + plot2.h
43048
43553
  )
43049
43554
  );
43050
- if (valueLabels)
43555
+ if (model.axes?.secondary?.source.majorGridlines || model.axes?.secondary?.source.minorGridlines)
43556
+ out.push(
43557
+ axisGridlines(model, model.axes.secondary, second.ticks, frame.secondary, plot2, false)
43558
+ );
43559
+ if (chartAxisLabels(model.axes?.secondary))
43051
43560
  second.ticks.forEach(
43052
43561
  (t, i2) => out.push(
43053
43562
  text3(plot2.x + plot2.w + 4, frame.secondary(t) + valueSize * 0.3, secondLabels[i2] ?? "", {
@@ -43091,18 +43600,19 @@ function linesAndAreas(model, frame, out) {
43091
43600
  index: i2,
43092
43601
  x: frame.band(i2),
43093
43602
  y: frame.value(top),
43094
- radius: area ? 0 : 3
43603
+ radius: area ? 0 : chartMarkerRadius(s, i2, 2.5)
43095
43604
  });
43096
43605
  lower3.push([frame.band(i2), frame.value(below)]);
43097
43606
  });
43098
43607
  layers.push({
43608
+ series: s,
43099
43609
  points,
43100
43610
  lower: lower3,
43101
43611
  color: s.color,
43102
43612
  filter: s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""
43103
43613
  });
43104
43614
  });
43105
- for (const { points, lower: lower3, color, filter: filter2 } of area ? [...layers].reverse() : layers) {
43615
+ for (const { points, lower: lower3, color, filter: filter2, series } of area ? [...layers].reverse() : layers) {
43106
43616
  if (area) {
43107
43617
  const poly = [...points, ...[...lower3].reverse()].map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
43108
43618
  out.push(`<polygon points="${poly}" fill="${color}" fill-opacity="0.85"${filter2}/>`);
@@ -43121,20 +43631,20 @@ function linesAndAreas(model, frame, out) {
43121
43631
  else segment2.push(`${n(x)},${n(y)}`);
43122
43632
  }
43123
43633
  flush();
43124
- for (const [x, y] of points)
43125
- if (!Number.isNaN(x))
43126
- out.push(`<circle cx="${n(x)}" cy="${n(y)}" r="2.5" fill="${color}"${filter2}/>`);
43634
+ points.forEach(([x, y], index3) => {
43635
+ if (!Number.isNaN(x)) out.push(chartSeriesMarkerSvg(series, index3, x, y, 2.5));
43636
+ });
43127
43637
  }
43128
43638
  pointLabels(model, marks, out);
43129
43639
  }
43130
43640
 
43131
43641
  // chart/bubble-radius.ts
43132
- function computeBubbleRadius(sizeVal, maxBubble, medianRadius, options) {
43133
- const scale2 = (options?.bubbleScale ?? 100) / 100;
43642
+ function computeBubbleRadius(sizeVal, maxBubble, medianRadius, options2) {
43643
+ const scale2 = (options2?.bubbleScale ?? 100) / 100;
43134
43644
  if (sizeVal === void 0) return medianRadius * scale2;
43135
43645
  const denom = maxBubble > 0 ? maxBubble : 1;
43136
43646
  const magnitude = Math.abs(sizeVal);
43137
- const ratio = (options?.sizeRepresents ?? "w") === "area" ? Math.sqrt(magnitude) / Math.sqrt(denom) : magnitude / denom;
43647
+ const ratio = (options2?.sizeRepresents ?? "w") === "area" ? Math.sqrt(magnitude) / Math.sqrt(denom) : magnitude / denom;
43138
43648
  return medianRadius * scale2 * 0.5 + ratio * medianRadius * scale2 * 1.5;
43139
43649
  }
43140
43650
  function maxBubbleSize(sizes) {
@@ -43149,16 +43659,14 @@ function scatter(model, area, out) {
43149
43659
  const ys = model.valueAxis;
43150
43660
  const xs = model.xAxis;
43151
43661
  if (!ys || !xs) return;
43152
- const yLabels = ys.ticks.map((t) => formatAxisValue(t));
43662
+ const yLabels = ys.ticks.map((t) => axisTickText(t, model.axes?.value));
43153
43663
  const valueAttrs = chartTextAttributes(model, "valueAxis");
43154
43664
  const categoryAttrs = chartTextAttributes(model, "categoryAxis");
43155
43665
  const valueSize = valueAttrs.size ?? 10;
43156
43666
  const categorySize = categoryAttrs.size ?? 10;
43157
- const grid = chartStroke(model, "gridlineMajor");
43158
43667
  const xAxis = chartStroke(model, "categoryAxis");
43159
- const yAxis = chartStroke(model, "valueAxis");
43160
- const valueLabels = model.appearance?.valueAxis?.labelsVisible !== false;
43161
- const categoryLabels = model.appearance?.categoryAxis?.labelsVisible !== false;
43668
+ const valueLabels = chartAxisLabels(model.axes?.value) && model.appearance?.valueAxis?.labelsVisible !== false;
43669
+ const categoryLabels = chartAxisLabels(model.axes?.category) && model.appearance?.categoryAxis?.labelsVisible !== false;
43162
43670
  const labelW = valueLabels ? Math.max(...yLabels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
43163
43671
  const plot2 = {
43164
43672
  x: area.x + labelW,
@@ -43178,17 +43686,24 @@ function scatter(model, area, out) {
43178
43686
  s.values.forEach((_, i2) => {
43179
43687
  reach = Math.max(reach, radiusOf(s.sizes?.[i2] ?? void 0) ?? 0);
43180
43688
  });
43181
- const widen = (s, length) => {
43689
+ const widen = (s, length, axis) => {
43690
+ if (axis?.range.logScale) return s;
43182
43691
  const pad7 = reach * (s.max - s.min || 1) / Math.max(1, length - 2 * reach);
43183
- return { ...s, min: s.min - pad7, max: s.max + pad7 };
43692
+ return {
43693
+ ...s,
43694
+ min: axis?.source.scaling.min === void 0 ? s.min - pad7 : s.min,
43695
+ max: axis?.source.scaling.max === void 0 ? s.max + pad7 : s.max
43696
+ };
43184
43697
  };
43185
- const xView = widen(xs, plot2.w);
43186
- const yView = widen(ys, plot2.h);
43187
- const px = (v) => plot2.x + (v - xView.min) / (xView.max - xView.min || 1) * plot2.w;
43188
- const py = (v) => plot2.y + plot2.h - (v - yView.min) / (yView.max - yView.min || 1) * plot2.h;
43698
+ const xView = widen(xs, plot2.w, model.axes?.category);
43699
+ const yView = widen(ys, plot2.h, model.axes?.value);
43700
+ const px = (v) => plot2.x + chartAxisRatio(v, xView, model.axes?.category) * plot2.w;
43701
+ const py = (v) => plot2.y + plot2.h - chartAxisRatio(v, yView, model.axes?.value) * plot2.h;
43189
43702
  out.push(chartAreaRect(model, "plotArea", plot2));
43703
+ out.push(axisGridlines(model, model.axes?.value, ys.ticks, py, plot2, false));
43704
+ if (model.axes?.category)
43705
+ out.push(axisGridlines(model, model.axes.category, xs.ticks, px, plot2, true));
43190
43706
  ys.ticks.forEach((t, i2) => {
43191
- out.push(line2(plot2.x, py(t), plot2.x + plot2.w, py(t), grid.color, grid.width));
43192
43707
  if (valueLabels)
43193
43708
  out.push(
43194
43709
  text3(plot2.x - 4, py(t) + valueSize * 0.3, yLabels[i2] ?? "", {
@@ -43198,19 +43713,30 @@ function scatter(model, area, out) {
43198
43713
  );
43199
43714
  });
43200
43715
  for (const t of xs.ticks) {
43201
- out.push(line2(px(t), plot2.y + plot2.h, px(t), plot2.y + plot2.h + 3, xAxis.color, xAxis.width));
43716
+ if (!model.axes?.category?.source.deleted)
43717
+ out.push(line2(px(t), plot2.y + plot2.h, px(t), plot2.y + plot2.h + 3, xAxis.color, xAxis.width));
43202
43718
  if (categoryLabels)
43203
43719
  out.push(
43204
- text3(px(t), plot2.y + plot2.h + categorySize + 3, formatAxisValue(t), {
43720
+ text3(px(t), plot2.y + plot2.h + categorySize + 3, axisTickText(t, model.axes?.category), {
43205
43721
  anchor: "middle",
43206
43722
  ...categoryAttrs
43207
43723
  })
43208
43724
  );
43209
43725
  }
43210
43726
  out.push(
43211
- line2(plot2.x, plot2.y + plot2.h, plot2.x + plot2.w, plot2.y + plot2.h, xAxis.color, xAxis.width)
43727
+ axisLine(
43728
+ model,
43729
+ model.axes?.category,
43730
+ "categoryAxis",
43731
+ plot2.x,
43732
+ plot2.y + plot2.h,
43733
+ plot2.x + plot2.w,
43734
+ plot2.y + plot2.h
43735
+ )
43736
+ );
43737
+ out.push(
43738
+ axisLine(model, model.axes?.value, "valueAxis", plot2.x, plot2.y, plot2.x, plot2.y + plot2.h)
43212
43739
  );
43213
- out.push(line2(plot2.x, plot2.y, plot2.x, plot2.y + plot2.h, yAxis.color, yAxis.width));
43214
43740
  const marks = [];
43215
43741
  for (const [si, s] of model.series.entries())
43216
43742
  s.values.forEach((v, i2) => {
@@ -43219,8 +43745,8 @@ function scatter(model, area, out) {
43219
43745
  const filter2 = s.shadowFilter ? ` filter="${s.shadowFilter}"` : "";
43220
43746
  const fill = s.pointColors?.[i2] ?? s.color;
43221
43747
  if (!bubble) {
43222
- out.push(`<circle cx="${n(px(x))}" cy="${n(py(v))}" r="3" fill="${fill}"${filter2}/>`);
43223
- marks.push({ series: s, index: i2, x: px(x), y: py(v), radius: 3 });
43748
+ out.push(chartSeriesMarkerSvg(s, i2, px(x), py(v)));
43749
+ marks.push({ series: s, index: i2, x: px(x), y: py(v), radius: chartMarkerRadius(s, i2) });
43224
43750
  return;
43225
43751
  }
43226
43752
  const r = radiusOf(s.sizes?.[i2] ?? void 0);
@@ -43440,32 +43966,37 @@ function radarSvg(model, area) {
43440
43966
  const valueSize = valueAttrs.size ?? 9;
43441
43967
  const categorySize = categoryAttrs.size ?? 10;
43442
43968
  const grid = chartStroke(model, "gridlineMajor");
43443
- const axis = chartStroke(model, "categoryAxis");
43444
43969
  const cx2 = area.x + area.w / 2;
43445
43970
  const cy = area.y + area.h / 2 + 4;
43446
43971
  const radius = Math.max(1, Math.min(area.w, area.h) / 2 - Math.max(18, categorySize * 1.8));
43447
43972
  const angle = (i2) => i2 / count2 * Math.PI * 2;
43448
- const r = (v) => (v - scale2.min) / (scale2.max - scale2.min || 1) * radius;
43973
+ const r = (v) => chartAxisRatio(v, scale2, model.axes?.value) * radius;
43449
43974
  const labelEvery = Math.max(
43450
43975
  1,
43451
43976
  Math.ceil(12 / Math.max(1, radius / Math.max(1, scale2.ticks.length - 1)))
43452
43977
  );
43453
43978
  for (const [k, t] of scale2.ticks.entries()) {
43454
43979
  const ring = Array.from({ length: count2 }, (_, i2) => polar2(cx2, cy, r(t), angle(i2))).map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
43455
- out.push(
43456
- `<polygon points="${ring}" fill="none" stroke="${grid.color}" stroke-width="${n(grid.width)}"/>`
43457
- );
43458
- if (model.appearance?.valueAxis?.labelsVisible !== false && k % labelEvery === 0)
43980
+ if (!model.axes?.value || model.axes.value.source.majorGridlines)
43459
43981
  out.push(
43460
- text3(cx2 + 3, cy - r(t) + valueSize * 0.3, formatAxisValue(t, scale2.percent), valueAttrs)
43982
+ `<polygon points="${ring}" fill="none" stroke="${grid.color}" stroke-width="${n(grid.width)}"/>`
43983
+ );
43984
+ if (chartAxisLabels(model.axes?.value) && model.appearance?.valueAxis?.labelsVisible !== false && k % labelEvery === 0)
43985
+ out.push(
43986
+ text3(
43987
+ cx2 + 3,
43988
+ cy - r(t) + valueSize * 0.3,
43989
+ axisTickText(t, model.axes?.value, scale2.percent),
43990
+ valueAttrs
43991
+ )
43461
43992
  );
43462
43993
  }
43463
43994
  model.categories.forEach((c2, i2) => {
43464
43995
  const [x, y] = polar2(cx2, cy, radius, angle(i2));
43465
- out.push(line2(cx2, cy, x, y, axis.color, axis.width));
43996
+ out.push(axisLine(model, model.axes?.category, "categoryAxis", cx2, cy, x, y));
43466
43997
  const [lx, ly] = polar2(cx2, cy, radius + 10, angle(i2));
43467
43998
  const anchor = Math.abs(lx - cx2) < 2 ? "middle" : lx > cx2 ? "start" : "end";
43468
- if (model.appearance?.categoryAxis?.labelsVisible !== false)
43999
+ if (chartAxisLabels(model.axes?.category) && model.appearance?.categoryAxis?.labelsVisible !== false)
43469
44000
  out.push(
43470
44001
  text3(lx, ly + categorySize * 0.3, fit(c2, area.w / 4, categorySize), {
43471
44002
  anchor,
@@ -43476,7 +44007,13 @@ function radarSvg(model, area) {
43476
44007
  const marks = [];
43477
44008
  for (const s of model.series) {
43478
44009
  const vertices = s.values.slice(0, count2).map((v, i2) => polar2(cx2, cy, r(v ?? scale2.min), angle(i2)));
43479
- vertices.forEach(([x, y], i2) => marks.push({ series: s, index: i2, x, y, radius: 3 }));
44010
+ vertices.forEach(([x, y], i2) => {
44011
+ if (s.values[i2] === null) return;
44012
+ const markerSeries = s;
44013
+ if (markerSeries.marker || markerSeries.pointMarkers)
44014
+ out.push(chartSeriesMarkerSvg(s, i2, x, y));
44015
+ marks.push({ series: s, index: i2, x, y, radius: chartMarkerRadius(s, i2) });
44016
+ });
43480
44017
  const points = vertices.map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
43481
44018
  out.push(
43482
44019
  `<polygon points="${points}" fill="none" stroke="${s.color}" stroke-width="2"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
@@ -43666,33 +44203,33 @@ var CHART_FONT_FAMILY = "Calibri, Carlito, Arial, sans-serif";
43666
44203
  function cssFont(attrs2) {
43667
44204
  return `${attrs2.italic ? "italic" : "normal"} ${attrs2.weight ?? "normal"} ${attrs2.size ?? 10}px ${attrs2.family ?? CHART_FONT_FAMILY}`;
43668
44205
  }
43669
- function chartFontMetrics(attrs2, options) {
43670
- const metrics = options.measureFont?.(cssFont(attrs2));
44206
+ function chartFontMetrics(attrs2, options2) {
44207
+ const metrics = options2.measureFont?.(cssFont(attrs2));
43671
44208
  return metrics && Number.isFinite(metrics.ascent) && Number.isFinite(metrics.descent) && metrics.ascent >= 0 && metrics.descent >= 0 && metrics.ascent + metrics.descent > 0 ? metrics : void 0;
43672
44209
  }
43673
- function chartTextWidth(content2, attrs2, options) {
43674
- const width = options.measureText?.(content2, cssFont(attrs2));
44210
+ function chartTextWidth(content2, attrs2, options2) {
44211
+ const width = options2.measureText?.(content2, cssFont(attrs2));
43675
44212
  return width !== void 0 && Number.isFinite(width) && width >= 0 ? width : textWidth(content2, attrs2.size);
43676
44213
  }
43677
- function fitChartText(content2, maxWidth, attrs2, options) {
43678
- if (!options.measureText) return fit(content2, maxWidth, attrs2.size);
43679
- if (chartTextWidth(content2, attrs2, options) <= maxWidth) return content2;
44214
+ function fitChartText(content2, maxWidth, attrs2, options2) {
44215
+ if (!options2.measureText) return fit(content2, maxWidth, attrs2.size);
44216
+ if (chartTextWidth(content2, attrs2, options2) <= maxWidth) return content2;
43680
44217
  const points = [...content2];
43681
44218
  let low = 0;
43682
44219
  let high = points.length;
43683
44220
  while (low < high) {
43684
44221
  const mid = Math.ceil((low + high) / 2);
43685
- if (chartTextWidth(`${points.slice(0, mid).join("")}\u2026`, attrs2, options) <= maxWidth) low = mid;
44222
+ if (chartTextWidth(`${points.slice(0, mid).join("")}\u2026`, attrs2, options2) <= maxWidth) low = mid;
43686
44223
  else high = mid - 1;
43687
44224
  }
43688
44225
  return `${points.slice(0, low).join("")}\u2026`;
43689
44226
  }
43690
44227
 
43691
44228
  // chart/render/chart-svg-legend.ts
43692
- function chartLegendSvg(model, area, frame, options) {
44229
+ function chartLegendSvg(model, area, frame, options2) {
43693
44230
  const automatic = [];
43694
44231
  const bounds = {};
43695
- const reserved = automaticLegend(model, area, automatic, options, bounds);
44232
+ const reserved = automaticLegend(model, area, automatic, options2, bounds);
43696
44233
  const plot2 = model.legendOverlay ? area : reserved;
43697
44234
  const box2 = bounds.box;
43698
44235
  if (!box2) return { plot: plot2, markup: "", foreground: false };
@@ -43706,11 +44243,11 @@ function chartLegendSvg(model, area, frame, options) {
43706
44243
  const entries = legendEntries(model);
43707
44244
  const attrs2 = chartTextAttributes(model, "legend");
43708
44245
  const size = attrs2.size ?? 10;
43709
- const font = chartFontMetrics(attrs2, options);
44246
+ const font = chartFontMetrics(attrs2, options2);
43710
44247
  const keySize = size / 2;
43711
44248
  const keyGap = size / 4;
43712
44249
  const widths = entries.map(
43713
- (entry3) => chartTextWidth(entry3.label, attrs2, options) + keySize + keyGap
44250
+ (entry3) => chartTextWidth(entry3.label, attrs2, options2) + keySize + keyGap
43714
44251
  );
43715
44252
  const horizontal = manual.width > manual.height && widths.reduce((sum3, width) => sum3 + width, 0) + size <= manual.width;
43716
44253
  const rowWidth = horizontal ? manual.width / entries.length : manual.width;
@@ -43725,8 +44262,8 @@ function chartLegendSvg(model, area, frame, options) {
43725
44262
  ];
43726
44263
  const baselineOffset = font ? (font.ascent - font.descent) / 2 : size * 0.35;
43727
44264
  entries.forEach((entry3, i2) => {
43728
- const available = horizontal ? chartTextWidth(entry3.label, attrs2, options) : Math.max(0, rowWidth - size / 2 - keySize - keyGap);
43729
- const label2 = fitChartText(entry3.label, available, attrs2, options);
44265
+ const available = horizontal ? chartTextWidth(entry3.label, attrs2, options2) : Math.max(0, rowWidth - size / 2 - keySize - keyGap);
44266
+ const label2 = fitChartText(entry3.label, available, attrs2, options2);
43730
44267
  const contentWidth = Math.min(
43731
44268
  horizontal ? widths[i2] ?? 0 : Math.max(...widths),
43732
44269
  rowWidth - size / 2
@@ -43769,7 +44306,7 @@ function legendEntries(model) {
43769
44306
  color: s.color
43770
44307
  }));
43771
44308
  }
43772
- function automaticLegend(model, area, out, options, bounds) {
44309
+ function automaticLegend(model, area, out, options2, bounds) {
43773
44310
  const entries = legendEntries(model);
43774
44311
  if (!model.showLegend || entries.length === 0) return area;
43775
44312
  const pos = model.legendPosition;
@@ -43778,7 +44315,7 @@ function automaticLegend(model, area, out, options, bounds) {
43778
44315
  const rowH = Math.max(16, size * 1.4);
43779
44316
  if (pos === "t" || pos === "b") {
43780
44317
  const widths = entries.map(
43781
- (e) => Math.min(chartTextWidth(e.label, attrs2, options) + 20, area.w / 2)
44318
+ (e) => Math.min(chartTextWidth(e.label, attrs2, options2) + 20, area.w / 2)
43782
44319
  );
43783
44320
  const total2 = widths.reduce((a2, b) => a2 + b, 0);
43784
44321
  let x2 = area.x + Math.max(0, (area.w - total2) / 2);
@@ -43795,14 +44332,14 @@ function automaticLegend(model, area, out, options, bounds) {
43795
44332
  entries.forEach((e, i2) => {
43796
44333
  const w = widths[i2] ?? 0;
43797
44334
  out.push(rect(x2, y, 8, 8, e.color));
43798
- out.push(text3(x2 + 12, y + 8, fitChartText(e.label, w - 16, attrs2, options), attrs2));
44335
+ out.push(text3(x2 + 12, y + 8, fitChartText(e.label, w - 16, attrs2, options2), attrs2));
43799
44336
  x2 += w;
43800
44337
  });
43801
44338
  return pos === "t" ? { x: area.x, y: area.y + rowH + 4, w: area.w, h: area.h - rowH - 4 } : { x: area.x, y: area.y, w: area.w, h: area.h - rowH - 4 };
43802
44339
  }
43803
44340
  const width = Math.min(
43804
44341
  area.w * 0.35,
43805
- Math.max(...entries.map((e) => chartTextWidth(e.label, attrs2, options))) + 22
44342
+ Math.max(...entries.map((e) => chartTextWidth(e.label, attrs2, options2))) + 22
43806
44343
  );
43807
44344
  const height = entries.length * rowH;
43808
44345
  const x = pos === "l" ? area.x + 4 : area.x + area.w - width;
@@ -43820,14 +44357,14 @@ function automaticLegend(model, area, out, options, bounds) {
43820
44357
  const y = y0 + i2 * rowH;
43821
44358
  if (y + rowH > area.y + area.h + 2) return;
43822
44359
  out.push(rect(x, y + 3, 8, 8, e.color));
43823
- out.push(text3(x + 12, y + 11, fitChartText(e.label, width - 16, attrs2, options), attrs2));
44360
+ out.push(text3(x + 12, y + 11, fitChartText(e.label, width - 16, attrs2, options2), attrs2));
43824
44361
  });
43825
44362
  return pos === "l" ? { x: area.x + width + 8, y: area.y, w: area.w - width - 8, h: area.h } : { x: area.x, y: area.y, w: area.w - width - 8, h: area.h };
43826
44363
  }
43827
44364
 
43828
44365
  // text/wrap-styled-runs.ts
43829
44366
  var graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
43830
- function wrapStyledRuns(runs, maxWidth, measure2, options = {}) {
44367
+ function wrapStyledRuns(runs, maxWidth, measure2, options2 = {}) {
43831
44368
  const groups = [];
43832
44369
  for (const [source2, run2] of runs.entries()) {
43833
44370
  for (const token of run2.text.split(/(\r\n|[\r\n]|[ \t]+)/u).filter(Boolean)) {
@@ -43875,7 +44412,7 @@ function wrapStyledRuns(runs, maxWidth, measure2, options = {}) {
43875
44412
  if (line3.length && width(merged(line3, [...separator, ...group2.pieces])) > maxWidth) flush();
43876
44413
  else line3 = merged(line3, separator);
43877
44414
  spaces = [];
43878
- if (options.breakWords && wordWidth > maxWidth) {
44415
+ if (options2.breakWords && wordWidth > maxWidth) {
43879
44416
  for (const piece of group2.pieces) {
43880
44417
  for (const { segment: segment2 } of graphemes.segment(piece.text)) {
43881
44418
  const next = { ...piece, text: segment2 };
@@ -43893,11 +44430,11 @@ function wrapStyledRuns(runs, maxWidth, measure2, options = {}) {
43893
44430
  function spacing2(value2, naturalHeight, fallback) {
43894
44431
  return value2 ? value2.unit === "points" ? chartPointsToPixels(value2.value) : naturalHeight * value2.value : fallback;
43895
44432
  }
43896
- function chartRichTitleSvg(model, width, options = {}, frameHeight = 400) {
44433
+ function chartRichTitleSvg(model, width, options2 = {}, frameHeight = 400) {
43897
44434
  if (!model.title) return void 0;
43898
44435
  const base = chartTextAttributes(model, "title", 14);
43899
44436
  const capacity = Math.max(1, width * 0.8 - 8);
43900
- if (!model.titleText && !hasManualLayoutFields(model.titleLayout) && !model.titleOverlay && !model.title.includes("\n") && chartTextWidth(model.title, base, options) <= capacity)
44437
+ if (!model.titleText && !hasManualLayoutFields(model.titleLayout) && !model.titleOverlay && !model.title.includes("\n") && chartTextWidth(model.title, base, options2) <= capacity)
43901
44438
  return void 0;
43902
44439
  const paragraphs = model.titleText?.paragraphs ?? [
43903
44440
  {
@@ -43933,7 +44470,7 @@ function chartRichTitleSvg(model, width, options = {}, frameHeight = 400) {
43933
44470
  "title",
43934
44471
  base.size
43935
44472
  ),
43936
- options
44473
+ options2
43937
44474
  ),
43938
44475
  { breakWords: true }
43939
44476
  );
@@ -43957,10 +44494,10 @@ function chartRichTitleSvg(model, width, options = {}, frameHeight = 400) {
43957
44494
  return {
43958
44495
  ...line3,
43959
44496
  runs,
43960
- width: runs.reduce((sum3, run2) => sum3 + chartTextWidth(run2.text, run2.attrs, options), 0),
44497
+ width: runs.reduce((sum3, run2) => sum3 + chartTextWidth(run2.text, run2.attrs, options2), 0),
43961
44498
  size: runs.length ? Math.max(...runs.map((run2) => run2.attrs.size ?? 14)) : base.size ?? 14,
43962
44499
  fontMetrics: (runs.length ? runs.map((run2) => run2.attrs) : [base]).map(
43963
- (attrs2) => chartFontMetrics(attrs2, options)
44500
+ (attrs2) => chartFontMetrics(attrs2, options2)
43964
44501
  )
43965
44502
  };
43966
44503
  });
@@ -43998,7 +44535,7 @@ function chartRichTitleSvg(model, width, options = {}, frameHeight = 400) {
43998
44535
  anchor: "start"
43999
44536
  }).replace("<text ", '<tspan data-chart-title-run="true" ').replace("</text>", "</tspan>")
44000
44537
  );
44001
- x += chartTextWidth(run2.text, run2.attrs, options);
44538
+ x += chartTextWidth(run2.text, run2.attrs, options2);
44002
44539
  }
44003
44540
  }
44004
44541
  const parent = text3(0, 0, "", { ...base, underline: false }).replace(
@@ -44024,7 +44561,7 @@ function chartRichTitleSvg(model, width, options = {}, frameHeight = 400) {
44024
44561
  }
44025
44562
 
44026
44563
  // chart/render/chart-svg.ts
44027
- function renderChartSvg(model, width, height, options = {}) {
44564
+ function renderChartSvg(model, width, height, options2 = {}) {
44028
44565
  const paint2 = chartGradientPaint(model, Math.max(1, width), Math.max(1, height));
44029
44566
  model = paint2.model;
44030
44567
  const w = Math.max(1, width);
@@ -44038,7 +44575,7 @@ function renderChartSvg(model, width, height, options = {}) {
44038
44575
  if (paint2.defs) out.push(paint2.defs);
44039
44576
  out.push(chartAreaRect(model, "chartArea", { x: 0, y: 0, w, h: h2 }));
44040
44577
  let area = { x: 8, y: 8, w: w - 16, h: h2 - 16 };
44041
- const richTitle = chartRichTitleSvg(model, w, options, h2);
44578
+ const richTitle = chartRichTitleSvg(model, w, options2, h2);
44042
44579
  if (richTitle) {
44043
44580
  if (model.titleLayout || model.titleOverlay) foregroundTitle = richTitle.markup;
44044
44581
  else out.push(richTitle.markup);
@@ -44047,9 +44584,9 @@ function renderChartSvg(model, width, height, options = {}) {
44047
44584
  } else if (model.title) {
44048
44585
  const attrs2 = chartTextAttributes(model, "title", 14);
44049
44586
  const size = attrs2.size ?? 14;
44050
- const label2 = fitChartText(model.title, w - 16, attrs2, options);
44051
- const titleWidth = Math.min(w - 16, chartTextWidth(label2, attrs2, options) + 8);
44052
- const font = chartFontMetrics(attrs2, options);
44587
+ const label2 = fitChartText(model.title, w - 16, attrs2, options2);
44588
+ const titleWidth = Math.min(w - 16, chartTextWidth(label2, attrs2, options2) + 8);
44589
+ const font = chartFontMetrics(attrs2, options2);
44053
44590
  const titleHeight = Math.max(24, font ? font.ascent + font.descent + 4 : size * 1.4 + 4);
44054
44591
  out.push(
44055
44592
  chartAreaRect(model, "title", {
@@ -44077,7 +44614,7 @@ function renderChartSvg(model, width, height, options = {}) {
44077
44614
  out.push("</svg>");
44078
44615
  return out.join("");
44079
44616
  }
44080
- const legend = chartLegendSvg(model, area, { width: w, height: h2 }, options);
44617
+ const legend = chartLegendSvg(model, area, { width: w, height: h2 }, options2);
44081
44618
  area = legend.plot;
44082
44619
  if (!legend.foreground) out.push(legend.markup);
44083
44620
  if (area.w > 4 && area.h > 4) {
@@ -44133,11 +44670,11 @@ function readRange(workbook, sheetIndex2, range) {
44133
44670
  for (let c2 = range.start.col; c2 <= end.col; c2++) out.push(getValue(sheet, r, c2));
44134
44671
  return out;
44135
44672
  }
44136
- function createRefEvaluator(workbook, calc, options = {}) {
44673
+ function createRefEvaluator(workbook, calc, options2 = {}) {
44137
44674
  return (ref) => {
44138
44675
  const text4 = ref.trim().replace(/^=/, "");
44139
44676
  if (!text4) return [];
44140
- const sheetIndex2 = options.sheet ?? workbook.activeSheet;
44677
+ const sheetIndex2 = options2.sheet ?? workbook.activeSheet;
44141
44678
  const plain3 = plainReference(workbook, text4, sheetIndex2);
44142
44679
  if (plain3) return readRange(workbook, plain3.sheet, plain3.range);
44143
44680
  const named2 = /^_xlchart\./i.test(text4) ? workbook.definedNames.find(