@oliasoft-open-source/charts-library 6.0.0 → 7.0.0-beta-1

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 (126) hide show
  1. package/dist/index.d.ts +1266 -15
  2. package/dist/index.js +327 -303
  3. package/package.json +21 -20
  4. package/dist/src/components/bar-chart/bar-chart-const.d.ts +0 -2
  5. package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +0 -3
  6. package/dist/src/components/bar-chart/bar-chart.d.ts +0 -3
  7. package/dist/src/components/bar-chart/bar-chart.interface.d.ts +0 -146
  8. package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +0 -10
  9. package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +0 -4
  10. package/dist/src/components/bar-chart/utils/get-bar-chart-tooltips.d.ts +0 -6
  11. package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +0 -13
  12. package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +0 -54
  13. package/dist/src/components/common/common.interface.d.ts +0 -273
  14. package/dist/src/components/common/controls-portal.d.ts +0 -7
  15. package/dist/src/components/common/enums.d.ts +0 -89
  16. package/dist/src/components/common/helpers/add-transparency/add-transparency.d.ts +0 -1
  17. package/dist/src/components/common/helpers/callout-helpers/callout-helpers.d.ts +0 -25
  18. package/dist/src/components/common/helpers/chart-border-plugin.d.ts +0 -16
  19. package/dist/src/components/common/helpers/chart-consts.d.ts +0 -39
  20. package/dist/src/components/common/helpers/chart-utils.d.ts +0 -86
  21. package/dist/src/components/common/helpers/container.d.ts +0 -18
  22. package/dist/src/components/common/helpers/custom-format-number.d.ts +0 -1
  23. package/dist/src/components/common/helpers/download-pgn.d.ts +0 -3
  24. package/dist/src/components/common/helpers/get-cartesian-scale-options.d.ts +0 -28
  25. package/dist/src/components/common/helpers/get-chart-annotation.d.ts +0 -139
  26. package/dist/src/components/common/helpers/get-chart-from-ctx.d.ts +0 -1
  27. package/dist/src/components/common/helpers/get-custom-legend-plugin-example.d.ts +0 -6
  28. package/dist/src/components/common/helpers/get-draggableData.d.ts +0 -18
  29. package/dist/src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.d.ts +0 -1
  30. package/dist/src/components/common/helpers/input-normalizers.d.ts +0 -15
  31. package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +0 -8
  32. package/dist/src/components/common/helpers/range/range.d.ts +0 -33
  33. package/dist/src/components/common/helpers/text.d.ts +0 -1
  34. package/dist/src/components/common/helpers/to-annotation.d.ts +0 -4
  35. package/dist/src/components/common/hooks/use-generated-labels.d.ts +0 -4
  36. package/dist/src/components/common/hooks/use-legend-state.d.ts +0 -28
  37. package/dist/src/components/common/hooks/use-legend.d.ts +0 -4
  38. package/dist/src/components/common/hooks/use-update-annotations.d.ts +0 -4
  39. package/dist/src/components/common/legend-component/legend-dropzone.d.ts +0 -3
  40. package/dist/src/components/common/legend-component/legend-interface.d.ts +0 -47
  41. package/dist/src/components/common/legend-component/legend-item/LegendItemLine.d.ts +0 -5
  42. package/dist/src/components/common/legend-component/legend-item/legend-item.d.ts +0 -3
  43. package/dist/src/components/common/legend-component/legend-panel.d.ts +0 -3
  44. package/dist/src/components/common/legend-component/legend.d.ts +0 -3
  45. package/dist/src/components/common/legend-component/state/legend-action-types.d.ts +0 -3
  46. package/dist/src/components/common/legend-component/state/legend-context.d.ts +0 -14
  47. package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +0 -30
  48. package/dist/src/components/common/legend-component/utils/create-style-object.d.ts +0 -27
  49. package/dist/src/components/common/legend-component/utils/get-generated-labels.d.ts +0 -2
  50. package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +0 -15
  51. package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-position-storage.d.ts +0 -7
  52. package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +0 -21
  53. package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +0 -6
  54. package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +0 -53
  55. package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +0 -5
  56. package/dist/src/components/common/plugins/ellipsis-annotation-plugin/compute-ellipse-geometry.d.ts +0 -9
  57. package/dist/src/components/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +0 -18
  58. package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +0 -10
  59. package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +0 -2
  60. package/dist/src/components/line-chart/constants/default-translations.d.ts +0 -25
  61. package/dist/src/components/line-chart/constants/line-chart-consts.d.ts +0 -13
  62. package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +0 -57
  63. package/dist/src/components/line-chart/controls/axes-options/axes-options.d.ts +0 -6
  64. package/dist/src/components/line-chart/controls/axes-options/axes-validation.d.ts +0 -8
  65. package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +0 -19
  66. package/dist/src/components/line-chart/controls/controls.d.ts +0 -3
  67. package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +0 -14
  68. package/dist/src/components/line-chart/controls/drag-options.d.ts +0 -23
  69. package/dist/src/components/line-chart/controls/line-options.d.ts +0 -19
  70. package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +0 -32
  71. package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +0 -19
  72. package/dist/src/components/line-chart/hooks/use-chart-plugins.d.ts +0 -7
  73. package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +0 -12
  74. package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +0 -12
  75. package/dist/src/components/line-chart/initialize/config.d.ts +0 -12
  76. package/dist/src/components/line-chart/initialize/initialize-line-chart.d.ts +0 -12
  77. package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +0 -3
  78. package/dist/src/components/line-chart/line-chart.d.ts +0 -3
  79. package/dist/src/components/line-chart/line-chart.interface.d.ts +0 -241
  80. package/dist/src/components/line-chart/plugins/callout-plugin/callout-plugin.d.ts +0 -11
  81. package/dist/src/components/line-chart/plugins/callout-plugin/helpers.d.ts +0 -42
  82. package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +0 -17
  83. package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +0 -8
  84. package/dist/src/components/line-chart/plugins/line-markers-plugin/draw.d.ts +0 -39
  85. package/dist/src/components/line-chart/plugins/line-markers-plugin/line-markers-plugin.d.ts +0 -10
  86. package/dist/src/components/line-chart/plugins/line-markers-plugin/types.d.ts +0 -109
  87. package/dist/src/components/line-chart/plugins/line-markers-plugin/utils.d.ts +0 -40
  88. package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +0 -11
  89. package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +0 -9
  90. package/dist/src/components/line-chart/state/action-types.d.ts +0 -12
  91. package/dist/src/components/line-chart/state/helpers.d.ts +0 -13
  92. package/dist/src/components/line-chart/state/initial-state.d.ts +0 -11
  93. package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +0 -2
  94. package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +0 -15
  95. package/dist/src/components/line-chart/state/state.interfaces.d.ts +0 -26
  96. package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +0 -2
  97. package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +0 -18
  98. package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +0 -12
  99. package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +0 -20
  100. package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +0 -8
  101. package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +0 -11
  102. package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +0 -6
  103. package/dist/src/components/line-chart/utils/enums.d.ts +0 -4
  104. package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +0 -8
  105. package/dist/src/components/line-chart/utils/get-annotations-data.d.ts +0 -1
  106. package/dist/src/components/line-chart/utils/get-axes-data-from-metasets.d.ts +0 -1
  107. package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +0 -9
  108. package/dist/src/components/line-chart/utils/get-axis-range-by-type.d.ts +0 -10
  109. package/dist/src/components/line-chart/utils/get-generated-labels.d.ts +0 -2
  110. package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +0 -16
  111. package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +0 -5
  112. package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +0 -30
  113. package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +0 -24
  114. package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +0 -8
  115. package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +0 -50
  116. package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +0 -3
  117. package/dist/src/components/pie-chart/pie-chart.d.ts +0 -3
  118. package/dist/src/components/pie-chart/pie-chart.interface.d.ts +0 -85
  119. package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +0 -42
  120. package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +0 -69
  121. package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +0 -73
  122. package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +0 -4
  123. package/dist/src/components/scatter-chart/scatter-chart.d.ts +0 -3
  124. package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +0 -111
  125. package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +0 -5
  126. package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +0 -21
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { displayNumber, isCloseTo, round, roundByMagnitude, toNum } from "@olias
7
7
  import cx from "classnames";
8
8
  import { cloneDeep, debounce, defaultTo, find, findIndex, get, has, isArray, isEmpty, isFinite as isFinite$1, isNil, isNumber, isObject, isString, map, noop, set, some, startCase } from "es-toolkit/compat";
9
9
  import { produce } from "immer";
