ooxml-ui 1.34.0 → 1.35.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 (111) hide show
  1. package/dist/{chunk-6TS7ASDJ.js → chunk-C4KI635Q.js} +2 -17
  2. package/dist/chunk-D5IRYZLP.js +19 -0
  3. package/dist/{chunk-CALEXPBD.js → chunk-GZNBWWJ5.js} +840 -51
  4. package/dist/{chunk-SWDVBUBW.js → chunk-TGG36HHF.js} +2 -2
  5. package/dist/docx/print-picture.d.ts +4 -0
  6. package/dist/docx.js +46 -7
  7. package/dist/fonts/catalog.d.ts +0 -1
  8. package/dist/image-native-size.d.ts +43 -0
  9. package/dist/image-native-size.d.ts.map +1 -0
  10. package/dist/index.js +3 -3
  11. package/dist/picture-artistic-filters.d.ts +9 -0
  12. package/dist/picture-artistic-filters.d.ts.map +1 -0
  13. package/dist/picture-artistic-preview.d.ts +3 -0
  14. package/dist/picture-artistic-preview.d.ts.map +1 -0
  15. package/dist/picture-effects.d.ts +3 -1
  16. package/dist/picture-effects.d.ts.map +1 -0
  17. package/dist/picture-paint.d.ts +23 -0
  18. package/dist/picture-paint.d.ts.map +1 -0
  19. package/dist/picture-pixels.d.ts +11 -0
  20. package/dist/picture-pixels.d.ts.map +1 -0
  21. package/dist/picture-standard-filter.d.ts +6 -0
  22. package/dist/picture-standard-filter.d.ts.map +1 -0
  23. package/dist/picture-view.d.ts +10 -0
  24. package/dist/picture-view.d.ts.map +1 -0
  25. package/dist/pptx/{chart-3d-view-scene-HNL4NWJT.mjs → chart-3d-view-scene-BKNMGRGO.mjs} +3 -25
  26. package/dist/pptx/{chart-3d-view-scene-OPVBTZL5.cjs → chart-3d-view-scene-V55XPBBF.cjs} +39 -61
  27. package/dist/pptx/{chunk-7DT3UJQB.mjs → chunk-5EERUTDC.mjs} +7 -3
  28. package/dist/pptx/{chunk-S3L5NNCK.cjs → chunk-FROIGMTI.cjs} +1 -1
  29. package/dist/pptx/{chunk-ZS5EVODY.cjs → chunk-GKQULDFF.cjs} +52 -48
  30. package/dist/pptx/{chunk-CH4Z6H6C.mjs → chunk-GPQP2R5Y.mjs} +1017 -371
  31. package/dist/pptx/{chunk-S5I64Y55.cjs → chunk-HIRBPTML.cjs} +12 -12
  32. package/dist/pptx/{chunk-D4LJJ7Z7.cjs → chunk-KJICUZXM.cjs} +171 -540
  33. package/dist/pptx/{chunk-TDIJHLS5.cjs → chunk-NPYNJOK2.cjs} +1351 -699
  34. package/dist/pptx/{chunk-RZVEPTLN.mjs → chunk-QK6LJT3K.mjs} +140 -529
  35. package/dist/pptx/{chunk-LCCRLB7Q.mjs → chunk-UHDWWRTX.mjs} +1 -1
  36. package/dist/pptx/{chunk-SPOECCPV.mjs → chunk-WZHYA2B3.mjs} +1 -1
  37. package/dist/pptx/dom/elements/smartart.d.ts.map +1 -1
  38. package/dist/pptx/dom/index.cjs +424 -424
  39. package/dist/pptx/dom/index.mjs +8 -8
  40. package/dist/pptx/export/html2canvas-clone.cjs +6 -6
  41. package/dist/pptx/export/html2canvas-clone.mjs +1 -1
  42. package/dist/pptx/index.cjs +3356 -3352
  43. package/dist/pptx/index.mjs +4 -4
  44. package/dist/pptx/render/chart-3d-projection.d.ts +5 -54
  45. package/dist/pptx/render/chart-3d-projection.d.ts.map +1 -1
  46. package/dist/pptx/render/chart-3d-shading.d.ts +7 -10
  47. package/dist/pptx/render/chart-3d-shading.d.ts.map +1 -1
  48. package/dist/pptx/render/chart-combo-stock.cjs +3 -3
  49. package/dist/pptx/render/chart-combo-stock.mjs +1 -1
  50. package/dist/pptx/render/chart-funnel-sunburst.d.ts +1 -1
  51. package/dist/pptx/render/chart-funnel-sunburst.d.ts.map +1 -1
  52. package/dist/pptx/render/chart-map-projection.d.ts +2 -37
  53. package/dist/pptx/render/chart-map-projection.d.ts.map +1 -1
  54. package/dist/pptx/render/chart-overlays.cjs +7 -7
  55. package/dist/pptx/render/chart-overlays.mjs +1 -1
  56. package/dist/pptx/render/chart-region-map-alias.d.ts +1 -11
  57. package/dist/pptx/render/chart-region-map-alias.d.ts.map +1 -1
  58. package/dist/pptx/render/chart-region-map-colors.d.ts +1 -3
  59. package/dist/pptx/render/chart-region-map-colors.d.ts.map +1 -1
  60. package/dist/pptx/render/chart-region-map-data.d.ts +2 -44
  61. package/dist/pptx/render/chart-region-map-data.d.ts.map +1 -1
  62. package/dist/pptx/render/chart-region-map-view.d.ts.map +1 -1
  63. package/dist/pptx/render/chart-surface-treemap.cjs +4 -4
  64. package/dist/pptx/render/chart-surface-treemap.mjs +1 -1
  65. package/dist/pptx/render/chart-view-model-types.d.ts +2 -0
  66. package/dist/pptx/render/chart-view-model-types.d.ts.map +1 -1
  67. package/dist/pptx/render/chart-view-model.cjs +44 -44
  68. package/dist/pptx/render/chart-view-model.mjs +1 -1
  69. package/dist/pptx/render/chart-waterfall-map.cjs +6 -6
  70. package/dist/pptx/render/chart-waterfall-map.mjs +1 -1
  71. package/dist/pptx/render/editor-key-target.d.ts.map +1 -1
  72. package/dist/pptx/render/image-effect-filter-values.d.ts +1 -10
  73. package/dist/pptx/render/image-effect-filter-values.d.ts.map +1 -1
  74. package/dist/pptx/render/image-effects.d.ts +1 -0
  75. package/dist/pptx/render/image-effects.d.ts.map +1 -1
  76. package/dist/pptx/render/image-native-size.d.ts +1 -42
  77. package/dist/pptx/render/image-native-size.d.ts.map +1 -1
  78. package/dist/pptx/render/image-tiling.d.ts.map +1 -1
  79. package/dist/pptx/render/index.d.ts +1 -1
  80. package/dist/pptx/render/index.d.ts.map +1 -1
  81. package/dist/pptx/render/render-cache.d.ts +1 -3
  82. package/dist/pptx/render/render-cache.d.ts.map +1 -1
  83. package/dist/pptx/render/smartart-drawing.d.ts +3 -0
  84. package/dist/pptx/render/smartart-drawing.d.ts.map +1 -1
  85. package/dist/pptx/render/smartart-picture-image.d.ts +9 -0
  86. package/dist/pptx/render/smartart-picture-image.d.ts.map +1 -0
  87. package/dist/pptx/render/smartart-reflow-to-shapes.d.ts.map +1 -1
  88. package/dist/pptx/{smartart-insert-preview-RQUFRLSV.mjs → smartart-insert-preview-6BITTUI4.mjs} +5 -5
  89. package/dist/pptx/{smartart-insert-preview-YKNB37GE.cjs → smartart-insert-preview-BUOS5XQR.cjs} +6 -6
  90. package/dist/render-cache.d.ts +4 -0
  91. package/dist/render-cache.d.ts.map +1 -0
  92. package/dist/smartart/smartart-paint.d.ts +2 -1
  93. package/dist/smartart/smartart-picture.d.ts +4 -3
  94. package/dist/smartart.d.ts +3 -0
  95. package/dist/smartart.js +1 -1
  96. package/dist/teams.js +1 -1
  97. package/dist/theme-bridge.d.ts +0 -1
  98. package/dist/visio/viewer-chart-editor.d.ts +2 -1
  99. package/dist/visio.js +43 -11
  100. package/dist/xlsx/dialogs/custom-autofilter.d.ts +12 -0
  101. package/dist/xlsx/dialogs/filter-dates.d.ts +4 -0
  102. package/dist/xlsx/dialogs/help-dialogs.d.ts +2 -2
  103. package/dist/xlsx/dialogs/text-to-columns.d.ts +0 -7
  104. package/dist/xlsx/dialogs/top10-filter.d.ts +5 -0
  105. package/dist/xlsx/grid/filter-buttons.d.ts +11 -0
  106. package/dist/xlsx/grid/filter-menu.d.ts +10 -0
  107. package/dist/xlsx/grid/filter-presets.d.ts +19 -0
  108. package/dist/xlsx/grid/styles.d.ts +1 -1
  109. package/dist/xlsx.js +874 -168
  110. package/package.json +2 -2
  111. /package/dist/{chunk-3AOIYE3R.js → chunk-FFM3WVLU.js} +0 -0
@@ -5,6 +5,8 @@ import { colorWithOpacity, clampUnitInterval, normalizeHexColor, hexToRgbChannel
5
5
  export { clampUnitInterval, colorWithOpacity, hexToRgbChannels, normalizeHexColor } from 'ooxml-core/color';
6
6
  import { buildRectPathGradientImage } from 'ooxml-core/diagram';
7
7
  export { buildRectPathGradientImage, buildRectPathGradientSvg } from 'ooxml-core/diagram';
8
+ import { regionMapGeometry, buildRegionMapEntries, resolveValueColorStops, buildValueColorScale, sequentialColorScale, regionViewBounds, normalizeValue, scalePathD, regionBounds, shouldRenderRegionLabel, resolveRegionCode } from 'ooxml-core/chart/region-map';
9
+ export { buildRegionMapEntries, formatRegionMapValue, normalizeValue, resolveRegionCode, resolveRegionEntityCode, sequentialColorScale, shouldRenderRegionLabel } from 'ooxml-core/chart/region-map';
8
10
 
9
11
  // src/pptx/render/chart-font.ts
10
12
  var CHART_PX_PER_PT = 4 / 3;
@@ -2775,15 +2777,8 @@ function build3DSurfacePanels(prims, surfaces, depth) {
2775
2777
  return [backWall, floor, sideWall].filter((p) => p !== void 0);
2776
2778
  }
2777
2779
 
2778
- // src/pptx/render/render-cache.ts
2780
+ // src/render-cache.ts
2779
2781
  var RENDER_CACHE_MAX_BYTES = 8 * 1024 * 1024;
2780
- var epoch = 0;
2781
- function getPptxRenderCacheEpoch() {
2782
- return epoch;
2783
- }
2784
- function invalidatePptxRenderCacheEpoch() {
2785
- epoch++;
2786
- }
2787
2782
  function setBoundedRenderCache(cache, key, value, maxEntries) {
2788
2783
  const bytesOf = (entryKey, entryValue) => (entryKey.length + (typeof entryValue === "string" ? entryValue.length : 0)) * 2;
2789
2784
  cache.delete(key);
@@ -2799,6 +2794,15 @@ function setBoundedRenderCache(cache, key, value, maxEntries) {
2799
2794
  }
2800
2795
  }
2801
2796
 
2797
+ // src/pptx/render/render-cache.ts
2798
+ var epoch = 0;
2799
+ function getPptxRenderCacheEpoch() {
2800
+ return epoch;
2801
+ }
2802
+ function invalidatePptxRenderCacheEpoch() {
2803
+ epoch++;
2804
+ }
2805
+
2802
2806
  // src/pptx/render/chart-bar3d-face-picture-sample.ts
2803
2807
  var CACHE_MAX = 128;
2804
2808
  var cacheEpoch = 0;
@@ -3978,7 +3982,7 @@ function groupedLabels(values) {
3978
3982
  });
