@oliasoft-open-source/charts-library 5.18.4 → 6.1.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 (2) hide show
  1. package/dist/index.js +310 -290
  2. package/package.json +17 -17
package/dist/index.js CHANGED
@@ -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));
@@ -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
  }
@@ -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
  };
@@ -20264,7 +20280,6 @@ var AxesOptionsPopover = (optionsPopover) => {
20264
20280
  var AxesOptions = (optionsPopover) => {
20265
20281
  return /* @__PURE__ */ jsx(Popover, {
20266
20282
  placement: "bottom-start",
20267
- overflowContainer: true,
20268
20283
  content: /* @__PURE__ */ jsx(AxesOptionsPopover, { ...optionsPopover }),
20269
20284
  children: /* @__PURE__ */ jsx(Tooltip, {
20270
20285
  text: optionsPopover.translations.axesOptions,
@@ -20994,7 +21009,8 @@ var getSuggestedAxisRange = ({ data, beginAtZero = false, autoAxisPadding = fals
20994
21009
  const point = dataMax;
20995
21010
  const padding = point * whiteSpacePercentage;
20996
21011
  const minAxisValue = beginAtZero && !isNegative ? 0 : point - padding;
20997
- const roundedMinAxisValue = round(beginAtZero && isNegative ? 0 : point + padding, 9);
21012
+ const maxAxisValue = beginAtZero && isNegative ? 0 : point + padding;
21013
+ const roundedMinAxisValue = round(maxAxisValue, 9);
20998
21014
  const roundedMaxAxisValue = round(minAxisValue, 9);
20999
21015
  return {
21000
21016
  min: roundedMinAxisValue < 0 ? roundedMinAxisValue : roundedMaxAxisValue,
@@ -21050,7 +21066,7 @@ var getAxesDataFromMetasets = (generatedDatasets, scalesKeys, annotationsData) =
21050
21066
  return (dataset?.data ?? []).map((point) => point[axisType]);
21051
21067
  });
21052
21068
  const annotationValues = annotations?.[axisKey] ?? [];
21053
- acc[axisKey] = [...new Set([...datasetValues, ...annotationValues])];
21069
+ acc[axisKey] = [.../* @__PURE__ */ new Set([...datasetValues, ...annotationValues])];
21054
21070
  return acc;
21055
21071
  }, {});
21056
21072
  };
@@ -21503,9 +21519,7 @@ var getReferencePoint$1 = (chart, area, annotation) => {
21503
21519
  y += Math.max(halfHeight, annotation?.radius ?? 0) + labelOffsetPx;
21504
21520
  break;
21505
21521
  case Position.Top:
21506
- default:
21507
- y -= Math.max(halfHeight, annotation?.radius ?? 0) + labelOffsetPx;
21508
- break;
21522
+ default: y -= Math.max(halfHeight, annotation?.radius ?? 0) + labelOffsetPx;
21509
21523
  }
21510
21524
  return {
21511
21525
  x: x + xAdjust,
@@ -22153,10 +22167,7 @@ var generateAnn = (ann, index) => {
22153
22167
  case AnnotationType$1.LABEL:
22154
22168
  handleLabelEnter(element, chart, ann);
22155
22169
  break;
22156
- case AnnotationType$1.POINT:
22157
- handlePointEnter(element, chart, ann);
22158
- break;
22159
- default: break;
22170
+ case AnnotationType$1.POINT: handlePointEnter(element, chart, ann);
22160
22171
  }
22161
22172
  };
22162
22173
  const leave = ({ element }, { chart }) => {
@@ -22170,10 +22181,7 @@ var generateAnn = (ann, index) => {
22170
22181
  case AnnotationType$1.LABEL:
22171
22182
  handleLabelLeave(element, chart, ann);
22172
22183
  break;
22173
- case AnnotationType$1.POINT:
22174
- handlePointLeave(element, chart, ann);
22175
- break;
22176
- default: break;
22184
+ case AnnotationType$1.POINT: handlePointLeave(element, chart, ann);
22177
22185
  }
22178
22186
  };
22179
22187
  const onDragStart = () => (cord, annotation) => ann?.onDragStart ? ann?.onDragStart(cord, annotation) : void 0;
@@ -22344,11 +22352,12 @@ var LegendProvider = ({ children, options, datasets }) => {
22344
22352
  showAnnotations,
22345
22353
  annotationsData
22346
22354
  });
22347
- const [state, dispatch] = useReducer(legendReducer, {
22355
+ const initialState = {
22348
22356
  ...legendInitialState,
22349
22357
  annotation,
22350
22358
  datasets: initDSs
22351
- });
22359
+ };
22360
+ const [state, dispatch] = useReducer(legendReducer, initialState);
22352
22361
  const contextValue = useMemo(() => ({
22353
22362
  state,
22354
22363
  dispatch
@@ -23027,7 +23036,6 @@ var annotationLabel = (ctx, annotations, scales) => {
23027
23036
  case Position.Right:
23028
23037
  textX = centerX + padding;
23029
23038
  textY = centerY;
23030
- break;
23031
23039
  }
23032
23040
  ctx?.fillText?.(content, textX, textY);
23033
23041
  ctx?.restore?.();
@@ -23191,9 +23199,7 @@ var getReferencePoint = (fromEl, connector) => {
23191
23199
  x += halfWidth;
23192
23200
  y += halfHeight;
23193
23201
  break;
23194
- default:
23195
- y -= Math.max(halfHeight, radius) + labelOffset;
23196
- break;
23202
+ default: y -= Math.max(halfHeight, radius) + labelOffset;
23197
23203
  }
23198
23204
  return {
23199
23205
  x: x + xAdjust,
@@ -23945,12 +23951,13 @@ var lineMarkersPlugin = {
23945
23951
  const dirIntoChart = side === LineMarkerSide.Left ? 1 : -1;
23946
23952
  const groupedVerticalIndex = groupedVerticalIndexBySide[side] ?? 0;
23947
23953
  const groupOffsetPx = item?.groupOffsetPx ?? 0;
23954
+ const xPx = isGroupedVertical ? baseXPx + dirIntoChart * groupedVerticalIndex * itemGapPx + dirIntoChart * groupOffsetPx : baseXPx;
23948
23955
  geometry = computeVerticalLineGeometry({
23949
23956
  chart,
23950
23957
  chartArea,
23951
23958
  item,
23952
23959
  global: cfg,
23953
- xPx: isGroupedVertical ? baseXPx + dirIntoChart * groupedVerticalIndex * itemGapPx + dirIntoChart * groupOffsetPx : baseXPx
23960
+ xPx
23954
23961
  });
23955
23962
  if (geometry && isGroupedVertical) {
23956
23963
  groupedVerticalIndexBySide[side] = groupedVerticalIndex + 1;
@@ -23959,21 +23966,23 @@ var lineMarkersPlugin = {
23959
23966
  }
23960
23967
  } else {
23961
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
+ })();
23962
23979
  geometry = computeHorizontalLineGeometry({
23963
23980
  chart,
23964
23981
  chartArea,
23965
23982
  item,
23966
23983
  global: cfg,
23967
- groupAnchorXPx: (() => {
23968
- const anchor = groupedAnchorBySide[side];
23969
- if (!isFiniteNumber(anchor)) return void 0;
23970
- return clamp(anchor, chartArea?.left, chartArea?.right);
23971
- })(),
23972
- previousGroupItemXPx: (() => {
23973
- const prev = previousGroupedHorizontalEndBySide[side];
23974
- if (!isFiniteNumber(prev)) return void 0;
23975
- return clamp(prev, chartArea?.left, chartArea?.right);
23976
- })()
23984
+ groupAnchorXPx,
23985
+ previousGroupItemXPx
23977
23986
  });
23978
23987
  if (geometry && stickToGroup) previousGroupedHorizontalEndBySide[side] = geometry.x2;
23979
23988
  }
@@ -24389,7 +24398,7 @@ var getGeneratedLabels = (chart) => {
24389
24398
  };
24390
24399
  //#endregion
24391
24400
  //#region src/components/common/hooks/use-generated-labels.ts
24392
- var EXCLUDED_KEYS = new Set([
24401
+ var EXCLUDED_KEYS = /* @__PURE__ */ new Set([
24393
24402
  "data",
24394
24403
  "_meta",
24395
24404
  "_parsed",
@@ -24398,11 +24407,7 @@ var EXCLUDED_KEYS = new Set([
24398
24407
  ]);
24399
24408
  var useGeneratedLabels = (chartRef, generatedDatasets) => {
24400
24409
  const [items, setItems] = useState([]);
24401
- useEffect(() => {
24402
- const chart = chartRef?.current;
24403
- if (!chart) return;
24404
- setItems(getGeneratedLabels(chart));
24405
- }, [useMemo(() => {
24410
+ const datasetHash = useMemo(() => {
24406
24411
  if (!generatedDatasets?.length) return "";
24407
24412
  return hash(generatedDatasets, {
24408
24413
  excludeKeys: (key) => EXCLUDED_KEYS.has(key),
@@ -24410,7 +24415,13 @@ var useGeneratedLabels = (chartRef, generatedDatasets) => {
24410
24415
  unorderedArrays: false,
24411
24416
  respectType: false
24412
24417
  });
24413
- }, [generatedDatasets]), chartRef]);
24418
+ }, [generatedDatasets]);
24419
+ useEffect(() => {
24420
+ const chart = chartRef?.current;
24421
+ if (!chart) return;
24422
+ const newItems = getGeneratedLabels(chart);
24423
+ setItems(newItems);
24424
+ }, [datasetHash, chartRef]);
24414
24425
  return items;
24415
24426
  };
24416
24427
  /**
@@ -26538,7 +26549,7 @@ var require_helpers_dataset = /* @__PURE__ */ __commonJSMin(((exports) => {
26538
26549
  appliers.forEach((apply) => apply(this));
26539
26550
  }
26540
26551
  };
26541
- var defaults = /* @__PURE__ */ new Defaults({
26552
+ var defaults = /* #__PURE__ */ new Defaults({
26542
26553
  _scriptable: (name) => !name.startsWith("on"),
26543
26554
  _indexable: (name) => name !== "events",
26544
26555
  hover: { _fallback: "interaction" },
@@ -26734,9 +26745,7 @@ var require_helpers_dataset = /* @__PURE__ */ __commonJSMin(((exports) => {
26734
26745
  ctx.moveTo(x, y);
26735
26746
  ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);
26736
26747
  break;
26737
- case false:
26738
- ctx.closePath();
26739
- break;
26748
+ case false: ctx.closePath();
26740
26749
  }
26741
26750
  ctx.fill();
26742
26751
  if (options.borderWidth > 0) ctx.stroke();
@@ -26869,9 +26878,7 @@ var require_helpers_dataset = /* @__PURE__ */ __commonJSMin(((exports) => {
26869
26878
  value = +matches[2];
26870
26879
  switch (matches[3]) {
26871
26880
  case "px": return value;
26872
- case "%":
26873
- value /= 100;
26874
- break;
26881
+ case "%": value /= 100;
26875
26882
  }
26876
26883
  return size * value;
26877
26884
  }
@@ -28195,7 +28202,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
28195
28202
  return this._charts.delete(chart);
28196
28203
  }
28197
28204
  };
28198
- var animator = /* @__PURE__ */ new Animator();
28205
+ var animator = /* #__PURE__ */ new Animator();
28199
28206
  var transparent = "transparent";
28200
28207
  var interpolators = {
28201
28208
  boolean(from, to, factor) {
@@ -28354,10 +28361,12 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
28354
28361
  const value = values[prop];
28355
28362
  let animation = running[prop];
28356
28363
  const cfg = animatedProps.get(prop);
28357
- if (animation) if (cfg && animation.active()) {
28358
- animation.update(cfg, value, date);
28359
- continue;
28360
- } else animation.cancel();
28364
+ if (animation) {
28365
+ if (cfg && animation.active()) {
28366
+ animation.update(cfg, value, date);
28367
+ continue;
28368
+ } else animation.cancel();
28369
+ }
28361
28370
  if (!cfg || !cfg.duration) {
28362
28371
  target[prop] = value;
28363
28372
  continue;
@@ -30297,7 +30306,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
30297
30306
  return Math.max(border, firstPoint, lastPoint) / 2;
30298
30307
  }
30299
30308
  };
30300
- var controllers = /* @__PURE__ */ Object.freeze({
30309
+ var controllers = /*#__PURE__*/ Object.freeze({
30301
30310
  __proto__: null,
30302
30311
  BarController,
30303
30312
  BubbleController,
@@ -30902,10 +30911,12 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
30902
30911
  const displayWidth = helpers_dataset.readUsedSize(canvas, "width");
30903
30912
  if (displayWidth !== void 0) canvas.width = displayWidth;
30904
30913
  }
30905
- if (isNullOrEmpty(renderHeight)) if (canvas.style.height === "") canvas.height = canvas.width / (aspectRatio || 2);
30906
- else {
30907
- const displayHeight = helpers_dataset.readUsedSize(canvas, "height");
30908
- if (displayHeight !== void 0) canvas.height = displayHeight;
30914
+ if (isNullOrEmpty(renderHeight)) {
30915
+ if (canvas.style.height === "") canvas.height = canvas.width / (aspectRatio || 2);
30916
+ else {
30917
+ const displayHeight = helpers_dataset.readUsedSize(canvas, "height");
30918
+ if (displayHeight !== void 0) canvas.height = displayHeight;
30919
+ }
30909
30920
  }
30910
30921
  return canvas;
30911
30922
  }
@@ -31621,14 +31632,15 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
31621
31632
  const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);
31622
31633
  let paddingLeft = 0;
31623
31634
  let paddingRight = 0;
31624
- if (isRotated) if (labelsBelowTicks) {
31625
- paddingLeft = cos * first.width;
31626
- paddingRight = sin * last.height;
31627
- } else {
31628
- paddingLeft = sin * first.height;
31629
- paddingRight = cos * last.width;
31630
- }
31631
- else if (align === "start") paddingRight = last.width;
31635
+ if (isRotated) {
31636
+ if (labelsBelowTicks) {
31637
+ paddingLeft = cos * first.width;
31638
+ paddingRight = sin * last.height;
31639
+ } else {
31640
+ paddingLeft = sin * first.height;
31641
+ paddingRight = cos * last.width;
31642
+ }
31643
+ } else if (align === "start") paddingRight = last.width;
31632
31644
  else if (align === "end") paddingLeft = first.width;
31633
31645
  else if (align !== "inner") {
31634
31646
  paddingLeft = first.width / 2;
@@ -31962,13 +31974,16 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
31962
31974
  let tickTextAlign = textAlign;
31963
31975
  if (isHorizontal) {
31964
31976
  x = pixel;
31965
- if (textAlign === "inner") if (i === ilen - 1) tickTextAlign = !this.options.reverse ? "right" : "left";
31966
- else if (i === 0) tickTextAlign = !this.options.reverse ? "left" : "right";
31967
- else tickTextAlign = "center";
31968
- if (position === "top") if (crossAlign === "near" || rotation !== 0) textOffset = -lineCount * lineHeight + lineHeight / 2;
31969
- else if (crossAlign === "center") textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;
31970
- else textOffset = -labelSizes.highest.height + lineHeight / 2;
31971
- else if (crossAlign === "near" || rotation !== 0) textOffset = lineHeight / 2;
31977
+ if (textAlign === "inner") {
31978
+ if (i === ilen - 1) tickTextAlign = !this.options.reverse ? "right" : "left";
31979
+ else if (i === 0) tickTextAlign = !this.options.reverse ? "left" : "right";
31980
+ else tickTextAlign = "center";
31981
+ }
31982
+ if (position === "top") {
31983
+ if (crossAlign === "near" || rotation !== 0) textOffset = -lineCount * lineHeight + lineHeight / 2;
31984
+ else if (crossAlign === "center") textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;
31985
+ else textOffset = -labelSizes.highest.height + lineHeight / 2;
31986
+ } else if (crossAlign === "near" || rotation !== 0) textOffset = lineHeight / 2;
31972
31987
  else if (crossAlign === "center") textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;
31973
31988
  else textOffset = labelSizes.highest.height - lineCount * lineHeight;
31974
31989
  if (mirror) textOffset *= -1;
@@ -31988,9 +32003,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
31988
32003
  case "middle":
31989
32004
  top -= height / 2;
31990
32005
  break;
31991
- case "bottom":
31992
- top -= height;
31993
- break;
32006
+ case "bottom": top -= height;
31994
32007
  }
31995
32008
  switch (textAlign) {
31996
32009
  case "center":
@@ -31999,10 +32012,8 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
31999
32012
  case "right":
32000
32013
  left -= width;
32001
32014
  break;
32002
- case "inner":
32003
- if (i === ilen - 1) left -= width;
32004
- else if (i > 0) left -= width / 2;
32005
- break;
32015
+ case "inner": if (i === ilen - 1) left -= width;
32016
+ else if (i > 0) left -= width / 2;
32006
32017
  }
32007
32018
  backdrop = {
32008
32019
  left,
@@ -32046,49 +32057,51 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
32046
32057
  const widest = labelSizes.widest.width;
32047
32058
  let textAlign;
32048
32059
  let x;
32049
- if (position === "left") if (mirror) {
32050
- x = this.right + padding;
32051
- if (crossAlign === "near") textAlign = "left";
32052
- else if (crossAlign === "center") {
32053
- textAlign = "center";
32054
- x += widest / 2;
32055
- } else {
32056
- textAlign = "right";
32057
- x += widest;
32058
- }
32059
- } else {
32060
- x = this.right - tickAndPadding;
32061
- if (crossAlign === "near") textAlign = "right";
32062
- else if (crossAlign === "center") {
32063
- textAlign = "center";
32064
- x -= widest / 2;
32065
- } else {
32066
- textAlign = "left";
32067
- x = this.left;
32068
- }
32069
- }
32070
- else if (position === "right") if (mirror) {
32071
- x = this.left + padding;
32072
- if (crossAlign === "near") textAlign = "right";
32073
- else if (crossAlign === "center") {
32074
- textAlign = "center";
32075
- x -= widest / 2;
32060
+ if (position === "left") {
32061
+ if (mirror) {
32062
+ x = this.right + padding;
32063
+ if (crossAlign === "near") textAlign = "left";
32064
+ else if (crossAlign === "center") {
32065
+ textAlign = "center";
32066
+ x += widest / 2;
32067
+ } else {
32068
+ textAlign = "right";
32069
+ x += widest;
32070
+ }
32076
32071
  } else {
32077
- textAlign = "left";
32078
- x -= widest;
32072
+ x = this.right - tickAndPadding;
32073
+ if (crossAlign === "near") textAlign = "right";
32074
+ else if (crossAlign === "center") {
32075
+ textAlign = "center";
32076
+ x -= widest / 2;
32077
+ } else {
32078
+ textAlign = "left";
32079
+ x = this.left;
32080
+ }
32079
32081
  }
32080
- } else {
32081
- x = this.left + tickAndPadding;
32082
- if (crossAlign === "near") textAlign = "left";
32083
- else if (crossAlign === "center") {
32084
- textAlign = "center";
32085
- x += widest / 2;
32082
+ } else if (position === "right") {
32083
+ if (mirror) {
32084
+ x = this.left + padding;
32085
+ if (crossAlign === "near") textAlign = "right";
32086
+ else if (crossAlign === "center") {
32087
+ textAlign = "center";
32088
+ x -= widest / 2;
32089
+ } else {
32090
+ textAlign = "left";
32091
+ x -= widest;
32092
+ }
32086
32093
  } else {
32087
- textAlign = "right";
32088
- x = this.right;
32094
+ x = this.left + tickAndPadding;
32095
+ if (crossAlign === "near") textAlign = "left";
32096
+ else if (crossAlign === "center") {
32097
+ textAlign = "center";
32098
+ x += widest / 2;
32099
+ } else {
32100
+ textAlign = "right";
32101
+ x = this.right;
32102
+ }
32089
32103
  }
32090
- }
32091
- else textAlign = "right";
32104
+ } else textAlign = "right";
32092
32105
  return {
32093
32106
  textAlign,
32094
32107
  x
@@ -32437,7 +32450,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
32437
32450
  return item;
32438
32451
  }
32439
32452
  };
32440
- var registry = /* @__PURE__ */ new Registry();
32453
+ var registry = /* #__PURE__ */ new Registry();
32441
32454
  var PluginService = class {
32442
32455
  constructor() {
32443
32456
  this._init = void 0;
@@ -34318,7 +34331,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
34318
34331
  return axis === "x" ? this.width / 2 : this.height / 2;
34319
34332
  }
34320
34333
  };
34321
- var elements = /* @__PURE__ */ Object.freeze({
34334
+ var elements = /*#__PURE__*/ Object.freeze({
34322
34335
  __proto__: null,
34323
34336
  ArcElement,
34324
34337
  BarElement,
@@ -34334,7 +34347,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
34334
34347
  "rgb(153, 102, 255)",
34335
34348
  "rgb(201, 203, 207)"
34336
34349
  ];
34337
- var BACKGROUND_COLORS = /* @__PURE__ */ BORDER_COLORS.map((color) => color.replace("rgb(", "rgba(").replace(")", ", 0.5)"));
34350
+ var BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color) => color.replace("rgb(", "rgba(").replace(")", ", 0.5)"));
34338
34351
  function getBorderColor(i) {
34339
34352
  return BORDER_COLORS[i % BORDER_COLORS.length];
34340
34353
  }
@@ -35394,7 +35407,8 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
35394
35407
  cursor.line++;
35395
35408
  y = cursor.y = helpers_dataset._alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);
35396
35409
  }
35397
- drawLegendBox(rtlHelper.x(x), y, legendItem);
35410
+ const realX = rtlHelper.x(x);
35411
+ drawLegendBox(realX, y, legendItem);
35398
35412
  x = helpers_dataset._textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);
35399
35413
  fillText(rtlHelper.x(x), y, legendItem);
35400
35414
  if (isHorizontal) cursor.x += width + padding;
@@ -35809,8 +35823,10 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
35809
35823
  }
35810
35824
  };
35811
35825
  function pushOrConcat(base, toPush) {
35812
- if (toPush) if (helpers_dataset.isArray(toPush)) Array.prototype.push.apply(base, toPush);
35813
- else base.push(toPush);
35826
+ if (toPush) {
35827
+ if (helpers_dataset.isArray(toPush)) Array.prototype.push.apply(base, toPush);
35828
+ else base.push(toPush);
35829
+ }
35814
35830
  return base;
35815
35831
  }
35816
35832
  function splitNewlines(str) {
@@ -36609,7 +36625,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
36609
36625
  },
36610
36626
  additionalOptionScopes: ["interaction"]
36611
36627
  };
36612
- var plugins = /* @__PURE__ */ Object.freeze({
36628
+ var plugins = /*#__PURE__*/ Object.freeze({
36613
36629
  __proto__: null,
36614
36630
  Colors: plugin_colors,
36615
36631
  Decimation: plugin_decimation,
@@ -36768,9 +36784,10 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
36768
36784
  if (maxDefined && tickValue > max) break;
36769
36785
  ticks.push({ value: tickValue });
36770
36786
  }
36771
- 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;
36772
- else ticks.push({ value: max });
36773
- else if (!maxDefined || niceMax === max) ticks.push({ value: niceMax });
36787
+ if (maxDefined && includeBounds && niceMax !== max) {
36788
+ if (ticks.length && helpers_dataset.almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) ticks[ticks.length - 1].value = max;
36789
+ else ticks.push({ value: max });
36790
+ } else if (!maxDefined || niceMax === max) ticks.push({ value: niceMax });
36774
36791
  return ticks;
36775
36792
  }
36776
36793
  function relativeLabelSize(value, minSpacing, { horizontal, minRotation }) {
@@ -36989,12 +37006,14 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
36989
37006
  let max = this.max;
36990
37007
  const setMin = (v) => min = minDefined ? min : v;
36991
37008
  const setMax = (v) => max = maxDefined ? max : v;
36992
- if (min === max) if (min <= 0) {
36993
- setMin(1);
36994
- setMax(10);
36995
- } else {
36996
- setMin(changeExponent(min, -1));
36997
- setMax(changeExponent(max, 1));
37009
+ if (min === max) {
37010
+ if (min <= 0) {
37011
+ setMin(1);
37012
+ setMax(10);
37013
+ } else {
37014
+ setMin(changeExponent(min, -1));
37015
+ setMax(changeExponent(max, 1));
37016
+ }
36998
37017
  }
36999
37018
  if (min <= 0) setMin(changeExponent(max, -1));
37000
37019
  if (max <= 0) setMax(changeExponent(min, 1));
@@ -37515,7 +37534,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
37515
37534
  size: 3154e7
37516
37535
  }
37517
37536
  };
37518
- var UNITS = /* @__PURE__ */ Object.keys(INTERVALS);
37537
+ var UNITS = /* #__PURE__ */ Object.keys(INTERVALS);
37519
37538
  function sorter(a, b) {
37520
37539
  return a - b;
37521
37540
  }
@@ -37911,7 +37930,7 @@ var require_chart = /* @__PURE__ */ __commonJSMin(((exports) => {
37911
37930
  return interpolate(this._table, decimal * this._tableRange + this._minPos, true);
37912
37931
  }
37913
37932
  };
37914
- var scales = /* @__PURE__ */ Object.freeze({
37933
+ var scales = /*#__PURE__*/ Object.freeze({
37915
37934
  __proto__: null,
37916
37935
  CategoryScale,
37917
37936
  LinearScale,
@@ -38982,12 +39001,14 @@ var getBarChartDataLabels = (options) => {
38982
39001
  const dataElement = context.chart.data.datasets[datasetIndex].data[dataIndex];
38983
39002
  let dataLabel = "";
38984
39003
  if (typeof dataElement === "number") dataLabel = Number.isInteger(dataElement) ? dataElement : dataElement.toFixed(2);
38985
- if (Array.isArray(dataElement)) if (dataElement.length === 2) {
38986
- const sum = dataElement[1] - dataElement[0];
38987
- dataLabel = sum < 0 ? round(sum, 2) : `+${round(sum, 2)}`;
38988
- } else dataLabel = dataElement.reduce((acc, curr, i) => {
38989
- return i === 0 ? `${acc} ${curr}` : `${acc}, ${curr}`;
38990
- }, "");
39004
+ if (Array.isArray(dataElement)) {
39005
+ if (dataElement.length === 2) {
39006
+ const sum = dataElement[1] - dataElement[0];
39007
+ dataLabel = sum < 0 ? round(sum, 2) : `+${round(sum, 2)}`;
39008
+ } else dataLabel = dataElement.reduce((acc, curr, i) => {
39009
+ return i === 0 ? `${acc} ${curr}` : `${acc}, ${curr}`;
39010
+ }, "");
39011
+ }
38991
39012
  return dataLabel;
38992
39013
  };
38993
39014
  const beginAtNotZeroAlign = reverse ? AlignOptions.End : AlignOptions.Start;
@@ -39710,12 +39731,11 @@ var ScatterChartWithLegend = (props) => {
39710
39731
  //#region src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.ts
39711
39732
  extend([lchPlugin]);
39712
39733
  var MIN_LIGHTNESS = 15;
39713
- var MAX_LIGHTNESS = 95;
39714
39734
  var getGroupedColorScheme = (length, startingColor) => {
39715
39735
  if (length === 1) return [startingColor];
39716
39736
  const { h: hue, c: chroma } = colord(startingColor).toLch();
39717
39737
  return Array.from({ length }, (_, index) => {
39718
- return `lch(${MIN_LIGHTNESS + (MAX_LIGHTNESS - MIN_LIGHTNESS) / length * (index + .5)} ${chroma} ${hue})`;
39738
+ return `lch(${MIN_LIGHTNESS + 80 / length * (index + .5)} ${chroma} ${hue})`;
39719
39739
  });
39720
39740
  };
39721
39741
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/charts-library",
3
- "version": "5.18.4",
3
+ "version": "6.1.0",
4
4
  "description": "React Chart Library (based on Chart.js and react-chart-js-2)",
5
5
  "homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
6
6
  "bugs": {
@@ -41,8 +41,8 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@dnd-kit/sortable": "^10.0.0",
44
- "@oliasoft-open-source/react-ui-library": "^6.0.0",
45
- "@oliasoft-open-source/units": "^5.0.0",
44
+ "@oliasoft-open-source/react-ui-library": "^7.2.0",
45
+ "@oliasoft-open-source/units": "^5.6.0",
46
46
  "@storybook/addon-docs": "^10.4.0",
47
47
  "@storybook/addon-themes": "^10.4.0",
48
48
  "@storybook/react-vite": "^10.4.0",
@@ -50,8 +50,8 @@
50
50
  "@types/object-hash": "^3.0.6",
51
51
  "@types/react": "^18.2.24",
52
52
  "@types/react-dom": "^18.3.7",
53
- "@vitejs/plugin-react": "^6.0.2",
54
- "@vitest/coverage-v8": "4.1.7",
53
+ "@vitejs/plugin-react": "^6.1.0",
54
+ "@vitest/coverage-v8": "^4.1.11",
55
55
  "classnames": "^2.5.1",
56
56
  "es-toolkit": "^1.44.0",
57
57
  "http-server": "^14.1.1",
@@ -61,21 +61,21 @@
61
61
  "less": "^4.3.0",
62
62
  "lint-staged": "^15.5.2",
63
63
  "normalize.css": "^8.0.1",
64
- "oxfmt": "^0.61.0",
65
- "oxlint": "^1.17.0",
64
+ "oxfmt": "^0.64.0",
65
+ "oxlint": "^1.79.0",
66
66
  "react": "^18.2.0",
67
67
  "react-dom": "^18.2.0",
68
68
  "storybook": "^10.4.0",
69
69
  "typescript": "^6.0.3",
70
- "vite": "8.0.14",
71
- "vite-plugin-css-injected-by-js": "^5.0.1",
72
- "vite-plugin-dts": "^5.0.1",
70
+ "vite": "^8.2.2",
71
+ "vite-plugin-css-injected-by-js": "^5.0.2",
72
+ "vite-plugin-dts": "^5.0.3",
73
73
  "vite-plugin-svgr": "^5.2.0",
74
- "vitest": "^4.1.7",
75
- "node": "runtime:26.3.0"
74
+ "vitest": "^4.1.11",
75
+ "node": "runtime:26.6.0"
76
76
  },
77
77
  "peerDependencies": {
78
- "@oliasoft-open-source/react-ui-library": "^6",
78
+ "@oliasoft-open-source/react-ui-library": "^7",
79
79
  "@oliasoft-open-source/units": "^5",
80
80
  "classnames": "^2.5.1",
81
81
  "es-toolkit": "^1",
@@ -85,19 +85,19 @@
85
85
  },
86
86
  "lint-staged": {
87
87
  "*": [
88
- "oxlint -c .oxlintrc.json --fix",
89
- "oxfmt"
88
+ "oxlint --fix --no-error-on-unmatched-pattern",
89
+ "oxfmt --no-error-on-unmatched-pattern"
90
90
  ]
91
91
  },
92
92
  "devEngines": {
93
93
  "packageManager": {
94
94
  "name": "pnpm",
95
- "version": "11.3.0",
95
+ "version": "11.9.0",
96
96
  "onFail": "download"
97
97
  },
98
98
  "runtime": {
99
99
  "name": "node",
100
- "version": "26.3.0",
100
+ "version": "26.6.0",
101
101
  "onFail": "download"
102
102
  }
103
103
  },