10
- import { Button, ButtonGroup, Field, Flex, Icon, InputGroup, InputGroupAddon, Menu, NumberInput, Popover, Portal, Select, Spacer, Text, Tooltip } from "@oliasoft-open-source/react-ui-library";
10
+ import { Button, ButtonGroup, Color, Field, Flex, Icon, InputGroup, InputGroupAddon, Menu, NumberInput, Popover, Portal, Select, Spacer, Text, Tooltip } from "@oliasoft-open-source/react-ui-library";
11
11
  import { useMeasure } from "react-use";
12
12
  import { TbArrowsMove, TbBan, TbCircleFilled, TbHandStop, TbList, TbRuler, TbSquareFilled, TbX, TbZoomIn } from "react-icons/tb";
13
13
  import { toPng } from "html-to-image";
@@ -35,7 +35,7 @@ var __copyProps = (to, from, except, desc) => {
35
35
  }
36
36
  return to;
37
37
  };
38
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
38
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
39
39
  value: mod,
40
40
  enumerable: true
41
41
  }) : target, mod));
@@ -526,9 +526,9 @@ function functionParse(str) {
526
526
  if (str.charAt(0) === "r") return rgbParse(str);
527
527
  return hueParse(str);
528
528
  }
529
- var Color = class Color {
529
+ var Color$1 = class Color$1 {
530
530
  constructor(input) {
531
- if (input instanceof Color) return input;
531
+ if (input instanceof Color$1) return input;
532
532
  const type = typeof input;
533
533
  let v;
534
534
  if (type === "object") v = fromObject(input);
@@ -579,7 +579,7 @@ var Color = class Color {
579
579
  return this;
580
580
  }
581
581
  clone() {
582
- return new Color(this.rgb);
582
+ return new Color$1(this.rgb);
583
583
  }
584
584
  alpha(a) {
585
585
  this._rgb.a = n2b(a);
@@ -1261,10 +1261,10 @@ function isPatternOrGradient(value) {
1261
1261
  return false;
1262
1262
  }
1263
1263
  function color(value) {
1264
- return isPatternOrGradient(value) ? value : new Color(value);
1264
+ return isPatternOrGradient(value) ? value : new Color$1(value);
1265
1265
  }
1266
1266
  function getHoverColor(value) {
1267
- return isPatternOrGradient(value) ? value : new Color(value).saturate(.5).darken(.1).hexString();
1267
+ return isPatternOrGradient(value) ? value : new Color$1(value).saturate(.5).darken(.1).hexString();
1268
1268
  }
1269
1269
  var numbers = [
1270
1270
  "x",
@@ -1563,7 +1563,7 @@ var Defaults = class {
1563
1563
  appliers.forEach((apply) => apply(this));
1564
1564
  }
1565
1565
  };
1566
- var defaults$1 = /* @__PURE__ */ new Defaults({
1566
+ var defaults$1 = /* #__PURE__ */ new Defaults({
1567
1567
  _scriptable: (name) => !name.startsWith("on"),
1568
1568
  _indexable: (name) => name !== "events",
1569
1569
  hover: { _fallback: "interaction" },
@@ -1759,9 +1759,7 @@ function drawPointLegend(ctx, options, x, y, w) {
1759
1759
  ctx.moveTo(x, y);
1760
1760
  ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);
1761
1761
  break;
1762
- case false:
1763
- ctx.closePath();
1764
- break;
1762
+ case false: ctx.closePath();
1765
1763
  }
1766
1764
  ctx.fill();
1767
1765
  if (options.borderWidth > 0) ctx.stroke();
@@ -1894,9 +1892,7 @@ var FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]d
1894
1892
  value = +matches[2];
1895
1893
  switch (matches[3]) {
1896
1894
  case "px": return value;
1897
- case "%":
1898
- value /= 100;
1899
- break;
1895
+ case "%": value /= 100;
1900
1896
  }
1901
1897
  return size * value;
1902
1898
  }
@@ -3078,7 +3074,7 @@ var Animator = class {
3078
3074
  return this._charts.delete(chart);
3079
3075
  }
3080
3076
  };
3081
- var animator = /* @__PURE__ */ new Animator();
3077
+ var animator = /* #__PURE__ */ new Animator();
3082
3078
  var transparent = "transparent";
3083
3079
  var interpolators = {
3084
3080
  boolean(from, to, factor) {
@@ -3237,10 +3233,12 @@ var Animations = class {
3237
3233
  const value = values[prop];
3238
3234
  let animation = running[prop];
3239
3235
  const cfg = animatedProps.get(prop);
3240
- if (animation) if (cfg && animation.active()) {
3241
- animation.update(cfg, value, date);
3242
- continue;
3243
- } else animation.cancel();
3236
+ if (animation) {
3237
+ if (cfg && animation.active()) {
3238
+ animation.update(cfg, value, date);
3239
+ continue;
3240
+ } else animation.cancel();
3241
+ }
3244
3242
  if (!cfg || !cfg.duration) {
3245
3243
  target[prop] = value;
3246
3244
  continue;
@@ -5462,10 +5460,12 @@ function initCanvas(canvas, aspectRatio) {
5462
5460
  const displayWidth = readUsedSize(canvas, "width");
5463
5461
  if (displayWidth !== void 0) canvas.width = displayWidth;
5464
5462
  }
5465
- if (isNullOrEmpty(renderHeight)) if (canvas.style.height === "") canvas.height = canvas.width / (aspectRatio || 2);
5466
- else {
5467
- const displayHeight = readUsedSize(canvas, "height");
5468
- if (displayHeight !== void 0) canvas.height = displayHeight;
5463
+ if (isNullOrEmpty(renderHeight)) {
5464
+ if (canvas.style.height === "") canvas.height = canvas.width / (aspectRatio || 2);
5465
+ else {
5466
+ const displayHeight = readUsedSize(canvas, "height");
5467
+ if (displayHeight !== void 0) canvas.height = displayHeight;
5468
+ }
5469
5469
  }
5470
5470
  return canvas;
5471
5471
  }
@@ -6181,14 +6181,15 @@ var Scale = class Scale extends Element {
6181
6181
  const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);
6182
6182
  let paddingLeft = 0;
6183
6183
  let paddingRight = 0;
6184
- if (isRotated) if (labelsBelowTicks) {
6185
- paddingLeft = cos * first.width;
6186
- paddingRight = sin * last.height;
6187
- } else {
6188
- paddingLeft = sin * first.height;
6189
- paddingRight = cos * last.width;
6190
- }
6191
- else if (align === "start") paddingRight = last.width;
6184
+ if (isRotated) {
6185
+ if (labelsBelowTicks) {
6186
+ paddingLeft = cos * first.width;
6187
+ paddingRight = sin * last.height;
6188
+ } else {
6189
+ paddingLeft = sin * first.height;
6190
+ paddingRight = cos * last.width;
6191
+ }
6192
+ } else if (align === "start") paddingRight = last.width;
6192
6193
  else if (align === "end") paddingLeft = first.width;
6193
6194
  else if (align !== "inner") {
6194
6195
  paddingLeft = first.width / 2;
@@ -6522,13 +6523,16 @@ var Scale = class Scale extends Element {
6522
6523
  let tickTextAlign = textAlign;
6523
6524
  if (isHorizontal) {
6524
6525
  x = pixel;
6525
- if (textAlign === "inner") if (i === ilen - 1) tickTextAlign = !this.options.reverse ? "right" : "left";
6526
- else if (i === 0) tickTextAlign = !this.options.reverse ? "left" : "right";
6527
- else tickTextAlign = "center";
6528
- if (position === "top") if (crossAlign === "near" || rotation !== 0) textOffset = -lineCount * lineHeight + lineHeight / 2;
6529
- else if (crossAlign === "center") textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;
6530
- else textOffset = -labelSizes.highest.height + lineHeight / 2;
6531
- else if (crossAlign === "near" || rotation !== 0) textOffset = lineHeight / 2;
6526
+ if (textAlign === "inner") {
6527
+ if (i === ilen - 1) tickTextAlign = !this.options.reverse ? "right" : "left";
6528
+ else if (i === 0) tickTextAlign = !this.options.reverse ? "left" : "right";
6529
+ else tickTextAlign = "center";
6530
+ }
6531
+ if (position === "top") {
6532
+ if (crossAlign === "near" || rotation !== 0) textOffset = -lineCount * lineHeight + lineHeight / 2;
6533
+ else if (crossAlign === "center") textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;
6534
+ else textOffset = -labelSizes.highest.height + lineHeight / 2;
6535
+ } else if (crossAlign === "near" || rotation !== 0) textOffset = lineHeight / 2;
6532
6536
  else if (crossAlign === "center") textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;
6533
6537
  else textOffset = labelSizes.highest.height - lineCount * lineHeight;
6534
6538
  if (mirror) textOffset *= -1;
@@ -6548,9 +6552,7 @@ var Scale = class Scale extends Element {
6548
6552
  case "middle":
6549
6553
  top -= height / 2;
6550
6554
  break;
6551
- case "bottom":
6552
- top -= height;
6553
- break;
6555
+ case "bottom": top -= height;
6554
6556
  }
6555
6557
  switch (textAlign) {
6556
6558
  case "center":
@@ -6559,10 +6561,8 @@ var Scale = class Scale extends Element {
6559
6561
  case "right":
6560
6562
  left -= width;
6561
6563
  break;
6562
- case "inner":
6563
- if (i === ilen - 1) left -= width;
6564
- else if (i > 0) left -= width / 2;
6565
- break;
6564
+ case "inner": if (i === ilen - 1) left -= width;
6565
+ else if (i > 0) left -= width / 2;
6566
6566
  }
6567
6567
  backdrop = {
6568
6568
  left,
@@ -6606,49 +6606,51 @@ var Scale = class Scale extends Element {
6606
6606
  const widest = labelSizes.widest.width;
6607
6607
  let textAlign;
6608
6608
  let x;
6609
- if (position === "left") if (mirror) {
6610
- x = this.right + padding;
6611
- if (crossAlign === "near") textAlign = "left";
6612
- else if (crossAlign === "center") {
6613
- textAlign = "center";
6614
- x += widest / 2;
6615
- } else {
6616
- textAlign = "right";
6617
- x += widest;
6618
- }
6619
- } else {
6620
- x = this.right - tickAndPadding;
6621
- if (crossAlign === "near") textAlign = "right";
6622
- else if (crossAlign === "center") {
6623
- textAlign = "center";
6624
- x -= widest / 2;
6625
- } else {
6626
- textAlign = "left";
6627
- x = this.left;
6628
- }
6629
- }
6630
- else if (position === "right") if (mirror) {
6631
- x = this.left + padding;
6632
- if (crossAlign === "near") textAlign = "right";
6633
- else if (crossAlign === "center") {
6634
- textAlign = "center";
6635
- x -= widest / 2;
6609
+ if (position === "left") {
6610
+ if (mirror) {
6611
+ x = this.right + padding;
6612
+ if (crossAlign === "near") textAlign = "left";
6613
+ else if (crossAlign === "center") {
6614
+ textAlign = "center";
6615
+ x += widest / 2;
6616
+ } else {
6617
+ textAlign = "right";
6618
+ x += widest;
6619
+ }
6636
6620
  } else {
6637
- textAlign = "left";
6638
- x -= widest;
6621
+ x = this.right - tickAndPadding;
6622
+ if (crossAlign === "near") textAlign = "right";
6623
+ else if (crossAlign === "center") {
6624
+ textAlign = "center";
6625
+ x -= widest / 2;
6626
+ } else {
6627
+ textAlign = "left";
6628
+ x = this.left;
6629
+ }
6639
6630
  }
6640
- } else {
6641
- x = this.left + tickAndPadding;
6642
- if (crossAlign === "near") textAlign = "left";
6643
- else if (crossAlign === "center") {
6644
- textAlign = "center";
6645
- x += widest / 2;
6631
+ } else if (position === "right") {
6632
+ if (mirror) {
6633
+ x = this.left + padding;
6634
+ if (crossAlign === "near") textAlign = "right";
6635
+ else if (crossAlign === "center") {
6636
+ textAlign = "center";
6637
+ x -= widest / 2;
6638
+ } else {
6639
+ textAlign = "left";
6640
+ x -= widest;
6641
+ }
6646
6642
  } else {
6647
- textAlign = "right";
6648
- x = this.right;
6643
+ x = this.left + tickAndPadding;
6644
+ if (crossAlign === "near") textAlign = "left";
6645
+ else if (crossAlign === "center") {
6646
+ textAlign = "center";
6647
+ x += widest / 2;
6648
+ } else {
6649
+ textAlign = "right";
6650
+ x = this.right;
6651
+ }
6649
6652
  }
6650
- }
6651
- else textAlign = "right";
6653
+ } else textAlign = "right";
6652
6654
  return {
6653
6655
  textAlign,
6654
6656
  x
@@ -6996,7 +6998,7 @@ var Registry = class {
6996
6998
  return item;
6997
6999
  }
6998
7000
  };
6999
- var registry = /* @__PURE__ */ new Registry();
7001
+ var registry = /* #__PURE__ */ new Registry();
7000
7002
  var PluginService = class {
7001
7003
  constructor() {
7002
7004
  this._init = void 0;
@@ -9631,13 +9633,17 @@ var Legend$1 = class extends Element {
9631
9633
  ctx.lineWidth = lineWidth;
9632
9634
  ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);
9633
9635
  ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));
9634
- if (labelOpts.usePointStyle) drawPointLegend(ctx, {
9635
- radius: boxHeight * Math.SQRT2 / 2,
9636
- pointStyle: legendItem.pointStyle,
9637
- rotation: legendItem.rotation,
9638
- borderWidth: lineWidth
9639
- }, rtlHelper.xPlus(x, boxWidth / 2), y + halfFontSize, labelOpts.pointStyleWidth && boxWidth);
9640
- else {
9636
+ if (labelOpts.usePointStyle) {
9637
+ const drawOptions = {
9638
+ radius: boxHeight * Math.SQRT2 / 2,
9639
+ pointStyle: legendItem.pointStyle,
9640
+ rotation: legendItem.rotation,
9641
+ borderWidth: lineWidth
9642
+ };
9643
+ const centerX = rtlHelper.xPlus(x, boxWidth / 2);
9644
+ const centerY = y + halfFontSize;
9645
+ drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);
9646
+ } else {
9641
9647
  const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);
9642
9648
  const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);
9643
9649
  const borderRadius = toTRBLCorners(legendItem.borderRadius);
@@ -9695,7 +9701,8 @@ var Legend$1 = class extends Element {
9695
9701
  cursor.line++;
9696
9702
  y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);
9697
9703
  }
9698
- drawLegendBox(rtlHelper.x(x), y, legendItem);
9704
+ const realX = rtlHelper.x(x);
9705
+ drawLegendBox(realX, y, legendItem);
9699
9706
  x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);
9700
9707
  fillText(rtlHelper.x(x), y, legendItem);
9701
9708
  if (isHorizontal) cursor.x += width + padding;
@@ -10071,8 +10078,10 @@ var positioners$1 = {
10071
10078
  }
10072
10079
  };
10073
10080
  function pushOrConcat(base, toPush) {
10074
- if (toPush) if (isArray$1(toPush)) Array.prototype.push.apply(base, toPush);
10075
- else base.push(toPush);
10081
+ if (toPush) {
10082
+ if (isArray$1(toPush)) Array.prototype.push.apply(base, toPush);
10083
+ else base.push(toPush);
10084
+ }
10076
10085
  return base;
10077
10086
  }
10078
10087
  function splitNewlines(str) {
@@ -11020,9 +11029,10 @@ function generateTicks$1(generationOptions, dataRange) {
11020
11029
  if (maxDefined && tickValue > max) break;
11021
11030
  ticks.push({ value: tickValue });
11022
11031
  }
11023
- if (maxDefined && includeBounds && niceMax !== max) if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) ticks[ticks.length - 1].value = max;
11024
- else ticks.push({ value: max });
11025
- else if (!maxDefined || niceMax === max) ticks.push({ value: niceMax });
11032
+ if (maxDefined && includeBounds && niceMax !== max) {
11033
+ if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) ticks[ticks.length - 1].value = max;
11034
+ else ticks.push({ value: max });
11035
+ } else if (!maxDefined || niceMax === max) ticks.push({ value: niceMax });
11026
11036
  return ticks;
11027
11037
  }
11028
11038
  function relativeLabelSize(value, minSpacing, { horizontal, minRotation }) {
@@ -11241,12 +11251,14 @@ var LogarithmicScale = class extends Scale {
11241
11251
  let max = this.max;
11242
11252
  const setMin = (v) => min = minDefined ? min : v;
11243
11253
  const setMax = (v) => max = maxDefined ? max : v;
11244
- if (min === max) if (min <= 0) {
11245
- setMin(1);
11246
- setMax(10);
11247
- } else {
11248
- setMin(changeExponent(min, -1));
11249
- setMax(changeExponent(max, 1));
11254
+ if (min === max) {
11255
+ if (min <= 0) {
11256
+ setMin(1);
11257
+ setMax(10);
11258
+ } else {
11259
+ setMin(changeExponent(min, -1));
11260
+ setMax(changeExponent(max, 1));
11261
+ }
11250
11262
  }
11251
11263
  if (min <= 0) setMin(changeExponent(max, -1));
11252
11264
  if (max <= 0) setMax(changeExponent(min, 1));
@@ -11767,7 +11779,7 @@ var INTERVALS = {
11767
11779
  size: 3154e7
11768
11780
  }
11769
11781
  };
11770
- var UNITS = /* @__PURE__ */ Object.keys(INTERVALS);
11782
+ var UNITS = /* #__PURE__ */ Object.keys(INTERVALS);
11771
11783
  function sorter(a, b) {
11772
11784
  return a - b;
11773
11785
  }
@@ -12164,7 +12176,7 @@ var TimeSeriesScale = class extends TimeScale {
12164
12176
  }
12165
12177
  };
12166
12178
  //#endregion
12167
- //#region node_modules/.pnpm/react-chartjs-2@5.3.1_chart.js@4.5.1_react@18.3.1/node_modules/react-chartjs-2/dist/index.js
12179
+ //#region node_modules/.pnpm/react-chartjs-2@5.3.1_chart.js@4.5.1_react@19.2.8/node_modules/react-chartjs-2/dist/index.js
12168
12180
  var defaultDatasetIdKey = "label";
12169
12181
  function reforwardRef(ref, value) {
12170
12182
  if (typeof ref === "function") ref(value);
@@ -12248,7 +12260,7 @@ function ChartComponent(props, ref) {
12248
12260
  renderChart();
12249
12261
  return () => destroyChart();
12250
12262
  }, []);
12251
- return /* @__PURE__ */ jsx("canvas", {
12263
+ return /*#__PURE__*/ jsx("canvas", {
12252
12264
  ref: canvasRef,
12253
12265
  role: "img",
12254
12266
  height,
@@ -12257,19 +12269,19 @@ function ChartComponent(props, ref) {
12257
12269
  children: fallbackContent
12258
12270
  });
12259
12271
  }
12260
- var Chart = /* @__PURE__ */ forwardRef(ChartComponent);
12272
+ var Chart = /*#__PURE__*/ forwardRef(ChartComponent);
12261
12273
  function createTypedChart(type, registerables) {
12262
12274
  Chart$1.register(registerables);
12263
- return /* @__PURE__ */ forwardRef((props, ref) => /* @__PURE__ */ jsx(Chart, {
12275
+ return /*#__PURE__*/ forwardRef((props, ref) => /*#__PURE__*/ jsx(Chart, {
12264
12276
  ...props,
12265
12277
  ref,
12266
12278
  type
12267
12279
  }));
12268
12280
  }
12269
- var Line = /* @__PURE__ */ createTypedChart("line", LineController);
12270
- var Bar = /* @__PURE__ */ createTypedChart("bar", BarController);
12271
- var Pie = /* @__PURE__ */ createTypedChart("pie", PieController);
12272
- var Scatter = /* @__PURE__ */ createTypedChart("scatter", ScatterController);
12281
+ var Line = /* #__PURE__ */ createTypedChart("line", LineController);
12282
+ var Bar = /* #__PURE__ */ createTypedChart("bar", BarController);
12283
+ var Pie = /* #__PURE__ */ createTypedChart("pie", PieController);
12284
+ var Scatter = /* #__PURE__ */ createTypedChart("scatter", ScatterController);
12273
12285
  /*! Hammer.JS - v2.0.7 - 2016-04-22
12274
12286
  * http://hammerjs.github.io/
12275
12287
  *
@@ -12540,10 +12552,12 @@ var import_hammer = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exp
12540
12552
  values[i] = val;
12541
12553
  i++;
12542
12554
  }
12543
- if (sort) if (!key) results = results.sort();
12544
- else results = results.sort(function sortUniqueArray(a, b) {
12545
- return a[key] > b[key];
12546
- });
12555
+ if (sort) {
12556
+ if (!key) results = results.sort();
12557
+ else results = results.sort(function sortUniqueArray(a, b) {
12558
+ return a[key] > b[key];
12559
+ });
12560
+ }
12547
12561
  return results;
12548
12562
  }
12549
12563
  /**
@@ -13580,14 +13594,16 @@ pointers: 1 },
13580
13594
  var direction = input.direction;
13581
13595
  var x = input.deltaX;
13582
13596
  var y = input.deltaY;
13583
- if (!(direction & options.direction)) if (options.direction & DIRECTION_HORIZONTAL) {
13584
- direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
13585
- hasMoved = x != this.pX;
13586
- distance = Math.abs(input.deltaX);
13587
- } else {
13588
- direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
13589
- hasMoved = y != this.pY;
13590
- distance = Math.abs(input.deltaY);
13597
+ if (!(direction & options.direction)) {
13598
+ if (options.direction & DIRECTION_HORIZONTAL) {
13599
+ direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
13600
+ hasMoved = x != this.pX;
13601
+ distance = Math.abs(input.deltaX);
13602
+ } else {
13603
+ direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
13604
+ hasMoved = y != this.pY;
13605
+ distance = Math.abs(input.deltaY);
13606
+ }
13591
13607
  }
13592
13608
  input.direction = direction;
13593
13609
  return hasMoved && distance > options.threshold && direction & options.direction;
@@ -13804,13 +13820,15 @@ pointers: 1 },
13804
13820
  if (!validMultiTap || !validInterval) this.count = 1;
13805
13821
  else this.count += 1;
13806
13822
  this._input = input;
13807
- if (this.count % options.taps === 0) if (!this.hasRequireFailures()) return STATE_RECOGNIZED;
13808
- else {
13809
- this._timer = setTimeoutContext(function() {
13810
- this.state = STATE_RECOGNIZED;
13811
- this.tryEmit();
13812
- }, options.interval, this);
13813
- return STATE_BEGAN;
13823
+ if (this.count % options.taps === 0) {
13824
+ if (!this.hasRequireFailures()) return STATE_RECOGNIZED;
13825
+ else {
13826
+ this._timer = setTimeoutContext(function() {
13827
+ this.state = STATE_RECOGNIZED;
13828
+ this.tryEmit();
13829
+ }, options.interval, this);
13830
+ return STATE_BEGAN;
13831
+ }
13814
13832
  }
13815
13833
  }
13816
13834
  return STATE_FAILED;
@@ -14452,13 +14470,13 @@ function panCategoryScale(scale, delta, limits) {
14452
14470
  }
14453
14471
  var OFFSETS = {
14454
14472
  second: 500,
14455
- minute: 30 * 1e3,
14456
- hour: 1800 * 1e3,
14457
- day: 720 * 60 * 1e3,
14458
- week: 3.5 * 24 * 60 * 60 * 1e3,
14459
- month: 360 * 60 * 60 * 1e3,
14460
- quarter: 1440 * 60 * 60 * 1e3,
14461
- year: 4368 * 60 * 60 * 1e3
14473
+ minute: 3e4,
14474
+ hour: 18e5,
14475
+ day: 432e5,
14476
+ week: 3024e5,
14477
+ month: 1296e6,
14478
+ quarter: 5184e6,
14479
+ year: 157248e5
14462
14480
  };
14463
14481
  function panNumericalScale(scale, delta, limits, pan = false) {
14464
14482
  const { min: prevStart, max: prevEnd, options } = scale;
@@ -15290,7 +15308,6 @@ function aligned(x, y, vx, vy, align) {
15290
15308
  align *= Math.PI / 180;
15291
15309
  vx = Math.cos(align);
15292
15310
  vy = Math.sin(align);
15293
- break;
15294
15311
  }
15295
15312
  return {
15296
15313
  x,
@@ -15911,12 +15928,14 @@ var formatter = function(value) {
15911
15928
  if (isNullOrUndef(value)) return null;
15912
15929
  var label = value;
15913
15930
  var keys, klen, k;
15914
- if (isObject$1(value)) if (!isNullOrUndef(value.label)) label = value.label;
15915
- else if (!isNullOrUndef(value.r)) label = value.r;
15916
- else {
15917
- label = "";
15918
- keys = Object.keys(value);
15919
- for (k = 0, klen = keys.length; k < klen; ++k) label += (k !== 0 ? ", " : "") + keys[k] + ": " + value[keys[k]];
15931
+ if (isObject$1(value)) {
15932
+ if (!isNullOrUndef(value.label)) label = value.label;
15933
+ else if (!isNullOrUndef(value.r)) label = value.r;
15934
+ else {
15935
+ label = "";
15936
+ keys = Object.keys(value);
15937
+ for (k = 0, klen = keys.length; k < klen; ++k) label += (k !== 0 ? ", " : "") + keys[k] + ": " + value[keys[k]];
15938
+ }
15920
15939
  }
15921
15940
  return "" + label;
15922
15941
  };
@@ -16104,9 +16123,7 @@ var plugin = {
16104
16123
  case "mouseout":
16105
16124
  handleMoveEvents$1(chart, event);
16106
16125
  break;
16107
- case "click":
16108
- handleClickEvents$1(chart, event);
16109
- break;
16126
+ case "click": handleClickEvents$1(chart, event);
16110
16127
  }
16111
16128
  }
16112
16129
  },
@@ -16340,8 +16357,10 @@ function requireVersion(pkg, min, ver, strict = true) {
16340
16357
  for (const req of min.split(".")) {
16341
16358
  const act = parts[i++];
16342
16359
  if (parseInt(req, 10) < parseInt(act, 10)) break;
16343
- if (isOlderPart(act, req)) if (strict) throw new Error(`${pkg} v${ver} is not supported. v${min} or newer is required.`);
16344
- else return false;
16360
+ if (isOlderPart(act, req)) {
16361
+ if (strict) throw new Error(`${pkg} v${ver} is not supported. v${min} or newer is required.`);
16362
+ else return false;
16363
+ }
16345
16364
  }
16346
16365
  return true;
16347
16366
  }
@@ -16792,7 +16811,6 @@ function drawPointStyle(ctx, { x, y, radius, rotation, style, rad }) {
16792
16811
  case "dash":
16793
16812
  ctx.moveTo(x, y);
16794
16813
  ctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius);
16795
- break;
16796
16814
  }
16797
16815
  ctx.fill();
16798
16816
  }
@@ -19539,9 +19557,7 @@ var reducer = (state, action) => {
19539
19557
  draft.zoomEnabled = false;
19540
19558
  }
19541
19559
  break;
19542
- case UPDATE_EDITED:
19543
- draft.edited = action.payload;
19544
- break;
19560
+ case UPDATE_EDITED: draft.edited = action.payload;
19545
19561
  }
19546
19562
  });
19547
19563
  };
@@ -20089,7 +20105,7 @@ var validateAxes = (axes) => {
20089
20105
  //#region src/components/line-chart/state/helpers.ts
20090
20106
  var RANGE_GAP = 1;
20091
20107
  var getInitAxes = ({ chartRef, state }) => {
20092
- const chart = chartRef?.current;
20108
+ const chart = chartRef.current;
20093
20109
  if (!chart) return [];
20094
20110
  const initScales = chart?.getInitialScaleBounds() ?? {};
20095
20111
  return Object.entries(initScales).map(([id, { min = "", max = "" }]) => {
@@ -20371,7 +20387,7 @@ var Controls = ({ table, headerComponent, subheaderComponent, chartRef, state, o
20371
20387
  ],
20372
20388
  trigger: "Component",
20373
20389
  component: /* @__PURE__ */ jsx(Button, {
20374
- colored: "muted",
20390
+ colored: Color.MUTED,
20375
20391
  basic: true,
20376
20392
  small: true,
20377
20393
  round: true,
@@ -20386,7 +20402,7 @@ var Controls = ({ table, headerComponent, subheaderComponent, chartRef, state, o
20386
20402
  children: /* @__PURE__ */ jsx(Button, {
20387
20403
  small: true,
20388
20404
  basic: true,
20389
- colored: "muted",
20405
+ colored: Color.MUTED,
20390
20406
  round: true,
20391
20407
  icon: "download",
20392
20408
  onClick: handleDownload
@@ -20400,7 +20416,7 @@ var Controls = ({ table, headerComponent, subheaderComponent, chartRef, state, o
20400
20416
  children: /* @__PURE__ */ jsx(Button, {
20401
20417
  small: true,
20402
20418
  basic: true,
20403
- colored: "muted",
20419
+ colored: Color.MUTED,
20404
20420
  round: true,
20405
20421
  icon: showTable ? "chart" : "table",
20406
20422
  onClick: onToggleTable
@@ -20993,7 +21009,8 @@ var getSuggestedAxisRange = ({ data, beginAtZero = false, autoAxisPadding = fals
20993
21009
  const point = dataMax;
20994
21010
  const padding = point * whiteSpacePercentage;
20995
21011
  const minAxisValue = beginAtZero && !isNegative ? 0 : point - padding;
20996
- const roundedMinAxisValue = round(beginAtZero && isNegative ? 0 : point + padding, 9);
21012
+ const maxAxisValue = beginAtZero && isNegative ? 0 : point + padding;
21013
+ const roundedMinAxisValue = round(maxAxisValue, 9);
20997
21014
  const roundedMaxAxisValue = round(minAxisValue, 9);
20998
21015
  return {
20999
21016
  min: roundedMinAxisValue < 0 ? roundedMinAxisValue : roundedMaxAxisValue,
@@ -21049,7 +21066,7 @@ var getAxesDataFromMetasets = (generatedDatasets, scalesKeys, annotationsData) =
21049
21066
  return (dataset?.data ?? []).map((point) => point[axisType]);
21050
21067
  });
21051
21068
  const annotationValues = annotations?.[axisKey] ?? [];
21052
- acc[axisKey] = [...new Set([...datasetValues, ...annotationValues])];
21069
+ acc[axisKey] = [.../* @__PURE__ */ new Set([...datasetValues, ...annotationValues])];
21053
21070
  return acc;
21054
21071
  }, {});
21055
21072
  };
@@ -21502,9 +21519,7 @@ var getReferencePoint$1 = (chart, area, annotation) => {
21502
21519
  y += Math.max(halfHeight, annotation?.radius ?? 0) + labelOffsetPx;
21503
21520
  break;
21504
21521
  case Position.Top:
21505
- default:
21506
- y -= Math.max(halfHeight, annotation?.radius ?? 0) + labelOffsetPx;
21507
- break;
21522
+ default: y -= Math.max(halfHeight, annotation?.radius ?? 0) + labelOffsetPx;
21508
21523
  }
21509
21524
  return {
21510
21525
  x: x + xAdjust,
@@ -22152,10 +22167,7 @@ var generateAnn = (ann, index) => {
22152
22167
  case AnnotationType$1.LABEL:
22153
22168
  handleLabelEnter(element, chart, ann);
22154
22169
  break;
22155
- case AnnotationType$1.POINT:
22156
- handlePointEnter(element, chart, ann);
22157
- break;
22158
- default: break;
22170
+ case AnnotationType$1.POINT: handlePointEnter(element, chart, ann);
22159
22171
  }
22160
22172
  };
22161
22173
  const leave = ({ element }, { chart }) => {
@@ -22169,10 +22181,7 @@ var generateAnn = (ann, index) => {
22169
22181
  case AnnotationType$1.LABEL:
22170
22182
  handleLabelLeave(element, chart, ann);
22171
22183
  break;
22172
- case AnnotationType$1.POINT:
22173
- handlePointLeave(element, chart, ann);
22174
- break;
22175
- default: break;
22184
+ case AnnotationType$1.POINT: handlePointLeave(element, chart, ann);
22176
22185
  }
22177
22186
  };
22178
22187
  const onDragStart = () => (cord, annotation) => ann?.onDragStart ? ann?.onDragStart(cord, annotation) : void 0;
@@ -22343,11 +22352,12 @@ var LegendProvider = ({ children, options, datasets }) => {
22343
22352
  showAnnotations,
22344
22353
  annotationsData
22345
22354
  });
22346
- const [state, dispatch] = useReducer(legendReducer, {
22355
+ const initialState = {
22347
22356
  ...legendInitialState,
22348
22357
  annotation,
22349
22358
  datasets: initDSs
22350
- });
22359
+ };
22360
+ const [state, dispatch] = useReducer(legendReducer, initialState);
22351
22361
  const contextValue = useMemo(() => ({
22352
22362
  state,
22353
22363
  dispatch
@@ -23026,7 +23036,6 @@ var annotationLabel = (ctx, annotations, scales) => {
23026
23036
  case Position.Right:
23027
23037
  textX = centerX + padding;
23028
23038
  textY = centerY;
23029
- break;
23030
23039
  }
23031
23040
  ctx?.fillText?.(content, textX, textY);
23032
23041
  ctx?.restore?.();
@@ -23190,9 +23199,7 @@ var getReferencePoint = (fromEl, connector) => {
23190
23199
  x += halfWidth;
23191
23200
  y += halfHeight;
23192
23201
  break;
23193
- default:
23194
- y -= Math.max(halfHeight, radius) + labelOffset;
23195
- break;
23202
+ default: y -= Math.max(halfHeight, radius) + labelOffset;
23196
23203
  }
23197
23204
  return {
23198
23205
  x: x + xAdjust,
@@ -23944,12 +23951,13 @@ var lineMarkersPlugin = {
23944
23951
  const dirIntoChart = side === LineMarkerSide.Left ? 1 : -1;
23945
23952
  const groupedVerticalIndex = groupedVerticalIndexBySide[side] ?? 0;
23946
23953
  const groupOffsetPx = item?.groupOffsetPx ?? 0;
23954
+ const xPx = isGroupedVertical ? baseXPx + dirIntoChart * groupedVerticalIndex * itemGapPx + dirIntoChart * groupOffsetPx : baseXPx;
23947
23955
  geometry = computeVerticalLineGeometry({
23948
23956
  chart,
23949
23957
  chartArea,
23950
23958
  item,
23951
23959
  global: cfg,
23952
- xPx: isGroupedVertical ? baseXPx + dirIntoChart * groupedVerticalIndex * itemGapPx + dirIntoChart * groupOffsetPx : baseXPx
23960
+ xPx
23953
23961
  });
23954
23962
  if (geometry && isGroupedVertical) {
23955
23963
  groupedVerticalIndexBySide[side] = groupedVerticalIndex + 1;
@@ -23958,21 +23966,23 @@ var lineMarkersPlugin = {
23958
23966
  }
23959
23967
  } else {
23960
23968
  const stickToGroup = item?.stickToGroup ?? cfg?.stickToGroup ?? false;
23969
+ const groupAnchorXPx = (() => {
23970
+ const anchor = groupedAnchorBySide[side];
23971
+ if (!isFiniteNumber(anchor)) return void 0;
23972
+ return clamp(anchor, chartArea?.left, chartArea?.right);
23973
+ })();
23974
+ const previousGroupItemXPx = (() => {
23975
+ const prev = previousGroupedHorizontalEndBySide[side];
23976
+ if (!isFiniteNumber(prev)) return void 0;
23977
+ return clamp(prev, chartArea?.left, chartArea?.right);
23978
+ })();
23961
23979
  geometry = computeHorizontalLineGeometry({
23962
23980
  chart,
23963
23981
  chartArea,
23964
23982
  item,
23965
23983
  global: cfg,
23966
- groupAnchorXPx: (() => {
23967
- const anchor = groupedAnchorBySide[side];
23968
- if (!isFiniteNumber(anchor)) return void 0;
23969
- return clamp(anchor, chartArea?.left, chartArea?.right);
23970
- })(),
23971
- previousGroupItemXPx: (() => {
23972
- const prev = previousGroupedHorizontalEndBySide[side];
23973
- if (!isFiniteNumber(prev)) return void 0;
23974
- return clamp(prev, chartArea?.left, chartArea?.right);
23975
- })()
23984
+ groupAnchorXPx,
23985
+ previousGroupItemXPx
23976
23986
  });
23977
23987
  if (geometry && stickToGroup) previousGroupedHorizontalEndBySide[side] = geometry.x2;
23978
23988
  }
@@ -24373,7 +24383,8 @@ var generateAnnotationLabels = (chart) => {
24373
24383
  return Object.values(annotations);
24374
24384
  };
24375
24385
  var generatedLabels = (chart) => {
24376
- return cloneDeep(chart?.options?.plugins?.legend?.labels?.generateLabels?.(chart)) ?? [];
24386
+ const generateLabels = chart.options.plugins?.legend?.labels?.generateLabels;
24387
+ return cloneDeep(generateLabels?.(chart)) ?? [];
24377
24388
  };
24378
24389
  var getGeneratedLabels = (chart) => {
24379
24390
  const datasetLabels = generatedLabels(chart);
@@ -24388,7 +24399,7 @@ var getGeneratedLabels = (chart) => {
24388
24399
  };
24389
24400
  //#endregion
24390
24401
  //#region src/components/common/hooks/use-generated-labels.ts
24391
- var EXCLUDED_KEYS = new Set([
24402
+ var EXCLUDED_KEYS = /* @__PURE__ */ new Set([
24392
24403
  "data",
24393
24404
  "_meta",
24394
24405
  "_parsed",
@@ -24397,11 +24408,7 @@ var EXCLUDED_KEYS = new Set([
24397
24408
  ]);
24398
24409
  var useGeneratedLabels = (chartRef, generatedDatasets) => {
24399
24410
  const [items, setItems] = useState([]);
24400
- useEffect(() => {
24401
- const chart = chartRef?.current;
24402
- if (!chart) return;
24403
- setItems(getGeneratedLabels(chart));
24404
- }, [useMemo(() => {
24411
+ const datasetHash = useMemo(() => {
24405
24412
  if (!generatedDatasets?.length) return "";
24406
24413
  return hash(generatedDatasets, {
24407
24414
  excludeKeys: (key) => EXCLUDED_KEYS.has(key),
@@ -24409,7 +24416,13 @@ var useGeneratedLabels = (chartRef, generatedDatasets) => {
24409
24416
  unorderedArrays: false,
24410
24417
  respectType: false
24411
24418
  });
24412
- }, [generatedDatasets]), chartRef]);
24419
+ }, [generatedDatasets]);
24420
+ useEffect(() => {
24421
+ const chart = chartRef?.current;
24422
+ if (!chart) return;
24423
+ const newItems = getGeneratedLabels(chart);
24424
+ setItems(newItems);
24425
+ }, [datasetHash, chartRef]);
24413
24426
  return items;
24414
24427
  };
24415
24428
  /**
@@ -24455,7 +24468,7 @@ var LegendPanel = forwardRef(({ legendPosition, chartRef, isDragging, legendConf
24455
24468
  const { state: legendState } = useLegend() ?? {};
24456
24469
  const [legendEnabled, setLegendEnabled] = useState(legend?.display ?? true);
24457
24470
  const items = useGeneratedLabels(chartRef, generatedDatasets);
24458
- const style = createLegendStyle(legendPosition, chart);
24471
+ const style = createLegendStyle(legendPosition, chart ?? null);
24459
24472
  return /* @__PURE__ */ jsxs("div", {
24460
24473
  ref,
24461
24474
  className: cx(legend_module_default.legend, !legendEnabled && legend_module_default.isHidden, isDragging && legend_module_default.isDragging),
@@ -24491,7 +24504,9 @@ var LegendDropZone = (legendDropZoneProps) => {
24491
24504
  }));
24492
24505
  const isActive = isOver && canDrop;
24493
24506
  return /* @__PURE__ */ jsx("div", {
24494
- ref: dropRef,
24507
+ ref: (node) => {
24508
+ dropRef(node);
24509
+ },
24495
24510
  className: cx(legend_module_default.dropzone, isActive && legend_module_default.isActive, position?.includes("left") && legend_module_default.left, position?.includes("right") && legend_module_default.right, position?.includes("top") && legend_module_default.top, position?.includes("bottom") && legend_module_default.bottom),
24496
24511
  children: /* @__PURE__ */ jsx("div", {
24497
24512
  className: legend_module_default.dropzonePlaceholder,
@@ -26537,7 +26552,7 @@ var require_helpers_dataset = /* @__PURE__ */ __commonJSMin(((exports) => {
26537
26552
  appliers.forEach((apply) => apply(this));
26538
26553
  }
26539
26554
  };
26540
- var defaults = /* @__PURE__ */ new Defaults({
26555
+ var defaults = /* #__PURE__ */ new Defaults({
26541
26556
  _scriptable: (name) => !name.startsWith("on"),
26542
26557
  _indexable: (name) => name !== "events",
26543
26558
  hover: { _fallback: "interaction" },
@@ -26733,9 +26748,7 @@ var require_helpers_dataset = /* @__PURE__ */ __commonJSMin(((exports) => {
26733
26748
  ctx.moveTo(x, y);
26734
26749
  ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);
26735
26750
  break;
26736
- case false:
26737
- ctx.closePath();
26738
- break;
26751
+ case false: ctx.closePath();
26739
26752
  }
26740
26753
  ctx.fill();
26741
26754
  if (options.borderWidth > 0) ctx.stroke();
@@ -26868,9 +26881,7 @@ var require_helpers_dataset = /* @__PURE__ */ __commonJSMin(((exports) => {
26868
26881
  value = +matches[2];
26869
26882
  switch (matches[3]) {
26870
26883
  case "px": return value;
26871
- case "%":
26872
- value /= 100;
26873
- break;
26884
+ case "%": value /= 100;
26874
26885
  }
26875
26886
  return size * value;
26876
26887
  }
@@ -28194,7 +28205,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
28194
28205
  return this._charts.delete(chart);
28195
28206
  }
28196
28207
  };
28197
- var animator = /* @__PURE__ */ new Animator();
28208
+ var animator = /* #__PURE__ */ new Animator();
28198
28209
  var transparent = "transparent";
28199
28210
  var interpolators = {
28200
28211
  boolean(from, to, factor) {
@@ -28353,10 +28364,12 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
28353
28364
  const value = values[prop];
28354
28365
  let animation = running[prop];
28355
28366
  const cfg = animatedProps.get(prop);
28356
- if (animation) if (cfg && animation.active()) {
28357
- animation.update(cfg, value, date);
28358
- continue;
28359
- } else animation.cancel();
28367
+ if (animation) {
28368
+ if (cfg && animation.active()) {
28369
+ animation.update(cfg, value, date);
28370
+ continue;
28371
+ } else animation.cancel();
28372
+ }
28360
28373
  if (!cfg || !cfg.duration) {
28361
28374
  target[prop] = value;
28362
28375
  continue;
@@ -30296,7 +30309,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
30296
30309
  return Math.max(border, firstPoint, lastPoint) / 2;
30297
30310
  }
30298
30311
  };
30299
- var controllers = /* @__PURE__ */ Object.freeze({
30312
+ var controllers = /*#__PURE__*/ Object.freeze({
30300
30313
  __proto__: null,
30301
30314
  BarController,
30302
30315
  BubbleController,
@@ -30901,10 +30914,12 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
30901
30914
  const displayWidth = helpers_dataset.readUsedSize(canvas, "width");
30902
30915
  if (displayWidth !== void 0) canvas.width = displayWidth;
30903
30916
  }
30904
- if (isNullOrEmpty(renderHeight)) if (canvas.style.height === "") canvas.height = canvas.width / (aspectRatio || 2);
30905
- else {
30906
- const displayHeight = helpers_dataset.readUsedSize(canvas, "height");
30907
- if (displayHeight !== void 0) canvas.height = displayHeight;
30917
+ if (isNullOrEmpty(renderHeight)) {
30918
+ if (canvas.style.height === "") canvas.height = canvas.width / (aspectRatio || 2);
30919
+ else {
30920
+ const displayHeight = helpers_dataset.readUsedSize(canvas, "height");
30921
+ if (displayHeight !== void 0) canvas.height = displayHeight;
30922
+ }
30908
30923
  }
30909
30924
  return canvas;
30910
30925
  }
@@ -31620,14 +31635,15 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
31620
31635
  const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);
31621
31636
  let paddingLeft = 0;
31622
31637
  let paddingRight = 0;
31623
- if (isRotated) if (labelsBelowTicks) {
31624
- paddingLeft = cos * first.width;
31625
- paddingRight = sin * last.height;
31626
- } else {
31627
- paddingLeft = sin * first.height;
31628
- paddingRight = cos * last.width;
31629
- }
31630
- else if (align === "start") paddingRight = last.width;
31638
+ if (isRotated) {
31639
+ if (labelsBelowTicks) {
31640
+ paddingLeft = cos * first.width;
31641
+ paddingRight = sin * last.height;
31642
+ } else {
31643
+ paddingLeft = sin * first.height;
31644
+ paddingRight = cos * last.width;
31645
+ }
31646
+ } else if (align === "start") paddingRight = last.width;
31631
31647
  else if (align === "end") paddingLeft = first.width;
31632
31648
  else if (align !== "inner") {
31633
31649
  paddingLeft = first.width / 2;
@@ -31961,13 +31977,16 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
31961
31977
  let tickTextAlign = textAlign;
31962
31978
  if (isHorizontal) {
31963
31979
  x = pixel;
31964
- if (textAlign === "inner") if (i === ilen - 1) tickTextAlign = !this.options.reverse ? "right" : "left";
31965
- else if (i === 0) tickTextAlign = !this.options.reverse ? "left" : "right";
31966
- else tickTextAlign = "center";
31967
- if (position === "top") if (crossAlign === "near" || rotation !== 0) textOffset = -lineCount * lineHeight + lineHeight / 2;
31968
- else if (crossAlign === "center") textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;
31969
- else textOffset = -labelSizes.highest.height + lineHeight / 2;
31970
- else if (crossAlign === "near" || rotation !== 0) textOffset = lineHeight / 2;
31980
+ if (textAlign === "inner") {
31981
+ if (i === ilen - 1) tickTextAlign = !this.options.reverse ? "right" : "left";
31982
+ else if (i === 0) tickTextAlign = !this.options.reverse ? "left" : "right";
31983
+ else tickTextAlign = "center";
31984
+ }
31985
+ if (position === "top") {
31986
+ if (crossAlign === "near" || rotation !== 0) textOffset = -lineCount * lineHeight + lineHeight / 2;
31987
+ else if (crossAlign === "center") textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;
31988
+ else textOffset = -labelSizes.highest.height + lineHeight / 2;
31989
+ } else if (crossAlign === "near" || rotation !== 0) textOffset = lineHeight / 2;
31971
31990
  else if (crossAlign === "center") textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;
31972
31991
  else textOffset = labelSizes.highest.height - lineCount * lineHeight;
31973
31992
  if (mirror) textOffset *= -1;
@@ -31987,9 +32006,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
31987
32006
  case "middle":
31988
32007
  top -= height / 2;
31989
32008
  break;
31990
- case "bottom":
31991
- top -= height;
31992
- break;
32009
+ case "bottom": top -= height;
31993
32010
  }
31994
32011
  switch (textAlign) {
31995
32012
  case "center":
@@ -31998,10 +32015,8 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
31998
32015
  case "right":
31999
32016
  left -= width;
32000
32017
  break;
32001
- case "inner":
32002
- if (i === ilen - 1) left -= width;
32003
- else if (i > 0) left -= width / 2;
32004
- break;
32018
+ case "inner": if (i === ilen - 1) left -= width;
32019
+ else if (i > 0) left -= width / 2;
32005
32020
  }
32006
32021
  backdrop = {
32007
32022
  left,
@@ -32045,49 +32060,51 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
32045
32060
  const widest = labelSizes.widest.width;
32046
32061
  let textAlign;
32047
32062
  let x;
32048
- if (position === "left") if (mirror) {
32049
- x = this.right + padding;
32050
- if (crossAlign === "near") textAlign = "left";
32051
- else if (crossAlign === "center") {
32052
- textAlign = "center";
32053
- x += widest / 2;
32054
- } else {
32055
- textAlign = "right";
32056
- x += widest;
32057
- }
32058
- } else {
32059
- x = this.right - tickAndPadding;
32060
- if (crossAlign === "near") textAlign = "right";
32061
- else if (crossAlign === "center") {
32062
- textAlign = "center";
32063
- x -= widest / 2;
32064
- } else {
32065
- textAlign = "left";
32066
- x = this.left;
32067
- }
32068
- }
32069
- else if (position === "right") if (mirror) {
32070
- x = this.left + padding;
32071
- if (crossAlign === "near") textAlign = "right";
32072
- else if (crossAlign === "center") {
32073
- textAlign = "center";
32074
- x -= widest / 2;
32063
+ if (position === "left") {
32064
+ if (mirror) {
32065
+ x = this.right + padding;
32066
+ if (crossAlign === "near") textAlign = "left";
32067
+ else if (crossAlign === "center") {
32068
+ textAlign = "center";
32069
+ x += widest / 2;
32070
+ } else {
32071
+ textAlign = "right";
32072
+ x += widest;
32073
+ }
32075
32074
  } else {
32076
- textAlign = "left";
32077
- x -= widest;
32075
+ x = this.right - tickAndPadding;
32076
+ if (crossAlign === "near") textAlign = "right";
32077
+ else if (crossAlign === "center") {
32078
+ textAlign = "center";
32079
+ x -= widest / 2;
32080
+ } else {
32081
+ textAlign = "left";
32082
+ x = this.left;
32083
+ }
32078
32084
  }
32079
- } else {
32080
- x = this.left + tickAndPadding;
32081
- if (crossAlign === "near") textAlign = "left";
32082
- else if (crossAlign === "center") {
32083
- textAlign = "center";
32084
- x += widest / 2;
32085
+ } else if (position === "right") {
32086
+ if (mirror) {
32087
+ x = this.left + padding;
32088
+ if (crossAlign === "near") textAlign = "right";
32089
+ else if (crossAlign === "center") {
32090
+ textAlign = "center";
32091
+ x -= widest / 2;
32092
+ } else {
32093
+ textAlign = "left";
32094
+ x -= widest;
32095
+ }
32085
32096
  } else {
32086
- textAlign = "right";
32087
- x = this.right;
32097
+ x = this.left + tickAndPadding;
32098
+ if (crossAlign === "near") textAlign = "left";
32099
+ else if (crossAlign === "center") {
32100
+ textAlign = "center";
32101
+ x += widest / 2;
32102
+ } else {
32103
+ textAlign = "right";
32104
+ x = this.right;
32105
+ }
32088
32106
  }
32089
- }
32090
- else textAlign = "right";
32107
+ } else textAlign = "right";
32091
32108
  return {
32092
32109
  textAlign,
32093
32110
  x
@@ -32436,7 +32453,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
32436
32453
  return item;
32437
32454
  }
32438
32455
  };
32439
- var registry = /* @__PURE__ */ new Registry();
32456
+ var registry = /* #__PURE__ */ new Registry();
32440
32457
  var PluginService = class {
32441
32458
  constructor() {
32442
32459
  this._init = void 0;
@@ -34317,7 +34334,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
34317
34334
  return axis === "x" ? this.width / 2 : this.height / 2;
34318
34335
  }
34319
34336
  };
34320
- var elements = /* @__PURE__ */ Object.freeze({
34337
+ var elements = /*#__PURE__*/ Object.freeze({
34321
34338
  __proto__: null,
34322
34339
  ArcElement,
34323
34340
  BarElement,
@@ -34333,7 +34350,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
34333
34350
  "rgb(153, 102, 255)",
34334
34351
  "rgb(201, 203, 207)"
34335
34352
  ];
34336
- var BACKGROUND_COLORS = /* @__PURE__ */ BORDER_COLORS.map((color) => color.replace("rgb(", "rgba(").replace(")", ", 0.5)"));
34353
+ var BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color) => color.replace("rgb(", "rgba(").replace(")", ", 0.5)"));
34337
34354
  function getBorderColor(i) {
34338
34355
  return BORDER_COLORS[i % BORDER_COLORS.length];
34339
34356
  }
@@ -35393,7 +35410,8 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
35393
35410
  cursor.line++;
35394
35411
  y = cursor.y = helpers_dataset._alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);
35395
35412
  }
35396
- drawLegendBox(rtlHelper.x(x), y, legendItem);
35413
+ const realX = rtlHelper.x(x);
35414
+ drawLegendBox(realX, y, legendItem);
35397
35415
  x = helpers_dataset._textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);
35398
35416
  fillText(rtlHelper.x(x), y, legendItem);
35399
35417
  if (isHorizontal) cursor.x += width + padding;
@@ -35808,8 +35826,10 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
35808
35826
  }
35809
35827
  };
35810
35828
  function pushOrConcat(base, toPush) {
35811
- if (toPush) if (helpers_dataset.isArray(toPush)) Array.prototype.push.apply(base, toPush);
35812
- else base.push(toPush);
35829
+ if (toPush) {
35830
+ if (helpers_dataset.isArray(toPush)) Array.prototype.push.apply(base, toPush);
35831
+ else base.push(toPush);
35832
+ }
35813
35833
  return base;
35814
35834
  }
35815
35835
  function splitNewlines(str) {
@@ -36608,7 +36628,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
36608
36628
  },
36609
36629
  additionalOptionScopes: ["interaction"]
36610
36630
  };
36611
- var plugins = /* @__PURE__ */ Object.freeze({
36631
+ var plugins = /*#__PURE__*/ Object.freeze({
36612
36632
  __proto__: null,
36613
36633
  Colors: plugin_colors,
36614
36634
  Decimation: plugin_decimation,
@@ -36767,9 +36787,10 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
36767
36787
  if (maxDefined && tickValue > max) break;
36768
36788
  ticks.push({ value: tickValue });
36769
36789
  }
36770
- if (maxDefined && includeBounds && niceMax !== max) if (ticks.length && helpers_dataset.almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) ticks[ticks.length - 1].value = max;
36771
- else ticks.push({ value: max });
36772
- else if (!maxDefined || niceMax === max) ticks.push({ value: niceMax });
36790
+ if (maxDefined && includeBounds && niceMax !== max) {
36791
+ if (ticks.length && helpers_dataset.almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) ticks[ticks.length - 1].value = max;
36792
+ else ticks.push({ value: max });
36793
+ } else if (!maxDefined || niceMax === max) ticks.push({ value: niceMax });
36773
36794
  return ticks;
36774
36795
  }
36775
36796
  function relativeLabelSize(value, minSpacing, { horizontal, minRotation }) {
@@ -36988,12 +37009,14 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
36988
37009
  let max = this.max;
36989
37010
  const setMin = (v) => min = minDefined ? min : v;
36990
37011
  const setMax = (v) => max = maxDefined ? max : v;
36991
- if (min === max) if (min <= 0) {
36992
- setMin(1);
36993
- setMax(10);
36994
- } else {
36995
- setMin(changeExponent(min, -1));
36996
- setMax(changeExponent(max, 1));
37012
+ if (min === max) {
37013
+ if (min <= 0) {
37014
+ setMin(1);
37015
+ setMax(10);
37016
+ } else {
37017
+ setMin(changeExponent(min, -1));
37018
+ setMax(changeExponent(max, 1));
37019
+ }
36997
37020
  }
36998
37021
  if (min <= 0) setMin(changeExponent(max, -1));
36999
37022
  if (max <= 0) setMax(changeExponent(min, 1));
@@ -37514,7 +37537,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
37514
37537
  size: 3154e7
37515
37538
  }
37516
37539
  };
37517
- var UNITS = /* @__PURE__ */ Object.keys(INTERVALS);
37540
+ var UNITS = /* #__PURE__ */ Object.keys(INTERVALS);
37518
37541
  function sorter(a, b) {
37519
37542
  return a - b;
37520
37543
  }
@@ -37910,7 +37933,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
37910
37933
  return interpolate(this._table, decimal * this._tableRange + this._minPos, true);
37911
37934
  }
37912
37935
  };
37913
- var scales = /* @__PURE__ */ Object.freeze({
37936
+ var scales = /*#__PURE__*/ Object.freeze({
37914
37937
  __proto__: null,
37915
37938
  CategoryScale,
37916
37939
  LinearScale,
@@ -38981,12 +39004,14 @@ var getBarChartDataLabels = (options) => {
38981
39004
  const dataElement = context.chart.data.datasets[datasetIndex].data[dataIndex];
38982
39005
  let dataLabel = "";
38983
39006
  if (typeof dataElement === "number") dataLabel = Number.isInteger(dataElement) ? dataElement : dataElement.toFixed(2);
38984
- if (Array.isArray(dataElement)) if (dataElement.length === 2) {
38985
- const sum = dataElement[1] - dataElement[0];
38986
- dataLabel = sum < 0 ? round(sum, 2) : `+${round(sum, 2)}`;
38987
- } else dataLabel = dataElement.reduce((acc, curr, i) => {
38988
- return i === 0 ? `${acc} ${curr}` : `${acc}, ${curr}`;
38989
- }, "");
39007
+ if (Array.isArray(dataElement)) {
39008
+ if (dataElement.length === 2) {
39009
+ const sum = dataElement[1] - dataElement[0];
39010
+ dataLabel = sum < 0 ? round(sum, 2) : `+${round(sum, 2)}`;
39011
+ } else dataLabel = dataElement.reduce((acc, curr, i) => {
39012
+ return i === 0 ? `${acc} ${curr}` : `${acc}, ${curr}`;
39013
+ }, "");
39014
+ }
38990
39015
  return dataLabel;
38991
39016
  };
38992
39017
  const beginAtNotZeroAlign = reverse ? AlignOptions.End : AlignOptions.Start;
@@ -39709,12 +39734,11 @@ var ScatterChartWithLegend = (props) => {
39709
39734
  //#region src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.ts
39710
39735
  extend([lchPlugin]);
39711
39736
  var MIN_LIGHTNESS = 15;
39712
- var MAX_LIGHTNESS = 95;
39713
39737
  var getGroupedColorScheme = (length, startingColor) => {
39714
39738
  if (length === 1) return [startingColor];
39715
39739
  const { h: hue, c: chroma } = colord(startingColor).toLch();
39716
39740
  return Array.from({ length }, (_, index) => {
39717
- return `lch(${MIN_LIGHTNESS + (MAX_LIGHTNESS - MIN_LIGHTNESS) / length * (index + .5)} ${chroma} ${hue})`;
39741
+ return `lch(${MIN_LIGHTNESS + 80 / length * (index + .5)} ${chroma} ${hue})`;
39718
39742
  });
39719
39743
  };
39720
39744
  //#endregion