3979
3983
  return groups;
3980
3984
  }
3981
- function buildMultiLevelCategoryLabels(categoryLabels, categoryLevels, sourceIndices2, layout, spacing, axis, labelY, labelsAbove, offset) {
3985
+ function buildMultiLevelCategoryLabels(categoryLabels, categoryLevels, sourceIndices, layout, spacing, axis, labelY, labelsAbove, offset) {
3982
3986
  const sourceLevels = categoryLevels?.length ? categoryLevels : [categoryLabels];
3983
3987
  const levels = axis?.noMultiLevelLabels ? sourceLevels.slice(0, 1) : sourceLevels;
3984
3988
  const skip = Math.max(1, axis?.tickLabelSkip ?? 1);
@@ -3988,13 +3992,13 @@ function buildMultiLevelCategoryLabels(categoryLabels, categoryLevels, sourceInd
3988
3992
  const bandHeight = Math.max(fontPx, 8) + 4;
3989
3993
  const baselineShift = labelsAbove ? -0.2 * fontPx : 0.8 * fontPx;
3990
3994
  return levels.flatMap((level, levelIndex) => {
3991
- const values = sourceIndices2.map((sourceIndex) => level[sourceIndex] ?? "");
3995
+ const values = sourceIndices.map((sourceIndex) => level[sourceIndex] ?? "");
3992
3996
  return groupedLabels(values).flatMap((group) => {
3993
3997
  if (!group.text || group.start % skip !== 0) {
3994
3998
  return [];
3995
3999
  }
3996
- const startX = categoryX(group.start, sourceIndices2.length, layout, spacing);
3997
- const endX = categoryX(group.end, sourceIndices2.length, layout, spacing);
4000
+ const startX = categoryX(group.start, sourceIndices.length, layout, spacing);
4001
+ const endX = categoryX(group.end, sourceIndices.length, layout, spacing);
3998
4002
  return [
3999
4003
  {
4000
4004
  kind: "text",
@@ -4069,16 +4073,16 @@ function buildTickMarks(axis, sourceCount, layout, spacing, axisY) {
4069
4073
  }
4070
4074
  function buildCategoryAxisPlan(categoryLabels, layout, spacing, axes, selectedAxis, axisY, categoryLevels) {
4071
4075
  const axis = selectedAxis ?? primaryCategoryAxis(axes);
4072
- const sourceIndices2 = categoryLabels.map((_label, index) => index);
4076
+ const sourceIndices = categoryLabels.map((_label, index) => index);
4073
4077
  if (axis?.orientation === "maxMin") {
4074
- sourceIndices2.reverse();
4078
+ sourceIndices.reverse();
4075
4079
  }
4076
4080
  if (axis?.deleted || axis?.tickLblPos === "none") {
4077
4081
  return {
4078
4082
  axis,
4079
- sourceIndices: sourceIndices2,
4083
+ sourceIndices,
4080
4084
  labels: [],
4081
- tickMarks: buildTickMarks(axis, sourceIndices2.length, layout, spacing, axisY)
4085
+ tickMarks: buildTickMarks(axis, sourceIndices.length, layout, spacing, axisY)
4082
4086
  };
4083
4087
  }
4084
4088
  const topAxis = axis?.axPos === "t";
@@ -4090,7 +4094,7 @@ function buildCategoryAxisPlan(categoryLabels, layout, spacing, axes, selectedAx
4090
4094
  const labels = buildMultiLevelCategoryLabels(
4091
4095
  categoryLabels,
4092
4096
  categoryLevels,
4093
- sourceIndices2,
4097
+ sourceIndices,
4094
4098
  layout,
4095
4099
  spacing,
4096
4100
  axis,
@@ -4100,28 +4104,28 @@ function buildCategoryAxisPlan(categoryLabels, layout, spacing, axes, selectedAx
4100
4104
  );
4101
4105
  return {
4102
4106
  axis,
4103
- sourceIndices: sourceIndices2,
4107
+ sourceIndices,
4104
4108
  labels,
4105
- tickMarks: buildTickMarks(axis, sourceIndices2.length, layout, spacing, axisY)
4109
+ tickMarks: buildTickMarks(axis, sourceIndices.length, layout, spacing, axisY)
4106
4110
  };
4107
4111
  }
4108
- function chartDataInCategoryOrder(chartData, sourceIndices2) {
4109
- if (sourceIndices2.every((sourceIndex, displayIndex) => sourceIndex === displayIndex)) {
4112
+ function chartDataInCategoryOrder(chartData, sourceIndices) {
4113
+ if (sourceIndices.every((sourceIndex, displayIndex) => sourceIndex === displayIndex)) {
4110
4114
  return chartData;
4111
4115
  }
4112
4116
  return {
4113
4117
  ...chartData,
4114
- categories: sourceIndices2.map((sourceIndex) => chartData.categories[sourceIndex] ?? ""),
4118
+ categories: sourceIndices.map((sourceIndex) => chartData.categories[sourceIndex] ?? ""),
4115
4119
  categoryLevels: chartData.categoryLevels?.map(
4116
- (level) => sourceIndices2.map((sourceIndex) => level[sourceIndex] ?? "")
4120
+ (level) => sourceIndices.map((sourceIndex) => level[sourceIndex] ?? "")
4117
4121
  ),
4118
4122
  series: chartData.series.map((series) => ({
4119
4123
  ...series,
4120
- values: sourceIndices2.map((sourceIndex) => series.values[sourceIndex] ?? 0),
4124
+ values: sourceIndices.map((sourceIndex) => series.values[sourceIndex] ?? 0),
4121
4125
  errBars: series.errBars?.map((errorBars) => ({
4122
4126
  ...errorBars,
4123
- customPlus: errorBars.customPlus ? sourceIndices2.map((sourceIndex) => errorBars.customPlus?.[sourceIndex] ?? 0) : void 0,
4124
- customMinus: errorBars.customMinus ? sourceIndices2.map((sourceIndex) => errorBars.customMinus?.[sourceIndex] ?? 0) : void 0
4127
+ customPlus: errorBars.customPlus ? sourceIndices.map((sourceIndex) => errorBars.customPlus?.[sourceIndex] ?? 0) : void 0,
4128
+ customMinus: errorBars.customMinus ? sourceIndices.map((sourceIndex) => errorBars.customMinus?.[sourceIndex] ?? 0) : void 0
4125
4129
  }))
4126
4130
  }))
4127
4131
  };
@@ -4437,9 +4441,9 @@ function clippedSeriesLine(points, smooth, style, band2) {
4437
4441
  }
4438
4442
 
4439
4443
  // src/pptx/render/chart-cartesian-area.ts
4440
- function buildAreas(chartData, catCount, layout, range, sourceIndices2, xPositions, stacking = "clustered") {
4444
+ function buildAreas(chartData, catCount, layout, range, sourceIndices, xPositions, stacking = "clustered") {
4441
4445
  const primitives = [], dataLabels = [], labelBoxes = [], showLabels = chartData.style?.hasDataLabels, isStackedMode = stacking !== "clustered", isPercent = stacking === "percentStacked", baselineY = valueToY2(0, range, layout.plotTop, layout.plotBottom), band2 = plotBand(layout), allDisplayValues = chartData.series.map(
4442
- (series) => series.values.length === 0 ? void 0 : sourceIndices2.map((sourceIndex) => series.values[sourceIndex] ?? 0)
4446
+ (series) => series.values.length === 0 ? void 0 : sourceIndices.map((sourceIndex) => series.values[sourceIndex] ?? 0)
4443
4447
  ), stackedPlots = isStackedMode ? computeStackedSeriesPlots(
4444
4448
  allDisplayValues.map((values) => values ?? []),
4445
4449
  catCount,
@@ -4480,7 +4484,7 @@ function buildAreas(chartData, catCount, layout, range, sourceIndices2, xPositio
4480
4484
  if (!insideBand(pt, band2)) {
4481
4485
  return;
4482
4486
  }
4483
- const idx = sourceIndices2[displayIndex] ?? displayIndex, part = { role: "dataPoint", seriesIndex: si, pointIndex: idx };
4487
+ const idx = sourceIndices[displayIndex] ?? displayIndex, part = { role: "dataPoint", seriesIndex: si, pointIndex: idx };
4484
4488
  pushMarker(
4485
4489
  primitives,
4486
4490
  series,
@@ -4532,13 +4536,13 @@ function buildAreas(chartData, catCount, layout, range, sourceIndices2, xPositio
4532
4536
  resolveDataLabelTextStyle(
4533
4537
  chartData,
4534
4538
  series,
4535
- sourceIndices2[displayIndex] ?? displayIndex
4539
+ sourceIndices[displayIndex] ?? displayIndex
4536
4540
  )
4537
4541
  )
4538
4542
  });
4539
4543
  return;
4540
4544
  }
4541
- const pointIndex = sourceIndices2[displayIndex] ?? displayIndex, label = buildDataLabelText({ chartData, series, pointIndex, value: val });
4545
+ const pointIndex = sourceIndices[displayIndex] ?? displayIndex, label = buildDataLabelText({ chartData, series, pointIndex, value: val });
4542
4546
  if (label === void 0) {
4543
4547
  return;
4544
4548
  }
@@ -4903,16 +4907,16 @@ function categoryTotals(series, catCount) {
4903
4907
  (_, ci) => series.reduce((sum, s) => sum + Math.abs(s.values[ci] ?? 0), 0)
4904
4908
  );
4905
4909
  }
4906
- function buildPercentStackedBars(chartData, catCount, layout, primaryRange, sourceIndices2, invertNegativeFill2) {
4910
+ function buildPercentStackedBars(chartData, catCount, layout, primaryRange, sourceIndices, invertNegativeFill2) {
4907
4911
  const primitives = [], dataLabels = [], series = chartData.series, palette = chartData.colorPalette, showLabels = chartData.style?.hasDataLabels, barGroupWidth = layout.plotWidth / Math.max(catCount, 1), barW = stackedBarWidth(barGroupWidth, chartData.barGapWidth), barOffset = (barGroupWidth - barW) / 2, displaySeries = series.map((entry) => ({
4908
4912
  ...entry,
4909
- values: sourceIndices2.map((sourceIndex) => entry.values[sourceIndex] ?? 0)
4913
+ values: sourceIndices.map((sourceIndex) => entry.values[sourceIndex] ?? 0)
4910
4914
  })), totals = categoryTotals(displaySeries, catCount);
4911
4915
  for (let ci = 0; ci < catCount; ci++) {
4912
4916
  let posRunning = 0, negRunning = 0;
4913
4917
  const catTotal = totals[ci] || 1;
4914
4918
  for (let si = 0; si < series.length; si++) {
4915
- const sourceIndex = sourceIndices2[ci] ?? ci, rawVal = series[si].values[sourceIndex] ?? 0, val = catTotal > 0 ? rawVal / catTotal * 100 : 0, base = val < 0 ? negRunning : posRunning;
4919
+ const sourceIndex = sourceIndices[ci] ?? ci, rawVal = series[si].values[sourceIndex] ?? 0, val = catTotal > 0 ? rawVal / catTotal * 100 : 0, base = val < 0 ? negRunning : posRunning;
4916
4920
  if (val < 0) {
4917
4921
  negRunning += val;
4918
4922
  } else {
@@ -4957,13 +4961,13 @@ function buildPercentStackedBars(chartData, catCount, layout, primaryRange, sour
4957
4961
  }
4958
4962
 
4959
4963
  // src/pptx/render/chart-cartesian-stacked-labels.ts
4960
- function pushStackedBarLabels(chartData, series, sourceIndices2, rects, layout, dataLabels) {
4964
+ function pushStackedBarLabels(chartData, series, sourceIndices, rects, layout, dataLabels) {
4961
4965
  for (const rect of rects) {
4962
4966
  const entry = rect.seriesIndex === void 0 ? void 0 : series[rect.seriesIndex];
4963
4967
  if (!entry || rect.pointIndex === void 0) {
4964
4968
  continue;
4965
4969
  }
4966
- const sourceIndex = sourceIndices2[rect.pointIndex] ?? rect.pointIndex, val = entry.values[sourceIndex] ?? 0, label = buildDataLabelText({ chartData, series: entry, pointIndex: sourceIndex, value: val });
4970
+ const sourceIndex = sourceIndices[rect.pointIndex] ?? rect.pointIndex, val = entry.values[sourceIndex] ?? 0, label = buildDataLabelText({ chartData, series: entry, pointIndex: sourceIndex, value: val });
4967
4971
  if (label === void 0) {
4968
4972
  continue;
4969
4973
  }
@@ -5007,7 +5011,7 @@ function invertNegativeFill(series, pointIndex, value, baseFill) {
5007
5011
  const point = series.dataPoints?.find((p) => p.idx === pointIndex), invert = point?.invertIfNegative ?? series.invertIfNegative ?? false;
5008
5012
  return invert ? blendToWhite(baseFill) : baseFill;
5009
5013
  }
5010
- function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, secondaryIdx, grouping, sourceIndices2) {
5014
+ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, secondaryIdx, grouping, sourceIndices) {
5011
5015
  const primitives = [], dataLabels = [], labelBoxes = [], series = chartData.series, palette = chartData.colorPalette, showLabels = chartData.style?.hasDataLabels, varyColorsSingle = chartData.varyColors === true && series.length === 1;
5012
5016
  if (grouping === "clustered") {
5013
5017
  const barGroupWidth = layout.plotWidth / Math.max(catCount, 1), split = secondaryRange !== void 0 && secondaryIdx.size > 0 && secondaryIdx.size < series.length, groups = split ? [
@@ -5022,7 +5026,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
5022
5026
  const order = groups.flat();
5023
5027
  const geometryOf = (si) => geometry[split && secondaryIdx.has(si) ? 1 : 0];
5024
5028
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
5025
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex;
5029
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex;
5026
5030
  for (const si of order) {
5027
5031
  const { singleBarWidth, step, groupOffset } = geometryOf(si);
5028
5032
  const val = series[si].values[sourceIndex] ?? 0, x = layout.plotLeft + barGroupWidth * displayIndex + groupOffset + step * (slots.get(si) ?? si), activeRange = secondaryIdx.has(si) && secondaryRange ? secondaryRange : primaryRange, zeroY = valueToY2(0, activeRange, layout.plotTop, layout.plotBottom), valY = valueToY2(val, activeRange, layout.plotTop, layout.plotBottom), y = Math.min(zeroY, valY), h = Math.max(Math.abs(zeroY - valY), 1), baseFill = varyColorsSingle ? resolveVaryColorFill(series[si], sourceIndex, paletteColor2(sourceIndex, palette)) : resolveDataPointFill(series[si], sourceIndex, paletteColor2(si, palette)) ?? seriesColor2(series[si], si, palette);
@@ -5098,7 +5102,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
5098
5102
  if (grouping === "stacked") {
5099
5103
  const displaySeries = series.map((entry) => ({
5100
5104
  ...entry,
5101
- values: sourceIndices2.map((sourceIndex) => entry.values[sourceIndex] ?? 0)
5105
+ values: sourceIndices.map((sourceIndex) => entry.values[sourceIndex] ?? 0)
5102
5106
  })), rects = computeStackedBarRects(
5103
5107
  displaySeries,
5104
5108
  catCount,
@@ -5110,7 +5114,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
5110
5114
  for (const r of rects) {
5111
5115
  let fill = r.fill, part, title;
5112
5116
  if (r.seriesIndex !== void 0 && r.pointIndex !== void 0) {
5113
- const sourcePointIndex = sourceIndices2[r.pointIndex] ?? r.pointIndex;
5117
+ const sourcePointIndex = sourceIndices[r.pointIndex] ?? r.pointIndex;
5114
5118
  fill = resolveDataPointFill(series[r.seriesIndex], sourcePointIndex, r.fill) ?? r.fill;
5115
5119
  const value = series[r.seriesIndex].values[sourcePointIndex] ?? 0;
5116
5120
  fill = invertNegativeFill(series[r.seriesIndex], sourcePointIndex, value, fill);
@@ -5125,7 +5129,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
5125
5129
  primitives.push({ kind: "rect", x: r.x, y: r.y, w: r.w, h: r.h, fill, rx: 1, part, title });
5126
5130
  }
5127
5131
  if (showLabels) {
5128
- pushStackedBarLabels(chartData, series, sourceIndices2, rects, layout, dataLabels);
5132
+ pushStackedBarLabels(chartData, series, sourceIndices, rects, layout, dataLabels);
5129
5133
  }
5130
5134
  return { primitives, dataLabels };
5131
5135
  }
@@ -5134,7 +5138,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
5134
5138
  catCount,
5135
5139
  layout,
5136
5140
  primaryRange,
5137
- sourceIndices2,
5141
+ sourceIndices,
5138
5142
  invertNegativeFill
5139
5143
  );
5140
5144
  }
@@ -5212,12 +5216,12 @@ function seriesLineStroke(chartData, series) {
5212
5216
  }
5213
5217
 
5214
5218
  // src/pptx/render/chart-cartesian-line-area.ts
5215
- function buildLines(chartData, catCount, layout, primaryRange, secondaryRange, secondaryIdx, sourceIndices2, xPositions, stacking = "clustered") {
5219
+ function buildLines(chartData, catCount, layout, primaryRange, secondaryRange, secondaryIdx, sourceIndices, xPositions, stacking = "clustered") {
5216
5220
  const primitives = [], dataLabels = [], labelBoxes = [], showLabels = chartData.style?.hasDataLabels, isStackedMode = stacking !== "clustered", isPercent = stacking === "percentStacked", band2 = plotBand(layout), resolved = chartData.series.map((series) => {
5217
5221
  if (series.values.length === 0) {
5218
5222
  return void 0;
5219
5223
  }
5220
- const rawValues = sourceIndices2.map((sourceIndex) => series.values[sourceIndex] ?? 0), displayBlanks = sourceIndices2.map((sourceIndex) => series.blanks?.[sourceIndex] ?? false), { values: displayValues, visible } = resolveBlankDisplay(
5224
+ const rawValues = sourceIndices.map((sourceIndex) => series.values[sourceIndex] ?? 0), displayBlanks = sourceIndices.map((sourceIndex) => series.blanks?.[sourceIndex] ?? false), { values: displayValues, visible } = resolveBlankDisplay(
5221
5225
  rawValues,
5222
5226
  displayBlanks,
5223
5227
  chartData.chartChrome?.dispBlanksAs
@@ -5254,7 +5258,7 @@ function buildLines(chartData, catCount, layout, primaryRange, secondaryRange, s
5254
5258
  if (!visible[displayIndex] || !insideBand(pt, band2)) {
5255
5259
  return;
5256
5260
  }
5257
- const idx = sourceIndices2[displayIndex] ?? displayIndex, part = { role: "dataPoint", seriesIndex: si, pointIndex: idx };
5261
+ const idx = sourceIndices[displayIndex] ?? displayIndex, part = { role: "dataPoint", seriesIndex: si, pointIndex: idx };
5258
5262
  pushMarker(
5259
5263
  primitives,
5260
5264
  series,
@@ -5296,13 +5300,13 @@ function buildLines(chartData, catCount, layout, primaryRange, secondaryRange, s
5296
5300
  resolveDataLabelTextStyle(
5297
5301
  chartData,
5298
5302
  series,
5299
- sourceIndices2[displayIndex] ?? displayIndex
5303
+ sourceIndices[displayIndex] ?? displayIndex
5300
5304
  )
5301
5305
  )
5302
5306
  });
5303
5307
  return;
5304
5308
  }
5305
- const pointIndex = sourceIndices2[displayIndex] ?? displayIndex, label = buildDataLabelText({ chartData, series, pointIndex, value: val });
5309
+ const pointIndex = sourceIndices[displayIndex] ?? displayIndex, label = buildDataLabelText({ chartData, series, pointIndex, value: val });
5306
5310
  if (label === void 0) {
5307
5311
  return;
5308
5312
  }
@@ -5618,7 +5622,7 @@ function buildDateAxisPlan(chartData, layout, selectedAxis, axisY) {
5618
5622
  if (axis.orientation === "maxMin") {
5619
5623
  visible.reverse();
5620
5624
  }
5621
- const sourceIndices2 = visible.map(({ index }) => index);
5625
+ const sourceIndices = visible.map(({ index }) => index);
5622
5626
  const xPositions = visible.map(({ value }) => {
5623
5627
  const x = serialToX(value, min, max, layout);
5624
5628
  return axis.orientation === "maxMin" ? layout.plotLeft + layout.plotWidth - (x - layout.plotLeft) : x;
@@ -5700,7 +5704,7 @@ function buildDateAxisPlan(chartData, layout, selectedAxis, axisY) {
5700
5704
  }
5701
5705
  }
5702
5706
  }
5703
- return { sourceIndices: sourceIndices2, xPositions, labels, tickMarks };
5707
+ return { sourceIndices, xPositions, labels, tickMarks };
5704
5708
  }
5705
5709
 
5706
5710
  // src/pptx/render/chart-horizontal-axis.ts
@@ -5745,10 +5749,10 @@ function buildCartesianHorizontalAxis(chartData, categoryLabels, layout, kind, p
5745
5749
  rangeAndY(secondaryAxis),
5746
5750
  chartData.categoryLevels
5747
5751
  ) : void 0;
5748
- const sourceIndices2 = datePlan?.sourceIndices ?? categoryPlan?.sourceIndices ?? categoryLabels.map((_label, index) => index);
5752
+ const sourceIndices = datePlan?.sourceIndices ?? categoryPlan?.sourceIndices ?? categoryLabels.map((_label, index) => index);
5749
5753
  return {
5750
5754
  catAxisStyle,
5751
- sourceIndices: sourceIndices2,
5755
+ sourceIndices,
5752
5756
  xPositions: datePlan?.xPositions ?? categoryPlan?.sourceIndices.map(
5753
5757
  (_sourceIndex, displayIndex) => categoryX(displayIndex, categoryPlan.sourceIndices.length, layout, catAxisStyle)
5754
5758
  ),
@@ -5760,7 +5764,7 @@ function buildCartesianHorizontalAxis(chartData, categoryLabels, layout, kind, p
5760
5764
  ...datePlan?.tickMarks ?? categoryPlan?.tickMarks ?? [],
5761
5765
  ...secondaryPlan?.tickMarks ?? []
5762
5766
  ],
5763
- displayChartData: datePlan || categoryPlan ? chartDataInCategoryOrder(chartData, sourceIndices2) : chartData
5767
+ displayChartData: datePlan || categoryPlan ? chartDataInCategoryOrder(chartData, sourceIndices) : chartData
5764
5768
  };
5765
5769
  }
5766
5770
 
@@ -6154,7 +6158,7 @@ function buildCartesianViewModel(element, chartData, categoryLabels, kind) {
6154
6158
  primaryRange,
6155
6159
  secondaryRange
6156
6160
  );
6157
- const { catAxisStyle, sourceIndices: sourceIndices2, displayChartData } = horizontalAxis;
6161
+ const { catAxisStyle, sourceIndices, displayChartData } = horizontalAxis;
6158
6162
  const legendPos = chartData.style?.legendPosition ?? "b";
6159
6163
  const { legend, legendX, legendY, legendAnchor } = buildLegend(
6160
6164
  chartData.series,
@@ -6175,7 +6179,7 @@ function buildCartesianViewModel(element, chartData, categoryLabels, kind) {
6175
6179
  secondaryRange,
6176
6180
  secondaryIdx,
6177
6181
  isStacked ? isPercent ? "percentStacked" : "stacked" : "clustered",
6178
- sourceIndices2
6182
+ sourceIndices
6179
6183
  );
6180
6184
  } else if (kind === "line") {
6181
6185
  plot = buildLines(
@@ -6185,7 +6189,7 @@ function buildCartesianViewModel(element, chartData, categoryLabels, kind) {
6185
6189
  primaryRange,
6186
6190
  secondaryRange,
6187
6191
  secondaryIdx,
6188
- sourceIndices2,
6192
+ sourceIndices,
6189
6193
  horizontalAxis.xPositions,
6190
6194
  isStacked ? isPercent ? "percentStacked" : "stacked" : "clustered"
6191
6195
  );
@@ -6195,7 +6199,7 @@ function buildCartesianViewModel(element, chartData, categoryLabels, kind) {
6195
6199
  catCount,
6196
6200
  layout,
6197
6201
  primaryRange,
6198
- sourceIndices2,
6202
+ sourceIndices,
6199
6203
  horizontalAxis.xPositions,
6200
6204
  isStacked ? isPercent ? "percentStacked" : "stacked" : "clustered"
6201
6205
  );
@@ -6299,7 +6303,7 @@ function buildStockCloseLabel(chartData, closeSeries, sourceIndex, close, x, clo
6299
6303
  }
6300
6304
 
6301
6305
  // src/pptx/render/chart-stock-candles.ts
6302
- function computeStockCandlePrimitives(seriesSet, chartData, layout, range, catCount, sourceIndices2, xPositions) {
6306
+ function computeStockCandlePrimitives(seriesSet, chartData, layout, range, catCount, sourceIndices, xPositions) {
6303
6307
  const { open, high, low, close, closeIndex } = seriesSet;
6304
6308
  const primitives = [];
6305
6309
  const barGroupWidth = layout.plotWidth / Math.max(catCount, 1);
@@ -6313,7 +6317,7 @@ function computeStockCandlePrimitives(seriesSet, chartData, layout, range, catCo
6313
6317
  );
6314
6318
  const upDownBars = chartData.upDownBars;
6315
6319
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
6316
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex;
6320
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex;
6317
6321
  const candle = stockCandle({
6318
6322
  x: xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2,
6319
6323
  band: barGroupWidth,
@@ -6364,7 +6368,7 @@ function computeStockCandlePrimitives(seriesSet, chartData, layout, range, catCo
6364
6368
  function findComboStockSeries(series) {
6365
6369
  return series.map((s, index) => ({ series: s, index })).filter((entry) => entry.series.seriesChartType === "stock");
6366
6370
  }
6367
- function computeComboStockOverlay(stockEntries, chartData, layout, range, catCount, sourceIndices2, xPositions) {
6371
+ function computeComboStockOverlay(stockEntries, chartData, layout, range, catCount, sourceIndices, xPositions) {
6368
6372
  if (stockEntries.length < 3) {
6369
6373
  return { primitives: [], dataLabels: [] };
6370
6374
  }
@@ -6379,14 +6383,14 @@ function computeComboStockOverlay(stockEntries, chartData, layout, range, catCou
6379
6383
  layout,
6380
6384
  range,
6381
6385
  catCount,
6382
- sourceIndices2,
6386
+ sourceIndices,
6383
6387
  xPositions
6384
6388
  );
6385
6389
  const dataLabels = [];
6386
6390
  if (chartData.style?.hasDataLabels) {
6387
6391
  const barGroupWidth = layout.plotWidth / Math.max(catCount, 1);
6388
6392
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
6389
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex;
6393
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex;
6390
6394
  const close = closeEntry.series.values[sourceIndex];
6391
6395
  if (close === void 0) {
6392
6396
  continue;
@@ -6431,17 +6435,17 @@ function comboDataLabel(chartData, series, pointIndex, value, anchor) {
6431
6435
  ...dataLabelFontOverride(resolveDataLabelTextStyle(chartData, series, pointIndex))
6432
6436
  };
6433
6437
  }
6434
- function appendLineSeries(series, seriesIndex, chartData, layout, range, barGroupWidth, sourceIndices2, primitives, dataLabels, xPositions) {
6438
+ function appendLineSeries(series, seriesIndex, chartData, layout, range, barGroupWidth, sourceIndices, primitives, dataLabels, xPositions) {
6435
6439
  if (series.values.length === 0) {
6436
6440
  return;
6437
6441
  }
6438
6442
  const fill = seriesColor2(series, seriesIndex, chartData.colorPalette);
6439
6443
  const { values, visible } = resolveBlankDisplay(
6440
- sourceIndices2.map((sourceIndex) => series.values[sourceIndex] ?? 0),
6441
- sourceIndices2.map((sourceIndex) => series.blanks?.[sourceIndex] ?? false),
6444
+ sourceIndices.map((sourceIndex) => series.values[sourceIndex] ?? 0),
6445
+ sourceIndices.map((sourceIndex) => series.blanks?.[sourceIndex] ?? false),
6442
6446
  chartData.chartChrome?.dispBlanksAs
6443
6447
  );
6444
- const points = sourceIndices2.map((sourceIndex, displayIndex) => {
6448
+ const points = sourceIndices.map((sourceIndex, displayIndex) => {
6445
6449
  const value = values[displayIndex] ?? 0;
6446
6450
  return {
6447
6451
  x: xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2,
@@ -6491,13 +6495,13 @@ function appendLineSeries(series, seriesIndex, chartData, layout, range, barGrou
6491
6495
  }
6492
6496
  });
6493
6497
  }
6494
- function appendAreaSeries(series, seriesIndex, chartData, layout, range, barGroupWidth, sourceIndices2, primitives, dataLabels, xPositions) {
6498
+ function appendAreaSeries(series, seriesIndex, chartData, layout, range, barGroupWidth, sourceIndices, primitives, dataLabels, xPositions) {
6495
6499
  if (series.values.length === 0) {
6496
6500
  return;
6497
6501
  }
6498
6502
  const fill = seriesColor2(series, seriesIndex, chartData.colorPalette);
6499
6503
  const baselineY = valueToY2(0, range, layout.plotTop, layout.plotBottom);
6500
- const points = sourceIndices2.map((sourceIndex, displayIndex) => {
6504
+ const points = sourceIndices.map((sourceIndex, displayIndex) => {
6501
6505
  const value = series.values[sourceIndex] ?? 0;
6502
6506
  return {
6503
6507
  x: xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2,
@@ -6584,7 +6588,7 @@ function groupComboSeriesIndices(series) {
6584
6588
  });
6585
6589
  return { barIndices, lineIndices, areaIndices };
6586
6590
  }
6587
- function computeComboBarCluster(barIndices, chartData, catCount, layout, primaryRange, secondaryRange, secondaryIndexes, sourceIndices2, xPositions) {
6591
+ function computeComboBarCluster(barIndices, chartData, catCount, layout, primaryRange, secondaryRange, secondaryIndexes, sourceIndices, xPositions) {
6588
6592
  if (barIndices.length === 0) {
6589
6593
  return [];
6590
6594
  }
@@ -6594,7 +6598,7 @@ function computeComboBarCluster(barIndices, chartData, catCount, layout, primary
6594
6598
  chartData
6595
6599
  ), rects = [];
6596
6600
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
6597
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex, center = xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2, clusterLeft = center - clusterWidth / 2;
6601
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex, center = xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2, clusterLeft = center - clusterWidth / 2;
6598
6602
  barIndices.forEach((originalIndex, si) => {
6599
6603
  const series = chartData.series[originalIndex], value = series.values[sourceIndex] ?? 0, range = secondaryIndexes.has(originalIndex) && secondaryRange ? secondaryRange : primaryRange, zeroY = valueToY2(0, range, layout.plotTop, layout.plotBottom), valY = valueToY2(value, range, layout.plotTop, layout.plotBottom), part = {
6600
6604
  role: "dataPoint",
@@ -6615,7 +6619,7 @@ function computeComboBarCluster(barIndices, chartData, catCount, layout, primary
6615
6619
  }
6616
6620
  return rects;
6617
6621
  }
6618
- function appendComboBarClusterLabels(barIndices, chartData, layout, catCount, primaryRange, secondaryRange, secondaryIndexes, sourceIndices2, labels, xPositions) {
6622
+ function appendComboBarClusterLabels(barIndices, chartData, layout, catCount, primaryRange, secondaryRange, secondaryIndexes, sourceIndices, labels, xPositions) {
6619
6623
  if (!chartData.style?.hasDataLabels || barIndices.length === 0) {
6620
6624
  return;
6621
6625
  }
@@ -6625,7 +6629,7 @@ function appendComboBarClusterLabels(barIndices, chartData, layout, catCount, pr
6625
6629
  chartData
6626
6630
  );
6627
6631
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
6628
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex, center = xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2, clusterLeft = center - clusterWidth / 2;
6632
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex, center = xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2, clusterLeft = center - clusterWidth / 2;
6629
6633
  barIndices.forEach((originalIndex, si) => {
6630
6634
  const series = chartData.series[originalIndex], value = series.values[sourceIndex] ?? 0, range = secondaryIndexes.has(originalIndex) && secondaryRange ? secondaryRange : primaryRange, zeroY = valueToY2(0, range, layout.plotTop, layout.plotBottom), valY = valueToY2(value, range, layout.plotTop, layout.plotBottom), x = clusterLeft + step * si, barY = Math.min(zeroY, valY), barH = Math.max(Math.abs(zeroY - valY), 1), anchor = resolveBarLabelPlacement(
6631
6635
  chartData,
@@ -6712,7 +6716,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6712
6716
  primaryRange,
6713
6717
  secondaryRange
6714
6718
  );
6715
- const sourceIndices2 = horizontalAxis.sourceIndices;
6719
+ const sourceIndices = horizontalAxis.sourceIndices;
6716
6720
  const legendPos = chartData.style?.legendPosition ?? "b";
6717
6721
  const { barIndices, lineIndices, areaIndices } = groupComboSeriesIndices(chartData.series);
6718
6722
  const barIndexSet = new Set(barIndices);
@@ -6749,7 +6753,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6749
6753
  primaryRange,
6750
6754
  secondaryRange,
6751
6755
  secondaryIndexes,
6752
- sourceIndices2,
6756
+ sourceIndices,
6753
6757
  horizontalAxis.xPositions
6754
6758
  )
6755
6759
  );
@@ -6761,7 +6765,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6761
6765
  primaryRange,
6762
6766
  secondaryRange,
6763
6767
  secondaryIndexes,
6764
- sourceIndices2,
6768
+ sourceIndices,
6765
6769
  dataLabels,
6766
6770
  horizontalAxis.xPositions
6767
6771
  );
@@ -6776,7 +6780,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6776
6780
  layout,
6777
6781
  range,
6778
6782
  barGroupWidth,
6779
- sourceIndices2,
6783
+ sourceIndices,
6780
6784
  primitives,
6781
6785
  dataLabels,
6782
6786
  horizontalAxis.xPositions
@@ -6795,7 +6799,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6795
6799
  layout,
6796
6800
  range,
6797
6801
  barGroupWidth,
6798
- sourceIndices2,
6802
+ sourceIndices,
6799
6803
  primitives,
6800
6804
  dataLabels,
6801
6805
  horizontalAxis.xPositions
@@ -6810,7 +6814,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6810
6814
  layout,
6811
6815
  stockRange,
6812
6816
  catCount,
6813
- sourceIndices2,
6817
+ sourceIndices,
6814
6818
  horizontalAxis.xPositions
6815
6819
  );
6816
6820
  primitives.push(...overlay.primitives);
@@ -6903,7 +6907,7 @@ function buildStockViewModel(element, chartData, categoryLabels) {
6903
6907
  "stock",
6904
6908
  range
6905
6909
  );
6906
- const sourceIndices2 = horizontalAxis.sourceIndices;
6910
+ const sourceIndices = horizontalAxis.sourceIndices;
6907
6911
  const legendPos = chartData.style?.legendPosition ?? "b";
6908
6912
  const { legend, legendX, legendY, legendAnchor } = buildLegend(
6909
6913
  chartData.series,
@@ -6935,14 +6939,14 @@ function buildStockViewModel(element, chartData, categoryLabels) {
6935
6939
  layout,
6936
6940
  range,
6937
6941
  catCount,
6938
- sourceIndices2,
6942
+ sourceIndices,
6939
6943
  horizontalAxis.xPositions
6940
6944
  )
6941
6945
  );
6942
6946
  if (chartData.style?.hasDataLabels) {
6943
6947
  const barGroupWidth = layout.plotWidth / catCount;
6944
6948
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
6945
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex;
6949
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex;
6946
6950
  const close = closeSeries.values[sourceIndex];
6947
6951
  if (close === void 0) {
6948
6952
  continue;
@@ -7603,19 +7607,23 @@ function emptyChrome2() {
7603
7607
  categoryLabels: []
7604
7608
  };
7605
7609
  }
7606
- function computeFunnelSegments(values, plotLeft, plotTop, plotWidth, plotHeight, categories, colorPalette, seriesColorOverride) {
7610
+ function computeFunnelSegments(values, plotLeft, plotTop, plotWidth, plotHeight, categories, colorPalette, seriesColorOverride, gapWidth) {
7607
7611
  const count = values.length;
7608
7612
  if (count === 0) {
7609
7613
  return [];
7610
7614
  }
7611
7615
  const fill = seriesColorOverride ?? paletteColor2(0, colorPalette);
7612
7616
  const out = [];
7613
- for (const bar of computeFunnelGeometry(values, {
7614
- x: plotLeft,
7615
- y: plotTop,
7616
- width: plotWidth,
7617
- height: plotHeight
7618
- })) {
7617
+ for (const bar of computeFunnelGeometry(
7618
+ values,
7619
+ {
7620
+ x: plotLeft,
7621
+ y: plotTop,
7622
+ width: plotWidth,
7623
+ height: plotHeight
7624
+ },
7625
+ gapWidth
7626
+ )) {
7619
7627
  const i = bar.index;
7620
7628
  const val = values[i];
7621
7629
  const w = bar.width, y = bar.y, segH = bar.height, centerX = bar.center;
@@ -7654,7 +7662,8 @@ function buildFunnelViewModel(element, chartData, categoryLabels) {
7654
7662
  layout.plotHeight,
7655
7663
  categoryLabels,
7656
7664
  chartData.colorPalette,
7657
- chartData.series[0]?.color
7665
+ chartData.series[0]?.color,
7666
+ chartData.funnelGapWidth
7658
7667
  );
7659
7668
  const primitives = [];
7660
7669
  const dataLabels = [];
@@ -9499,239 +9508,7 @@ function buildRadarViewModel(element, chartData, categoryLabels) {
9499
9508
  legendAnchor
9500
9509
  };
9501
9510
  }
9502
-
9503
- // src/pptx/render/chart-region-map-alias.ts
9504
- var REGION_ALIAS_MAP = {
9505
- us: "US",
9506
- usa: "US",
9507
- "united states": "US",
9508
- "united states of america": "US",
9509
- ca: "CA",
9510
- can: "CA",
9511
- canada: "CA",
9512
- br: "BR",
9513
- bra: "BR",
9514
- brazil: "BR",
9515
- gb: "GB",
9516
- gbr: "GB",
9517
- uk: "GB",
9518
- "united kingdom": "GB",
9519
- fr: "FR",
9520
- fra: "FR",
9521
- france: "FR",
9522
- de: "DE",
9523
- deu: "DE",
9524
- germany: "DE",
9525
- it: "IT",
9526
- ita: "IT",
9527
- italy: "IT",
9528
- es: "ES",
9529
- esp: "ES",
9530
- spain: "ES",
9531
- ru: "RU",
9532
- rus: "RU",
9533
- russia: "RU",
9534
- cn: "CN",
9535
- chn: "CN",
9536
- china: "CN",
9537
- in: "IN",
9538
- ind: "IN",
9539
- india: "IN",
9540
- jp: "JP",
9541
- jpn: "JP",
9542
- japan: "JP",
9543
- kr: "KR",
9544
- kor: "KR",
9545
- "south korea": "KR",
9546
- korea: "KR",
9547
- au: "AU",
9548
- aus: "AU",
9549
- australia: "AU",
9550
- mx: "MX",
9551
- mex: "MX",
9552
- mexico: "MX",
9553
- id: "ID",
9554
- idn: "ID",
9555
- indonesia: "ID",
9556
- tr: "TR",
9557
- tur: "TR",
9558
- turkey: "TR",
9559
- sa: "SA",
9560
- sau: "SA",
9561
- "saudi arabia": "SA",
9562
- za: "ZA",
9563
- zaf: "ZA",
9564
- "south africa": "ZA",
9565
- ar: "AR",
9566
- arg: "AR",
9567
- argentina: "AR",
9568
- ng: "NG",
9569
- nga: "NG",
9570
- nigeria: "NG",
9571
- eg: "EG",
9572
- egy: "EG",
9573
- egypt: "EG"
9574
- };
9575
- function resolveRegionCode(label) {
9576
- const normalized = label.trim().toLowerCase();
9577
- return REGION_ALIAS_MAP[normalized];
9578
- }
9579
-
9580
- // src/pptx/render/chart-region-map-data.ts
9581
- function sourceIndices(indices, length) {
9582
- return Array.from({ length }, (_, position) => indices?.[position] ?? position);
9583
- }
9584
- function valueAtSource(values, indices, sourceIndex) {
9585
- const position = indices.indexOf(sourceIndex);
9586
- return position >= 0 ? values[position] : void 0;
9587
- }
9588
- function cachedEntityName(cache, entityId) {
9589
- if (!cache || typeof cache !== "object") {
9590
- return void 0;
9591
- }
9592
- const record = cache;
9593
- if (String(record["@_entityId"] ?? "") === entityId && record["@_entityName"] !== void 0) {
9594
- return String(record["@_entityName"]);
9595
- }
9596
- for (const value of Object.values(record)) {
9597
- if (Array.isArray(value)) {
9598
- for (const item of value) {
9599
- const name = cachedEntityName(item, entityId);
9600
- if (name) {
9601
- return name;
9602
- }
9603
- }
9604
- } else {
9605
- const name = cachedEntityName(value, entityId);
9606
- if (name) {
9607
- return name;
9608
- }
9609
- }
9610
- }
9611
- return void 0;
9612
- }
9613
- function resolveRegionEntityCode(entityId, options, resolveCode) {
9614
- if (!entityId) {
9615
- return void 0;
9616
- }
9617
- const direct = resolveCode(entityId);
9618
- if (direct) {
9619
- return direct;
9620
- }
9621
- const tokens = entityId.split(/[:/|._-]+/u).filter(Boolean);
9622
- for (let index = tokens.length - 1; index >= 0; index--) {
9623
- const resolved = resolveCode(tokens[index] ?? "");
9624
- if (resolved) {
9625
- return resolved;
9626
- }
9627
- }
9628
- const cachedName = cachedEntityName(options?.geographyCache, entityId);
9629
- return cachedName ? resolveCode(cachedName) : void 0;
9630
- }
9631
- function buildRegionMapEntries(categories, values, options, resolveCode) {
9632
- const entityIds = options?.entityIds ?? [];
9633
- const categoryIndices = sourceIndices(options?.categorySourceIndices, categories.length);
9634
- const valueIndices = sourceIndices(options?.valueSourceIndices, values.length);
9635
- const entityIndices = sourceIndices(options?.entityIdSourceIndices, entityIds.length);
9636
- const indices = [.../* @__PURE__ */ new Set([...categoryIndices, ...valueIndices, ...entityIndices])].sort(
9637
- (a, b) => a - b
9638
- );
9639
- return indices.map((sourceIndex) => {
9640
- const category = valueAtSource(categories, categoryIndices, sourceIndex) ?? "";
9641
- const value = valueAtSource(values, valueIndices, sourceIndex) ?? 0;
9642
- const entityId = valueAtSource(entityIds, entityIndices, sourceIndex);
9643
- return {
9644
- sourceIndex,
9645
- label: category || entityId || `Region ${sourceIndex + 1}`,
9646
- value,
9647
- ...entityId ? { entityId } : {},
9648
- code: resolveRegionEntityCode(entityId, options, resolveCode) ?? resolveCode(category)
9649
- };
9650
- });
9651
- }
9652
- function shouldRenderRegionLabel(layout, projectedWidth, projectedHeight) {
9653
- if (layout === "none") {
9654
- return false;
9655
- }
9656
- if (layout === "bestFitOnly") {
9657
- return projectedWidth >= 18 && projectedHeight >= 10;
9658
- }
9659
- return true;
9660
- }
9661
- function formatRegionMapValue(value, cultureLanguage) {
9662
- if (!cultureLanguage) {
9663
- return String(value);
9664
- }
9665
- try {
9666
- return new Intl.NumberFormat(cultureLanguage, { maximumFractionDigits: 2 }).format(value);
9667
- } catch {
9668
- return String(value);
9669
- }
9670
- }
9671
- function lerpColor(a, b, t) {
9672
- const clamp3 = (v) => Math.max(0, Math.min(255, Math.round(v))), ha = a.replace("#", ""), hb = b.replace("#", ""), r1 = parseInt(ha.substring(0, 2), 16), g1 = parseInt(ha.substring(2, 4), 16), b1 = parseInt(ha.substring(4, 6), 16), r26 = parseInt(hb.substring(0, 2), 16), g2 = parseInt(hb.substring(2, 4), 16), b2 = parseInt(hb.substring(4, 6), 16), r = clamp3(r1 + (r26 - r1) * t), g = clamp3(g1 + (g2 - g1) * t), bl = clamp3(b1 + (b2 - b1) * t), toHex = (n) => n.toString(16).padStart(2, "0");
9673
- return `#${toHex(r)}${toHex(g)}${toHex(bl)}`;
9674
- }
9675
- function resolveValueColorStops(valueColors, valueColorPositions, minVal, maxVal) {
9676
- if (!valueColors || valueColors.length < 2) {
9677
- return void 0;
9678
- }
9679
- const span = maxVal - minVal || 1, count = valueColors.length, resolvePosition = (position, index) => {
9680
- if (position?.kind === "min") {
9681
- return 0;
9682
- }
9683
- if (position?.kind === "max") {
9684
- return 1;
9685
- }
9686
- if (position?.kind === "number" && position.value !== void 0) {
9687
- return Math.min(1, Math.max(0, (position.value - minVal) / span));
9688
- }
9689
- if (position?.kind === "percent" && position.value !== void 0) {
9690
- return Math.min(1, Math.max(0, position.value / 100));
9691
- }
9692
- return count === 1 ? 0 : index / (count - 1);
9693
- };
9694
- return valueColors.map((color, index) => ({
9695
- color,
9696
- position: resolvePosition(valueColorPositions?.[index], index)
9697
- }));
9698
- }
9699
- function buildValueColorScale(stops) {
9700
- const sorted = [...stops].sort((a, b) => a.position - b.position);
9701
- return (t) => {
9702
- const clamped = Math.max(0, Math.min(1, t)), first = sorted[0];
9703
- if (!first) {
9704
- return "#94a3b8";
9705
- }
9706
- if (sorted.length === 1) {
9707
- return first.color;
9708
- }
9709
- for (let i = 0; i < sorted.length - 1; i++) {
9710
- const a = sorted[i], b = sorted[i + 1];
9711
- if (clamped >= a.position && clamped <= b.position) {
9712
- return lerpColor(a.color, b.color, (clamped - a.position) / (b.position - a.position || 1));
9713
- }
9714
- }
9715
- const last = sorted[sorted.length - 1] ?? first;
9716
- return clamped <= first.position ? first.color : last.color;
9717
- };
9718
- }
9719
-
9720
- // src/pptx/render/chart-region-map-colors.ts
9721
9511
  var REGION_LEGEND_BANDS = 32;
9722
- function sequentialColorScale(t) {
9723
- const clamped = Math.max(0, Math.min(1, t));
9724
- if (clamped <= 0.5) {
9725
- return lerpColor("#dbeafe", "#3b82f6", clamped * 2);
9726
- }
9727
- return lerpColor("#3b82f6", "#1e3a5f", (clamped - 0.5) * 2);
9728
- }
9729
- function normalizeValue(value, min, max) {
9730
- if (max === min) {
9731
- return 0.5;
9732
- }
9733
- return (value - min) / (max - min);
9734
- }
9735
9512
  function buildRegionMapColorLegend(params) {
9736
9513
  const { svgWidth, legendY, minVal, maxVal, colorScale, attribution, svgHeight } = params;
9737
9514
  const primitives = [];
@@ -9783,202 +9560,6 @@ function buildRegionMapColorLegend(params) {
9783
9560
  return primitives;
9784
9561
  }
9785
9562
 
9786
- // src/pptx/render/chart-map-projection.ts
9787
- var WORLD_REGIONS = [
9788
- {
9789
- code: "US",
9790
- name: "United States",
9791
- path: "M130,160 L250,155 265,170 270,190 260,210 230,215 200,220 170,215 145,205 130,195Z M280,175 L295,165 310,170 310,185 295,195 280,190Z",
9792
- labelXY: [200, 190]
9793
- },
9794
- {
9795
- code: "CA",
9796
- name: "Canada",
9797
- path: "M120,90 L280,85 290,100 295,130 280,150 250,155 200,155 160,155 130,155 115,140 110,115Z",
9798
- labelXY: [200, 125]
9799
- },
9800
- {
9801
- code: "MX",
9802
- name: "Mexico",
9803
- path: "M145,215 L200,220 210,235 200,255 185,265 165,260 150,245 140,230Z",
9804
- labelXY: [175, 240]
9805
- },
9806
- {
9807
- code: "BR",
9808
- name: "Brazil",
9809
- path: "M270,300 L310,280 335,290 340,320 330,355 310,370 285,365 265,345 260,320Z",
9810
- labelXY: [300, 330]
9811
- },
9812
- {
9813
- code: "AR",
9814
- name: "Argentina",
9815
- path: "M260,370 L280,365 290,380 285,410 275,435 260,445 250,425 248,395Z",
9816
- labelXY: [268, 410]
9817
- },
9818
- {
9819
- code: "GB",
9820
- name: "United Kingdom",
9821
- path: "M440,120 L448,110 455,115 455,135 448,142 440,138Z",
9822
- labelXY: [448, 128]
9823
- },
9824
- {
9825
- code: "FR",
9826
- name: "France",
9827
- path: "M450,145 L470,140 480,150 478,168 465,175 450,170 445,158Z",
9828
- labelXY: [463, 158]
9829
- },
9830
- {
9831
- code: "DE",
9832
- name: "Germany",
9833
- path: "M478,125 L498,120 505,130 502,148 490,152 478,148 475,138Z",
9834
- labelXY: [490, 138]
9835
- },
9836
- {
9837
- code: "IT",
9838
- name: "Italy",
9839
- path: "M490,155 L498,152 505,162 500,180 492,190 488,178 486,165Z",
9840
- labelXY: [495, 172]
9841
- },
9842
- {
9843
- code: "ES",
9844
- name: "Spain",
9845
- path: "M432,168 L460,165 465,175 460,188 442,192 430,185 428,175Z",
9846
- labelXY: [448, 180]
9847
- },
9848
- {
9849
- code: "RU",
9850
- name: "Russia",
9851
- path: "M510,60 L780,50 830,70 840,100 820,120 750,115 700,105 650,100 580,105 530,110 510,100 505,80Z",
9852
- labelXY: [670, 85]
9853
- },
9854
- {
9855
- code: "TR",
9856
- name: "Turkey",
9857
- path: "M530,165 L570,160 585,170 580,182 555,185 530,180Z",
9858
- labelXY: [558, 175]
9859
- },
9860
- {
9861
- code: "EG",
9862
- name: "Egypt",
9863
- path: "M530,200 L555,195 565,205 560,225 545,230 530,222Z",
9864
- labelXY: [548, 215]
9865
- },
9866
- {
9867
- code: "NG",
9868
- name: "Nigeria",
9869
- path: "M475,275 L500,270 510,280 505,298 490,302 475,295Z",
9870
- labelXY: [492, 288]
9871
- },
9872
- {
9873
- code: "ZA",
9874
- name: "South Africa",
9875
- path: "M520,380 L545,370 560,380 555,400 540,410 520,405 515,392Z",
9876
- labelXY: [538, 392]
9877
- },
9878
- {
9879
- code: "SA",
9880
- name: "Saudi Arabia",
9881
- path: "M565,220 L600,210 615,225 610,250 590,258 570,250 560,238Z",
9882
- labelXY: [590, 238]
9883
- },
9884
- {
9885
- code: "IN",
9886
- name: "India",
9887
- path: "M640,210 L665,195 685,210 688,240 678,268 660,278 645,265 635,240Z",
9888
- labelXY: [662, 240]
9889
- },
9890
- {
9891
- code: "CN",
9892
- name: "China",
9893
- path: "M700,120 L775,115 800,130 805,160 790,180 760,185 730,180 710,168 695,150 690,135Z",
9894
- labelXY: [750, 155]
9895
- },
9896
- {
9897
- code: "JP",
9898
- name: "Japan",
9899
- path: "M835,145 L845,135 852,140 850,158 842,165 835,160Z",
9900
- labelXY: [843, 152]
9901
- },
9902
- {
9903
- code: "KR",
9904
- name: "South Korea",
9905
- path: "M815,158 L825,152 830,160 827,170 818,172 813,165Z",
9906
- labelXY: [822, 163]
9907
- },
9908
- {
9909
- code: "ID",
9910
- name: "Indonesia",
9911
- path: "M740,295 L780,288 810,292 830,298 825,310 790,312 755,308 740,305Z",
9912
- labelXY: [785, 302]
9913
- },
9914
- {
9915
- code: "AU",
9916
- name: "Australia",
9917
- path: "M790,350 L850,340 880,355 885,385 870,405 840,410 810,400 790,380Z",
9918
- labelXY: [838, 378]
9919
- }
9920
- ];
9921
- function regionBounds(region) {
9922
- const coordinates = region.path.match(/-?\d+(?:\.\d+)?/gu)?.map(Number) ?? [];
9923
- const xs = [];
9924
- const ys = [];
9925
- for (let index = 0; index < coordinates.length; index += 2) {
9926
- xs.push(coordinates[index] ?? 0);
9927
- ys.push(coordinates[index + 1] ?? 0);
9928
- }
9929
- return {
9930
- minX: Math.min(...xs),
9931
- minY: Math.min(...ys),
9932
- maxX: Math.max(...xs),
9933
- maxY: Math.max(...ys)
9934
- };
9935
- }
9936
- function regionViewBounds(viewedRegionType, regionValues) {
9937
- if (!viewedRegionType || viewedRegionType === "world" || regionValues.size === 0) {
9938
- return { minX: 0, minY: 0, maxX: 1e3, maxY: 500 };
9939
- }
9940
- const matched = WORLD_REGIONS.filter((region) => regionValues.has(region.code));
9941
- const targets = viewedRegionType === "countryRegion" ? matched.slice(0, 1) : matched;
9942
- if (targets.length === 0) {
9943
- return { minX: 0, minY: 0, maxX: 1e3, maxY: 500 };
9944
- }
9945
- const bounds = targets.map(regionBounds);
9946
- const padding = 10;
9947
- return {
9948
- minX: Math.max(0, Math.min(...bounds.map((item) => item.minX)) - padding),
9949
- minY: Math.max(0, Math.min(...bounds.map((item) => item.minY)) - padding),
9950
- maxX: Math.min(1e3, Math.max(...bounds.map((item) => item.maxX)) + padding),
9951
- maxY: Math.min(500, Math.max(...bounds.map((item) => item.maxY)) + padding)
9952
- };
9953
- }
9954
- function scalePathD(d, scale, dx, dy) {
9955
- const tokens = d.match(/[A-Za-z]|-?\d+(?:\.\d+)?/gu) ?? [];
9956
- const out = [];
9957
- let i = 0;
9958
- while (i < tokens.length) {
9959
- const tok = tokens[i];
9960
- if (tok === void 0) {
9961
- i++;
9962
- continue;
9963
- }
9964
- if (/^[A-Za-z]$/u.test(tok)) {
9965
- out.push(tok);
9966
- i++;
9967
- continue;
9968
- }
9969
- const xRaw = parseFloat(tok);
9970
- const yRaw = parseFloat(tokens[i + 1] ?? "");
9971
- if (!Number.isNaN(xRaw) && !Number.isNaN(yRaw)) {
9972
- out.push(`${(xRaw * scale + dx).toFixed(2)},${(yRaw * scale + dy).toFixed(2)}`);
9973
- i += 2;
9974
- } else {
9975
- out.push(tok);
9976
- i++;
9977
- }
9978
- }
9979
- return out.join(" ");
9980
- }
9981
-
9982
9563
  // src/pptx/render/chart-region-map-fallback-table.ts
9983
9564
  var FALLBACK_ROW_HEIGHT = 14;
9984
9565
  function fallbackTableHeight(unmatchedRows) {
@@ -10070,12 +9651,12 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10070
9651
  const categories = categoryLabels.length > 0 ? categoryLabels : chartData.categories;
10071
9652
  const series = chartData.series[0];
10072
9653
  const options = series?.regionMapOptions;
10073
- const entries = buildRegionMapEntries(
10074
- categories,
10075
- series?.values ?? [],
10076
- options,
10077
- resolveRegionCode
10078
- );
9654
+ const geometry = regionMapGeometry(options);
9655
+ const regions = geometry.regions;
9656
+ const resolve2 = (label) => regions.find(
9657
+ (r) => r.entityId === label || r.code === label || r.name.toLowerCase() === label.toLowerCase()
9658
+ )?.code ?? resolveRegionCode(label);
9659
+ const entries = buildRegionMapEntries(categories, series?.values ?? [], options, resolve2);
10079
9660
  const values = entries.map((entry) => entry.value);
10080
9661
  const finiteVals = values.filter((v) => Number.isFinite(v));
10081
9662
  const minVal = finiteVals.length > 0 ? Math.min(...finiteVals) : 0;
@@ -10086,7 +9667,7 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10086
9667
  minVal,
10087
9668
  maxVal
10088
9669
  );
10089
- const colorScale = valueColorStops ? buildValueColorScale(valueColorStops) : sequentialColorScale;
9670
+ const colorScale = valueColorStops ? buildValueColorScale(valueColorStops) : (t) => sequentialColorScale(t, series?.color ?? "#4472C4");
10090
9671
  const regionValueMap = /* @__PURE__ */ new Map();
10091
9672
  const unmatchedRows = [];
10092
9673
  for (const entry of entries) {
@@ -10104,7 +9685,7 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10104
9685
  const fallbackTableH = fallbackTableHeight(unmatchedRows);
10105
9686
  const titleH = chartData.title ? 22 : 0;
10106
9687
  const mapAreaH = Math.max(svgHeight - titleH - legendHeight - fallbackTableH - 8, 80);
10107
- const viewBounds = regionViewBounds(options?.viewedRegionType, regionValueMap);
9688
+ const viewBounds = regionViewBounds(options?.viewedRegionType, regionValueMap, regions);
10108
9689
  const viewWidth = Math.max(viewBounds.maxX - viewBounds.minX, 1);
10109
9690
  const viewHeight = Math.max(viewBounds.maxY - viewBounds.minY, 1);
10110
9691
  const mapScale = Math.min((svgWidth - 20) / viewWidth, mapAreaH / viewHeight);
@@ -10131,20 +9712,21 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10131
9712
  fontWeight: "bold",
10132
9713
  dominantBaseline: "auto"
10133
9714
  } : void 0;
10134
- for (const region of WORLD_REGIONS) {
9715
+ for (const region of regions) {
10135
9716
  const entry = regionValueMap.get(region.code);
10136
9717
  let fill = "#e2e8f0";
10137
9718
  if (entry !== void 0) {
10138
9719
  const t = normalizeValue(entry.value, minVal, maxVal);
10139
9720
  fill = colorScale(t);
10140
9721
  }
9722
+ if (options?.fixedColor) fill = options.fixedColor;
10141
9723
  const scaledPath = scalePathD(region.path, mapScale, mapOffsetX, mapOffsetY);
10142
9724
  primitives.push({
10143
9725
  kind: "path",
10144
9726
  d: scaledPath,
10145
9727
  fill,
10146
- stroke: "#94a3b8",
10147
- strokeWidth: Math.max(0.5 / mapScale, 0.3),
9728
+ stroke: series?.lineWidth && !series.lineNoFill ? series.color ?? "#000000" : "none",
9729
+ strokeWidth: series?.lineWidth ?? 0,
10148
9730
  // Hover tooltip. A choropleth prints only the value inside the shape
10149
9731
  // (and only where the shape is big enough), so without this the reader
10150
9732
  // has no way to find out WHICH country a patch of colour is.
@@ -10169,7 +9751,7 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10169
9751
  kind: "text",
10170
9752
  x: lx,
10171
9753
  y: ly,
10172
- text: formatRegionMapValue(entry.value, options?.cultureLanguage),
9754
+ text: region.name,
10173
9755
  fontSize: Math.max(6, 7 * mapScale),
10174
9756
  fill: "#1e293b",
10175
9757
  textAnchor: "middle",
@@ -10177,6 +9759,24 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10177
9759
  dominantBaseline: "central"
10178
9760
  });
10179
9761
  }
9762
+ if (entry && series && (series.dataLabelOptions || series.dataLabels?.length || chartData.style?.dataLabels)) {
9763
+ const label = buildDataLabelText({
9764
+ chartData,
9765
+ series,
9766
+ pointIndex: entry.sourceIndex,
9767
+ value: entry.value
9768
+ });
9769
+ if (label)
9770
+ primitives.push({
9771
+ kind: "text",
9772
+ x: region.labelXY[0] * mapScale + mapOffsetX,
9773
+ y: region.labelXY[1] * mapScale + mapOffsetY,
9774
+ text: label.text,
9775
+ fontSize: 10,
9776
+ fill: label.color ?? "#000000",
9777
+ textAnchor: "middle"
9778
+ });
9779
+ }
10180
9780
  }
10181
9781
  const legendY = mapOffsetY + mapAreaH + 4;
10182
9782
  primitives.push(
@@ -10191,6 +9791,16 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10191
9791
  })
10192
9792
  );
10193
9793
  primitives.push(...buildRegionMapFallbackTable(unmatchedRows, legendY, svgWidth, svgHeight));
9794
+ if (geometry.approximate)
9795
+ primitives.push({
9796
+ kind: "text",
9797
+ x: 8,
9798
+ y: titleH + 12,
9799
+ text: "\u2248",
9800
+ fontSize: 8,
9801
+ fill: "#595959",
9802
+ textAnchor: "start"
9803
+ });
10194
9804
  const dataLabels = titlePrimitive !== void 0 ? [titlePrimitive] : [];
10195
9805
  const valueDrag = {
10196
9806
  range: { min: minVal, max: maxVal, span: Math.max(maxVal - minVal, Number.EPSILON) },
@@ -10198,6 +9808,7 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10198
9808
  plotBottom: mapOffsetY + mapAreaH
10199
9809
  };
10200
9810
  return {
9811
+ reports: geometry.approximate ? ["approximate-country-outlines"] : [],
10201
9812
  svgWidth,
10202
9813
  svgHeight,
10203
9814
  title: void 0,
@@ -10717,4 +10328,4 @@ function computeTrendlinePrimitives(chartData, catCount, layout, range, mode = "
10717
10328
  return out;
10718
10329
  }
10719
10330
 
10720
- export { AXIS_LABEL_COLOR, CHART_PX_PER_PT, CHART_TITLE_FONT_PX, CHART_TITLE_TOP_INSET_PX, DATA_LABEL_LINE_HEIGHT, DATA_LABEL_PAD_X, DATA_LABEL_PAD_Y, DATA_TABLE_HEADER_H, DATA_TABLE_KEY_W, DATA_TABLE_PADDING, DATA_TABLE_ROW_H, DEFAULT_BODY_INSET_LR_PX, DEFAULT_BODY_INSET_TB_PX, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_CHART_AREA_FILL, DEFAULT_CHART_DATA_LABEL_PX, DEFAULT_CHART_TEXT_PX, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_PALETTE, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, GRIDLINE_COLOR3 as GRIDLINE_COLOR, HYPERLINK_COLOR, LEGACY_CHART_TITLE_BAND_PX, LEGEND_LINE_SWATCH_WIDTH, LEGEND_MARKER_RADIUS, OOXML_PATTERN_PRESETS, PIE_AUTO_INSET_PX, TEXT_ORIENTATION_IDENTITY, ZERO_LINE_COLOR, adjustFillForMode, applyDataPointPictureFills, applyLegendEntryOverrides, applyParetoConversion, axisShowsMajorGridlines, axisTickValues, buildBoxWhiskerViewModel, buildCartesianViewModel, buildCategoryLabels, buildChartViewModel, buildCirclePathGradient, buildComboViewModel, buildCssGradientFromShapeStyle, buildDashArray, buildDataLabelText, buildFallbackViewModel, buildFunnelViewModel, buildGradientCss, buildGridlinesAndLabels, buildHistogramViewModel, buildLegend, buildLineLegendSwatch, buildMarkTooltip, buildPatternFill, buildPatternFillCss, buildPieViewModel, buildPrimaryAxis, buildRadarViewModel, buildRectPathGradient, buildReflectedGradientStops, buildRegionMapEntries, buildRegionMapViewModel, buildSecondaryAxis, buildShapePathGradient, buildStockCloseLabel, buildStockViewModel, buildSubpathFillOverlay, buildSubpathPaints, buildSunburstViewModel, buildSurfaceViewModel, buildTreemapViewModel, buildTrendlineLegendSwatch, buildValueAxisGridlinesAndLabels, buildWaterfallViewModel, buildZeroLine, canvasFontFamily, chartAreaCornerRadius, chartAreaFill, chartAxisIndex, chartFontPx, chartFrameToViewOffset, chartGridlinesPatch, chartGridlinesState, chartPlotBounds, chartPreserveAspectRatio, chartTextBox, chartTextFontFamily, chartTitleBand, chartTitleBandFor, chartTitleFontPx, chartTitleReservePx, clampCropValue, clearBarFacePicturePixelCache, clipStackedSegment, collapseChartTitleRunsForEdit, computeAxisTitlePrimitives, computeBarRects, computeBoxWhiskerGeometry, computeChartLegendLayout, computeDataTableHeight, computeDataTablePrimitives, computeErrorBarPrimitives, computeFunnelSegments, computeGradientCenter, computeHierarchicalSunburstArcs, computeHistogramBars, computeHistogramBins, computeLayout, computeLayoutOptions, computeLinePoints, computePieLayout, computePieSlicePath, computePieSlices, computePlotLayout, computeScatterDots, computeScatterXDomain, computeStackedBarRects, computeStackedValueRange, computeSunburstArcs, computeTrendlinePrimitives, computeValueRange, computeValueRange2, convertOoxmlAngleToCss, createArrayBufferCopy, cumulativePercentOfTotal, dataLabelBox, dataLabelBoxSize, dataLabelFontOverride, decodeFirstPixelColor, ensureBarFacePicturePixelSampled, estimateChartTextWidth, estimateTextWidth, findDataPoint, findPointLabel, findValueAxis, fitTitleBand, formatAxisValue, formatAxisValue2, formatAxisValueWithUnits, formatRegionMapValue, getBarFacePicturePixelSampleVersion, getCachedBarFacePicturePixelColor, getCompoundLineBorderWidth, getCompoundLineBoxShadow, getCompoundLineStyle, getComputedFillStyle, getCssBorderDashStyle, getDisplayUnitDivisor, getDisplayUnitLabel, getElementOrientationMatrix, getElementTransform, getElementTransformWithoutRotation, getGradientTileFlipCss, getGradientTileRectCss, getPatternSvg, getPatternTile, getPptxRenderCacheEpoch, getPrimaryValueAxis, getPrimaryValueAxisId, getSecondaryCategoryAxis, getSecondaryValueAxis, getSecondaryValueAxisId, getSvgStrokeDasharray, getTextCompensationTransform, hasSecondaryCategoryAxis, hasSecondaryValueAxis, invalidatePptxRenderCacheEpoch, isParetoChart, isPrimaryCategoryAxisAtTop, isSeriesOnSecondaryAxis, isTextOrientationMatrix, linePointsToSvgString, manualLayoutOf, manualLegendAnchor, manualTitleAnchor, measureChartTextWidth, multiplyTextOrientationMatrices, normalizeStrokeDashType, normalizeValue, orderParetoEntries, paletteColor, paletteColor2, parseDrawingPercent, plotAreaFill, primaryValueAxis, reserveLegendSpace, resetBarFacePicturePixelCacheForTests, resolveActiveDataPointPicture, resolveBarFacePicturePixelColor, resolveBarFaceTargets, resolveBarLabelAnchor, resolveBarLabelPlacement, resolveCategoryLabels, resolveChartKind, resolveChartPalette, resolveChartStyleDefaults, resolveChartTitleRunSpans, resolveChartTitleTextStyle, resolveDataLabelContent, resolveDataLabelTextStyle, resolveDataPointExplosion, resolveDataPointFill, resolveDataPointMarker, resolveDataPointPictureFill, resolveDisplayedChartType, resolveExtrusionFaceFill, resolveLabelPosition, resolveLegendAnchorPosition, resolveLegendPlacement, resolveLegendSwatchKind, resolveMarkerLabelAnchor, resolveMarkerLabelPlacement, resolveRegionCode, resolveRegionEntityCode, resolveUntargetedBarFaceFill, resolveVaryColorFill, sanitizeGradientStops, sequentialColorScale, seriesColor, seriesColor2, seriesXValues, setBoundedRenderCache, setChartTextMeasurer, shouldRenderMajorGridlines, shouldRenderRegionLabel, splitLabelLines, splitSeriesByAxis, stackedBarWidth, stackedSegmentExtent, subscribeBarFacePicturePixelSamples, suppressesCssFill, surfaceColor, titleBaselineFor, toCssGradientStop, unitsCaptionOffset, upsertDataPoint, valueToY, valueToY2, withChartTitleBand, withManualLayouts, withResolvedPalette, wrapTextByEstimatedWidth };
10331
+ export { AXIS_LABEL_COLOR, CHART_PX_PER_PT, CHART_TITLE_FONT_PX, CHART_TITLE_TOP_INSET_PX, DATA_LABEL_LINE_HEIGHT, DATA_LABEL_PAD_X, DATA_LABEL_PAD_Y, DATA_TABLE_HEADER_H, DATA_TABLE_KEY_W, DATA_TABLE_PADDING, DATA_TABLE_ROW_H, DEFAULT_BODY_INSET_LR_PX, DEFAULT_BODY_INSET_TB_PX, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_CHART_AREA_FILL, DEFAULT_CHART_DATA_LABEL_PX, DEFAULT_CHART_TEXT_PX, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_PALETTE, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, GRIDLINE_COLOR3 as GRIDLINE_COLOR, HYPERLINK_COLOR, LEGACY_CHART_TITLE_BAND_PX, LEGEND_LINE_SWATCH_WIDTH, LEGEND_MARKER_RADIUS, OOXML_PATTERN_PRESETS, PIE_AUTO_INSET_PX, TEXT_ORIENTATION_IDENTITY, ZERO_LINE_COLOR, adjustFillForMode, applyDataPointPictureFills, applyLegendEntryOverrides, applyParetoConversion, axisShowsMajorGridlines, axisTickValues, buildBoxWhiskerViewModel, buildCartesianViewModel, buildCategoryLabels, buildChartViewModel, buildCirclePathGradient, buildComboViewModel, buildCssGradientFromShapeStyle, buildDashArray, buildDataLabelText, buildFallbackViewModel, buildFunnelViewModel, buildGradientCss, buildGridlinesAndLabels, buildHistogramViewModel, buildLegend, buildLineLegendSwatch, buildMarkTooltip, buildPatternFill, buildPatternFillCss, buildPieViewModel, buildPrimaryAxis, buildRadarViewModel, buildRectPathGradient, buildReflectedGradientStops, buildRegionMapViewModel, buildSecondaryAxis, buildShapePathGradient, buildStockCloseLabel, buildStockViewModel, buildSubpathFillOverlay, buildSubpathPaints, buildSunburstViewModel, buildSurfaceViewModel, buildTreemapViewModel, buildTrendlineLegendSwatch, buildValueAxisGridlinesAndLabels, buildWaterfallViewModel, buildZeroLine, canvasFontFamily, chartAreaCornerRadius, chartAreaFill, chartAxisIndex, chartFontPx, chartFrameToViewOffset, chartGridlinesPatch, chartGridlinesState, chartPlotBounds, chartPreserveAspectRatio, chartTextBox, chartTextFontFamily, chartTitleBand, chartTitleBandFor, chartTitleFontPx, chartTitleReservePx, clampCropValue, clearBarFacePicturePixelCache, clipStackedSegment, collapseChartTitleRunsForEdit, computeAxisTitlePrimitives, computeBarRects, computeBoxWhiskerGeometry, computeChartLegendLayout, computeDataTableHeight, computeDataTablePrimitives, computeErrorBarPrimitives, computeFunnelSegments, computeGradientCenter, computeHierarchicalSunburstArcs, computeHistogramBars, computeHistogramBins, computeLayout, computeLayoutOptions, computeLinePoints, computePieLayout, computePieSlicePath, computePieSlices, computePlotLayout, computeScatterDots, computeScatterXDomain, computeStackedBarRects, computeStackedValueRange, computeSunburstArcs, computeTrendlinePrimitives, computeValueRange, computeValueRange2, convertOoxmlAngleToCss, createArrayBufferCopy, cumulativePercentOfTotal, dataLabelBox, dataLabelBoxSize, dataLabelFontOverride, decodeFirstPixelColor, ensureBarFacePicturePixelSampled, estimateChartTextWidth, estimateTextWidth, findDataPoint, findPointLabel, findValueAxis, fitTitleBand, formatAxisValue, formatAxisValue2, formatAxisValueWithUnits, getBarFacePicturePixelSampleVersion, getCachedBarFacePicturePixelColor, getCompoundLineBorderWidth, getCompoundLineBoxShadow, getCompoundLineStyle, getComputedFillStyle, getCssBorderDashStyle, getDisplayUnitDivisor, getDisplayUnitLabel, getElementOrientationMatrix, getElementTransform, getElementTransformWithoutRotation, getGradientTileFlipCss, getGradientTileRectCss, getPatternSvg, getPatternTile, getPptxRenderCacheEpoch, getPrimaryValueAxis, getPrimaryValueAxisId, getSecondaryCategoryAxis, getSecondaryValueAxis, getSecondaryValueAxisId, getSvgStrokeDasharray, getTextCompensationTransform, hasSecondaryCategoryAxis, hasSecondaryValueAxis, invalidatePptxRenderCacheEpoch, isParetoChart, isPrimaryCategoryAxisAtTop, isSeriesOnSecondaryAxis, isTextOrientationMatrix, linePointsToSvgString, manualLayoutOf, manualLegendAnchor, manualTitleAnchor, measureChartTextWidth, multiplyTextOrientationMatrices, normalizeStrokeDashType, orderParetoEntries, paletteColor, paletteColor2, parseDrawingPercent, plotAreaFill, primaryValueAxis, reserveLegendSpace, resetBarFacePicturePixelCacheForTests, resolveActiveDataPointPicture, resolveBarFacePicturePixelColor, resolveBarFaceTargets, resolveBarLabelAnchor, resolveBarLabelPlacement, resolveCategoryLabels, resolveChartKind, resolveChartPalette, resolveChartStyleDefaults, resolveChartTitleRunSpans, resolveChartTitleTextStyle, resolveDataLabelContent, resolveDataLabelTextStyle, resolveDataPointExplosion, resolveDataPointFill, resolveDataPointMarker, resolveDataPointPictureFill, resolveDisplayedChartType, resolveExtrusionFaceFill, resolveLabelPosition, resolveLegendAnchorPosition, resolveLegendPlacement, resolveLegendSwatchKind, resolveMarkerLabelAnchor, resolveMarkerLabelPlacement, resolveUntargetedBarFaceFill, resolveVaryColorFill, sanitizeGradientStops, seriesColor, seriesColor2, seriesXValues, setBoundedRenderCache, setChartTextMeasurer, shouldRenderMajorGridlines, splitLabelLines, splitSeriesByAxis, stackedBarWidth, stackedSegmentExtent, subscribeBarFacePicturePixelSamples, suppressesCssFill, surfaceColor, titleBaselineFor, toCssGradientStop, unitsCaptionOffset, upsertDataPoint, valueToY, valueToY2, withChartTitleBand, withManualLayouts, withResolvedPalette, wrapTextByEstimatedWidth };