apexcharts 8.3.0 → 8.4.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 (277) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +20039 -19931
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +3 -8
  6. package/dist/apexcharts.esm.js +950 -574
  7. package/dist/apexcharts.full.js +23401 -22504
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +21723 -21287
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +21758 -21242
  13. package/dist/area.common.js +2 -2
  14. package/dist/area.esm.js +118 -65
  15. package/dist/bar.common.js +2 -2
  16. package/dist/bar.esm.js +404 -218
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +379 -205
  20. package/dist/bubble.common.js +2 -2
  21. package/dist/bubble.esm.js +118 -65
  22. package/dist/candlestick.common.js +2 -2
  23. package/dist/candlestick.esm.js +379 -205
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +404 -218
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +20034 -19926
  29. package/dist/donut.common.js +2 -2
  30. package/dist/donut.esm.js +106 -11
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +404 -218
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +282 -184
  35. package/dist/features/annotations.common.js +2 -2
  36. package/dist/features/annotations.esm.js +65 -48
  37. package/dist/features/annotations.js +2 -2
  38. package/dist/features/context-menu.common.js +1 -1
  39. package/dist/features/context-menu.esm.js +1 -1
  40. package/dist/features/context-menu.js +1 -1
  41. package/dist/features/drilldown.common.js +2 -2
  42. package/dist/features/drilldown.esm.js +137 -124
  43. package/dist/features/drilldown.js +2 -2
  44. package/dist/features/dumbbell.common.js +1 -1
  45. package/dist/features/dumbbell.esm.js +1 -1
  46. package/dist/features/dumbbell.js +1 -1
  47. package/dist/features/exports.common.js +2 -2
  48. package/dist/features/exports.esm.js +31 -15
  49. package/dist/features/exports.js +2 -2
  50. package/dist/features/facet.common.js +1 -1
  51. package/dist/features/facet.esm.js +1 -1
  52. package/dist/features/facet.js +1 -1
  53. package/dist/features/highlight-filter.common.js +2 -2
  54. package/dist/features/highlight-filter.esm.js +206 -119
  55. package/dist/features/highlight-filter.js +2 -2
  56. package/dist/features/history.common.js +1 -1
  57. package/dist/features/history.esm.js +1 -1
  58. package/dist/features/history.js +1 -1
  59. package/dist/features/ink.common.js +1 -1
  60. package/dist/features/ink.esm.js +1 -1
  61. package/dist/features/ink.js +1 -1
  62. package/dist/features/keyboard.common.js +1 -1
  63. package/dist/features/keyboard.esm.js +1 -1
  64. package/dist/features/keyboard.js +1 -1
  65. package/dist/features/legend.common.js +2 -2
  66. package/dist/features/legend.esm.js +52 -28
  67. package/dist/features/legend.js +2 -2
  68. package/dist/features/link.common.js +1 -1
  69. package/dist/features/link.esm.js +1 -1
  70. package/dist/features/link.js +1 -1
  71. package/dist/features/marks.common.js +1 -1
  72. package/dist/features/marks.esm.js +1 -1
  73. package/dist/features/marks.js +1 -1
  74. package/dist/features/measure.common.js +1 -1
  75. package/dist/features/measure.esm.js +1 -1
  76. package/dist/features/measure.js +1 -1
  77. package/dist/features/morph.common.js +2 -2
  78. package/dist/features/morph.esm.js +27 -14
  79. package/dist/features/morph.js +2 -2
  80. package/dist/features/perspectives.common.js +2 -2
  81. package/dist/features/perspectives.esm.js +4 -1
  82. package/dist/features/perspectives.js +2 -2
  83. package/dist/features/raincloud.common.js +2 -2
  84. package/dist/features/raincloud.esm.js +26 -27
  85. package/dist/features/raincloud.js +2 -2
  86. package/dist/features/renderer-canvas.common.js +2 -2
  87. package/dist/features/renderer-canvas.esm.js +35 -21
  88. package/dist/features/renderer-canvas.js +2 -2
  89. package/dist/features/stats.common.js +2 -2
  90. package/dist/features/stats.esm.js +52 -59
  91. package/dist/features/stats.js +2 -2
  92. package/dist/features/storyboard.common.js +2 -2
  93. package/dist/features/storyboard.esm.js +4 -1
  94. package/dist/features/storyboard.js +2 -2
  95. package/dist/features/streamgraph.common.js +2 -2
  96. package/dist/features/streamgraph.esm.js +160 -55
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +78 -28
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +876 -543
  103. package/dist/features/trellis.js +2 -2
  104. package/dist/features/waterfall.common.js +2 -2
  105. package/dist/features/waterfall.esm.js +14 -25
  106. package/dist/features/waterfall.js +2 -2
  107. package/dist/features/weave.common.js +2 -2
  108. package/dist/features/weave.esm.js +13 -12
  109. package/dist/features/weave.js +2 -2
  110. package/dist/full.common.js +2 -2
  111. package/dist/full.esm.js +1893 -1342
  112. package/dist/heatmap.common.js +2 -2
  113. package/dist/heatmap.esm.js +38 -54
  114. package/dist/heatmap.js +2 -2
  115. package/dist/histogram.common.js +2 -2
  116. package/dist/histogram.esm.js +455 -276
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +156 -91
  119. package/dist/icicle.js +2 -2
  120. package/dist/line.common.js +2 -2
  121. package/dist/line.esm.js +118 -65
  122. package/dist/line.js +2 -2
  123. package/dist/pictograms.common.js +2 -2
  124. package/dist/pictograms.esm.js +2 -2
  125. package/dist/pictograms.js +2 -2
  126. package/dist/pie.common.js +2 -2
  127. package/dist/pie.esm.js +106 -11
  128. package/dist/pie.js +2 -2
  129. package/dist/polarArea.common.js +2 -2
  130. package/dist/polarArea.esm.js +106 -11
  131. package/dist/radar.common.js +2 -2
  132. package/dist/radar.esm.js +23 -9
  133. package/dist/radar.js +2 -2
  134. package/dist/radialBar.common.js +2 -2
  135. package/dist/radialBar.esm.js +108 -14
  136. package/dist/radialBar.js +2 -2
  137. package/dist/raincloud.common.js +2 -2
  138. package/dist/raincloud.esm.js +39 -31
  139. package/dist/rangeArea.common.js +2 -2
  140. package/dist/rangeArea.esm.js +118 -65
  141. package/dist/rangeBar.common.js +2 -2
  142. package/dist/rangeBar.esm.js +404 -218
  143. package/dist/scatter.common.js +2 -2
  144. package/dist/scatter.esm.js +118 -65
  145. package/dist/streamgraph.common.js +2 -2
  146. package/dist/streamgraph.esm.js +276 -118
  147. package/dist/sunburst.common.js +2 -2
  148. package/dist/sunburst.esm.js +333 -116
  149. package/dist/sunburst.js +2 -2
  150. package/dist/treemap.common.js +2 -2
  151. package/dist/treemap.esm.js +155 -124
  152. package/dist/treemap.js +2 -2
  153. package/dist/unit-shapes.common.js +2 -2
  154. package/dist/unit-shapes.esm.js +2 -2
  155. package/dist/unit-shapes.js +2 -2
  156. package/dist/unit.common.js +2 -2
  157. package/dist/unit.esm.js +29 -27
  158. package/dist/unit.js +2 -2
  159. package/dist/violin.common.js +2 -2
  160. package/dist/violin.esm.js +14 -5
  161. package/dist/violin.js +2 -2
  162. package/dist/waterfall.common.js +2 -2
  163. package/dist/waterfall.esm.js +417 -242
  164. package/package.json +1 -1
  165. package/src/apexcharts.js +37 -60
  166. package/src/assets/apexcharts.css +3 -8
  167. package/src/charts/Bar.js +30 -12
  168. package/src/charts/BarStacked.js +10 -4
  169. package/src/charts/BoxCandleStick.js +8 -2
  170. package/src/charts/Icicle.js +60 -76
  171. package/src/charts/Line.js +58 -22
  172. package/src/charts/Pie.js +136 -14
  173. package/src/charts/Radar.js +6 -9
  174. package/src/charts/Radial.js +2 -6
  175. package/src/charts/RangeBar.js +13 -13
  176. package/src/charts/Scatter.js +5 -7
  177. package/src/charts/Sunburst.js +157 -135
  178. package/src/charts/Treemap.js +100 -56
  179. package/src/charts/common/Breadcrumb.js +37 -16
  180. package/src/charts/common/PreviousPaths.js +45 -0
  181. package/src/charts/common/Stats.js +30 -23
  182. package/src/charts/common/bar/DataLabels.js +85 -77
  183. package/src/charts/common/bar/Helpers.js +144 -56
  184. package/src/charts/common/line/Helpers.js +8 -11
  185. package/src/charts/common/partition/NodeTooltip.js +62 -22
  186. package/src/charts/common/partition/Partition.js +64 -19
  187. package/src/charts/common/partition/Tint.js +6 -3
  188. package/src/charts/common/partition/Transitions.js +108 -0
  189. package/src/charts/common/treemap/ColorScale.js +30 -14
  190. package/src/charts/common/treemap/Helpers.js +47 -68
  191. package/src/charts/common/treemap/Nested.js +2 -3
  192. package/src/features/raincloud.js +16 -10
  193. package/src/features/stats.js +67 -62
  194. package/src/modules/Animations.js +102 -95
  195. package/src/modules/AxisMapping.js +47 -12
  196. package/src/modules/Base.js +12 -14
  197. package/src/modules/CoreUtils.js +26 -46
  198. package/src/modules/Data.js +82 -55
  199. package/src/modules/DataLabels.js +14 -13
  200. package/src/modules/Exports.js +44 -19
  201. package/src/modules/Fill.js +17 -8
  202. package/src/modules/Filters.js +50 -50
  203. package/src/modules/Graphics.js +65 -84
  204. package/src/modules/Markers.js +57 -58
  205. package/src/modules/MorphPieces.js +16 -10
  206. package/src/modules/MorphTypeChange.js +21 -9
  207. package/src/modules/Range.js +32 -55
  208. package/src/modules/RendererController.js +4 -4
  209. package/src/modules/Responsive.js +5 -1
  210. package/src/modules/Scales.js +24 -15
  211. package/src/modules/Series.js +85 -73
  212. package/src/modules/Toolbar.js +3 -2
  213. package/src/modules/UnitLayoutRegistry.js +8 -5
  214. package/src/modules/UnitMarkRegistry.js +7 -10
  215. package/src/modules/ZoomPanSelection.js +4 -0
  216. package/src/modules/animations/AxisTransition.js +11 -4
  217. package/src/modules/animations/DataLabelTransition.js +30 -15
  218. package/src/modules/animations/Easing.js +2 -1
  219. package/src/modules/animations/LayoutTransition.js +43 -32
  220. package/src/modules/animations/LengthTransition.js +176 -84
  221. package/src/modules/annotations/Helpers.js +68 -52
  222. package/src/modules/axes/AxesUtils.js +14 -12
  223. package/src/modules/axes/Grid.js +21 -7
  224. package/src/modules/axes/XAxis.js +4 -4
  225. package/src/modules/axes/YAxis.js +12 -13
  226. package/src/modules/dimensions/Dimensions.js +9 -3
  227. package/src/modules/dimensions/Grid.js +2 -2
  228. package/src/modules/dimensions/XAxis.js +2 -5
  229. package/src/modules/drilldown/Breadcrumb.js +11 -53
  230. package/src/modules/drilldown/Drilldown.js +151 -95
  231. package/src/modules/helpers/InitCtxVariables.js +2 -1
  232. package/src/modules/helpers/UpdateHelpers.js +165 -15
  233. package/src/modules/helpers/XKey.js +56 -0
  234. package/src/modules/highlightFilter/HighlightFilter.js +98 -49
  235. package/src/modules/highlightFilter/PiePart.js +6 -3
  236. package/src/modules/highlightFilter/RadialPart.js +41 -7
  237. package/src/modules/highlightFilter/TreemapPart.js +71 -44
  238. package/src/modules/highlightFilter/util.js +23 -7
  239. package/src/modules/legend/Helpers.js +6 -1
  240. package/src/modules/legend/Legend.js +39 -13
  241. package/src/modules/license/LicenseEnforcer.js +5 -0
  242. package/src/modules/settings/Defaults.js +62 -106
  243. package/src/modules/settings/Globals.js +5 -0
  244. package/src/modules/settings/Options.js +0 -7
  245. package/src/modules/settings/TypeAliases.js +33 -16
  246. package/src/modules/streamgraph/StreamData.js +81 -35
  247. package/src/modules/streamgraph/StreamLabels.js +44 -17
  248. package/src/modules/tooltip/Labels.js +80 -80
  249. package/src/modules/tooltip/Marker.js +25 -21
  250. package/src/modules/tooltip/Position.js +88 -51
  251. package/src/modules/tooltip/Tooltip.js +229 -253
  252. package/src/modules/tooltip/Utils.js +64 -131
  253. package/src/modules/tooltip/constants.js +5 -5
  254. package/src/modules/trellis/Trellis.js +402 -248
  255. package/src/modules/trellis/TrellisChrome.js +110 -44
  256. package/src/modules/trellis/TrellisExports.js +48 -13
  257. package/src/modules/trellis/TrellisFrames.js +11 -15
  258. package/src/modules/trellis/TrellisScales.js +201 -115
  259. package/src/modules/trellis/TrellisSplit.js +72 -36
  260. package/src/modules/trellis/TrellisSync.js +41 -13
  261. package/src/modules/trellis/TrellisTooltip.js +101 -78
  262. package/src/modules/trellis/pivotRows.js +20 -6
  263. package/src/modules/waterfall/WaterfallData.js +14 -30
  264. package/src/modules/weave/WeaveHost.js +18 -12
  265. package/src/pictograms/registry.js +2 -1
  266. package/src/renderers/Renderer.js +41 -37
  267. package/src/renderers/canvas/CanvasCompositor.js +4 -1
  268. package/src/renderers/canvas/CanvasGraphics.js +56 -24
  269. package/src/ssr/RenderShim.js +129 -20
  270. package/src/svg/SVGContainer.js +3 -2
  271. package/src/svg/SVGFilter.js +26 -17
  272. package/src/types/internal.d.ts +8 -6
  273. package/src/unit-shapes/registry.js +3 -1
  274. package/src/utils/DateTime.js +5 -20
  275. package/src/utils/Utils.js +0 -14
  276. package/src/utils/nameAsHtml.js +16 -0
  277. package/types/apexcharts.d.ts +72 -13
@@ -30,7 +30,7 @@ var __objRest = (source, exclude) => {
30
30
  return target;
31
31
  };
32
32
  /*!
33
- * ApexCharts v8.3.0
33
+ * ApexCharts v8.4.0
34
34
  * (c) 2018-2026 ApexCharts
35
35
  */
36
36
  import * as _core from "apexcharts/core";
@@ -158,6 +158,14 @@ function stashSeries(ser, gl) {
158
158
  return __spreadProps(__spreadValues({}, rest), { data: Array.isArray(data) ? data.slice() : data });
159
159
  });
160
160
  }
161
+ function withX(data, categories) {
162
+ return data.map(
163
+ (d, j) => d !== null && typeof d === "object" ? d : {
164
+ x: categories && categories[j] !== void 0 ? categories[j] : j + 1,
165
+ y: d
166
+ }
167
+ );
168
+ }
161
169
  function readDatum(d, j, categories) {
162
170
  const fallbackX = categories && categories[j] !== void 0 ? categories[j] : j + 1;
163
171
  if (d == null) {
@@ -205,8 +213,6 @@ function fillFor(datum, kind, colors) {
205
213
  function accumulate(data, categories, colors) {
206
214
  const rows = [];
207
215
  const values = [];
208
- const cumulative = [];
209
- const kinds = [];
210
216
  let running = 0;
211
217
  let cut = 0;
212
218
  for (let j = 0; j < data.length; j++) {
@@ -228,8 +234,6 @@ function accumulate(data, categories, colors) {
228
234
  if (delta === null || !isFinite(delta)) {
229
235
  rows.push(__spreadProps(__spreadValues({}, rest), { x, y: null }));
230
236
  values.push(null);
231
- cumulative.push(running);
232
- kinds.push(null);
233
237
  continue;
234
238
  }
235
239
  start = running;
@@ -243,10 +247,8 @@ function accumulate(data, categories, colors) {
243
247
  y: [start, end]
244
248
  }), fill ? { fillColor: fill } : {}));
245
249
  values.push(end - start);
246
- cumulative.push(running);
247
- kinds.push(kind);
248
250
  }
249
- return { data: rows, values, cumulative, kinds };
251
+ return { data: rows, values };
250
252
  }
251
253
  function waterfallTransform(ser, w) {
252
254
  var _a, _b, _c;
@@ -261,15 +263,12 @@ function waterfallTransform(ser, w) {
261
263
  const categories = (_c = cnf.xaxis) == null ? void 0 : _c.categories;
262
264
  const collapsed = collapsedIndices(gl);
263
265
  const values = [];
264
- const cumulative = [];
265
- const kinds = [];
266
266
  const out = raw.map((s, i) => {
267
267
  const data = Array.isArray(s == null ? void 0 : s.data) ? s.data : [];
268
- if (collapsed.indexOf(i) !== -1) {
269
- values[i] = [];
270
- cumulative[i] = [];
271
- kinds[i] = [];
272
- return __spreadProps(__spreadValues({}, s), { data: [] });
268
+ values[i] = [];
269
+ if (collapsed.indexOf(i) !== -1) return __spreadProps(__spreadValues({}, s), { data: [] });
270
+ if ((s == null ? void 0 : s.type) && s.type !== "waterfall" && s.type !== "rangeBar") {
271
+ return Array.isArray(s.data) ? __spreadProps(__spreadValues({}, s), { data: withX(s.data, categories) }) : s;
273
272
  }
274
273
  if (isPrecomputed(data)) {
275
274
  values[i] = data.map((d) => {
@@ -279,24 +278,14 @@ function waterfallTransform(ser, w) {
279
278
  const hi = Utils.parseNumber(y[1]);
280
279
  return lo === null || hi === null ? null : hi - lo;
281
280
  });
282
- cumulative[i] = data.map((d) => {
283
- const y = Array.isArray(d) ? d[1] : d && typeof d === "object" ? d.y : d;
284
- const hi = Array.isArray(y) ? Utils.parseNumber(y[1]) : null;
285
- return hi === null ? 0 : hi;
286
- });
287
- kinds[i] = data.map(() => null);
288
281
  return s;
289
282
  }
290
283
  const acc = accumulate(data, categories, colors);
291
284
  values[i] = acc.values;
292
- cumulative[i] = acc.cumulative;
293
- kinds[i] = acc.kinds;
294
285
  return __spreadProps(__spreadValues({}, s), { data: acc.data });
295
286
  });
296
287
  w.waterfallData = {
297
288
  values,
298
- cumulative,
299
- kinds,
300
289
  // A non-null sink is what tells RangeBar to record the px box it drew each
301
290
  // column in, which the connector layer joins up. Fresh every parse.
302
291
  geometry: []
@@ -453,7 +442,11 @@ class BarDataLabels {
453
442
  dataLabelsConfig.style.fontWeight
454
443
  );
455
444
  }
445
+ const drawTotal = w.config.chart.stacked && barTotalDataLabelsConfig.enabled && this.hlt !== false && this.drawsStackedTotal(realIndex);
446
+ const totalText = drawTotal ? this.getStackedTotalDataLabel({ realIndex, j }) : void 0;
456
447
  const params = {
448
+ drawTotal,
449
+ totalText,
457
450
  x: (_a = hl == null ? void 0 : hl.x) != null ? _a : x,
458
451
  y: (_b = hl == null ? void 0 : hl.y) != null ? _b : y,
459
452
  neg: hl && hl.val != null ? hl.val < 0 : void 0,
@@ -499,7 +492,7 @@ class BarDataLabels {
499
492
  textRects,
500
493
  dataLabelsConfig
501
494
  });
502
- if (w.config.chart.stacked && barTotalDataLabelsConfig.enabled && this.hlt !== false) {
495
+ if (drawTotal) {
503
496
  totalDataLabels = this.drawTotalDataLabels({
504
497
  x: dataLabelsPos.totalDataLabelsX,
505
498
  y: dataLabelsPos.totalDataLabelsY,
@@ -508,7 +501,7 @@ class BarDataLabels {
508
501
  realIndex,
509
502
  j,
510
503
  textAnchor: dataLabelsPos.totalDataLabelsAnchor,
511
- val: this.getStackedTotalDataLabel({ realIndex, j }),
504
+ val: totalText,
512
505
  rawVal: this.getStackedTotalValue({ realIndex, j }),
513
506
  dataLabelsConfig,
514
507
  barTotalDataLabelsConfig
@@ -584,12 +577,12 @@ class BarDataLabels {
584
577
  }
585
578
  /**
586
579
  * The stacked total's text box, measured in the total's own font.
587
- * @param {number} realIndex @param {number} j
580
+ * @param {any} text the formatted total
588
581
  */
589
- totalRects(realIndex, j) {
582
+ totalRects(text) {
590
583
  const s = this.barCtx.barOptions.dataLabels.total.style;
591
584
  return new Graphics(this.w).getTextRects(
592
- this.getStackedTotalDataLabel({ realIndex, j }),
585
+ text,
593
586
  s.fontSize,
594
587
  s.fontFamily,
595
588
  void 0,
@@ -610,6 +603,16 @@ class BarDataLabels {
610
603
  }
611
604
  return val;
612
605
  }
606
+ /**
607
+ * How many zero bars ahead of this one were dropped from its group, which
608
+ * only `hideZeroBarsWhenGrouped` does (and never on a stack): 0 otherwise,
609
+ * without asking for every bar.
610
+ * @param {number} realIndex @param {number} j
611
+ */
612
+ zeroEncounters(realIndex, j) {
613
+ const w = this.w;
614
+ return !w.config.chart.stacked && w.config.plotOptions.bar.hideZeroBarsWhenGrouped ? this.barCtx.barHelpers.getZeroValueEncounters({ i: realIndex, j }).zeroEncounters : 0;
615
+ }
613
616
  /**
614
617
  * @param {Record<string, any>} opts
615
618
  */
@@ -638,10 +641,7 @@ class BarDataLabels {
638
641
  const totalDataLabelsBcx = bcx;
639
642
  barHeight = Math.abs(barHeight);
640
643
  const vertical = w.config.plotOptions.bar.dataLabels.orientation === "vertical";
641
- const { zeroEncounters } = this.barCtx.barHelpers.getZeroValueEncounters({
642
- i: realIndex,
643
- j
644
- });
644
+ const zeroEncounters = this.zeroEncounters(realIndex, j);
645
645
  bcx = bcx - strokeWidth / 2;
646
646
  const dataPointsDividedWidth = w.layout.gridWidth / w.globals.dataPoints;
647
647
  if (this.barCtx.isVerticalGroupedRangeBar) {
@@ -652,9 +652,7 @@ class BarDataLabels {
652
652
  } else {
653
653
  dataLabelsX = bcx - dataPointsDividedWidth + barWidth / 2 + offX;
654
654
  }
655
- if (!w.config.chart.stacked && zeroEncounters > 0 && w.config.plotOptions.bar.hideZeroBarsWhenGrouped) {
656
- dataLabelsX -= barWidth * zeroEncounters;
657
- }
655
+ if (zeroEncounters > 0) dataLabelsX -= barWidth * zeroEncounters;
658
656
  }
659
657
  if (vertical) {
660
658
  const offsetDLX = 2;
@@ -712,29 +710,29 @@ class BarDataLabels {
712
710
  }
713
711
  break;
714
712
  }
715
- let lowestPrevY = newY;
716
- const totalGroupCtx = this.getTotalGroupContext(realIndex);
717
- const top = this.xStackTop(realIndex, j);
718
- const stacks = top ? [] : (
719
- /** @type {any} */
720
- this.barCtx.stacks || []
721
- );
722
- if (top) {
723
- lowestPrevY = valIsNegative ? Math.max(newY, top[5]) : Math.min(newY, top[4]);
724
- }
725
- stacks.forEach((g, gi) => {
726
- if (totalGroupCtx && gi !== totalGroupCtx.groupIndex) return;
727
- g.prevY.forEach((arr) => {
728
- if (valIsNegative) {
729
- lowestPrevY = Math.max(arr[j], lowestPrevY);
730
- } else {
731
- lowestPrevY = Math.min(arr[j], lowestPrevY);
732
- }
713
+ if (opts.drawTotal) {
714
+ let lowestPrevY = newY;
715
+ const totalGroupCtx = this.getTotalGroupContext(realIndex);
716
+ const top = this.xStackTop(realIndex, j);
717
+ const stacks = top ? [] : (
718
+ /** @type {any} */
719
+ this.barCtx.stacks || []
720
+ );
721
+ if (top) {
722
+ lowestPrevY = valIsNegative ? Math.max(newY, top[5]) : Math.min(newY, top[4]);
723
+ }
724
+ stacks.forEach((g, gi) => {
725
+ if (totalGroupCtx && gi !== totalGroupCtx.groupIndex) return;
726
+ g.prevY.forEach((arr) => {
727
+ if (valIsNegative) {
728
+ lowestPrevY = Math.max(arr[j], lowestPrevY);
729
+ } else {
730
+ lowestPrevY = Math.min(arr[j], lowestPrevY);
731
+ }
732
+ });
733
733
  });
734
- });
735
- if (this.hlt) lowestPrevY = this.hlt.edge;
736
- if (this.drawsStackedTotal(realIndex) && barTotalDataLabelsConfig.enabled) {
737
- const h = this.totalRects(realIndex, j).height;
734
+ if (this.hlt) lowestPrevY = this.hlt.edge;
735
+ const h = this.totalRects(opts.totalText).height;
738
736
  if (valIsNegative) {
739
737
  totalDataLabelsY = lowestPrevY + h * 0.77 - offY - barTotalDataLabelsConfig.offsetY;
740
738
  } else {
@@ -783,10 +781,7 @@ class BarDataLabels {
783
781
  offY
784
782
  } = opts;
785
783
  const dataPointsDividedHeight = w.layout.gridHeight / w.globals.dataPoints;
786
- const { zeroEncounters } = this.barCtx.barHelpers.getZeroValueEncounters({
787
- i: realIndex,
788
- j
789
- });
784
+ const zeroEncounters = this.zeroEncounters(realIndex, j);
790
785
  barWidth = Math.abs(barWidth);
791
786
  let dataLabelsY;
792
787
  if (this.barCtx.isPyramid) {
@@ -795,9 +790,7 @@ class BarDataLabels {
795
790
  } else {
796
791
  dataLabelsY = bcy - (this.barCtx.isRangeBar ? 0 : dataPointsDividedHeight) + barHeight / 2 + textRects.height / 2 + offY - 3;
797
792
  }
798
- if (!w.config.chart.stacked && zeroEncounters > 0 && w.config.plotOptions.bar.hideZeroBarsWhenGrouped) {
799
- dataLabelsY -= barHeight * zeroEncounters;
800
- }
793
+ if (zeroEncounters > 0) dataLabelsY -= barHeight * zeroEncounters;
801
794
  let totalDataLabelsX;
802
795
  let totalDataLabelsY;
803
796
  let totalDataLabelsAnchor = "start";
@@ -834,29 +827,29 @@ class BarDataLabels {
834
827
  break;
835
828
  }
836
829
  }
837
- let lowestPrevX = newX;
838
- const totalGroupCtx = this.getTotalGroupContext(realIndex);
839
- const top = this.xStackTop(realIndex, j);
840
- const stacks = top ? [] : (
841
- /** @type {any} */
842
- this.barCtx.stacks || []
843
- );
844
- if (top) {
845
- lowestPrevX = valIsNegative ? Math.min(newX, top[4]) : Math.max(newX, top[5]);
846
- }
847
- stacks.forEach((g, gi) => {
848
- if (totalGroupCtx && gi !== totalGroupCtx.groupIndex) return;
849
- g.prevX.forEach((arr) => {
850
- if (valIsNegative) {
851
- lowestPrevX = Math.min(arr[j], lowestPrevX);
852
- } else {
853
- lowestPrevX = Math.max(arr[j], lowestPrevX);
854
- }
830
+ if (opts.drawTotal) {
831
+ let lowestPrevX = newX;
832
+ const totalGroupCtx = this.getTotalGroupContext(realIndex);
833
+ const top = this.xStackTop(realIndex, j);
834
+ const stacks = top ? [] : (
835
+ /** @type {any} */
836
+ this.barCtx.stacks || []
837
+ );
838
+ if (top) {
839
+ lowestPrevX = valIsNegative ? Math.min(newX, top[4]) : Math.max(newX, top[5]);
840
+ }
841
+ stacks.forEach((g, gi) => {
842
+ if (totalGroupCtx && gi !== totalGroupCtx.groupIndex) return;
843
+ g.prevX.forEach((arr) => {
844
+ if (valIsNegative) {
845
+ lowestPrevX = Math.min(arr[j], lowestPrevX);
846
+ } else {
847
+ lowestPrevX = Math.max(arr[j], lowestPrevX);
848
+ }
849
+ });
855
850
  });
856
- });
857
- if (this.hlt) lowestPrevX = this.hlt.edge;
858
- if (this.drawsStackedTotal(realIndex) && barTotalDataLabelsConfig.enabled) {
859
- const totalLabeltextRects = this.totalRects(realIndex, j);
851
+ if (this.hlt) lowestPrevX = this.hlt.edge;
852
+ const totalLabeltextRects = this.totalRects(opts.totalText);
860
853
  if (valIsNegative) {
861
854
  totalDataLabelsX = lowestPrevX - strokeWidth - offX - barTotalDataLabelsConfig.offsetX;
862
855
  totalDataLabelsAnchor = "end";
@@ -1080,21 +1073,12 @@ class Helpers {
1080
1073
  this.barCtx.totalItems = 0;
1081
1074
  this.barCtx.seriesLen = 0;
1082
1075
  this.barCtx.visibleI = -1;
1083
- this.barCtx.visibleItems = 1;
1076
+ this._bgOwner = void 0;
1084
1077
  for (let sl = 0; sl < series.length; sl++) {
1085
1078
  if (series[sl].length > 0) {
1086
1079
  this.barCtx.seriesLen = this.barCtx.seriesLen + 1;
1087
1080
  this.barCtx.totalItems += series[sl].length;
1088
1081
  }
1089
- if (w.axisFlags.isXNumeric) {
1090
- for (let j = 0; j < series[sl].length; j++) {
1091
- if (w.seriesData.seriesX[sl][j] > w.globals.minX && w.seriesData.seriesX[sl][j] < w.globals.maxX) {
1092
- this.barCtx.visibleItems++;
1093
- }
1094
- }
1095
- } else {
1096
- this.barCtx.visibleItems = w.globals.dataPoints;
1097
- }
1098
1082
  }
1099
1083
  const labels = w.labelData.labels;
1100
1084
  this.rows = w.globals.isBarHorizontal && w.axisFlags.isXNumeric && !this.barCtx.isRangeBar && w.seriesData.seriesX.some((s) => s == null ? void 0 : s.some((x, j) => x !== labels[j])) ? new Map(labels.map((x, r) => [x, r])) : null;
@@ -1215,6 +1199,26 @@ class Helpers {
1215
1199
  }
1216
1200
  return isFinite(min) ? min : 0;
1217
1201
  }
1202
+ /**
1203
+ * How many bars a column slot is divided by: the data points on a category
1204
+ * axis, and on a numeric one 1 plus every x strictly inside the axis range.
1205
+ * Only read when a numeric axis has no slot span, so counted then.
1206
+ * @returns {number}
1207
+ */
1208
+ visibleItems() {
1209
+ const g = this.w.globals;
1210
+ if (!this.w.axisFlags.isXNumeric) return g.dataPoints;
1211
+ let n = 1;
1212
+ const xs = this.w.seriesData.seriesX;
1213
+ this.barCtx.series.forEach(
1214
+ (s, sl) => {
1215
+ for (let j = 0; j < s.length; j++) {
1216
+ if (xs[sl][j] > g.minX && xs[sl][j] < g.maxX) n++;
1217
+ }
1218
+ }
1219
+ );
1220
+ return n;
1221
+ }
1218
1222
  /**
1219
1223
  * The band a horizontal bar is drawn in: its x's band when the series do
1220
1224
  * not line up by index (see initVariables), else its index.
@@ -1251,15 +1255,13 @@ class Helpers {
1251
1255
  }
1252
1256
  y = (yDivision - barHeight * this.barCtx.seriesLen) / 2;
1253
1257
  } else {
1254
- xDivision = w.layout.gridWidth / this.barCtx.visibleItems;
1255
- if (w.config.xaxis.convertedCatToNumeric) {
1256
- xDivision = w.layout.gridWidth / w.globals.dataPoints;
1257
- }
1258
+ const xRatio = this.barCtx.xRatio;
1259
+ const slotXSpan = w.axisFlags.isXNumeric ? this.barSlotXSpan() : 0;
1260
+ const bySlot = slotXSpan > 0 && slotXSpan / xRatio > 0;
1261
+ xDivision = w.config.xaxis.convertedCatToNumeric ? w.layout.gridWidth / w.globals.dataPoints : bySlot ? 0 : w.layout.gridWidth / this.visibleItems();
1258
1262
  barWidth = xDivision / seriesLen * parseInt(this.barCtx.barOptions.columnWidth, 10) / 100;
1259
1263
  if (w.axisFlags.isXNumeric) {
1260
- const xRatio = this.barCtx.xRatio;
1261
- const slotXSpan = this.barSlotXSpan();
1262
- if (slotXSpan > 0 && slotXSpan / xRatio > 0) {
1264
+ if (bySlot) {
1263
1265
  xDivision = slotXSpan / xRatio;
1264
1266
  }
1265
1267
  barWidth = xDivision / seriesLen * parseInt(this.barCtx.barOptions.columnWidth, 10) / 100;
@@ -1559,22 +1561,25 @@ class Helpers {
1559
1561
  /** @param {{ j?: any, i?: any, x1?: any, x2?: any, y1?: any, y2?: any, bc?: any, elSeries?: any }} opts */
1560
1562
  barBackground({ j, i, x1, x2, y1, y2, elSeries }) {
1561
1563
  const w = this.w;
1562
- const graphics = new Graphics(this.barCtx.w);
1563
- const sr = new Series(this.barCtx.w);
1564
- const activeSeriesIndex = sr.getActiveConfigSeriesIndex();
1565
- if (this.barCtx.barOptions.colors.backgroundBarColors.length > 0 && activeSeriesIndex === i) {
1566
- if (j >= this.barCtx.barOptions.colors.backgroundBarColors.length) {
1567
- j %= this.barCtx.barOptions.colors.backgroundBarColors.length;
1564
+ const colors = this.barCtx.barOptions.colors;
1565
+ if (!colors.backgroundBarColors.length) return;
1566
+ if (this._bgOwner === void 0) {
1567
+ this._bgOwner = new Series(w).getActiveConfigSeriesIndex();
1568
+ }
1569
+ if (this._bgOwner === i) {
1570
+ const graphics = new Graphics(w);
1571
+ if (j >= colors.backgroundBarColors.length) {
1572
+ j %= colors.backgroundBarColors.length;
1568
1573
  }
1569
- const bcolor = this.barCtx.barOptions.colors.backgroundBarColors[j];
1574
+ const bcolor = colors.backgroundBarColors[j];
1570
1575
  const rect = graphics.drawRect(
1571
1576
  typeof x1 !== "undefined" ? x1 : 0,
1572
1577
  typeof y1 !== "undefined" ? y1 : 0,
1573
1578
  typeof x2 !== "undefined" ? x2 : w.layout.gridWidth,
1574
1579
  typeof y2 !== "undefined" ? y2 : w.layout.gridHeight,
1575
- this.barCtx.barOptions.colors.backgroundBarRadius,
1580
+ colors.backgroundBarRadius,
1576
1581
  bcolor,
1577
- this.barCtx.barOptions.colors.backgroundBarOpacity
1582
+ colors.backgroundBarOpacity
1578
1583
  );
1579
1584
  elSeries.add(rect);
1580
1585
  rect.node.classList.add("apexcharts-backgroundBar");
@@ -1591,13 +1596,37 @@ class Helpers {
1591
1596
  * `base` is the rect collapsed onto its baseline, padded to the command
1592
1597
  * count of `pathTo` so the rise morphs cleanly.
1593
1598
  *
1594
- * @param {{a: number, len: number, v1: number, v2: number, strokeWidth: any, realIndex: number, j: number, dir: number, horizontal?: boolean}} o
1599
+ * `insetWidth`, when given, is the stroke width used only for the sideways
1600
+ * inset along the slot (`a`/`len`); the value axis keeps `strokeWidth`. It
1601
+ * defaults to `strokeWidth`, so one width sets both directions. When
1602
+ * `strokeWidth` is the smaller (an empty segment of a stroked series), the
1603
+ * rect collapses onto its base edge inset by `insetWidth`, where its drawn
1604
+ * self starts.
1605
+ *
1606
+ * @param {{a: number, len: number, v1: number, v2: number, strokeWidth: any, insetWidth?: any, realIndex: number, j: number, dir: number, horizontal?: boolean}} o
1595
1607
  */
1596
- barRect({ a, len, v1, v2, strokeWidth, realIndex, j, dir, horizontal }) {
1608
+ barRect({
1609
+ a,
1610
+ len,
1611
+ v1,
1612
+ v2,
1613
+ strokeWidth,
1614
+ insetWidth,
1615
+ realIndex,
1616
+ j,
1617
+ dir,
1618
+ horizontal
1619
+ }) {
1597
1620
  const w = this.w;
1598
1621
  const graphics = new Graphics(w);
1599
1622
  strokeWidth = Array.isArray(strokeWidth) ? strokeWidth[realIndex] : strokeWidth;
1600
1623
  if (!strokeWidth) strokeWidth = 0;
1624
+ if (insetWidth === void 0) {
1625
+ insetWidth = strokeWidth;
1626
+ } else {
1627
+ insetWidth = Array.isArray(insetWidth) ? insetWidth[realIndex] : insetWidth;
1628
+ if (!insetWidth) insetWidth = 0;
1629
+ }
1601
1630
  const datum = (
1602
1631
  /** @type {any} */
1603
1632
  w.config.series[realIndex].data[j]
@@ -1608,28 +1637,35 @@ class Helpers {
1608
1637
  len += offset;
1609
1638
  }
1610
1639
  const strokeCenter = strokeWidth / 2;
1640
+ const insetCenter = insetWidth / 2;
1611
1641
  const direction = dir * (this.barCtx.isReversed ? -1 : 1);
1642
+ const empty = strokeWidth < insetWidth;
1643
+ const baseCenter = empty ? insetCenter : strokeCenter;
1644
+ let tip;
1612
1645
  const closing = w.config.plotOptions.bar.borderRadiusApplication === "around" || this.arrBorderRadius[realIndex][j] === "both" ? " Z" : " z";
1613
1646
  let x1, x2, y1, y2, sl, squarePathTo;
1614
1647
  if (horizontal) {
1615
- y1 = a + strokeCenter;
1616
- y2 = a + len - strokeCenter;
1617
- x1 = v1 + 1e-3 + strokeCenter * direction;
1618
- x2 = v2 + 1e-3 - strokeCenter * direction;
1648
+ y1 = a + insetCenter;
1649
+ y2 = a + len - insetCenter;
1650
+ x1 = v1 + 1e-3 + baseCenter * direction;
1651
+ tip = v2 + 1e-3 - strokeCenter * direction;
1652
+ x2 = empty ? x1 : tip;
1619
1653
  sl = graphics.line(x1, y2);
1620
1654
  squarePathTo = graphics.move(x1, y1) + graphics.line(x2, y1) + graphics.line(x2, y2) + sl + closing;
1621
1655
  } else {
1622
- x1 = a + strokeCenter;
1623
- x2 = a + len - strokeCenter;
1624
- y1 = v1 + 1e-3 - strokeCenter * direction;
1625
- y2 = v2 + 1e-3 + strokeCenter * direction;
1656
+ x1 = a + insetCenter;
1657
+ x2 = a + len - insetCenter;
1658
+ y1 = v1 + 1e-3 - baseCenter * direction;
1659
+ tip = v2 + 1e-3 + strokeCenter * direction;
1660
+ y2 = empty ? y1 : tip;
1626
1661
  sl = graphics.line(x2, y1);
1627
1662
  squarePathTo = graphics.move(x1, y1) + graphics.line(x1, y2) + graphics.line(x2, y2) + sl + closing;
1628
1663
  }
1629
- const pathTo = this.arrBorderRadius[realIndex][j] !== "none" ? graphics.roundPathCorners(
1630
- squarePathTo,
1631
- w.config.plotOptions.bar.borderRadius
1632
- ) : squarePathTo;
1664
+ const radius = w.config.plotOptions.bar.borderRadius;
1665
+ let pathTo = squarePathTo;
1666
+ if (this.arrBorderRadius[realIndex][j] !== "none") {
1667
+ pathTo = radius === 0 && isFinite(x1 + x2 + y1 + y2) ? squarePathTo.replace(" Z", ` L ${x1} ${y1} Z`).replace(/ L (\S+ \S+)(?= [LZ])/g, " L $1 C $1 $1 $1") + " " : graphics.roundPathCorners(squarePathTo, radius);
1668
+ }
1633
1669
  return {
1634
1670
  x1,
1635
1671
  x2,
@@ -1640,18 +1676,47 @@ class Helpers {
1640
1676
  squarePathTo,
1641
1677
  pathTo,
1642
1678
  base: graphics.move(x1, y1) + graphics.line(x1, y1) + sl + sl + sl + sl + sl + graphics.line(x1, y1) + closing,
1679
+ // the value end before an empty segment folds it onto its base edge
1680
+ tip,
1643
1681
  strokeWidth,
1644
1682
  strokeCenter,
1645
1683
  direction
1646
1684
  };
1647
1685
  }
1648
- /** @param {{ barWidth?: any, barXPosition?: any, y1?: any, y2?: any, yRatio?: any, strokeWidth?: any, isReversed?: any, series?: any, realIndex?: any, i?: any, j?: any, w?: any }} opts */
1686
+ /**
1687
+ * The sign a legend-hidden column had, read from the data its collapse
1688
+ * stored (its values are all 0 while hidden): 1, -1, or 0 when the series
1689
+ * is not hidden or the datum has no sign. A hidden layer then folds onto
1690
+ * the base edge of the side it left, where its neighbours' strokes run.
1691
+ * @param {number} realIndex @param {number} j
1692
+ * @returns {number}
1693
+ */
1694
+ collapsedSign(realIndex, j) {
1695
+ var _a;
1696
+ const gl = this.w.globals;
1697
+ const lists = [
1698
+ [gl.collapsedSeriesIndices, gl.collapsedSeries],
1699
+ [gl.ancillaryCollapsedSeriesIndices, gl.ancillaryCollapsedSeries]
1700
+ ];
1701
+ for (const [indices, entries] of lists) {
1702
+ if (!indices || indices.indexOf(realIndex) < 0) continue;
1703
+ const c = (entries || []).find(
1704
+ (s) => s.index === realIndex
1705
+ );
1706
+ const d = (_a = c == null ? void 0 : c.data) == null ? void 0 : _a[j];
1707
+ const v = Array.isArray(d) ? d[1] : d && typeof d === "object" ? d.y : d;
1708
+ return typeof v === "number" && v ? Math.sign(v) : 0;
1709
+ }
1710
+ return 0;
1711
+ }
1712
+ /** @param {{ barWidth?: any, barXPosition?: any, y1?: any, y2?: any, yRatio?: any, strokeWidth?: any, insetWidth?: any, isReversed?: any, series?: any, realIndex?: any, i?: any, j?: any, w?: any }} opts */
1649
1713
  getColumnPaths({
1650
1714
  barWidth,
1651
1715
  barXPosition,
1652
1716
  y1,
1653
1717
  y2,
1654
1718
  strokeWidth,
1719
+ insetWidth,
1655
1720
  series,
1656
1721
  realIndex,
1657
1722
  i,
@@ -1665,9 +1730,10 @@ class Helpers {
1665
1730
  v1: y1,
1666
1731
  v2: y2,
1667
1732
  strokeWidth,
1733
+ insetWidth,
1668
1734
  realIndex,
1669
1735
  j,
1670
- dir: series[i][j] >= 0 ? 1 : -1
1736
+ dir: this.collapsedSign(realIndex, j) || (series[i][j] >= 0 ? 1 : -1)
1671
1737
  });
1672
1738
  const { pathTo, squarePathTo, strokeCenter, direction } = r;
1673
1739
  y1 = r.y1;
@@ -1687,7 +1753,7 @@ class Helpers {
1687
1753
  }
1688
1754
  if (w.config.chart.stacked) {
1689
1755
  const _ctx = this.barCtx.groupCtx;
1690
- _ctx.yArrj.push(y2 - strokeCenter * direction);
1756
+ _ctx.yArrj.push(r.tip - strokeCenter * direction);
1691
1757
  _ctx.yArrjF.push(Math.abs(y1 - y2 + r.strokeWidth * direction));
1692
1758
  _ctx.yArrjVal.push((_c = this.barCtx.series[i][j]) != null ? _c : null);
1693
1759
  }
@@ -2274,24 +2340,24 @@ function lengthTransitionEnabled(w) {
2274
2340
  return !!(Environment.isBrowser() && w.globals.dataChanged && w.globals.shouldAnimate);
2275
2341
  }
2276
2342
  function datumKey(w, realIndex, j) {
2277
- var _a, _b, _c, _d;
2278
- if ((_a = w.axisFlags) == null ? void 0 : _a.isXNumeric) {
2279
- const sx = (_c = (_b = w.seriesData) == null ? void 0 : _b.seriesX) == null ? void 0 : _c[realIndex];
2280
- if (sx && sx.length && sx[j] != null) return "x:" + sx[j];
2281
- }
2282
- const lbl = (_d = w.globals.labels) == null ? void 0 : _d[j];
2283
- if (lbl != null && String(lbl) !== "") {
2284
- return "c:" + (Array.isArray(lbl) ? lbl.join(" ") : String(lbl));
2285
- }
2286
- return "j:" + j;
2343
+ var _a, _b;
2344
+ return keyOf(
2345
+ (_a = w.axisFlags) == null ? void 0 : _a.isXNumeric,
2346
+ (_b = w.seriesData) == null ? void 0 : _b.seriesX,
2347
+ w.globals.labels,
2348
+ realIndex,
2349
+ j
2350
+ );
2287
2351
  }
2288
2352
  function frameDatumKey(frame, realIndex, j) {
2289
- var _a, _b;
2290
- if (frame.isXNumeric) {
2291
- const sx = (_a = frame.seriesX) == null ? void 0 : _a[realIndex];
2353
+ return keyOf(frame.isXNumeric, frame.seriesX, frame.labels, realIndex, j);
2354
+ }
2355
+ function keyOf(isXNumeric, seriesX, labels, realIndex, j) {
2356
+ if (isXNumeric) {
2357
+ const sx = seriesX == null ? void 0 : seriesX[realIndex];
2292
2358
  if (sx && sx.length && sx[j] != null) return "x:" + sx[j];
2293
2359
  }
2294
- const lbl = (_b = frame.labels) == null ? void 0 : _b[j];
2360
+ const lbl = labels == null ? void 0 : labels[j];
2295
2361
  if (lbl != null && String(lbl) !== "") {
2296
2362
  return "c:" + (Array.isArray(lbl) ? lbl.join(" ") : String(lbl));
2297
2363
  }
@@ -2336,7 +2402,13 @@ function seriesKeys(w, realIndex, n = ((_a) => (_a = w.seriesData.series[realInd
2336
2402
  Array.from({ length: n }, (_, j) => datumKey(w, realIndex, j))
2337
2403
  );
2338
2404
  }
2339
- function seriesJoin(w, realIndex, includeIdentity = false, allowReorder = false) {
2405
+ function seriesJoin(w, realIndex, includeIdentity = false, allowReorder = false, sj = buildJoin(w, realIndex)) {
2406
+ if (!sj) return null;
2407
+ if (!sj.join.ordered && !allowReorder) return null;
2408
+ if (!sj.join.changed && !includeIdentity) return null;
2409
+ return sj;
2410
+ }
2411
+ function buildJoin(w, realIndex) {
2340
2412
  var _a, _b;
2341
2413
  if (!lengthTransitionEnabled(w)) return null;
2342
2414
  const frame = w.globals.prevStreamFrame;
@@ -2349,10 +2421,23 @@ function seriesJoin(w, realIndex, includeIdentity = false, allowReorder = false)
2349
2421
  oldY.map((_, j) => frameDatumKey(frame, realIndex, j))
2350
2422
  );
2351
2423
  const newKeys = seriesKeys(w, realIndex);
2352
- const join = joinKeys(oldKeys, newKeys);
2353
- if (!join.ordered && !allowReorder) return null;
2354
- if (!join.changed && !includeIdentity) return null;
2355
- return { join, oldKeys, newKeys };
2424
+ return { join: joinKeys(oldKeys, newKeys), oldKeys, newKeys };
2425
+ }
2426
+ function rafTween(w, duration, ease, onFrame, onDone, alive, startAt = performance.now()) {
2427
+ const step = (now) => {
2428
+ if (w.globals.isDestroyed || alive && !alive()) return;
2429
+ const raw = Math.max(0, Math.min(1, (now - startAt) / duration));
2430
+ onFrame(ease(raw), raw);
2431
+ if (raw < 1) {
2432
+ BrowserAPIs.requestAnimationFrame(step);
2433
+ } else if (onDone) {
2434
+ onDone();
2435
+ }
2436
+ };
2437
+ BrowserAPIs.requestAnimationFrame(step);
2438
+ return () => {
2439
+ alive = () => false;
2440
+ };
2356
2441
  }
2357
2442
  function firstMove(d) {
2358
2443
  const m = /^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(d || "");
@@ -2361,6 +2446,7 @@ function firstMove(d) {
2361
2446
  const y = parseFloat(m[2]);
2362
2447
  return isFinite(x) && isFinite(y) ? { x, y } : null;
2363
2448
  }
2449
+ const GHOST_EASE = (t) => 1 - Math.pow(1 - t, 3);
2364
2450
  function renderBarExitGhosts({
2365
2451
  w,
2366
2452
  elSeries,
@@ -2379,7 +2465,9 @@ function renderBarExitGhosts({
2379
2465
  if (!exits.length) return;
2380
2466
  const graphics = new Graphics(w);
2381
2467
  const fallbackFill = (_a = w.globals.colors) == null ? void 0 : _a[parseInt(String(record.realIndex), 10)];
2382
- exits.forEach((p) => {
2468
+ const host = elSeries.node;
2469
+ const staged = host.ownerDocument.createDocumentFragment();
2470
+ const nodes = exits.map((p) => {
2383
2471
  let fill = p.fill || fallbackFill || "#c8c8c8";
2384
2472
  if (String(fill).indexOf("url(") === 0) fill = fallbackFill || "#c8c8c8";
2385
2473
  const ghost = graphics.drawPath({
@@ -2396,46 +2484,45 @@ function renderBarExitGhosts({
2396
2484
  "clip-path",
2397
2485
  `url(#gridRectBarMask${w.globals.cuid})`
2398
2486
  );
2399
- elSeries.node.insertBefore(node, elSeries.node.firstChild);
2400
- const start = firstMove(p.d);
2401
- let origin = isHorizontal ? "left center" : "center bottom";
2487
+ staged.insertBefore(node, staged.firstChild);
2488
+ return node;
2489
+ });
2490
+ host.insertBefore(staged, host.firstChild);
2491
+ const boxes = nodes.map((node) => {
2402
2492
  try {
2403
- const bb = node.getBBox();
2404
- if (start && bb) {
2405
- if (isHorizontal) {
2406
- origin = Math.abs(start.x - bb.x) <= Math.abs(start.x - (bb.x + bb.width)) ? "left center" : "right center";
2407
- } else {
2408
- origin = Math.abs(start.y - (bb.y + bb.height)) <= Math.abs(start.y - bb.y) ? "center bottom" : "center top";
2409
- }
2410
- }
2493
+ return node.getBBox();
2411
2494
  } catch (_) {
2495
+ return null;
2412
2496
  }
2497
+ });
2498
+ const t0 = performance.now();
2499
+ exits.forEach((p, i) => {
2500
+ const node = nodes[i];
2501
+ const bb = boxes[i];
2502
+ const start = firstMove(p.d);
2503
+ const near = !start || !bb || (isHorizontal ? Math.abs(start.x - bb.x) <= Math.abs(start.x - (bb.x + bb.width)) : Math.abs(start.y - (bb.y + bb.height)) <= Math.abs(start.y - bb.y));
2413
2504
  const style = node.style;
2414
2505
  style.transformBox = "fill-box";
2415
- style.transformOrigin = origin;
2506
+ style.transformOrigin = isHorizontal ? near ? "left center" : "right center" : near ? "center bottom" : "center top";
2416
2507
  node.setAttribute("data:ghostKey", `${record.realIndex}::${p.key}`);
2417
- try {
2418
- const bb = node.getBBox();
2419
- const edge = isHorizontal ? origin.startsWith("left") ? bb.x : bb.x + bb.width : origin.endsWith("bottom") ? bb.y + bb.height : bb.y;
2508
+ node.setAttribute("data:ghostStart", String(t0));
2509
+ if (bb) {
2510
+ const edge = isHorizontal ? near ? bb.x : bb.x + bb.width : near ? bb.y + bb.height : bb.y;
2420
2511
  if (isFinite(edge)) node.setAttribute("data:ghostEdge", String(edge));
2421
- } catch (_) {
2422
2512
  }
2423
- const duration = Math.max(1, speed || 1);
2424
- const startAt = performance.now();
2425
- const step = (now) => {
2426
- if (w.globals.isDestroyed || !node.parentNode) return;
2427
- const t = Math.max(0, Math.min(1, (now - startAt) / duration));
2428
- const eased = 1 - Math.pow(1 - t, 3);
2429
- const scale = 1 - eased;
2430
- style.transform = isHorizontal ? `scaleX(${scale})` : `scaleY(${scale})`;
2431
- style.opacity = String(1 - eased);
2432
- if (t < 1) {
2433
- BrowserAPIs.requestAnimationFrame(step);
2434
- } else {
2435
- node.parentNode.removeChild(node);
2436
- }
2437
- };
2438
- BrowserAPIs.requestAnimationFrame(step);
2513
+ rafTween(
2514
+ w,
2515
+ Math.max(1, speed || 1),
2516
+ GHOST_EASE,
2517
+ (eased) => {
2518
+ const scale = 1 - eased;
2519
+ style.transform = isHorizontal ? `scaleX(${scale})` : `scaleY(${scale})`;
2520
+ style.opacity = String(scale);
2521
+ },
2522
+ () => node.remove(),
2523
+ () => node.parentNode,
2524
+ t0
2525
+ );
2439
2526
  });
2440
2527
  }
2441
2528
  class AxisMapping {
@@ -2468,23 +2555,74 @@ class AxisMapping {
2468
2555
  return w.globals.minX + px * AxisMapping.xRatio(w);
2469
2556
  }
2470
2557
  /**
2471
- * Client (screen) x -> pixels from the plot origin. The origin is the svg
2472
- * element's left edge plus `translateX`, never the `.apexcharts-grid` box
2473
- * (fact 2 above), so the result does not depend on what the grid happens to
2474
- * render. `svgWidth` is the unscaled width the svg was drawn at, so the ratio
2475
- * against the measured one is the CSS zoom of any container the chart sits in.
2558
+ * The plot area on screen, in client px: its corner is where the plot's
2559
+ * group is translated to (translateX, translateY into the svg), and it is
2560
+ * gridWidth by gridHeight. The one screen-to-plot measurement: the tooltip,
2561
+ * zoom, selection and every other pointer reader map through it, so x and y
2562
+ * cannot disagree under CSS zoom.
2563
+ *
2564
+ * Never the `.apexcharts-grid` group's box: a group measures to the union
2565
+ * of what it happens to draw (fact 2 above). The plot's outline starts a
2566
+ * pixel down (`Grid.drawGridArea`), so unless gridlines or row bands reach
2567
+ * the top edge the box starts a pixel below the plot, and on a numeric-x bar
2568
+ * chart the horizontal gridlines run `barPadForNumericAxis` out past both
2569
+ * sides.
2570
+ *
2571
+ * `zoom` is the CSS zoom of any container the chart sits in (screen px per
2572
+ * plot px): the measured svg width over `svgWidth`, the unscaled width it
2573
+ * was drawn at. A distance measured on screen from this corner is divided
2574
+ * by it to land in plot px, the space the series are laid out and painted in.
2575
+ * With nothing mounted to measure, screen px are taken as svg px.
2576
+ *
2577
+ * @param {import('../types/internal').ChartStateW} w
2578
+ * @returns {{ left: number, top: number, width: number, height: number, zoom: number }}
2579
+ */
2580
+ static plotRect(w) {
2581
+ var _a, _b, _c;
2582
+ const svg = ((_a = w.dom.Paper) == null ? void 0 : _a.node) || ((_b = w.dom.baseEl) == null ? void 0 : _b.querySelector(".apexcharts-svg"));
2583
+ const box = ((_c = svg || w.dom.elWrap) == null ? void 0 : _c.getBoundingClientRect()) || {
2584
+ left: 0,
2585
+ top: 0,
2586
+ width: 0
2587
+ };
2588
+ const zoom = (svg && w.globals.svgWidth ? box.width / w.globals.svgWidth : 1) || 1;
2589
+ return {
2590
+ left: box.left + w.layout.translateX * zoom,
2591
+ top: box.top + w.layout.translateY * zoom,
2592
+ width: w.layout.gridWidth * zoom,
2593
+ height: w.layout.gridHeight * zoom,
2594
+ zoom
2595
+ };
2596
+ }
2597
+ /**
2598
+ * Client (screen) x -> pixels from the plot origin of {@link plotRect}.
2599
+ * Pass the rect when the caller has already measured it.
2476
2600
  * @param {import('../types/internal').ChartStateW} w
2477
2601
  * @param {number} screenX
2602
+ * @param {{ left: number, zoom: number }} [plot]
2478
2603
  * @returns {number}
2479
2604
  */
2480
- static screenXToPlotPx(w, screenX) {
2481
- const baseEl = w.dom.baseEl;
2482
- const svg = baseEl && baseEl.querySelector(".apexcharts-svg");
2483
- if (!svg) return screenX - w.layout.translateX;
2484
- const svgRect = svg.getBoundingClientRect();
2485
- const zoom = w.globals.svgWidth ? svgRect.width / w.globals.svgWidth : 1;
2486
- return (screenX - svgRect.left) / (zoom || 1) - w.layout.translateX;
2605
+ static screenXToPlotPx(w, screenX, plot = AxisMapping.plotRect(w)) {
2606
+ return (screenX - plot.left) / plot.zoom;
2607
+ }
2608
+ }
2609
+ const indexes = /* @__PURE__ */ new WeakMap();
2610
+ function prevRecords(w, realIndex) {
2611
+ const all = w.globals.previousPaths;
2612
+ let idx = indexes.get(all);
2613
+ if (!idx || idx.n !== all.length) {
2614
+ idx = { n: all.length, m: /* @__PURE__ */ new Map() };
2615
+ for (const gpp of all) {
2616
+ const k = parseInt((gpp || {}).realIndex, 10);
2617
+ if (k === k) {
2618
+ const list = idx.m.get(k);
2619
+ if (list) list.push(gpp);
2620
+ else idx.m.set(k, [gpp]);
2621
+ }
2622
+ }
2623
+ indexes.set(all, idx);
2487
2624
  }
2625
+ return idx.m.get(parseInt(String(realIndex), 10)) || [];
2488
2626
  }
2489
2627
  function seriesEmitter(ctx, graphics) {
2490
2628
  const r = ctx && ctx.renderer;
@@ -3078,7 +3216,7 @@ class Bar {
3078
3216
  }
3079
3217
  /** @param {{indexes: any, barHeight: any, strokeWidth: any, zeroW: any, x: any, y: any, yDivision: any, elSeries: any}} opts */
3080
3218
  drawBarPaths({
3081
- indexes,
3219
+ indexes: indexes2,
3082
3220
  barHeight,
3083
3221
  strokeWidth,
3084
3222
  zeroW,
@@ -3088,12 +3226,12 @@ class Bar {
3088
3226
  elSeries
3089
3227
  }) {
3090
3228
  const w = this.w;
3091
- const i = indexes.i;
3092
- const j = indexes.j;
3229
+ const i = indexes2.i;
3230
+ const j = indexes2.j;
3093
3231
  let barYPosition;
3094
3232
  if (w.config.plotOptions.bar.hideZeroBarsWhenGrouped) {
3095
3233
  const { nonZeroColumns, zeroEncounters } = this.barHelpers.getZeroValueEncounters({
3096
- i: indexes.realIndex,
3234
+ i: indexes2.realIndex,
3097
3235
  j
3098
3236
  });
3099
3237
  if (nonZeroColumns > 0) {
@@ -3133,7 +3271,7 @@ class Bar {
3133
3271
  barHeight,
3134
3272
  topHalf: pyramidSeg.topHalf,
3135
3273
  bottomHalf: pyramidSeg.bottomHalf,
3136
- realIndex: indexes.realIndex,
3274
+ realIndex: indexes2.realIndex,
3137
3275
  j,
3138
3276
  strokeWidth,
3139
3277
  w
@@ -3149,7 +3287,7 @@ class Bar {
3149
3287
  ),
3150
3288
  i,
3151
3289
  j,
3152
- realIndex: indexes.realIndex,
3290
+ realIndex: indexes2.realIndex,
3153
3291
  strokeWidth,
3154
3292
  w
3155
3293
  });
@@ -3163,7 +3301,7 @@ class Bar {
3163
3301
  strokeWidth,
3164
3302
  isReversed: this.isReversed,
3165
3303
  series: this.series,
3166
- realIndex: indexes.realIndex,
3304
+ realIndex: indexes2.realIndex,
3167
3305
  i,
3168
3306
  j,
3169
3307
  w
@@ -3197,7 +3335,7 @@ class Bar {
3197
3335
  zeroW,
3198
3336
  /** @type {any} */
3199
3337
  null,
3200
- indexes.realIndex,
3338
+ indexes2.realIndex,
3201
3339
  j,
3202
3340
  0
3203
3341
  ),
@@ -3207,7 +3345,7 @@ class Bar {
3207
3345
  }
3208
3346
  /** @param {{indexes: any, x: any, y: any, xDivision: any, barWidth: any, zeroH: any, strokeWidth: any, elSeries: any}} opts */
3209
3347
  drawColumnPaths({
3210
- indexes,
3348
+ indexes: indexes2,
3211
3349
  x,
3212
3350
  y,
3213
3351
  xDivision,
@@ -3217,11 +3355,11 @@ class Bar {
3217
3355
  elSeries
3218
3356
  }) {
3219
3357
  const w = this.w;
3220
- const realIndex = indexes.realIndex;
3221
- const translationsIndex = indexes.translationsIndex;
3222
- const i = indexes.i;
3223
- const j = indexes.j;
3224
- const bc = indexes.bc;
3358
+ const realIndex = indexes2.realIndex;
3359
+ const translationsIndex = indexes2.translationsIndex;
3360
+ const i = indexes2.i;
3361
+ const j = indexes2.j;
3362
+ const bc = indexes2.bc;
3225
3363
  let barXPosition;
3226
3364
  if (w.axisFlags.isXNumeric) {
3227
3365
  const xForNumericX = this.getBarXForNumericXAxis({
@@ -3351,15 +3489,38 @@ class Bar {
3351
3489
  * @returns {any | null}
3352
3490
  */
3353
3491
  _prevRecord(realIndex) {
3354
- const w = this.w;
3355
- let record = null;
3356
- for (let pp = 0; pp < w.globals.previousPaths.length; pp++) {
3357
- const gpp = w.globals.previousPaths[pp];
3358
- if (gpp.paths && gpp.paths.length > 0 && parseInt(gpp.realIndex, 10) === parseInt(String(realIndex), 10)) {
3359
- record = gpp;
3360
- }
3492
+ const list = prevRecords(this.w, realIndex);
3493
+ for (let k = list.length - 1; k >= 0; k--) {
3494
+ if (list[k].paths && list[k].paths.length > 0) return list[k];
3361
3495
  }
3362
- return record;
3496
+ return null;
3497
+ }
3498
+ /**
3499
+ * Whether this render uses a bar's `pathFrom` at all (Graphics.revealPlan,
3500
+ * the predicate renderPaths itself runs); when it does not, the
3501
+ * previous-path lookups and corner padding built for it are skipped. A
3502
+ * chart drawing highlight parts (now or a frame ago) keeps them: its parts
3503
+ * start from the whole's pathFrom on their own rule. Canvas paints the
3504
+ * final frame. `_fadeReveal` is the candles' per-series fade.
3505
+ * @returns {boolean}
3506
+ */
3507
+ _pathFromUsed() {
3508
+ var _a;
3509
+ const w = this.w;
3510
+ const hd = w.highlightData;
3511
+ const parts = (
3512
+ /** @type {any} */
3513
+ w.globals.prevHighlightParts
3514
+ );
3515
+ if (hd && (hd.active || (parts == null ? void 0 : parts.size))) return true;
3516
+ const r = (_a = this.ctx) == null ? void 0 : _a.renderer;
3517
+ if (r && r.kind && r.kind !== "svg") return false;
3518
+ const p = new Graphics(w, this.ctx).revealPlan(
3519
+ "",
3520
+ /** @type {any} */
3521
+ this._fadeReveal
3522
+ );
3523
+ return p.animate && !p.fade;
3363
3524
  }
3364
3525
  /**
3365
3526
  * Previous paths of a series re-keyed by datum key (stamped as
@@ -3464,6 +3625,7 @@ class Bar {
3464
3625
  getPreviousPath(realIndex, j, pathTo, squarePathTo) {
3465
3626
  const w = this.w;
3466
3627
  this._pathToInterp = null;
3628
+ if (!this._pathFromUsed()) return pathTo;
3467
3629
  const record = this._prevRecord(realIndex);
3468
3630
  if (!record) {
3469
3631
  return lengthTransitionEnabled(w) ? null : pathTo;
@@ -3940,7 +4102,7 @@ class BarStacked extends Bar {
3940
4102
  }
3941
4103
  /** @param {{indexes: any, barHeight: any, strokeWidth: any, zeroW: any, x: any, y: any, columnGroupIndex: any, yDivision: any, elSeries: any}} opts */
3942
4104
  drawStackedBarPaths({
3943
- indexes,
4105
+ indexes: indexes2,
3944
4106
  barHeight,
3945
4107
  strokeWidth,
3946
4108
  zeroW,
@@ -3954,10 +4116,10 @@ class BarStacked extends Bar {
3954
4116
  const w = this.w;
3955
4117
  const barYPosition = y + columnGroupIndex * barHeight;
3956
4118
  let barXPosition;
3957
- const i = indexes.i;
3958
- const j = indexes.j;
3959
- const realIndex = indexes.realIndex;
3960
- const translationsIndex = indexes.translationsIndex;
4119
+ const i = indexes2.i;
4120
+ const j = indexes2.j;
4121
+ const realIndex = indexes2.realIndex;
4122
+ const translationsIndex = indexes2.translationsIndex;
3961
4123
  const v = (
3962
4124
  /** @type {any} */
3963
4125
  (_b = (_a = this.series[i]) == null ? void 0 : _a[j]) != null ? _b : null
@@ -3981,7 +4143,7 @@ class BarStacked extends Bar {
3981
4143
  strokeWidth,
3982
4144
  isReversed: this.isReversed,
3983
4145
  series: this.series,
3984
- realIndex: indexes.realIndex,
4146
+ realIndex: indexes2.realIndex,
3985
4147
  i,
3986
4148
  j,
3987
4149
  w
@@ -4013,24 +4175,25 @@ class BarStacked extends Bar {
4013
4175
  y
4014
4176
  };
4015
4177
  }
4016
- /** @param {{indexes: any, x: any, y: any, xDivision: any, barWidth: any, zeroH: any, columnGroupIndex: any, elSeries: any}} opts */
4178
+ /** @param {{indexes: any, x: any, y: any, xDivision: any, barWidth: any, zeroH: any, columnGroupIndex: any, strokeWidth: any, elSeries: any}} opts */
4017
4179
  drawStackedColumnPaths({
4018
- indexes,
4180
+ indexes: indexes2,
4019
4181
  x,
4020
4182
  y,
4021
4183
  xDivision,
4022
4184
  barWidth,
4023
4185
  zeroH,
4024
4186
  columnGroupIndex,
4187
+ strokeWidth,
4025
4188
  elSeries
4026
4189
  }) {
4027
4190
  var _a, _b, _c;
4028
4191
  const w = this.w;
4029
- const i = indexes.i;
4030
- const j = indexes.j;
4031
- const bc = indexes.bc;
4032
- const realIndex = indexes.realIndex;
4033
- const translationsIndex = indexes.translationsIndex;
4192
+ const i = indexes2.i;
4193
+ const j = indexes2.j;
4194
+ const bc = indexes2.bc;
4195
+ const realIndex = indexes2.realIndex;
4196
+ const translationsIndex = indexes2.translationsIndex;
4034
4197
  const v = (
4035
4198
  /** @type {any} */
4036
4199
  (_b = (_a = this.series[i]) == null ? void 0 : _a[j]) != null ? _b : null
@@ -4071,12 +4234,17 @@ class BarStacked extends Bar {
4071
4234
  y1: barYPosition,
4072
4235
  y2: y,
4073
4236
  yRatio: this.yRatio[translationsIndex],
4074
- // the series' width even for an empty segment, so a hidden layer keeps
4075
- // its place, but no inset at all when no stroke is drawn
4076
- strokeWidth: w.config.stroke.show ? this.strokeWidth : 0,
4237
+ // Along the value axis, the per-datum width from getStrokeWidth (0 for
4238
+ // a null/zero value): the series' width grew an empty segment by the
4239
+ // stroke centering into a visible strip (#5046).
4240
+ strokeWidth,
4241
+ // Sideways, the series' width even for an empty segment, so a hidden
4242
+ // layer keeps its slot inset and re-enters from the geometry it left,
4243
+ // but no inset at all when no stroke is drawn.
4244
+ insetWidth: w.config.stroke.show ? this.strokeWidth : 0,
4077
4245
  isReversed: this.isReversed,
4078
4246
  series: this.series,
4079
- realIndex: indexes.realIndex,
4247
+ realIndex: indexes2.realIndex,
4080
4248
  i,
4081
4249
  j,
4082
4250
  w
@@ -4348,8 +4516,15 @@ class RangeBar extends Bar {
4348
4516
  (_d = (_c = w.config.series[i].data) == null ? void 0 : _c[j]) == null ? void 0 : _d.x
4349
4517
  );
4350
4518
  const labelX = Array.isArray(x) ? x.join(" ") : x;
4351
- const rowIndex = w.labelData.labels.map((_) => Array.isArray(_) ? _.join(" ") : _).indexOf(labelX);
4352
- const overlappedIndex = w.rangeData.seriesRange[i].findIndex(
4519
+ const self = (
4520
+ /** @type {any} */
4521
+ this
4522
+ );
4523
+ self._rowKeys || (self._rowKeys = w.labelData.labels.map(
4524
+ (l) => Array.isArray(l) ? l.join(" ") : l
4525
+ ));
4526
+ const rowIndex = self._rowKeys.indexOf(labelX);
4527
+ const overlappedIndex = w.config.plotOptions.bar.rangeBarOverlap ? -1 : w.rangeData.seriesRange[i].findIndex(
4353
4528
  (tx) => {
4354
4529
  var _a2;
4355
4530
  return tx.x === labelX && ((_a2 = tx.overlaps) == null ? void 0 : _a2.size) > 0;
@@ -4361,7 +4536,7 @@ class RangeBar extends Bar {
4361
4536
  } else {
4362
4537
  barYPosition = srty + barHeight * this.visibleI + yDivision * rowIndex;
4363
4538
  }
4364
- if (overlappedIndex > -1 && !w.config.plotOptions.bar.rangeBarOverlap) {
4539
+ if (overlappedIndex > -1) {
4365
4540
  overlaps = Array.from(
4366
4541
  /** @type {any} */
4367
4542
  w.rangeData.seriesRange[i][overlappedIndex].overlaps
@@ -4379,7 +4554,7 @@ class RangeBar extends Bar {
4379
4554
  barXPosition = srtx + barWidth * this.visibleI + xDivision * rowIndex;
4380
4555
  }
4381
4556
  }
4382
- if (overlappedIndex > -1 && !w.config.plotOptions.bar.rangeBarOverlap) {
4557
+ if (overlappedIndex > -1) {
4383
4558
  overlaps = Array.from(
4384
4559
  /** @type {any} */
4385
4560
  w.rangeData.seriesRange[i][overlappedIndex].overlaps
@@ -4399,7 +4574,7 @@ class RangeBar extends Bar {
4399
4574
  }
4400
4575
  /** @param {{indexes: any, x: any, xDivision: any, barWidth: any, barXPosition: any, zeroH: any}} opts */
4401
4576
  drawRangeColumnPaths({
4402
- indexes,
4577
+ indexes: indexes2,
4403
4578
  x,
4404
4579
  xDivision,
4405
4580
  barWidth,
@@ -4408,7 +4583,7 @@ class RangeBar extends Bar {
4408
4583
  }) {
4409
4584
  var _a, _b;
4410
4585
  const w = this.w;
4411
- const { i, j, realIndex, translationsIndex } = indexes;
4586
+ const { i, j, realIndex, translationsIndex } = indexes2;
4412
4587
  const yRatio = this.yRatio[translationsIndex] * (this.isReversed ? -1 : 1);
4413
4588
  const range = this.getRangeValue(realIndex, j);
4414
4589
  let y1 = Math.min(range.start, range.end);
@@ -4517,7 +4692,7 @@ class RangeBar extends Bar {
4517
4692
  }
4518
4693
  /** @param {{indexes: any, y: any, y1: any, y2: any, yDivision: any, barHeight: any, barYPosition: any, zeroW: any}} opts */
4519
4694
  drawRangeBarPaths({
4520
- indexes,
4695
+ indexes: indexes2,
4521
4696
  y,
4522
4697
  y1,
4523
4698
  y2,
@@ -4527,7 +4702,7 @@ class RangeBar extends Bar {
4527
4702
  zeroW
4528
4703
  }) {
4529
4704
  const w = this.w;
4530
- const { realIndex, j } = indexes;
4705
+ const { realIndex, j } = indexes2;
4531
4706
  const ratio = this.invertedYRatio * (this.isReversed ? -1 : 1);
4532
4707
  const x1 = this.preventBarOverflow(zeroW + y1 / ratio);
4533
4708
  const x2 = this.preventBarOverflow(zeroW + y2 / ratio);