@oliasoft-open-source/charts-library 4.3.0-beta-2 → 4.3.0-beta-3

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.
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
7
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
8
8
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
9
9
  import React, { forwardRef, useRef, useEffect, createContext as createContext$2, memo, useLayoutEffect, useState, useCallback, useMemo, isValidElement, cloneElement, useContext, useReducer } from "react";
10
10
  import { produce } from "immer";
@@ -4914,6 +4914,130 @@ let PieController$1 = (_e = class extends DoughnutController$1 {
4914
4914
  circumference: 360,
4915
4915
  radius: "100%"
4916
4916
  }), _e);
4917
+ let ScatterController$1 = (_f = class extends DatasetController$1 {
4918
+ getLabelAndValue(index2) {
4919
+ const meta = this._cachedMeta;
4920
+ const labels = this.chart.data.labels || [];
4921
+ const { xScale, yScale } = meta;
4922
+ const parsed = this.getParsed(index2);
4923
+ const x2 = xScale.getLabelForValue(parsed.x);
4924
+ const y2 = yScale.getLabelForValue(parsed.y);
4925
+ return {
4926
+ label: labels[index2] || "",
4927
+ value: "(" + x2 + ", " + y2 + ")"
4928
+ };
4929
+ }
4930
+ update(mode) {
4931
+ const meta = this._cachedMeta;
4932
+ const { data: points = [] } = meta;
4933
+ const animationsDisabled = this.chart._animationsDisabled;
4934
+ let { start, count } = _getStartAndCountOfVisiblePoints$1(meta, points, animationsDisabled);
4935
+ this._drawStart = start;
4936
+ this._drawCount = count;
4937
+ if (_scaleRangesChanged$1(meta)) {
4938
+ start = 0;
4939
+ count = points.length;
4940
+ }
4941
+ if (this.options.showLine) {
4942
+ if (!this.datasetElementType) {
4943
+ this.addElements();
4944
+ }
4945
+ const { dataset: line, _dataset } = meta;
4946
+ line._chart = this.chart;
4947
+ line._datasetIndex = this.index;
4948
+ line._decimated = !!_dataset._decimated;
4949
+ line.points = points;
4950
+ const options = this.resolveDatasetElementOptions(mode);
4951
+ options.segment = this.options.segment;
4952
+ this.updateElement(line, void 0, {
4953
+ animated: !animationsDisabled,
4954
+ options
4955
+ }, mode);
4956
+ } else if (this.datasetElementType) {
4957
+ delete meta.dataset;
4958
+ this.datasetElementType = false;
4959
+ }
4960
+ this.updateElements(points, start, count, mode);
4961
+ }
4962
+ addElements() {
4963
+ const { showLine } = this.options;
4964
+ if (!this.datasetElementType && showLine) {
4965
+ this.datasetElementType = this.chart.registry.getElement("line");
4966
+ }
4967
+ super.addElements();
4968
+ }
4969
+ updateElements(points, start, count, mode) {
4970
+ const reset = mode === "reset";
4971
+ const { iScale, vScale, _stacked, _dataset } = this._cachedMeta;
4972
+ const firstOpts = this.resolveDataElementOptions(start, mode);
4973
+ const sharedOptions = this.getSharedOptions(firstOpts);
4974
+ const includeOptions = this.includeOptions(mode, sharedOptions);
4975
+ const iAxis = iScale.axis;
4976
+ const vAxis = vScale.axis;
4977
+ const { spanGaps, segment } = this.options;
4978
+ const maxGapLength = isNumber$1(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;
4979
+ const directUpdate = this.chart._animationsDisabled || reset || mode === "none";
4980
+ let prevParsed = start > 0 && this.getParsed(start - 1);
4981
+ for (let i2 = start; i2 < start + count; ++i2) {
4982
+ const point = points[i2];
4983
+ const parsed = this.getParsed(i2);
4984
+ const properties = directUpdate ? point : {};
4985
+ const nullData = isNullOrUndef$1(parsed[vAxis]);
4986
+ const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i2);
4987
+ const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i2);
4988
+ properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;
4989
+ properties.stop = i2 > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;
4990
+ if (segment) {
4991
+ properties.parsed = parsed;
4992
+ properties.raw = _dataset.data[i2];
4993
+ }
4994
+ if (includeOptions) {
4995
+ properties.options = sharedOptions || this.resolveDataElementOptions(i2, point.active ? "active" : mode);
4996
+ }
4997
+ if (!directUpdate) {
4998
+ this.updateElement(point, i2, properties, mode);
4999
+ }
5000
+ prevParsed = parsed;
5001
+ }
5002
+ this.updateSharedOptions(sharedOptions, mode, firstOpts);
5003
+ }
5004
+ getMaxOverflow() {
5005
+ const meta = this._cachedMeta;
5006
+ const data = meta.data || [];
5007
+ if (!this.options.showLine) {
5008
+ let max = 0;
5009
+ for (let i2 = data.length - 1; i2 >= 0; --i2) {
5010
+ max = Math.max(max, data[i2].size(this.resolveDataElementOptions(i2)) / 2);
5011
+ }
5012
+ return max > 0 && max;
5013
+ }
5014
+ const dataset = meta.dataset;
5015
+ const border = dataset.options && dataset.options.borderWidth || 0;
5016
+ if (!data.length) {
5017
+ return border;
5018
+ }
5019
+ const firstPoint = data[0].size(this.resolveDataElementOptions(0));
5020
+ const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));
5021
+ return Math.max(border, firstPoint, lastPoint) / 2;
5022
+ }
5023
+ }, __publicField(_f, "id", "scatter"), __publicField(_f, "defaults", {
5024
+ datasetElementType: false,
5025
+ dataElementType: "point",
5026
+ showLine: false,
5027
+ fill: false
5028
+ }), __publicField(_f, "overrides", {
5029
+ interaction: {
5030
+ mode: "point"
5031
+ },
5032
+ scales: {
5033
+ x: {
5034
+ type: "linear"
5035
+ },
5036
+ y: {
5037
+ type: "linear"
5038
+ }
5039
+ }
5040
+ }), _f);
4917
5041
  function abstract$1() {
4918
5042
  throw new Error("This method is not implemented: Check that a complete date adapter is provided.");
4919
5043
  }
@@ -5803,7 +5927,7 @@ function _detectPlatform$1(canvas2) {
5803
5927
  }
5804
5928
  return DomPlatform$1;
5805
5929
  }
5806
- let Element$2 = (_f = class {
5930
+ let Element$2 = (_g = class {
5807
5931
  constructor() {
5808
5932
  __publicField(this, "x");
5809
5933
  __publicField(this, "y");
@@ -5835,7 +5959,7 @@ let Element$2 = (_f = class {
5835
5959
  });
5836
5960
  return ret;
5837
5961
  }
5838
- }, __publicField(_f, "defaults", {}), __publicField(_f, "defaultRoutes"), _f);
5962
+ }, __publicField(_g, "defaults", {}), __publicField(_g, "defaultRoutes"), _g);
5839
5963
  function autoSkip$1(scale, ticks) {
5840
5964
  const tickOpts = scale.options.ticks;
5841
5965
  const determinedMaxTicks = determineMaxTicks$1(scale);
@@ -7922,7 +8046,7 @@ function getDatasetArea(meta, chartArea) {
7922
8046
  }
7923
8047
  return chartArea;
7924
8048
  }
7925
- let Chart$2 = (_g = class {
8049
+ let Chart$2 = (_h = class {
7926
8050
  static register(...items) {
7927
8051
  registry$1.add(...items);
7928
8052
  invalidatePlugins$1();
@@ -8742,7 +8866,7 @@ let Chart$2 = (_g = class {
8742
8866
  const hoverOptions = this.options.hover;
8743
8867
  return this.getElementsAtEventForMode(e2, hoverOptions.mode, hoverOptions, useFinalPosition);
8744
8868
  }
8745
- }, __publicField(_g, "defaults", defaults$2), __publicField(_g, "instances", instances$1), __publicField(_g, "overrides", overrides$1), __publicField(_g, "registry", registry$1), __publicField(_g, "version", version$3), __publicField(_g, "getChart", getChart$1), _g);
8869
+ }, __publicField(_h, "defaults", defaults$2), __publicField(_h, "instances", instances$1), __publicField(_h, "overrides", overrides$1), __publicField(_h, "registry", registry$1), __publicField(_h, "version", version$3), __publicField(_h, "getChart", getChart$1), _h);
8746
8870
  function invalidatePlugins$1() {
8747
8871
  return each$1(Chart$2.instances, (chart2) => chart2._plugins.invalidate());
8748
8872
  }
@@ -8904,7 +9028,7 @@ function drawBorder$1(ctx, element, offset, spacing, circular) {
8904
9028
  ctx.stroke();
8905
9029
  }
8906
9030
  }
8907
- let ArcElement$1 = (_h = class extends Element$2 {
9031
+ let ArcElement$1 = (_i = class extends Element$2 {
8908
9032
  constructor(cfg) {
8909
9033
  super();
8910
9034
  __publicField(this, "circumference");
@@ -8989,7 +9113,7 @@ let ArcElement$1 = (_h = class extends Element$2 {
8989
9113
  drawBorder$1(ctx, this, radiusOffset, spacing, circular);
8990
9114
  ctx.restore();
8991
9115
  }
8992
- }, __publicField(_h, "id", "arc"), __publicField(_h, "defaults", {
9116
+ }, __publicField(_i, "id", "arc"), __publicField(_i, "defaults", {
8993
9117
  borderAlign: "center",
8994
9118
  borderColor: "#fff",
8995
9119
  borderDash: [],
@@ -9001,12 +9125,12 @@ let ArcElement$1 = (_h = class extends Element$2 {
9001
9125
  spacing: 0,
9002
9126
  angle: void 0,
9003
9127
  circular: true
9004
- }), __publicField(_h, "defaultRoutes", {
9128
+ }), __publicField(_i, "defaultRoutes", {
9005
9129
  backgroundColor: "backgroundColor"
9006
- }), __publicField(_h, "descriptors", {
9130
+ }), __publicField(_i, "descriptors", {
9007
9131
  _scriptable: true,
9008
9132
  _indexable: (name) => name !== "borderDash"
9009
- }), _h);
9133
+ }), _i);
9010
9134
  function setStyle$1(ctx, options, style = options) {
9011
9135
  ctx.lineCap = valueOrDefault$1(style.borderCapStyle, options.borderCapStyle);
9012
9136
  ctx.setLineDash(valueOrDefault$1(style.borderDash, options.borderDash));
@@ -9159,7 +9283,7 @@ function draw$3(ctx, line, start, count) {
9159
9283
  strokePathDirect$1(ctx, line, start, count);
9160
9284
  }
9161
9285
  }
9162
- let LineElement$1 = (_i = class extends Element$2 {
9286
+ let LineElement$1 = (_j = class extends Element$2 {
9163
9287
  constructor(cfg) {
9164
9288
  super();
9165
9289
  this.animated = true;
@@ -9269,7 +9393,7 @@ let LineElement$1 = (_i = class extends Element$2 {
9269
9393
  this._path = void 0;
9270
9394
  }
9271
9395
  }
9272
- }, __publicField(_i, "id", "line"), __publicField(_i, "defaults", {
9396
+ }, __publicField(_j, "id", "line"), __publicField(_j, "defaults", {
9273
9397
  borderCapStyle: "butt",
9274
9398
  borderDash: [],
9275
9399
  borderDashOffset: 0,
@@ -9281,13 +9405,13 @@ let LineElement$1 = (_i = class extends Element$2 {
9281
9405
  spanGaps: false,
9282
9406
  stepped: false,
9283
9407
  tension: 0
9284
- }), __publicField(_i, "defaultRoutes", {
9408
+ }), __publicField(_j, "defaultRoutes", {
9285
9409
  backgroundColor: "backgroundColor",
9286
9410
  borderColor: "borderColor"
9287
- }), __publicField(_i, "descriptors", {
9411
+ }), __publicField(_j, "descriptors", {
9288
9412
  _scriptable: true,
9289
9413
  _indexable: (name) => name !== "borderDash" && name !== "fill"
9290
- }), _i);
9414
+ }), _j);
9291
9415
  function inRange$1$1(el, pos, axis, useFinalPosition) {
9292
9416
  const options = el.options;
9293
9417
  const { [axis]: value } = el.getProps([
@@ -9295,7 +9419,7 @@ function inRange$1$1(el, pos, axis, useFinalPosition) {
9295
9419
  ], useFinalPosition);
9296
9420
  return Math.abs(pos - value) < options.radius + options.hitRadius;
9297
9421
  }
9298
- let PointElement$1 = (_j = class extends Element$2 {
9422
+ let PointElement$1 = (_k = class extends Element$2 {
9299
9423
  constructor(cfg) {
9300
9424
  super();
9301
9425
  __publicField(this, "parsed");
@@ -9354,10 +9478,10 @@ let PointElement$1 = (_j = class extends Element$2 {
9354
9478
  const options = this.options || {};
9355
9479
  return options.radius + options.hitRadius;
9356
9480
  }
9357
- }, __publicField(_j, "id", "point"), /**
9481
+ }, __publicField(_k, "id", "point"), /**
9358
9482
  * @type {any}
9359
9483
  */
9360
- __publicField(_j, "defaults", {
9484
+ __publicField(_k, "defaults", {
9361
9485
  borderWidth: 1,
9362
9486
  hitRadius: 1,
9363
9487
  hoverBorderWidth: 1,
@@ -9368,10 +9492,10 @@ __publicField(_j, "defaults", {
9368
9492
  }), /**
9369
9493
  * @type {any}
9370
9494
  */
9371
- __publicField(_j, "defaultRoutes", {
9495
+ __publicField(_k, "defaultRoutes", {
9372
9496
  backgroundColor: "backgroundColor",
9373
9497
  borderColor: "borderColor"
9374
- }), _j);
9498
+ }), _k);
9375
9499
  function getBarBounds$1(bar, useFinalPosition) {
9376
9500
  const { x: x2, y: y2, base, width, height } = bar.getProps([
9377
9501
  "x",
@@ -9485,7 +9609,7 @@ function inflateRect$1(rect, amount, refRect = {}) {
9485
9609
  radius: rect.radius
9486
9610
  };
9487
9611
  }
9488
- let BarElement$1 = (_k = class extends Element$2 {
9612
+ let BarElement$1 = (_l = class extends Element$2 {
9489
9613
  constructor(cfg) {
9490
9614
  super();
9491
9615
  this.options = void 0;
@@ -9541,16 +9665,16 @@ let BarElement$1 = (_k = class extends Element$2 {
9541
9665
  getRange(axis) {
9542
9666
  return axis === "x" ? this.width / 2 : this.height / 2;
9543
9667
  }
9544
- }, __publicField(_k, "id", "bar"), __publicField(_k, "defaults", {
9668
+ }, __publicField(_l, "id", "bar"), __publicField(_l, "defaults", {
9545
9669
  borderSkipped: "start",
9546
9670
  borderWidth: 0,
9547
9671
  borderRadius: 0,
9548
9672
  inflateAmount: "auto",
9549
9673
  pointStyle: void 0
9550
- }), __publicField(_k, "defaultRoutes", {
9674
+ }), __publicField(_l, "defaultRoutes", {
9551
9675
  backgroundColor: "backgroundColor",
9552
9676
  borderColor: "borderColor"
9553
- }), _k);
9677
+ }), _l);
9554
9678
  function _segments(line, target, property) {
9555
9679
  const segments = line.segments;
9556
9680
  const points = line.points;
@@ -11119,7 +11243,7 @@ function invokeCallbackWithFallback(callbacks, name, ctx, arg) {
11119
11243
  }
11120
11244
  return result;
11121
11245
  }
11122
- let Tooltip$1 = (_l = class extends Element$2 {
11246
+ let Tooltip$1 = (_m = class extends Element$2 {
11123
11247
  constructor(config2) {
11124
11248
  super();
11125
11249
  this.opacity = 0;
@@ -11658,7 +11782,7 @@ let Tooltip$1 = (_l = class extends Element$2 {
11658
11782
  const position = positioners$2[options.position].call(this, active, e2);
11659
11783
  return position !== false && (caretX !== position.x || caretY !== position.y);
11660
11784
  }
11661
- }, __publicField(_l, "positioners", positioners$2), _l);
11785
+ }, __publicField(_m, "positioners", positioners$2), _m);
11662
11786
  var plugin_tooltip = {
11663
11787
  id: "tooltip",
11664
11788
  _element: Tooltip$1,
@@ -11813,7 +11937,7 @@ function _getLabelForValue(value) {
11813
11937
  }
11814
11938
  return value;
11815
11939
  }
11816
- let CategoryScale$1 = (_m = class extends Scale$1 {
11940
+ let CategoryScale$1 = (_n = class extends Scale$1 {
11817
11941
  constructor(cfg) {
11818
11942
  super(cfg);
11819
11943
  this._startValue = void 0;
@@ -11899,11 +12023,11 @@ let CategoryScale$1 = (_m = class extends Scale$1 {
11899
12023
  getBasePixel() {
11900
12024
  return this.bottom;
11901
12025
  }
11902
- }, __publicField(_m, "id", "category"), __publicField(_m, "defaults", {
12026
+ }, __publicField(_n, "id", "category"), __publicField(_n, "defaults", {
11903
12027
  ticks: {
11904
12028
  callback: _getLabelForValue
11905
12029
  }
11906
- }), _m);
12030
+ }), _n);
11907
12031
  function generateTicks$1$1(generationOptions, dataRange) {
11908
12032
  const ticks = [];
11909
12033
  const MIN_SPACING = 1e-14;
@@ -12126,7 +12250,7 @@ let LinearScaleBase$1 = class LinearScaleBase extends Scale$1 {
12126
12250
  return formatNumber$1(value, this.chart.options.locale, this.options.ticks.format);
12127
12251
  }
12128
12252
  };
12129
- let LinearScale$1 = (_n = class extends LinearScaleBase$1 {
12253
+ let LinearScale$1 = (_o = class extends LinearScaleBase$1 {
12130
12254
  determineDataLimits() {
12131
12255
  const { min, max } = this.getMinMax(true);
12132
12256
  this.min = isNumberFinite$1(min) ? min : 0;
@@ -12147,11 +12271,11 @@ let LinearScale$1 = (_n = class extends LinearScaleBase$1 {
12147
12271
  getValueForPixel(pixel) {
12148
12272
  return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;
12149
12273
  }
12150
- }, __publicField(_n, "id", "linear"), __publicField(_n, "defaults", {
12274
+ }, __publicField(_o, "id", "linear"), __publicField(_o, "defaults", {
12151
12275
  ticks: {
12152
12276
  callback: Ticks$1.formatters.numeric
12153
12277
  }
12154
- }), _n);
12278
+ }), _o);
12155
12279
  const log10Floor = (v2) => Math.floor(log10$1(v2));
12156
12280
  const changeExponent = (v2, m2) => Math.pow(10, log10Floor(v2) + m2);
12157
12281
  function isMajor$1(tickVal) {
@@ -12213,7 +12337,7 @@ function generateTicks$2(generationOptions, { min, max }) {
12213
12337
  });
12214
12338
  return ticks;
12215
12339
  }
12216
- let LogarithmicScale$1 = (_o = class extends Scale$1 {
12340
+ let LogarithmicScale$1 = (_p = class extends Scale$1 {
12217
12341
  constructor(cfg) {
12218
12342
  super(cfg);
12219
12343
  this.start = void 0;
@@ -12310,14 +12434,14 @@ let LogarithmicScale$1 = (_o = class extends Scale$1 {
12310
12434
  const decimal = this.getDecimalForPixel(pixel);
12311
12435
  return Math.pow(10, this._startValue + decimal * this._valueRange);
12312
12436
  }
12313
- }, __publicField(_o, "id", "logarithmic"), __publicField(_o, "defaults", {
12437
+ }, __publicField(_p, "id", "logarithmic"), __publicField(_p, "defaults", {
12314
12438
  ticks: {
12315
12439
  callback: Ticks$1.formatters.logarithmic,
12316
12440
  major: {
12317
12441
  enabled: true
12318
12442
  }
12319
12443
  }
12320
- }), _o);
12444
+ }), _p);
12321
12445
  const INTERVALS$1 = {
12322
12446
  millisecond: {
12323
12447
  common: true,
@@ -12453,7 +12577,7 @@ function ticksFromTimestamps$1(scale, values2, majorUnit) {
12453
12577
  }
12454
12578
  return ilen === 0 || !majorUnit ? ticks : setMajorTicks$1(scale, ticks, map2, majorUnit);
12455
12579
  }
12456
- let TimeScale$1 = (_p = class extends Scale$1 {
12580
+ let TimeScale$1 = (_q = class extends Scale$1 {
12457
12581
  constructor(props) {
12458
12582
  super(props);
12459
12583
  this._cache = {
@@ -12719,7 +12843,7 @@ let TimeScale$1 = (_p = class extends Scale$1 {
12719
12843
  normalize(values2) {
12720
12844
  return _arrayUnique$1(values2.sort(sorter$1));
12721
12845
  }
12722
- }, __publicField(_p, "id", "time"), __publicField(_p, "defaults", {
12846
+ }, __publicField(_q, "id", "time"), __publicField(_q, "defaults", {
12723
12847
  bounds: "data",
12724
12848
  adapters: {},
12725
12849
  time: {
@@ -12737,7 +12861,7 @@ let TimeScale$1 = (_p = class extends Scale$1 {
12737
12861
  enabled: false
12738
12862
  }
12739
12863
  }
12740
- }), _p);
12864
+ }), _q);
12741
12865
  function interpolate$2(table2, val, reverse) {
12742
12866
  let lo = 0;
12743
12867
  let hi = table2.length - 1;
@@ -12758,7 +12882,7 @@ function interpolate$2(table2, val, reverse) {
12758
12882
  const span = nextSource - prevSource;
12759
12883
  return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;
12760
12884
  }
12761
- let TimeSeriesScale$1 = (_q = class extends TimeScale$1 {
12885
+ let TimeSeriesScale$1 = (_r = class extends TimeScale$1 {
12762
12886
  constructor(props) {
12763
12887
  super(props);
12764
12888
  this._table = [];
@@ -12843,7 +12967,7 @@ let TimeSeriesScale$1 = (_q = class extends TimeScale$1 {
12843
12967
  const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;
12844
12968
  return interpolate$2(this._table, decimal * this._tableRange + this._minPos, true);
12845
12969
  }
12846
- }, __publicField(_q, "id", "timeseries"), __publicField(_q, "defaults", TimeScale$1.defaults), _q);
12970
+ }, __publicField(_r, "id", "timeseries"), __publicField(_r, "defaults", TimeScale$1.defaults), _r);
12847
12971
  const defaultDatasetIdKey = "label";
12848
12972
  function reforwardRef(ref, value) {
12849
12973
  if (typeof ref === "function") {
@@ -12980,6 +13104,7 @@ function createTypedChart(type, registerables) {
12980
13104
  const Line = /* @__PURE__ */ createTypedChart("line", LineController$1);
12981
13105
  const Bar = /* @__PURE__ */ createTypedChart("bar", BarController$1);
12982
13106
  const Pie = /* @__PURE__ */ createTypedChart("pie", PieController$1);
13107
+ const Scatter = /* @__PURE__ */ createTypedChart("scatter", ScatterController$1);
12983
13108
  function getDefaultExportFromCjs(x2) {
12984
13109
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
12985
13110
  }
@@ -22048,26 +22173,26 @@ class HTML5BackendImpl {
22048
22173
  const HTML5Backend = function createBackend(manager, context, options) {
22049
22174
  return new HTML5BackendImpl(manager, context, options);
22050
22175
  };
22051
- const chart$2 = "_chart_e3qdd_1";
22176
+ const chart$3 = "_chart_e3qdd_1";
22052
22177
  const canvas$1 = "_canvas_e3qdd_11";
22053
- const fixedHeight$2 = "_fixedHeight_e3qdd_20";
22054
- const stretchHeight$2 = "_stretchHeight_e3qdd_26";
22178
+ const fixedHeight$3 = "_fixedHeight_e3qdd_20";
22179
+ const stretchHeight$3 = "_stretchHeight_e3qdd_26";
22055
22180
  const squareAspectRatio = "_squareAspectRatio_e3qdd_32";
22056
- const zoomForm$2 = "_zoomForm_e3qdd_43";
22057
- const zoomReset$2 = "_zoomReset_e3qdd_51";
22058
- const help$2 = "_help_e3qdd_54";
22059
- const autoWeight$2 = "_autoWeight_e3qdd_58";
22181
+ const zoomForm$3 = "_zoomForm_e3qdd_43";
22182
+ const zoomReset$3 = "_zoomReset_e3qdd_51";
22183
+ const help$3 = "_help_e3qdd_54";
22184
+ const autoWeight$3 = "_autoWeight_e3qdd_58";
22060
22185
  const table = "_table_e3qdd_62";
22061
- const styles$4 = {
22062
- chart: chart$2,
22186
+ const styles$5 = {
22187
+ chart: chart$3,
22063
22188
  canvas: canvas$1,
22064
- fixedHeight: fixedHeight$2,
22065
- stretchHeight: stretchHeight$2,
22189
+ fixedHeight: fixedHeight$3,
22190
+ stretchHeight: stretchHeight$3,
22066
22191
  squareAspectRatio,
22067
- zoomForm: zoomForm$2,
22068
- zoomReset: zoomReset$2,
22069
- help: help$2,
22070
- autoWeight: autoWeight$2,
22192
+ zoomForm: zoomForm$3,
22193
+ zoomReset: zoomReset$3,
22194
+ help: help$3,
22195
+ autoWeight: autoWeight$3,
22071
22196
  table
22072
22197
  };
22073
22198
  const TOGGLE_ZOOM = "TOGGLE_ZOOM";
@@ -22194,6 +22319,10 @@ var ChartType$1 = /* @__PURE__ */ ((ChartType2) => {
22194
22319
  var CursorStyle = /* @__PURE__ */ ((CursorStyle2) => {
22195
22320
  CursorStyle2["Pointer"] = "pointer";
22196
22321
  CursorStyle2["Initial"] = "initial";
22322
+ CursorStyle2["Grab"] = "grab";
22323
+ CursorStyle2["Grabbing"] = "grabbing";
22324
+ CursorStyle2["Crosshair"] = "crosshair";
22325
+ CursorStyle2["Move"] = "move";
22197
22326
  return CursorStyle2;
22198
22327
  })(CursorStyle || {});
22199
22328
  var ScaleType = /* @__PURE__ */ ((ScaleType2) => {
@@ -22202,10 +22331,10 @@ var ScaleType = /* @__PURE__ */ ((ScaleType2) => {
22202
22331
  ScaleType2["Logarithmic"] = "logarithmic";
22203
22332
  return ScaleType2;
22204
22333
  })(ScaleType || {});
22205
- var ChartDirection = /* @__PURE__ */ ((ChartDirection2) => {
22334
+ var ChartDirection$1 = /* @__PURE__ */ ((ChartDirection2) => {
22206
22335
  ChartDirection2["Vertical"] = "vertical";
22207
22336
  return ChartDirection2;
22208
- })(ChartDirection || {});
22337
+ })(ChartDirection$1 || {});
22209
22338
  var TooltipLabel = /* @__PURE__ */ ((TooltipLabel2) => {
22210
22339
  TooltipLabel2["Y"] = "yLabel";
22211
22340
  TooltipLabel2["X"] = "xLabel";
@@ -22329,7 +22458,8 @@ const chartMinorGridlinesPlugin = {
22329
22458
  };
22330
22459
  const BORDER_WIDTH = {
22331
22460
  INITIAL: 2,
22332
- HOVERED: 6
22461
+ HOVERED: 6,
22462
+ POINT_HOVERED: 8
22333
22463
  };
22334
22464
  const BORDER_COLOR = "rgba(0,0,0,0.1)";
22335
22465
  const ANNOTATION_DASH = [10, 2];
@@ -22424,7 +22554,7 @@ const getTitle = (options) => {
22424
22554
  } : {};
22425
22555
  };
22426
22556
  const isVertical = (direction) => {
22427
- return direction === ChartDirection.Vertical;
22557
+ return direction === ChartDirection$1.Vertical;
22428
22558
  };
22429
22559
  const getAxisPosition = (axisType, i2) => {
22430
22560
  const [positionA, positionB] = axisType === AxisType.Y ? [Position.Left, Position.Right] : [Position.Top, Position.Bottom];
@@ -22895,7 +23025,7 @@ const DragOptions = ({
22895
23025
  };
22896
23026
  const controls = "_controls_gbo9q_1";
22897
23027
  const buttons = "_buttons_gbo9q_7";
22898
- const styles$3 = {
23028
+ const styles$4 = {
22899
23029
  controls,
22900
23030
  buttons
22901
23031
  };
@@ -24357,10 +24487,10 @@ const Controls = ({
24357
24487
  generatedDatasets
24358
24488
  });
24359
24489
  return /* @__PURE__ */ jsxs(Fragment, { children: [
24360
- /* @__PURE__ */ jsxs("div", { className: styles$3.controls, children: [
24490
+ /* @__PURE__ */ jsxs("div", { className: styles$4.controls, children: [
24361
24491
  !!options.title && /* @__PURE__ */ jsx(Text, { bold: true, children: options.title }),
24362
24492
  headerComponent,
24363
- /* @__PURE__ */ jsx(ControlsPortal, { controlsPortalId: controlsPortalId ?? "", children: /* @__PURE__ */ jsxs("div", { className: styles$3.buttons, children: [
24493
+ /* @__PURE__ */ jsx(ControlsPortal, { controlsPortalId: controlsPortalId ?? "", children: /* @__PURE__ */ jsxs("div", { className: styles$4.buttons, children: [
24364
24494
  !showTable && /* @__PURE__ */ jsxs(Fragment, { children: [
24365
24495
  /* @__PURE__ */ jsx(
24366
24496
  AxesOptions,
@@ -24465,11 +24595,11 @@ const defaultAxis = (position) => ({
24465
24595
  }
24466
24596
  }
24467
24597
  });
24468
- const defaultAxes$1 = (axes) => ({
24598
+ const defaultAxes$2 = (axes) => ({
24469
24599
  x: (axes == null ? void 0 : axes.x) || [defaultAxis("bottom")],
24470
24600
  y: (axes == null ? void 0 : axes.y) || [defaultAxis("left")]
24471
24601
  });
24472
- const defaultAdditionalAxesOptions$1 = (options) => ({
24602
+ const defaultAdditionalAxesOptions$2 = (options) => ({
24473
24603
  chartScaleType: (options == null ? void 0 : options.chartScaleType) || "linear",
24474
24604
  reverse: (options == null ? void 0 : options.reverse) || false,
24475
24605
  beginAtZero: (options == null ? void 0 : options.beginAtZero) ?? false,
@@ -24479,7 +24609,7 @@ const defaultAdditionalAxesOptions$1 = (options) => ({
24479
24609
  range: options == null ? void 0 : options.range,
24480
24610
  autoAxisPadding: (options == null ? void 0 : options.autoAxisPadding) ?? false
24481
24611
  });
24482
- const defaultChartStyling$2 = (options) => ({
24612
+ const defaultChartStyling$3 = (options) => ({
24483
24613
  width: options == null ? void 0 : options.width,
24484
24614
  height: options == null ? void 0 : options.height,
24485
24615
  maintainAspectRatio: (options == null ? void 0 : options.maintainAspectRatio) ?? false,
@@ -24493,22 +24623,22 @@ const defaultChartStyling$2 = (options) => ({
24493
24623
  right: 0
24494
24624
  }
24495
24625
  });
24496
- const defaultTooltip$2 = (tooltip) => ({
24626
+ const defaultTooltip$3 = (tooltip) => ({
24497
24627
  tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
24498
24628
  showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) ?? false,
24499
24629
  hideSimulationName: (tooltip == null ? void 0 : tooltip.hideSimulationName) ?? false,
24500
24630
  scientificNotation: (tooltip == null ? void 0 : tooltip.scientificNotation) ?? true
24501
24631
  });
24502
- const defaultGraph$2 = (graph) => ({
24632
+ const defaultGraph$3 = (graph) => ({
24503
24633
  lineTension: (graph == null ? void 0 : graph.lineTension) ?? 0.01,
24504
24634
  spanGaps: (graph == null ? void 0 : graph.spanGaps) ?? false,
24505
24635
  showDataLabels: (graph == null ? void 0 : graph.showDataLabels) ?? false,
24506
24636
  showMinorGridlines: (graph == null ? void 0 : graph.showMinorGridlines) ?? false
24507
24637
  });
24508
- const defaultAnnotationsData$1 = (annotationsData) => {
24638
+ const defaultAnnotationsData$2 = (annotationsData) => {
24509
24639
  return annotationsData ? annotationsData.map((ann) => ({ ...ann, display: (ann == null ? void 0 : ann.display) ?? true })) : [];
24510
24640
  };
24511
- const defaultAnnotations$1 = (annotations) => {
24641
+ const defaultAnnotations$2 = (annotations) => {
24512
24642
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
24513
24643
  return {
24514
24644
  labelAnnotation: {
@@ -24524,10 +24654,10 @@ const defaultAnnotations$1 = (annotations) => {
24524
24654
  showAnnotations: (annotations == null ? void 0 : annotations.showAnnotations) ?? false,
24525
24655
  controlAnnotation: (annotations == null ? void 0 : annotations.controlAnnotation) ?? false,
24526
24656
  enableDragAnnotation: (annotations == null ? void 0 : annotations.enableDragAnnotation) ?? false,
24527
- annotationsData: defaultAnnotationsData$1(annotations == null ? void 0 : annotations.annotationsData)
24657
+ annotationsData: defaultAnnotationsData$2(annotations == null ? void 0 : annotations.annotationsData)
24528
24658
  };
24529
24659
  };
24530
- const defaultLegend$2 = (legend2) => ({
24660
+ const defaultLegend$3 = (legend2) => ({
24531
24661
  display: (legend2 == null ? void 0 : legend2.display) ?? true,
24532
24662
  position: (legend2 == null ? void 0 : legend2.position) ?? Position.BottomLeft,
24533
24663
  align: (legend2 == null ? void 0 : legend2.align) ?? AlignOptions.Center,
@@ -24537,14 +24667,14 @@ const defaultLegend$2 = (legend2) => ({
24537
24667
  },
24538
24668
  usePointStyle: (legend2 == null ? void 0 : legend2.usePointStyle) ?? true
24539
24669
  });
24540
- const defaultChartOptions$2 = (options) => ({
24670
+ const defaultChartOptions$3 = (options) => ({
24541
24671
  showPoints: (options == null ? void 0 : options.showPoints) ?? true,
24542
24672
  enableZoom: (options == null ? void 0 : options.enableZoom) ?? true,
24543
24673
  enablePan: (options == null ? void 0 : options.enablePan) ?? false,
24544
24674
  showLine: (options == null ? void 0 : options.showLine) ?? true,
24545
24675
  closeOnOutsideClick: (options == null ? void 0 : options.closeOnOutsideClick) ?? false
24546
24676
  });
24547
- const defaultInteractions$2 = (interactions) => ({
24677
+ const defaultInteractions$3 = (interactions) => ({
24548
24678
  onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
24549
24679
  onHover: interactions == null ? void 0 : interactions.onHover,
24550
24680
  onUnhover: interactions == null ? void 0 : interactions.onUnhover,
@@ -24560,7 +24690,7 @@ const defaultDragData$1 = (dragData) => ({
24560
24690
  onDrag: dragData == null ? void 0 : dragData.onDrag,
24561
24691
  onDragEnd: dragData == null ? void 0 : dragData.onDragEnd
24562
24692
  });
24563
- const getDefaultProps$2 = (props) => {
24693
+ const getDefaultProps$3 = (props) => {
24564
24694
  const chart2 = (props == null ? void 0 : props.chart) || {};
24565
24695
  const options = (chart2 == null ? void 0 : chart2.options) || {};
24566
24696
  return {
@@ -24571,17 +24701,17 @@ const getDefaultProps$2 = (props) => {
24571
24701
  options: {
24572
24702
  title: (options == null ? void 0 : options.title) ?? "",
24573
24703
  scales: (options == null ? void 0 : options.scales) ?? {},
24574
- axes: defaultAxes$1(options == null ? void 0 : options.axes),
24575
- additionalAxesOptions: defaultAdditionalAxesOptions$1(
24704
+ axes: defaultAxes$2(options == null ? void 0 : options.axes),
24705
+ additionalAxesOptions: defaultAdditionalAxesOptions$2(
24576
24706
  options == null ? void 0 : options.additionalAxesOptions
24577
24707
  ),
24578
- chartStyling: defaultChartStyling$2(options == null ? void 0 : options.chartStyling),
24579
- tooltip: defaultTooltip$2(options == null ? void 0 : options.tooltip),
24580
- graph: defaultGraph$2(options == null ? void 0 : options.graph),
24581
- annotations: defaultAnnotations$1(options == null ? void 0 : options.annotations),
24582
- legend: defaultLegend$2(options == null ? void 0 : options.legend),
24583
- chartOptions: defaultChartOptions$2(options == null ? void 0 : options.chartOptions),
24584
- interactions: defaultInteractions$2(options == null ? void 0 : options.interactions),
24708
+ chartStyling: defaultChartStyling$3(options == null ? void 0 : options.chartStyling),
24709
+ tooltip: defaultTooltip$3(options == null ? void 0 : options.tooltip),
24710
+ graph: defaultGraph$3(options == null ? void 0 : options.graph),
24711
+ annotations: defaultAnnotations$2(options == null ? void 0 : options.annotations),
24712
+ legend: defaultLegend$3(options == null ? void 0 : options.legend),
24713
+ chartOptions: defaultChartOptions$3(options == null ? void 0 : options.chartOptions),
24714
+ interactions: defaultInteractions$3(options == null ? void 0 : options.interactions),
24585
24715
  dragData: defaultDragData$1(options == null ? void 0 : options.dragData),
24586
24716
  depthType: (options == null ? void 0 : options.depthType) ?? {}
24587
24717
  }
@@ -25024,7 +25154,7 @@ const getUnitsFromLabel = (label) => {
25024
25154
  const units = matches && (matches == null ? void 0 : matches.length) > 0 ? matches == null ? void 0 : matches[0] : "";
25025
25155
  return units;
25026
25156
  };
25027
- const customFormatNumber = (labelNumber, scientificNotation) => {
25157
+ const customFormatNumber$1 = (labelNumber, scientificNotation) => {
25028
25158
  let roundOptions = {};
25029
25159
  if (!scientificNotation) {
25030
25160
  roundOptions = { scientific: false };
@@ -25060,21 +25190,21 @@ const getLineChartToolTips = (options) => {
25060
25190
  };
25061
25191
  }
25062
25192
  };
25063
- const titleCallback = (tooltipItem) => {
25193
+ const titleCallback2 = (tooltipItem) => {
25064
25194
  const labels = getTooltipLabels(tooltipItem[0].dataset);
25065
25195
  const { titleLabel, titleAxisLabel } = labels ?? {};
25066
25196
  const formattedValue = titleLabel === TooltipLabel.Y ? tooltipItem[0].parsed.y : tooltipItem[0].parsed.x;
25067
- const roundedValue = customFormatNumber(formattedValue, scientificNotation);
25197
+ const roundedValue = customFormatNumber$1(formattedValue, scientificNotation);
25068
25198
  return `${roundedValue} ${titleAxisLabel}`;
25069
25199
  };
25070
- const labelCallback = (tooltipItem) => {
25200
+ const labelCallback2 = (tooltipItem) => {
25071
25201
  const { showLabelsInTooltips } = options.tooltip;
25072
25202
  let label = tooltipItem.dataset.label || "";
25073
25203
  const labels = getTooltipLabels(tooltipItem.dataset);
25074
25204
  const { valueLabel = "", valueAxisLabel = "" } = labels ?? {};
25075
25205
  const getTooltipItemValue = () => {
25076
25206
  const labelNumber = valueLabel === TooltipLabel.X ? tooltipItem.parsed.x : tooltipItem.parsed.y;
25077
- return customFormatNumber(labelNumber, scientificNotation);
25207
+ return customFormatNumber$1(labelNumber, scientificNotation);
25078
25208
  };
25079
25209
  const tooltipItemValue = getTooltipItemValue();
25080
25210
  const units = getUnitsFromLabel(valueAxisLabel);
@@ -25091,8 +25221,8 @@ const getLineChartToolTips = (options) => {
25091
25221
  boxHeight: LEGEND_LABEL_BOX_SIZE,
25092
25222
  boxPadding: TOOLTIP_BOX_PADDING,
25093
25223
  callbacks: {
25094
- title: titleCallback,
25095
- label: labelCallback,
25224
+ title: titleCallback2,
25225
+ label: labelCallback2,
25096
25226
  afterLabel: afterLabelCallback
25097
25227
  }
25098
25228
  };
@@ -25187,80 +25317,151 @@ var AnnotationType = /* @__PURE__ */ ((AnnotationType2) => {
25187
25317
  AnnotationType2["ELLIPSE"] = "ellipse";
25188
25318
  return AnnotationType2;
25189
25319
  })(AnnotationType || {});
25190
- const annotationEnter = (element, chart2) => {
25320
+ const handleLineEnter = (element, chart2, annotation2) => {
25191
25321
  var _a2;
25322
+ chart2.canvas.style.cursor = CursorStyle.Pointer;
25192
25323
  if ((_a2 = element.options.scaleID) == null ? void 0 : _a2.includes(AxisType.X)) {
25193
25324
  if (element.options.label) {
25194
25325
  element.options.label.xAdjust = chart2.chartArea.left;
25195
25326
  }
25196
25327
  }
25197
25328
  element.options.borderWidth = BORDER_WIDTH.HOVERED;
25198
- chart2.hoveredAnnotationId = element.options.id || null;
25199
25329
  if (element.options.label) {
25200
25330
  element.label.options.display = true;
25201
25331
  element.options.label.enabled = true;
25202
25332
  }
25333
+ if (annotation2 == null ? void 0 : annotation2.enableDrag) {
25334
+ chart2.hoveredAnnotationId = element.options.id || null;
25335
+ chart2.update();
25336
+ }
25203
25337
  chart2.draw();
25204
- chart2.update();
25205
- chart2.canvas.style.cursor = CursorStyle.Pointer;
25206
- return true;
25207
25338
  };
25208
- const annotationLeave = (element, chart2) => {
25339
+ const handleLineLeave = (element, chart2, annotation2) => {
25209
25340
  element.options.borderWidth = BORDER_WIDTH.INITIAL;
25341
+ chart2.canvas.style.cursor = CursorStyle.Initial;
25210
25342
  chart2.hoveredAnnotationId = null;
25211
25343
  if (element.options.label) {
25212
25344
  element.label.options.display = false;
25213
25345
  element.options.label.enabled = false;
25214
25346
  }
25347
+ if (annotation2 == null ? void 0 : annotation2.enableDrag) {
25348
+ chart2.hoveredAnnotationId = null;
25349
+ chart2.update();
25350
+ }
25351
+ chart2.draw();
25352
+ };
25353
+ const handleBoxEnter = (element, chart2, annotation2) => {
25354
+ if (annotation2 == null ? void 0 : annotation2.enableDrag) {
25355
+ chart2.hoveredAnnotationId = element.options.id || null;
25356
+ chart2.update();
25357
+ element.options.borderWidth = BORDER_WIDTH.HOVERED;
25358
+ chart2.canvas.style.cursor = CursorStyle.Pointer;
25359
+ }
25360
+ chart2.draw();
25361
+ };
25362
+ const handleBoxLeave = (element, chart2, annotation2) => {
25363
+ if (annotation2 == null ? void 0 : annotation2.enableDrag) {
25364
+ chart2.hoveredAnnotationId = null;
25365
+ element.options.borderWidth = BORDER_WIDTH.INITIAL;
25366
+ chart2.canvas.style.cursor = CursorStyle.Initial;
25367
+ chart2.update();
25368
+ }
25369
+ chart2.draw();
25370
+ };
25371
+ const handlePointEnter = (element, chart2, annotation2) => {
25372
+ if (annotation2 == null ? void 0 : annotation2.enableDrag) {
25373
+ chart2.hoveredAnnotationId = element.options.id || null;
25374
+ chart2.update();
25375
+ element.options.borderWidth = BORDER_WIDTH.POINT_HOVERED;
25376
+ chart2.canvas.style.cursor = CursorStyle.Pointer;
25377
+ }
25378
+ chart2.draw();
25379
+ };
25380
+ const handlePointLeave = (element, chart2, annotation2) => {
25381
+ if (annotation2 == null ? void 0 : annotation2.enableDrag) {
25382
+ chart2.hoveredAnnotationId = null;
25383
+ element.options.borderWidth = BORDER_WIDTH.INITIAL;
25384
+ chart2.canvas.style.cursor = CursorStyle.Initial;
25385
+ chart2.update();
25386
+ }
25215
25387
  chart2.draw();
25216
- chart2.update();
25217
- chart2.canvas.style.cursor = CursorStyle.Initial;
25218
- return true;
25219
25388
  };
25220
25389
  const generateAnnotations = (annotationsData) => {
25221
25390
  return annotationsData == null ? void 0 : annotationsData.map((ann, idx) => {
25391
+ var _a2, _b2, _c2, _d2, _e2;
25222
25392
  const scaleID = (ann == null ? void 0 : ann.annotationAxis) ?? void 0;
25223
- const color2 = (ann == null ? void 0 : ann.color) || COLORS[idx];
25224
- const type = (ann == null ? void 0 : ann.type) || "line";
25393
+ const color2 = (ann == null ? void 0 : ann.color) ?? COLORS[idx];
25394
+ const type = (ann == null ? void 0 : ann.type) || AnnotationType.LINE;
25225
25395
  const adjustScaleRange2 = ann == null ? void 0 : ann.adjustScaleRange;
25226
25396
  const borderColor = {
25227
25397
  [AnnotationType.LINE]: color2,
25228
25398
  [AnnotationType.POINT]: color2,
25229
25399
  [AnnotationType.BOX]: color2
25230
25400
  }[type] || "transparent";
25231
- const borderWidth = type == "line" ? BORDER_WIDTH.INITIAL : 0;
25232
- const borderDash = type == "line" ? ANNOTATION_DASH : void 0;
25233
- const label = type === "line" ? {
25234
- backgroundColor: color2,
25235
- content: ann == null ? void 0 : ann.label,
25236
- display: false,
25237
- position: Position.Top
25238
- } : {
25239
- content: ann == null ? void 0 : ann.label,
25240
- display: true,
25241
- font: { weight: "normal" }
25242
- };
25401
+ const borderWidth = type === AnnotationType.LINE ? BORDER_WIDTH.INITIAL : 0;
25402
+ const borderDash = type === AnnotationType.LINE ? ANNOTATION_DASH : void 0;
25403
+ const label = {
25404
+ [AnnotationType.LINE]: {
25405
+ backgroundColor: color2,
25406
+ content: ann == null ? void 0 : ann.label,
25407
+ display: false,
25408
+ position: Position.Top
25409
+ },
25410
+ [AnnotationType.POINT]: {
25411
+ backgroundColor: ((_a2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _a2.backgroundColor) ?? "transparent",
25412
+ content: ann == null ? void 0 : ann.label,
25413
+ display: !!(ann == null ? void 0 : ann.label),
25414
+ position: ((_b2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _b2.position) ?? Position.Bottom,
25415
+ color: ((_c2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _c2.color) ?? "black",
25416
+ font: ((_d2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _d2.font) ?? `bold 12px ${DEFAULT_FONT_FAMILY}`,
25417
+ borderWidth: BORDER_WIDTH.INITIAL,
25418
+ padding: 5,
25419
+ borderRadius: 3,
25420
+ borderColor: ((_e2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _e2.borderColor) ?? "transparent"
25421
+ },
25422
+ [AnnotationType.BOX]: {
25423
+ content: ann == null ? void 0 : ann.label,
25424
+ display: true,
25425
+ font: { weight: "normal" }
25426
+ }
25427
+ }[type] || "transparent";
25243
25428
  const enter = ({
25244
25429
  element
25245
25430
  }, {
25246
25431
  chart: chart2
25247
25432
  }) => {
25248
- if (type !== "line" && !ann.enableDrag)
25249
- return;
25250
- annotationEnter(element, chart2);
25433
+ switch (type) {
25434
+ case AnnotationType.LINE:
25435
+ handleLineEnter(element, chart2, ann);
25436
+ break;
25437
+ case AnnotationType.BOX:
25438
+ handleBoxEnter(element, chart2, ann);
25439
+ break;
25440
+ case AnnotationType.POINT:
25441
+ handlePointEnter(element, chart2, ann);
25442
+ break;
25443
+ }
25251
25444
  };
25252
25445
  const leave = ({
25253
25446
  element
25254
25447
  }, {
25255
25448
  chart: chart2
25256
25449
  }) => {
25257
- if (type !== "line" && !ann.enableDrag)
25258
- return;
25259
- annotationLeave(element, chart2);
25450
+ switch (type) {
25451
+ case AnnotationType.LINE:
25452
+ handleLineLeave(element, chart2, ann);
25453
+ break;
25454
+ case AnnotationType.BOX:
25455
+ handleBoxLeave(element, chart2, ann);
25456
+ break;
25457
+ case AnnotationType.POINT:
25458
+ handlePointLeave(element, chart2, ann);
25459
+ break;
25460
+ }
25260
25461
  };
25261
- const onDragStart = () => (cord) => (ann == null ? void 0 : ann.onDragStart) ? ann == null ? void 0 : ann.onDragStart(cord) : void 0;
25262
- const onDrag = () => (cord) => (ann == null ? void 0 : ann.onDrag) ? ann == null ? void 0 : ann.onDrag(cord) : void 0;
25263
- const onDragEnd = () => (cord) => (ann == null ? void 0 : ann.onDragEnd) ? ann == null ? void 0 : ann.onDragEnd(cord) : void 0;
25462
+ const onDragStart = () => (cord, annotation2) => (ann == null ? void 0 : ann.onDragStart) ? ann == null ? void 0 : ann.onDragStart(cord, annotation2) : void 0;
25463
+ const onDrag = () => (cord, annotation2) => (ann == null ? void 0 : ann.onDrag) ? ann == null ? void 0 : ann.onDrag(cord, annotation2) : void 0;
25464
+ const onDragEnd = () => (cord, annotation2) => (ann == null ? void 0 : ann.onDragEnd) ? ann == null ? void 0 : ann.onDragEnd(cord, annotation2) : void 0;
25264
25465
  return {
25265
25466
  ...ann,
25266
25467
  display: ann == null ? void 0 : ann.display,
@@ -25904,16 +26105,18 @@ const handleAnnotationMouseDown = (event, canvas2, scales, annotations, setDragg
25904
26105
  return;
25905
26106
  const metrics = calculateAnnotationMetricsInValues(annotation2);
25906
26107
  if (annotation2 && annotation2.enableDrag && metrics.centerY && metrics.centerX) {
26108
+ canvas2.style.cursor = CursorStyle.Move;
25907
26109
  const dragStartX = x2 - metrics.centerX;
25908
26110
  const dragStartY = y2 - metrics.centerY;
25909
26111
  setDraggingState(true, annotation2, dragStartX, dragStartY);
25910
26112
  if (annotation2 == null ? void 0 : annotation2.onDragStart) {
25911
- annotation2.onDragStart({ x: x2, y: y2 });
26113
+ annotation2.onDragStart({ x: x2, y: y2 }, cloneDeep(annotation2));
25912
26114
  }
25913
26115
  }
25914
26116
  };
25915
26117
  const handleAnnotationMouseMove = (event, canvas2, scales, isDragging2, activeAnnotation, dragStartX, dragStartY, chart2) => {
25916
26118
  if (isDragging2 && activeAnnotation) {
26119
+ canvas2.style.cursor = CursorStyle.Move;
25917
26120
  const { x: x2, y: y2 } = getMousePositionInCoordinates(event, canvas2, scales);
25918
26121
  const metrics = calculateAnnotationMetricsInValues(activeAnnotation);
25919
26122
  let newCenterX = x2 - dragStartX;
@@ -25933,7 +26136,7 @@ const handleAnnotationMouseMove = (event, canvas2, scales, isDragging2, activeAn
25933
26136
  }
25934
26137
  chart2.update();
25935
26138
  if (activeAnnotation == null ? void 0 : activeAnnotation.onDrag) {
25936
- activeAnnotation.onDrag({ x: x2, y: y2 });
26139
+ activeAnnotation.onDrag({ x: x2, y: y2 }, cloneDeep(activeAnnotation));
25937
26140
  }
25938
26141
  const { ctx, width, height } = chart2;
25939
26142
  const { centerX, centerY } = calculateAnnotationMetricsInValues(activeAnnotation) ?? {};
@@ -25964,15 +26167,61 @@ const handleAnnotationMouseUp = (isDragging2, activeAnnotation, chart2, setDragg
25964
26167
  if (activeAnnotation) {
25965
26168
  const { centerX = -1, centerY = -1 } = calculateAnnotationMetricsInValues(activeAnnotation) ?? {};
25966
26169
  if (activeAnnotation == null ? void 0 : activeAnnotation.onDragEnd) {
25967
- activeAnnotation.onDragEnd({ x: centerX, y: centerY });
26170
+ activeAnnotation.onDragEnd(
26171
+ { x: centerX, y: centerY },
26172
+ cloneDeep(activeAnnotation)
26173
+ );
25968
26174
  }
26175
+ chart2.canvas.style.cursor = CursorStyle.Pointer;
25969
26176
  setDraggingState(false, null);
25970
26177
  }
25971
26178
  chart2.update();
25972
26179
  }
25973
26180
  };
26181
+ const annotationLabel = (ctx, annotations, scales) => {
26182
+ Object.values(annotations).forEach((annotation2) => {
26183
+ var _a2;
26184
+ if (annotation2.type === AnnotationType.POINT && !isNil(annotation2 == null ? void 0 : annotation2.label) && ((_a2 = annotation2 == null ? void 0 : annotation2.label) == null ? void 0 : _a2.display)) {
26185
+ const { content, font, color: color2, position, padding } = (annotation2 == null ? void 0 : annotation2.label) ?? {};
26186
+ console.log(cloneDeep(annotation2));
26187
+ ctx.save();
26188
+ ctx.font = font;
26189
+ ctx.fillStyle = color2;
26190
+ const { centerX = -1, centerY = -1 } = calculateAnnotationMetricsInValuesInPixels(annotation2, scales);
26191
+ const textWidth = ctx.measureText(content).width;
26192
+ let textX = centerX - textWidth / 2;
26193
+ let textY = centerY + 20;
26194
+ switch (position) {
26195
+ case Position.Top:
26196
+ textY = centerY - 20;
26197
+ break;
26198
+ case Position.Left:
26199
+ textX = centerX - textWidth - padding;
26200
+ textY = centerY;
26201
+ break;
26202
+ case Position.Right:
26203
+ textX = centerX + padding;
26204
+ textY = centerY;
26205
+ break;
26206
+ }
26207
+ ctx.fillText(content, textX, textY);
26208
+ ctx.restore();
26209
+ }
26210
+ });
26211
+ };
25974
26212
  const annotationDraggerPlugin = {
25975
26213
  id: "annotationDraggerPlugin",
26214
+ beforeDraw(chart2) {
26215
+ var _a2, _b2;
26216
+ let annotations = ((_b2 = (_a2 = chart2.options.plugins) == null ? void 0 : _a2.annotation) == null ? void 0 : _b2.annotations) ?? {};
26217
+ if (!annotations)
26218
+ return;
26219
+ annotationLabel(
26220
+ chart2.ctx,
26221
+ annotations,
26222
+ chart2.scales
26223
+ );
26224
+ },
25976
26225
  afterUpdate(chart2) {
25977
26226
  var _a2, _b2, _c2, _d2;
25978
26227
  const { canvas: canvas2, scales, hoveredAnnotationId } = chart2;
@@ -26141,7 +26390,7 @@ const bottom = "_bottom_wpro0_161";
26141
26390
  const dropzonePlaceholder = "_dropzonePlaceholder_wpro0_165";
26142
26391
  const isActive = "_isActive_wpro0_173";
26143
26392
  const resizeContainer = "_resizeContainer_wpro0_176";
26144
- const styles$2 = {
26393
+ const styles$3 = {
26145
26394
  legend,
26146
26395
  isDragging,
26147
26396
  legendItems,
@@ -26171,6 +26420,11 @@ var ChartType = /* @__PURE__ */ ((ChartType2) => {
26171
26420
  ChartType2["SCATTER"] = "scatter";
26172
26421
  return ChartType2;
26173
26422
  })(ChartType || {});
26423
+ var ChartDirection = /* @__PURE__ */ ((ChartDirection2) => {
26424
+ ChartDirection2["VERTICAL"] = "vertical";
26425
+ ChartDirection2["HORIZONTAL"] = "horizontal";
26426
+ return ChartDirection2;
26427
+ })(ChartDirection || {});
26174
26428
  const circleSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiIGZpbGw9ImN1cnJlbnRDb2xvciIgLz48L3N2Zz4=";
26175
26429
  const rectSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHJlY3QgeD0iMiIgeT0iMiIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIiBmaWxsPSJjdXJyZW50Q29sb3IiIC8+PC9zdmc+";
26176
26430
  const rectRotSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHJlY3QgeD0iMyIgeT0iMyIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiBmaWxsPSJjdXJyZW50Q29sb3IiIHRyYW5zZm9ybT0ncm90YXRlKDQ1IDEyIDEyKScgLz48L3N2Zz4=";
@@ -26181,7 +26435,7 @@ const LineItem = ({ dataset }) => {
26181
26435
  const { borderColor, borderDash, borderWidth } = dataset;
26182
26436
  const offset = borderDash.length ? (LEGEND_SYMBOL_SIZE$1 - borderDash[0]) / 2 % (borderDash[0] + borderDash[1]) * -1 : 0;
26183
26437
  const borderDashString = ((_a2 = dataset.borderDash) == null ? void 0 : _a2.join(" ")) || "";
26184
- return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemLine, children: /* @__PURE__ */ jsx(
26438
+ return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemLine, children: /* @__PURE__ */ jsx(
26185
26439
  "svg",
26186
26440
  {
26187
26441
  xmlns: "http://www.w3.org/2000/svg",
@@ -26213,7 +26467,7 @@ const PointItem = ({ dataset }) => {
26213
26467
  rectRot: rectRotSvg,
26214
26468
  rect: rectSvg
26215
26469
  };
26216
- return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemPoint, children: /* @__PURE__ */ jsx(
26470
+ return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemPoint, children: /* @__PURE__ */ jsx(
26217
26471
  Icon,
26218
26472
  {
26219
26473
  icon: icons[pointStyle] || circleSvg,
@@ -26225,7 +26479,7 @@ const PointItem = ({ dataset }) => {
26225
26479
  const BoxItem = ({ dataset }) => {
26226
26480
  const { backgroundColor } = dataset;
26227
26481
  const style = { backgroundColor };
26228
- return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemBox, style });
26482
+ return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemBox, style });
26229
26483
  };
26230
26484
  const LegendItemLine = ({ dataset }) => {
26231
26485
  const { annotationType, showLine } = dataset;
@@ -26248,11 +26502,11 @@ const renderLegendItemSymbol = (dataset, chartType) => {
26248
26502
  case ChartType.LINE:
26249
26503
  return /* @__PURE__ */ jsx(LegendItemLine, { dataset });
26250
26504
  case ChartType.BAR:
26251
- return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemBox, children: /* @__PURE__ */ jsx(TbSquareFilled, { color: dataset.borderColor }) });
26505
+ return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemBox, children: /* @__PURE__ */ jsx(TbSquareFilled, { color: dataset.borderColor }) });
26252
26506
  case ChartType.PIE:
26253
- return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemPoint, children: /* @__PURE__ */ jsx(Icon, { icon: circleSvg }) });
26507
+ return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemPoint, children: /* @__PURE__ */ jsx(Icon, { icon: circleSvg }) });
26254
26508
  case ChartType.SCATTER:
26255
- return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemPoint, children: /* @__PURE__ */ jsx(TbCircleFilled, { color: dataset.borderColor }) });
26509
+ return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemPoint, children: /* @__PURE__ */ jsx(TbCircleFilled, { color: dataset.borderColor }) });
26256
26510
  default:
26257
26511
  return null;
26258
26512
  }
@@ -26266,18 +26520,18 @@ const LegendItem = ({
26266
26520
  return /* @__PURE__ */ jsxs(
26267
26521
  "div",
26268
26522
  {
26269
- className: cx(styles$2.legendItem, hidden && styles$2.isHidden),
26523
+ className: cx(styles$3.legendItem, hidden && styles$3.isHidden),
26270
26524
  onClick: handleClick,
26271
26525
  children: [
26272
26526
  /* @__PURE__ */ jsx(
26273
26527
  "span",
26274
26528
  {
26275
- className: styles$2.legendItemSymbol,
26529
+ className: styles$3.legendItemSymbol,
26276
26530
  style: { width: LEGEND_SYMBOL_SIZE },
26277
26531
  children: renderLegendItemSymbol(dataset, chartType)
26278
26532
  }
26279
26533
  ),
26280
- /* @__PURE__ */ jsx("span", { className: styles$2.legendItemText, children: dataset.label })
26534
+ /* @__PURE__ */ jsx("span", { className: styles$3.legendItemText, children: dataset.label })
26281
26535
  ]
26282
26536
  }
26283
26537
  );
@@ -26344,7 +26598,7 @@ const LegendItems = ({
26344
26598
  datasets,
26345
26599
  legendClick,
26346
26600
  chartType
26347
- }) => /* @__PURE__ */ jsx("div", { className: styles$2.legendItems, children: items.map((item) => {
26601
+ }) => /* @__PURE__ */ jsx("div", { className: styles$3.legendItems, children: items.map((item) => {
26348
26602
  if (datasets[item.datasetIndex].hideLegend) {
26349
26603
  return null;
26350
26604
  }
@@ -26377,13 +26631,13 @@ const LegendPanel = forwardRef(
26377
26631
  {
26378
26632
  ref,
26379
26633
  className: cx(
26380
- styles$2.legend,
26381
- !legendEnabled && styles$2.isHidden,
26382
- isDragging2 && styles$2.isDragging
26634
+ styles$3.legend,
26635
+ !legendEnabled && styles$3.isHidden,
26636
+ isDragging2 && styles$3.isDragging
26383
26637
  ),
26384
26638
  style,
26385
26639
  children: [
26386
- /* @__PURE__ */ jsx("div", { className: styles$2.legendToggle, children: /* @__PURE__ */ jsx(
26640
+ /* @__PURE__ */ jsx("div", { className: styles$3.legendToggle, children: /* @__PURE__ */ jsx(
26387
26641
  Button,
26388
26642
  {
26389
26643
  onClick: () => setLegendEnabled(!legendEnabled),
@@ -26422,17 +26676,17 @@ const LegendDropZone = (legendDropZoneProps) => {
26422
26676
  {
26423
26677
  ref: dropRef,
26424
26678
  className: cx(
26425
- styles$2.dropzone,
26426
- isActive2 && styles$2.isActive,
26427
- position.includes("left") && styles$2.left,
26428
- position.includes("right") && styles$2.right,
26429
- position.includes("top") && styles$2.top,
26430
- position.includes("bottom") && styles$2.bottom
26679
+ styles$3.dropzone,
26680
+ isActive2 && styles$3.isActive,
26681
+ position.includes("left") && styles$3.left,
26682
+ position.includes("right") && styles$3.right,
26683
+ position.includes("top") && styles$3.top,
26684
+ position.includes("bottom") && styles$3.bottom
26431
26685
  ),
26432
26686
  children: /* @__PURE__ */ jsx(
26433
26687
  "div",
26434
26688
  {
26435
- className: styles$2.dropzonePlaceholder,
26689
+ className: styles$3.dropzonePlaceholder,
26436
26690
  style: { ...placeholderSize, margin: LEGEND_MARGIN }
26437
26691
  }
26438
26692
  )
@@ -26451,7 +26705,7 @@ const LegendDropZones = (legendDropZonesProps) => {
26451
26705
  return /* @__PURE__ */ jsx(
26452
26706
  "div",
26453
26707
  {
26454
- className: styles$2.dropzoneContainer,
26708
+ className: styles$3.dropzoneContainer,
26455
26709
  style: {
26456
26710
  top: top2,
26457
26711
  left: left2,
@@ -26493,7 +26747,7 @@ const Legend2 = ({ chartRef, legendConfig }) => {
26493
26747
  })
26494
26748
  }));
26495
26749
  return /* @__PURE__ */ jsxs(Fragment, { children: [
26496
- /* @__PURE__ */ jsx("div", { ref: resizeRef, className: styles$2.resizeContainer }),
26750
+ /* @__PURE__ */ jsx("div", { ref: resizeRef, className: styles$3.resizeContainer }),
26497
26751
  /* @__PURE__ */ jsx(
26498
26752
  LegendPanel,
26499
26753
  {
@@ -26540,7 +26794,7 @@ const LineChart = (props) => {
26540
26794
  const chartRef = useRef(null);
26541
26795
  const { table: table2 } = props;
26542
26796
  const { translations, languageKey } = getConfig();
26543
- const chart2 = getDefaultProps$2(props);
26797
+ const chart2 = getDefaultProps$3(props);
26544
26798
  const {
26545
26799
  data: { datasets } = { datasets: [] },
26546
26800
  options,
@@ -26587,7 +26841,7 @@ const LineChart = (props) => {
26587
26841
  return /* @__PURE__ */ jsxs(
26588
26842
  "div",
26589
26843
  {
26590
- className: getClassName(chartStyling, styles$4),
26844
+ className: getClassName(chartStyling, styles$5),
26591
26845
  style: {
26592
26846
  width: chartStyling.width || AUTO,
26593
26847
  height: chartStyling.height || AUTO
@@ -26610,7 +26864,7 @@ const LineChart = (props) => {
26610
26864
  controlsPortalId
26611
26865
  }
26612
26866
  ),
26613
- table2 && state.showTable ? /* @__PURE__ */ jsx("div", { className: styles$4.table, children: table2 }) : /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsxs("div", { className: styles$4.canvas, id: "canvas", children: [
26867
+ table2 && state.showTable ? /* @__PURE__ */ jsx("div", { className: styles$5.table, children: table2 }) : /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsxs("div", { className: styles$5.canvas, id: "canvas", children: [
26614
26868
  /* @__PURE__ */ jsx(
26615
26869
  Line,
26616
26870
  {
@@ -26646,7 +26900,7 @@ const LineChart = (props) => {
26646
26900
  );
26647
26901
  };
26648
26902
  const LineChartWithLegend = (props) => {
26649
- const { options } = getDefaultProps$2(props);
26903
+ const { options } = getDefaultProps$3(props);
26650
26904
  return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(LineChart, { ...props }) });
26651
26905
  };
26652
26906
  const initializeLineChart = ({ languageKey = "en", ...options }) => {
@@ -26660,73 +26914,73 @@ const initializeLineChart = ({ languageKey = "en", ...options }) => {
26660
26914
  }
26661
26915
  });
26662
26916
  };
26663
- const chart$1 = "_chart_1jdnu_1";
26664
- const fixedHeight$1 = "_fixedHeight_1jdnu_13";
26665
- const stretchHeight$1 = "_stretchHeight_1jdnu_19";
26666
- const zoomForm$1 = "_zoomForm_1jdnu_32";
26667
- const zoomReset$1 = "_zoomReset_1jdnu_40";
26668
- const help$1 = "_help_1jdnu_43";
26669
- const autoWeight$1 = "_autoWeight_1jdnu_47";
26670
- const styles$1 = {
26671
- chart: chart$1,
26672
- fixedHeight: fixedHeight$1,
26673
- stretchHeight: stretchHeight$1,
26674
- zoomForm: zoomForm$1,
26675
- zoomReset: zoomReset$1,
26676
- help: help$1,
26677
- autoWeight: autoWeight$1
26917
+ const chart$2 = "_chart_1jdnu_1";
26918
+ const fixedHeight$2 = "_fixedHeight_1jdnu_13";
26919
+ const stretchHeight$2 = "_stretchHeight_1jdnu_19";
26920
+ const zoomForm$2 = "_zoomForm_1jdnu_32";
26921
+ const zoomReset$2 = "_zoomReset_1jdnu_40";
26922
+ const help$2 = "_help_1jdnu_43";
26923
+ const autoWeight$2 = "_autoWeight_1jdnu_47";
26924
+ const styles$2 = {
26925
+ chart: chart$2,
26926
+ fixedHeight: fixedHeight$2,
26927
+ stretchHeight: stretchHeight$2,
26928
+ zoomForm: zoomForm$2,
26929
+ zoomReset: zoomReset$2,
26930
+ help: help$2,
26931
+ autoWeight: autoWeight$2
26678
26932
  };
26679
- const defaultChartStyling$1 = (styling) => ({
26933
+ const defaultChartStyling$2 = (styling) => ({
26680
26934
  width: styling == null ? void 0 : styling.width,
26681
26935
  height: styling == null ? void 0 : styling.height,
26682
26936
  maintainAspectRatio: (styling == null ? void 0 : styling.maintainAspectRatio) || false,
26683
26937
  staticChartHeight: (styling == null ? void 0 : styling.staticChartHeight) || false,
26684
26938
  performanceMode: (styling == null ? void 0 : styling.performanceMode) ?? true
26685
26939
  });
26686
- const defaultTooltip$1 = (tooltip) => ({
26940
+ const defaultTooltip$2 = (tooltip) => ({
26687
26941
  tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
26688
26942
  showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) || false
26689
26943
  });
26690
- const defaultGraph$1 = (graph) => ({
26944
+ const defaultGraph$2 = (graph) => ({
26691
26945
  showDataLabels: (graph == null ? void 0 : graph.showDataLabels) || false,
26692
26946
  stacked: (graph == null ? void 0 : graph.stacked) || false,
26693
26947
  cutout: (graph == null ? void 0 : graph.cutout) || 0
26694
26948
  });
26695
- const defaultLegend$1 = (legend2) => ({
26949
+ const defaultLegend$2 = (legend2) => ({
26696
26950
  display: (legend2 == null ? void 0 : legend2.display) ?? true,
26697
26951
  useDataset: (legend2 == null ? void 0 : legend2.useDataset) || false,
26698
26952
  position: (legend2 == null ? void 0 : legend2.position) || Position.Bottom,
26699
26953
  align: (legend2 == null ? void 0 : legend2.align) || AlignOptions.Center
26700
26954
  });
26701
- const defaultChartOptions$1 = (options) => ({
26955
+ const defaultChartOptions$2 = (options) => ({
26702
26956
  enableZoom: (options == null ? void 0 : options.enableZoom) || false,
26703
26957
  enablePan: (options == null ? void 0 : options.enablePan) || false
26704
26958
  });
26705
- const defaultInteractions$1 = (interactions) => ({
26959
+ const defaultInteractions$2 = (interactions) => ({
26706
26960
  onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
26707
26961
  onHover: interactions == null ? void 0 : interactions.onHover,
26708
26962
  onUnhover: interactions == null ? void 0 : interactions.onUnhover
26709
26963
  });
26710
- const defaultChartData = (data) => {
26964
+ const defaultChartData$1 = (data) => {
26711
26965
  return {
26712
26966
  labels: (data == null ? void 0 : data.labels) || [],
26713
26967
  datasets: (data == null ? void 0 : data.datasets) || []
26714
26968
  };
26715
26969
  };
26716
- const getDefaultProps$1 = (props) => {
26970
+ const getDefaultProps$2 = (props) => {
26717
26971
  const chart2 = (props == null ? void 0 : props.chart) || {};
26718
26972
  const options = (chart2 == null ? void 0 : chart2.options) || {};
26719
26973
  return {
26720
26974
  testId: (chart2 == null ? void 0 : chart2.testId) ?? null,
26721
- data: defaultChartData(chart2 == null ? void 0 : chart2.data),
26975
+ data: defaultChartData$1(chart2 == null ? void 0 : chart2.data),
26722
26976
  options: {
26723
26977
  title: (options == null ? void 0 : options.title) || "",
26724
- chartStyling: defaultChartStyling$1(options == null ? void 0 : options.chartStyling),
26725
- tooltip: defaultTooltip$1(options == null ? void 0 : options.tooltip),
26726
- graph: defaultGraph$1(options == null ? void 0 : options.graph),
26727
- legend: defaultLegend$1(options == null ? void 0 : options.legend),
26728
- chartOptions: defaultChartOptions$1(options == null ? void 0 : options.chartOptions),
26729
- interactions: defaultInteractions$1(options == null ? void 0 : options.interactions)
26978
+ chartStyling: defaultChartStyling$2(options == null ? void 0 : options.chartStyling),
26979
+ tooltip: defaultTooltip$2(options == null ? void 0 : options.tooltip),
26980
+ graph: defaultGraph$2(options == null ? void 0 : options.graph),
26981
+ legend: defaultLegend$2(options == null ? void 0 : options.legend),
26982
+ chartOptions: defaultChartOptions$2(options == null ? void 0 : options.chartOptions),
26983
+ interactions: defaultInteractions$2(options == null ? void 0 : options.interactions)
26730
26984
  }
26731
26985
  };
26732
26986
  };
@@ -26914,7 +27168,7 @@ Chart$2.register(
26914
27168
  );
26915
27169
  const PieChart = (props) => {
26916
27170
  setDefaultTheme();
26917
- const chart2 = getDefaultProps$1(props);
27171
+ const chart2 = getDefaultProps$2(props);
26918
27172
  const chartRef = useRef(null);
26919
27173
  const { data, options, testId } = chart2;
26920
27174
  const {
@@ -26930,8 +27184,8 @@ const PieChart = (props) => {
26930
27184
  "div",
26931
27185
  {
26932
27186
  className: cx(
26933
- styles$1.chart,
26934
- !options.chartStyling.width || !options.chartStyling.height ? options.chartStyling.staticChartHeight ? styles$1.fixedHeight : styles$1.stretchHeight : ""
27187
+ styles$2.chart,
27188
+ !options.chartStyling.width || !options.chartStyling.height ? options.chartStyling.staticChartHeight ? styles$2.fixedHeight : styles$2.stretchHeight : ""
26935
27189
  ),
26936
27190
  style: {
26937
27191
  width: options.chartStyling.width || "auto",
@@ -26975,7 +27229,7 @@ const PieChart = (props) => {
26975
27229
  );
26976
27230
  };
26977
27231
  const PieChartWithLegend = (props) => {
26978
- const { options } = getDefaultProps$1(props);
27232
+ const { options } = getDefaultProps$2(props);
26979
27233
  return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(PieChart, { ...props }) });
26980
27234
  };
26981
27235
  /*!
@@ -39564,7 +39818,7 @@ const getBarChartToolTips = (options) => {
39564
39818
  valueUnit: (yAxis == null ? void 0 : yAxis.unit) || ""
39565
39819
  };
39566
39820
  };
39567
- const titleCallback = (tooltipItems, _data) => {
39821
+ const titleCallback2 = (tooltipItems, _data) => {
39568
39822
  var _a3, _b2;
39569
39823
  const barLabel = ((_a3 = tooltipItems == null ? void 0 : tooltipItems[0]) == null ? void 0 : _a3.label) || "";
39570
39824
  const labels = getTooltipLabels((_b2 = tooltipItems == null ? void 0 : tooltipItems[0]) == null ? void 0 : _b2.dataset);
@@ -39579,7 +39833,7 @@ const getBarChartToolTips = (options) => {
39579
39833
  }
39580
39834
  return displayNumber(roundByMagnitude(labelNumber), roundOptions);
39581
39835
  };
39582
- const labelCallback = (tooltipItem) => {
39836
+ const labelCallback2 = (tooltipItem) => {
39583
39837
  var _a3;
39584
39838
  const { showLabelsInTooltips = false } = (options == null ? void 0 : options.tooltip) || {};
39585
39839
  let label = ((_a3 = tooltipItem.dataset) == null ? void 0 : _a3.label) || "";
@@ -39621,8 +39875,8 @@ const getBarChartToolTips = (options) => {
39621
39875
  boxHeight: LEGEND_LABEL_BOX_SIZE,
39622
39876
  boxPadding: TOOLTIP_BOX_PADDING,
39623
39877
  callbacks: {
39624
- title: titleCallback,
39625
- label: labelCallback,
39878
+ title: titleCallback2,
39879
+ label: labelCallback2,
39626
39880
  afterLabel: afterLabelCallback
39627
39881
  }
39628
39882
  };
@@ -39665,31 +39919,31 @@ const useBarChartOptions = ({
39665
39919
  }
39666
39920
  };
39667
39921
  };
39668
- const chart = "_chart_x1sru_1";
39922
+ const chart$1 = "_chart_x1sru_1";
39669
39923
  const canvas = "_canvas_x1sru_10";
39670
- const fixedHeight = "_fixedHeight_x1sru_19";
39671
- const stretchHeight = "_stretchHeight_x1sru_25";
39672
- const zoomForm = "_zoomForm_x1sru_38";
39673
- const zoomReset = "_zoomReset_x1sru_46";
39674
- const help = "_help_x1sru_49";
39675
- const autoWeight = "_autoWeight_x1sru_53";
39924
+ const fixedHeight$1 = "_fixedHeight_x1sru_19";
39925
+ const stretchHeight$1 = "_stretchHeight_x1sru_25";
39926
+ const zoomForm$1 = "_zoomForm_x1sru_38";
39927
+ const zoomReset$1 = "_zoomReset_x1sru_46";
39928
+ const help$1 = "_help_x1sru_49";
39929
+ const autoWeight$1 = "_autoWeight_x1sru_53";
39676
39930
  const actions = "_actions_x1sru_57";
39677
- const styles = {
39678
- chart,
39931
+ const styles$1 = {
39932
+ chart: chart$1,
39679
39933
  canvas,
39680
- fixedHeight,
39681
- stretchHeight,
39682
- zoomForm,
39683
- zoomReset,
39684
- help,
39685
- autoWeight,
39934
+ fixedHeight: fixedHeight$1,
39935
+ stretchHeight: stretchHeight$1,
39936
+ zoomForm: zoomForm$1,
39937
+ zoomReset: zoomReset$1,
39938
+ help: help$1,
39939
+ autoWeight: autoWeight$1,
39686
39940
  actions
39687
39941
  };
39688
- const defaultAxes = (axes) => ({
39942
+ const defaultAxes$1 = (axes) => ({
39689
39943
  x: (axes == null ? void 0 : axes.x) || [{}],
39690
39944
  y: (axes == null ? void 0 : axes.y) || [{}]
39691
39945
  });
39692
- const defaultAdditionalAxesOptions = (options) => ({
39946
+ const defaultAdditionalAxesOptions$1 = (options) => ({
39693
39947
  chartScaleType: (options == null ? void 0 : options.chartScaleType) || "linear",
39694
39948
  reverse: (options == null ? void 0 : options.reverse) || false,
39695
39949
  stacked: (options == null ? void 0 : options.stacked) || false,
@@ -39700,30 +39954,30 @@ const defaultAdditionalAxesOptions = (options) => ({
39700
39954
  min: options == null ? void 0 : options.min,
39701
39955
  max: options == null ? void 0 : options.max
39702
39956
  });
39703
- const defaultChartStyling = (styling) => ({
39957
+ const defaultChartStyling$1 = (styling) => ({
39704
39958
  width: styling == null ? void 0 : styling.width,
39705
39959
  height: styling == null ? void 0 : styling.height,
39706
39960
  maintainAspectRatio: (styling == null ? void 0 : styling.maintainAspectRatio) || false,
39707
39961
  staticChartHeight: (styling == null ? void 0 : styling.staticChartHeight) || false,
39708
39962
  performanceMode: (styling == null ? void 0 : styling.performanceMode) ?? true
39709
39963
  });
39710
- const defaultTooltip = (tooltip) => ({
39964
+ const defaultTooltip$1 = (tooltip) => ({
39711
39965
  tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
39712
39966
  showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) || false
39713
39967
  });
39714
- const defaultGraph = (graph) => ({
39968
+ const defaultGraph$1 = (graph) => ({
39715
39969
  showDataLabels: (graph == null ? void 0 : graph.showDataLabels) || false,
39716
39970
  showMinorGridlines: (graph == null ? void 0 : graph.showMinorGridlines) || false
39717
39971
  });
39718
- const defaultAnnotationsData = (annotationsData) => {
39972
+ const defaultAnnotationsData$1 = (annotationsData) => {
39719
39973
  return annotationsData ? annotationsData.map((ann) => ({ ...ann, display: (ann == null ? void 0 : ann.display) ?? true })) : [];
39720
39974
  };
39721
- const defaultAnnotations = (annotations) => ({
39975
+ const defaultAnnotations$1 = (annotations) => ({
39722
39976
  showAnnotations: (annotations == null ? void 0 : annotations.showAnnotations) ?? true,
39723
39977
  controlAnnotation: (annotations == null ? void 0 : annotations.controlAnnotation) || false,
39724
- annotationsData: defaultAnnotationsData(annotations == null ? void 0 : annotations.annotationsData)
39978
+ annotationsData: defaultAnnotationsData$1(annotations == null ? void 0 : annotations.annotationsData)
39725
39979
  });
39726
- const defaultLegend = (legend2) => ({
39980
+ const defaultLegend$1 = (legend2) => ({
39727
39981
  display: (legend2 == null ? void 0 : legend2.display) ?? true,
39728
39982
  position: (legend2 == null ? void 0 : legend2.position) || Position.TopLeft,
39729
39983
  align: (legend2 == null ? void 0 : legend2.align) || AlignOptions.Center,
@@ -39732,11 +39986,11 @@ const defaultLegend = (legend2) => ({
39732
39986
  customLegendContainerID: ""
39733
39987
  }
39734
39988
  });
39735
- const defaultChartOptions = (options) => ({
39989
+ const defaultChartOptions$1 = (options) => ({
39736
39990
  enableZoom: (options == null ? void 0 : options.enableZoom) || false,
39737
39991
  enablePan: (options == null ? void 0 : options.enablePan) || false
39738
39992
  });
39739
- const defaultInteractions = (interactions) => ({
39993
+ const defaultInteractions$1 = (interactions) => ({
39740
39994
  onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
39741
39995
  onHover: interactions == null ? void 0 : interactions.onHover,
39742
39996
  onUnhover: interactions == null ? void 0 : interactions.onUnhover
@@ -39751,7 +40005,7 @@ const defaultDragData = (dragData) => ({
39751
40005
  onDrag: dragData == null ? void 0 : dragData.onDrag,
39752
40006
  onDragEnd: dragData == null ? void 0 : dragData.onDragEnd
39753
40007
  });
39754
- const getDefaultProps = (props) => {
40008
+ const getDefaultProps$1 = (props) => {
39755
40009
  const chart2 = (props == null ? void 0 : props.chart) || {};
39756
40010
  const options = (chart2 == null ? void 0 : chart2.options) || {};
39757
40011
  return {
@@ -39760,17 +40014,17 @@ const getDefaultProps = (props) => {
39760
40014
  options: {
39761
40015
  title: (options == null ? void 0 : options.title) || "",
39762
40016
  direction: (options == null ? void 0 : options.direction) || "vertical",
39763
- axes: defaultAxes(options == null ? void 0 : options.axes),
39764
- additionalAxesOptions: defaultAdditionalAxesOptions(
40017
+ axes: defaultAxes$1(options == null ? void 0 : options.axes),
40018
+ additionalAxesOptions: defaultAdditionalAxesOptions$1(
39765
40019
  options == null ? void 0 : options.additionalAxesOptions
39766
40020
  ),
39767
- chartStyling: defaultChartStyling(options == null ? void 0 : options.chartStyling),
39768
- tooltip: defaultTooltip(options == null ? void 0 : options.tooltip),
39769
- graph: defaultGraph(options == null ? void 0 : options.graph),
39770
- annotations: defaultAnnotations(options == null ? void 0 : options.annotations),
39771
- legend: defaultLegend(options == null ? void 0 : options.legend),
39772
- chartOptions: defaultChartOptions(options == null ? void 0 : options.chartOptions),
39773
- interactions: defaultInteractions(options == null ? void 0 : options.interactions),
40021
+ chartStyling: defaultChartStyling$1(options == null ? void 0 : options.chartStyling),
40022
+ tooltip: defaultTooltip$1(options == null ? void 0 : options.tooltip),
40023
+ graph: defaultGraph$1(options == null ? void 0 : options.graph),
40024
+ annotations: defaultAnnotations$1(options == null ? void 0 : options.annotations),
40025
+ legend: defaultLegend$1(options == null ? void 0 : options.legend),
40026
+ chartOptions: defaultChartOptions$1(options == null ? void 0 : options.chartOptions),
40027
+ interactions: defaultInteractions$1(options == null ? void 0 : options.interactions),
39774
40028
  dragData: defaultDragData(options == null ? void 0 : options.dragData)
39775
40029
  }
39776
40030
  };
@@ -39793,7 +40047,7 @@ const BarChart = (props) => {
39793
40047
  var _a2, _b2, _c2, _d2;
39794
40048
  setDefaultTheme();
39795
40049
  const chartRef = useRef(null);
39796
- const chart2 = getDefaultProps(props);
40050
+ const chart2 = getDefaultProps$1(props);
39797
40051
  const { translations, languageKey } = getConfig();
39798
40052
  const { options, testId } = chart2;
39799
40053
  const { chartStyling, graph } = options;
@@ -39803,14 +40057,14 @@ const BarChart = (props) => {
39803
40057
  return /* @__PURE__ */ jsxs(
39804
40058
  "div",
39805
40059
  {
39806
- className: getClassName(chartStyling, styles),
40060
+ className: getClassName(chartStyling, styles$1),
39807
40061
  style: {
39808
40062
  width: chartStyling.width || AUTO,
39809
40063
  height: chartStyling.height || AUTO
39810
40064
  },
39811
40065
  "data-testid": testId,
39812
40066
  children: [
39813
- /* @__PURE__ */ jsx("div", { className: styles.actions, children: /* @__PURE__ */ jsx(Tooltip$2, { text: translations.downloadAsPNG, placement: "bottom-end", children: /* @__PURE__ */ jsx(
40067
+ /* @__PURE__ */ jsx("div", { className: styles$1.actions, children: /* @__PURE__ */ jsx(Tooltip$2, { text: translations.downloadAsPNG, placement: "bottom-end", children: /* @__PURE__ */ jsx(
39814
40068
  Button,
39815
40069
  {
39816
40070
  small: true,
@@ -39821,7 +40075,7 @@ const BarChart = (props) => {
39821
40075
  onClick: () => downloadPgn(chartRef)
39822
40076
  }
39823
40077
  ) }) }),
39824
- /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsxs("div", { className: styles.canvas, id: "canvas", children: [
40078
+ /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsxs("div", { className: styles$1.canvas, id: "canvas", children: [
39825
40079
  /* @__PURE__ */ jsx(
39826
40080
  Bar,
39827
40081
  {
@@ -39852,13 +40106,342 @@ const BarChart = (props) => {
39852
40106
  );
39853
40107
  };
39854
40108
  const BarChartWithLegend = (props) => {
39855
- const { options } = getDefaultProps(props);
40109
+ const { options } = getDefaultProps$1(props);
39856
40110
  return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(BarChart, { ...props }) });
39857
40111
  };
40112
+ const customFormatNumber = (labelNumber) => {
40113
+ let roundOptions = {};
40114
+ if (Math.abs(labelNumber) < DISPLAY_SCIENTIFIC_LOWER_BOUND || Math.abs(labelNumber) > DISPLAY_SCIENTIFIC_UPPER_BOUND) {
40115
+ roundOptions = { roundScientificCoefficient: 3 };
40116
+ }
40117
+ return displayNumber(roundByMagnitude(labelNumber), roundOptions);
40118
+ };
40119
+ const titleCallback = (tooltipItems, options) => {
40120
+ var _a2;
40121
+ if ((_a2 = options == null ? void 0 : options.tooltip) == null ? void 0 : _a2.showLabelsInTooltips) {
40122
+ const item = tooltipItems[0];
40123
+ const { label } = (item == null ? void 0 : item.dataset) ?? {};
40124
+ return label;
40125
+ }
40126
+ };
40127
+ const labelCallback = (tooltipItem) => {
40128
+ const { raw, dataset } = tooltipItem ?? {};
40129
+ return `${dataset == null ? void 0 : dataset.label} ( x: ${customFormatNumber(
40130
+ raw == null ? void 0 : raw.x
40131
+ )} , y: ${customFormatNumber(raw == null ? void 0 : raw.y)} )`;
40132
+ };
40133
+ const getTooltipsConfig = (options) => {
40134
+ var _a2, _b2, _c2;
40135
+ return {
40136
+ enabled: (_a2 = options == null ? void 0 : options.tooltip) == null ? void 0 : _a2.enabled,
40137
+ callbacks: {
40138
+ title: (tooltipItems) => titleCallback(tooltipItems, options),
40139
+ label: labelCallback
40140
+ },
40141
+ backgroundColor: (_b2 = options == null ? void 0 : options.tooltip) == null ? void 0 : _b2.backgroundColor,
40142
+ displayColors: (_c2 = options == null ? void 0 : options.tooltip) == null ? void 0 : _c2.displayColors,
40143
+ padding: 7
40144
+ };
40145
+ };
40146
+ const getScatterChartAxis = ({
40147
+ options,
40148
+ axisType = AxisType.X,
40149
+ currentScale
40150
+ }) => {
40151
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
40152
+ const isDirectionVertical = isVertical(options.direction);
40153
+ const axisData = currentScale || ((_b2 = (_a2 = options == null ? void 0 : options.axes) == null ? void 0 : _a2[axisType]) == null ? void 0 : _b2[0]);
40154
+ const isDirectionCompatibleWithAxisType = isDirectionVertical && axisType === AxisType.Y || !isDirectionVertical && axisType === AxisType.X;
40155
+ const grid = (axisData == null ? void 0 : axisData.gridLines) || {};
40156
+ const getReverse = () => {
40157
+ var _a3;
40158
+ const axisWithReverse = isDirectionVertical ? AxisType.Y : AxisType.X;
40159
+ return axisType === axisWithReverse ? (_a3 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _a3.reverse : false;
40160
+ };
40161
+ const getTicks = () => {
40162
+ const additionalAxesOptions = options == null ? void 0 : options.additionalAxesOptions;
40163
+ const stepSize = {
40164
+ stepSize: (axisData == null ? void 0 : axisData.stepSize) ?? (axisType === AxisType.Y ? additionalAxesOptions == null ? void 0 : additionalAxesOptions.stepSize : void 0)
40165
+ };
40166
+ return {
40167
+ ...stepSize,
40168
+ includeBounds: false,
40169
+ //OW-10088 disable irregular axis ticks
40170
+ font: {
40171
+ size: DEFAULT_FONT_SIZE
40172
+ }
40173
+ };
40174
+ };
40175
+ return {
40176
+ type: ScaleType.Linear,
40177
+ position: axisData == null ? void 0 : axisData.position,
40178
+ beginAtZero: (_c2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _c2.beginAtZero,
40179
+ reverse: getReverse(),
40180
+ suggestedMax: (_d2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _d2.suggestedMax,
40181
+ suggestedMin: (_e2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _e2.suggestedMin,
40182
+ min: isDirectionCompatibleWithAxisType ? (_f2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _f2.min : void 0,
40183
+ max: isDirectionCompatibleWithAxisType ? (_g2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _g2.max : void 0,
40184
+ title: {
40185
+ display: !!((_h2 = axisData == null ? void 0 : axisData.label) == null ? void 0 : _h2.length) || !!((_i2 = axisData == null ? void 0 : axisData.unit) == null ? void 0 : _i2.length),
40186
+ text: (axisData == null ? void 0 : axisData.label) || (axisData == null ? void 0 : axisData.unit),
40187
+ padding: 0
40188
+ },
40189
+ ticks: getTicks(),
40190
+ grid: {
40191
+ ...grid
40192
+ }
40193
+ };
40194
+ };
40195
+ const getScatterChartScales = (options) => {
40196
+ const xAxis = getScatterChartAxis({ options, axisType: AxisType.X });
40197
+ const yAxis = getScatterChartAxis({ options, axisType: AxisType.Y });
40198
+ return {
40199
+ x: xAxis,
40200
+ y: yAxis
40201
+ };
40202
+ };
40203
+ const useScatterChartConfig = (chart2, chartRef) => {
40204
+ const { data, options: defaultOptions } = chart2;
40205
+ const { interactions, chartStyling } = defaultOptions;
40206
+ const [pointHover, setPointHover] = useState(false);
40207
+ const { legend: legend2, customLegendPlugin, legendClick } = useLegendState({
40208
+ chartRef,
40209
+ options: defaultOptions
40210
+ });
40211
+ const { state: legendState } = useLegend();
40212
+ const { annotation: annotation2 } = legendState;
40213
+ const generateDatasets = (datasets) => {
40214
+ return datasets.map(
40215
+ (scatterDataset, index2) => {
40216
+ const { borderWidth: inputBorderWidth = DEFAULT_BORDER_WIDTH } = scatterDataset ?? {};
40217
+ const borderWidth = parseFloat(String(inputBorderWidth)) || 1;
40218
+ const color2 = COLORS[index2];
40219
+ const borderColor = scatterDataset.borderColor ?? color2;
40220
+ const backgroundColor = scatterDataset.backgroundColor ?? color2;
40221
+ return {
40222
+ ...scatterDataset,
40223
+ borderWidth,
40224
+ borderColor,
40225
+ backgroundColor
40226
+ };
40227
+ }
40228
+ );
40229
+ };
40230
+ const generatedDatasets = generateDatasets(
40231
+ data.datasets
40232
+ );
40233
+ const onClick = (_evt, _elements, chartInstance) => {
40234
+ chartInstance.resetZoom();
40235
+ };
40236
+ const onHover = (evt, hoveredItems) => {
40237
+ if (pointHover && !(hoveredItems == null ? void 0 : hoveredItems.length)) {
40238
+ setPointHover(false);
40239
+ if (interactions.onUnhover) {
40240
+ interactions.onUnhover(evt);
40241
+ }
40242
+ }
40243
+ if (!pointHover && (hoveredItems == null ? void 0 : hoveredItems.length)) {
40244
+ setPointHover(true);
40245
+ if (interactions.onHover) {
40246
+ const { index: index2, datasetIndex } = hoveredItems[0];
40247
+ interactions.onHover(evt, datasetIndex, index2, generatedDatasets);
40248
+ }
40249
+ }
40250
+ };
40251
+ const scatterOptions = {
40252
+ onClick,
40253
+ onHover,
40254
+ chartStyling,
40255
+ interactions: {
40256
+ onLegendClick: legendClick,
40257
+ onHover
40258
+ },
40259
+ scales: getScatterChartScales(chart2 == null ? void 0 : chart2.options),
40260
+ plugins: {
40261
+ legend: { ...legend2, display: false },
40262
+ // hide default legend
40263
+ customLegendPlugin,
40264
+ title: getTitle(defaultOptions),
40265
+ annotation: toAnnotationObject(annotation2),
40266
+ chartAreaBorder: {
40267
+ borderColor: BORDER_COLOR
40268
+ },
40269
+ datalabels: {
40270
+ display: defaultOptions.graph.showDataLabels
40271
+ },
40272
+ tooltip: getTooltipsConfig(defaultOptions)
40273
+ }
40274
+ };
40275
+ return {
40276
+ generatedDatasets,
40277
+ scatterOptions
40278
+ };
40279
+ };
40280
+ const defaultChartStyling = (styling) => ({
40281
+ width: (styling == null ? void 0 : styling.width) ?? AUTO,
40282
+ height: (styling == null ? void 0 : styling.height) ?? AUTO,
40283
+ maintainAspectRatio: (styling == null ? void 0 : styling.maintainAspectRatio) || false,
40284
+ staticChartHeight: (styling == null ? void 0 : styling.staticChartHeight) || false,
40285
+ performanceMode: (styling == null ? void 0 : styling.performanceMode) ?? true
40286
+ });
40287
+ const defaultTooltip = (tooltip) => ({
40288
+ enabled: (tooltip == null ? void 0 : tooltip.enabled) ?? true,
40289
+ tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
40290
+ showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) || false,
40291
+ backgroundColor: (tooltip == null ? void 0 : tooltip.backgroundColor) || "#333",
40292
+ displayColors: (tooltip == null ? void 0 : tooltip.displayColors) || false
40293
+ });
40294
+ const defaultGraph = (graph) => ({
40295
+ showMinorGridlines: (graph == null ? void 0 : graph.showMinorGridlines) ?? false,
40296
+ showDataLabels: (graph == null ? void 0 : graph.showDataLabels) ?? false
40297
+ });
40298
+ const defaultLegend = (legend2) => ({
40299
+ display: (legend2 == null ? void 0 : legend2.display) ?? true,
40300
+ useDataset: (legend2 == null ? void 0 : legend2.useDataset) || false,
40301
+ position: (legend2 == null ? void 0 : legend2.position) || Position.BottomLeft,
40302
+ align: (legend2 == null ? void 0 : legend2.align) || AlignOptions.Center
40303
+ });
40304
+ const defaultChartOptions = (options) => ({
40305
+ enableZoom: (options == null ? void 0 : options.enableZoom) || false,
40306
+ enablePan: (options == null ? void 0 : options.enablePan) || false
40307
+ });
40308
+ const defaultInteractions = (interactions) => ({
40309
+ onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
40310
+ onHover: interactions == null ? void 0 : interactions.onHover,
40311
+ onUnhover: interactions == null ? void 0 : interactions.onUnhover
40312
+ });
40313
+ const defaultChartData = (data) => {
40314
+ return {
40315
+ labels: (data == null ? void 0 : data.labels) || [],
40316
+ datasets: (data == null ? void 0 : data.datasets) || []
40317
+ };
40318
+ };
40319
+ const defaultAnnotationsData = (annotationsData) => {
40320
+ return annotationsData ? annotationsData.map((ann) => ({ ...ann, display: (ann == null ? void 0 : ann.display) ?? true })) : [];
40321
+ };
40322
+ const defaultAnnotations = (annotations) => ({
40323
+ showAnnotations: (annotations == null ? void 0 : annotations.showAnnotations) ?? true,
40324
+ controlAnnotation: (annotations == null ? void 0 : annotations.controlAnnotation) || false,
40325
+ annotationsData: defaultAnnotationsData(annotations == null ? void 0 : annotations.annotationsData)
40326
+ });
40327
+ const defaultAxes = (axes) => ({
40328
+ x: (axes == null ? void 0 : axes.x) || [{}],
40329
+ y: (axes == null ? void 0 : axes.y) || [{}]
40330
+ });
40331
+ const defaultAdditionalAxesOptions = (options) => ({
40332
+ reverse: (options == null ? void 0 : options.reverse) || false,
40333
+ stacked: (options == null ? void 0 : options.stacked) || false,
40334
+ beginAtZero: (options == null ? void 0 : options.beginAtZero) ?? true,
40335
+ stepSize: options == null ? void 0 : options.stepSize,
40336
+ suggestedMin: options == null ? void 0 : options.suggestedMin,
40337
+ suggestedMax: options == null ? void 0 : options.suggestedMax,
40338
+ min: options == null ? void 0 : options.min,
40339
+ max: options == null ? void 0 : options.max
40340
+ });
40341
+ const getDefaultProps = (props) => {
40342
+ const chart2 = (props == null ? void 0 : props.chart) || {};
40343
+ const options = (chart2 == null ? void 0 : chart2.options) || {};
40344
+ return {
40345
+ testId: (chart2 == null ? void 0 : chart2.testId) ?? null,
40346
+ data: defaultChartData(chart2 == null ? void 0 : chart2.data),
40347
+ options: {
40348
+ title: (options == null ? void 0 : options.title) || "",
40349
+ axes: defaultAxes(options == null ? void 0 : options.axes),
40350
+ additionalAxesOptions: defaultAdditionalAxesOptions(
40351
+ options == null ? void 0 : options.additionalAxesOptions
40352
+ ),
40353
+ direction: (options == null ? void 0 : options.direction) || ChartDirection.VERTICAL,
40354
+ chartStyling: defaultChartStyling(options == null ? void 0 : options.chartStyling),
40355
+ tooltip: defaultTooltip(options == null ? void 0 : options.tooltip),
40356
+ graph: defaultGraph(options == null ? void 0 : options.graph),
40357
+ legend: defaultLegend(options == null ? void 0 : options.legend),
40358
+ annotations: defaultAnnotations(options == null ? void 0 : options.annotations),
40359
+ chartOptions: defaultChartOptions(options == null ? void 0 : options.chartOptions),
40360
+ interactions: defaultInteractions(options == null ? void 0 : options.interactions)
40361
+ }
40362
+ };
40363
+ };
40364
+ const chart = "_chart_1jdnu_1";
40365
+ const fixedHeight = "_fixedHeight_1jdnu_13";
40366
+ const stretchHeight = "_stretchHeight_1jdnu_19";
40367
+ const zoomForm = "_zoomForm_1jdnu_32";
40368
+ const zoomReset = "_zoomReset_1jdnu_40";
40369
+ const help = "_help_1jdnu_43";
40370
+ const autoWeight = "_autoWeight_1jdnu_47";
40371
+ const styles = {
40372
+ chart,
40373
+ fixedHeight,
40374
+ stretchHeight,
40375
+ zoomForm,
40376
+ zoomReset,
40377
+ help,
40378
+ autoWeight
40379
+ };
40380
+ Chart$2.register(
40381
+ LinearScale$1,
40382
+ PointElement$1,
40383
+ CategoryScale$1,
40384
+ plugin_legend,
40385
+ plugin_tooltip,
40386
+ plugin_title,
40387
+ plugin$1,
40388
+ plugin,
40389
+ annotation
40390
+ );
40391
+ const ScatterChart = (props) => {
40392
+ setDefaultTheme();
40393
+ const chartRef = useRef(null);
40394
+ const chart2 = getDefaultProps(props);
40395
+ const { options, testId } = chart2;
40396
+ const { scatterOptions, generatedDatasets } = useScatterChartConfig(
40397
+ chart2,
40398
+ chartRef
40399
+ );
40400
+ return /* @__PURE__ */ jsx(
40401
+ "div",
40402
+ {
40403
+ className: getClassName(options.chartStyling, styles),
40404
+ style: {
40405
+ width: options.chartStyling.width,
40406
+ height: options.chartStyling.height
40407
+ },
40408
+ "data-testid": testId,
40409
+ children: /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsxs("div", { className: styles.canvas, id: "canvas", children: [
40410
+ /* @__PURE__ */ jsx(
40411
+ Scatter,
40412
+ {
40413
+ ref: chartRef,
40414
+ data: {
40415
+ datasets: generatedDatasets
40416
+ },
40417
+ options: scatterOptions,
40418
+ plugins: getPlugins(options.graph, options.legend)
40419
+ }
40420
+ ),
40421
+ !!generatedDatasets.length && /* @__PURE__ */ jsx(
40422
+ Legend2,
40423
+ {
40424
+ chartRef,
40425
+ legendConfig: {
40426
+ options,
40427
+ generatedDatasets,
40428
+ chartType: ChartType.SCATTER
40429
+ }
40430
+ }
40431
+ )
40432
+ ] }) })
40433
+ }
40434
+ );
40435
+ };
40436
+ const ScatterChartWithLegend = (props) => {
40437
+ const { options } = getDefaultProps(props);
40438
+ return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(ScatterChart, { ...props }) });
40439
+ };
39858
40440
  export {
39859
40441
  BarChartWithLegend as BarChart,
39860
40442
  LineChartWithLegend as LineChart,
39861
40443
  PieChartWithLegend as PieChart,
40444
+ ScatterChartWithLegend as ScatterChart,
39862
40445
  initializeLineChart
39863
40446
  };
39864
40447
  //# sourceMappingURL=index.js.map
@@ -39867,7 +40450,7 @@ export {
39867
40450
  try {
39868
40451
  if (typeof document != "undefined") {
39869
40452
  var elementStyle = document.createElement("style");
39870
- elementStyle.appendChild(document.createTextNode("html[data-theme='dark'] ._chart_e3qdd_1 canvas {\n filter: invert(1) hue-rotate(180deg);\n}\n._chart_e3qdd_1 {\n border: 1px solid rgba(255, 255, 255, 0);\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n._chart_e3qdd_1 ._canvas_e3qdd_11 {\n flex-grow: 1;\n min-height: 0;\n position: relative;\n}\n._chart_e3qdd_1 ._canvas_e3qdd_11 canvas {\n width: 100% !important;\n height: 100% !important;\n}\n._chart_e3qdd_1._fixedHeight_e3qdd_20 {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n height: auto;\n}\n._chart_e3qdd_1._stretchHeight_e3qdd_26 {\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n height: 100%;\n}\n._chart_e3qdd_1._squareAspectRatio_e3qdd_32 {\n aspect-ratio: 1;\n min-height: 0;\n min-width: 0;\n}\n._chart_e3qdd_1:focus {\n outline: none;\n}\n._chart_e3qdd_1::-moz-focus-inner {\n border: 0;\n}\n._zoomForm_e3qdd_43 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n right: 0;\n}\n._zoomForm_e3qdd_43 ._zoomReset_e3qdd_51 {\n margin-left: 10px;\n}\n._zoomForm_e3qdd_43 ._help_e3qdd_54 {\n margin-left: 5px;\n line-height: 0;\n}\n._autoWeight_e3qdd_58 {\n width: auto;\n height: auto;\n}\n._table_e3qdd_62 {\n overflow: auto;\n}\n._controls_gbo9q_1 {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--padding-xs);\n}\n._buttons_gbo9q_7 {\n display: flex;\n align-items: flex-start;\n margin-left: auto;\n gap: var(--padding-xxs);\n}\n._legend_wpro0_1 {\n position: absolute;\n opacity: 0.9;\n display: flex;\n flex-direction: column;\n z-index: 1;\n}\n._legend_wpro0_1._isDragging_wpro0_8 {\n opacity: 0;\n}\n._legendItems_wpro0_11 {\n background-color: var(--color-background-raised);\n border: 1px solid var(--color-border);\n padding: 4px 8px;\n border-radius: 2px;\n overflow-y: auto;\n max-height: 100%;\n overflow: overlay;\n --scrollbar-color: #00000040;\n}\n._legendItems_wpro0_11::-webkit-scrollbar {\n display: block;\n width: 16px;\n z-index: 2;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-button {\n display: none;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-track {\n background-color: #00000000;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-track-piece {\n background-color: #00000000;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-thumb {\n background-color: #00000000;\n border: 5px solid transparent;\n border-radius: 24px;\n box-shadow: 4px 0px 0px 4px var(--scrollbar-color) inset;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-corner {\n background: rgba(0, 0, 0, 0);\n}\n._legend_wpro0_1._isDragging_wpro0_8 ._legendItems_wpro0_11._legendItems_wpro0_11 {\n pointer-events: none;\n}\n._legend_wpro0_1._isHidden_wpro0_47 ._legendItems_wpro0_11._legendItems_wpro0_11 {\n display: none;\n}\n._legendToggle_wpro0_50 {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: none;\n}\n._legend_wpro0_1._isHidden_wpro0_47 ._legendToggle_wpro0_50._legendToggle_wpro0_50,\n._legend_wpro0_1:hover ._legendToggle_wpro0_50._legendToggle_wpro0_50 {\n display: block;\n}\n._legend_wpro0_1:active ._legendToggle_wpro0_50._legendToggle_wpro0_50:not(:hover) {\n display: none;\n}\n._legend_wpro0_1._isHidden_wpro0_47 ._legendToggle_wpro0_50._legendToggle_wpro0_50 {\n position: static;\n transform: none;\n}\n._legend_wpro0_1._isDragging_wpro0_8 ._legendToggle_wpro0_50._legendToggle_wpro0_50 {\n display: none;\n}\n._legendItem_wpro0_11 {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n user-select: none;\n cursor: pointer;\n font-size: 12px;\n line-height: 16px;\n}\n._legendItemSymbol_wpro0_80 {\n display: flex;\n align-items: center;\n height: 16px;\n position: relative;\n flex-shrink: 0;\n}\nhtml[data-theme='dark'] ._legendItemSymbol_wpro0_80._legendItemSymbol_wpro0_80 {\n filter: invert(1) hue-rotate(180deg);\n}\n._legendItemBox_wpro0_90 {\n width: 100%;\n height: 12px;\n display: block;\n}\n._legendItemLine_wpro0_95 {\n position: absolute;\n display: flex;\n top: 50%;\n left: 0;\n width: 100%;\n transform: translateY(-50%);\n}\n._legendItemPoint_wpro0_103 {\n position: absolute;\n display: flex;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n._isHidden_wpro0_47 ._legendItemText_wpro0_110._legendItemText_wpro0_110 {\n text-decoration: line-through;\n}\n._scrollbars_wpro0_113 {\n overflow: overlay;\n --scrollbar-color: #00000040;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar {\n display: block;\n width: 16px;\n z-index: 2;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-button {\n display: none;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-track {\n background-color: #00000000;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-track-piece {\n background-color: #00000000;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-thumb {\n background-color: #00000000;\n border: 5px solid transparent;\n border-radius: 24px;\n box-shadow: 4px 0px 0px 4px var(--scrollbar-color) inset;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-corner {\n background: rgba(0, 0, 0, 0);\n}\n._dropzoneContainer_wpro0_140 {\n position: absolute;\n}\n._dropzone_wpro0_140 {\n position: absolute;\n width: 50%;\n height: 50%;\n display: flex;\n}\n._dropzone_wpro0_140._left_wpro0_149 {\n left: 0;\n justify-content: flex-start;\n}\n._dropzone_wpro0_140._right_wpro0_153 {\n right: 0;\n justify-content: flex-end;\n}\n._dropzone_wpro0_140._top_wpro0_157 {\n top: 0;\n align-items: flex-start;\n}\n._dropzone_wpro0_140._bottom_wpro0_161 {\n bottom: 0;\n align-items: flex-end;\n}\n._dropzonePlaceholder_wpro0_165 {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.05);\n display: none;\n}\n[data-theme='dark'] ._dropzonePlaceholder_wpro0_165 {\n background-color: rgba(255, 255, 255, 0.05);\n}\n._isActive_wpro0_173 ._dropzonePlaceholder_wpro0_165._dropzonePlaceholder_wpro0_165 {\n display: block;\n}\n._resizeContainer_wpro0_176 {\n position: absolute;\n inset: 0;\n z-index: -1;\n}\nhtml[data-theme='dark'] ._chart_1jdnu_1 canvas {\n filter: invert(1) hue-rotate(180deg);\n}\n._chart_1jdnu_1 {\n border: 1px solid rgba(255, 255, 255, 0);\n padding-top: 10px;\n position: relative;\n}\n._chart_1jdnu_1 canvas {\n width: 100% !important;\n height: 100% !important;\n}\n._chart_1jdnu_1._fixedHeight_1jdnu_13 {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n height: auto;\n}\n._chart_1jdnu_1._stretchHeight_1jdnu_19 {\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n height: 100%;\n}\n._chart_1jdnu_1:focus {\n border: 1px solid #85b7d9;\n outline: none;\n}\n._chart_1jdnu_1::-moz-focus-inner {\n border: 0;\n}\n._zoomForm_1jdnu_32 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n right: 0;\n}\n._zoomForm_1jdnu_32 ._zoomReset_1jdnu_40 {\n margin-left: 10px;\n}\n._zoomForm_1jdnu_32 ._help_1jdnu_43 {\n margin-left: 5px;\n line-height: 0;\n}\n._autoWeight_1jdnu_47 {\n width: 'auto';\n height: 'auto';\n}\nhtml[data-theme='dark'] ._chart_x1sru_1 canvas {\n filter: invert(1) hue-rotate(180deg);\n}\n._chart_x1sru_1 {\n border: 1px solid rgba(255, 255, 255, 0);\n position: relative;\n display: flex;\n flex-direction: column;\n}\n._chart_x1sru_1 ._canvas_x1sru_10 {\n flex-grow: 1;\n min-height: 0;\n position: relative;\n}\n._chart_x1sru_1 ._canvas_x1sru_10 canvas {\n width: 100% !important;\n height: 100% !important;\n}\n._chart_x1sru_1._fixedHeight_x1sru_19 {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n height: auto;\n}\n._chart_x1sru_1._stretchHeight_x1sru_25 {\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n height: 100%;\n}\n._chart_x1sru_1:focus {\n border: 1px solid #85b7d9;\n outline: none;\n}\n._chart_x1sru_1::-moz-focus-inner {\n border: 0;\n}\n._zoomForm_x1sru_38 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n right: 0;\n}\n._zoomForm_x1sru_38 ._zoomReset_x1sru_46 {\n margin-left: 10px;\n}\n._zoomForm_x1sru_38 ._help_x1sru_49 {\n margin-left: 5px;\n line-height: 0;\n}\n._autoWeight_x1sru_53 {\n width: auto;\n height: auto;\n}\n._actions_x1sru_57 {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}"));
40453
+ elementStyle.appendChild(document.createTextNode("html[data-theme='dark'] ._chart_e3qdd_1 canvas {\n filter: invert(1) hue-rotate(180deg);\n}\n._chart_e3qdd_1 {\n border: 1px solid rgba(255, 255, 255, 0);\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n._chart_e3qdd_1 ._canvas_e3qdd_11 {\n flex-grow: 1;\n min-height: 0;\n position: relative;\n}\n._chart_e3qdd_1 ._canvas_e3qdd_11 canvas {\n width: 100% !important;\n height: 100% !important;\n}\n._chart_e3qdd_1._fixedHeight_e3qdd_20 {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n height: auto;\n}\n._chart_e3qdd_1._stretchHeight_e3qdd_26 {\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n height: 100%;\n}\n._chart_e3qdd_1._squareAspectRatio_e3qdd_32 {\n aspect-ratio: 1;\n min-height: 0;\n min-width: 0;\n}\n._chart_e3qdd_1:focus {\n outline: none;\n}\n._chart_e3qdd_1::-moz-focus-inner {\n border: 0;\n}\n._zoomForm_e3qdd_43 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n right: 0;\n}\n._zoomForm_e3qdd_43 ._zoomReset_e3qdd_51 {\n margin-left: 10px;\n}\n._zoomForm_e3qdd_43 ._help_e3qdd_54 {\n margin-left: 5px;\n line-height: 0;\n}\n._autoWeight_e3qdd_58 {\n width: auto;\n height: auto;\n}\n._table_e3qdd_62 {\n overflow: auto;\n}\n._controls_gbo9q_1 {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--padding-xs);\n}\n._buttons_gbo9q_7 {\n display: flex;\n align-items: flex-start;\n margin-left: auto;\n gap: var(--padding-xxs);\n}\n._legend_wpro0_1 {\n position: absolute;\n opacity: 0.9;\n display: flex;\n flex-direction: column;\n z-index: 1;\n}\n._legend_wpro0_1._isDragging_wpro0_8 {\n opacity: 0;\n}\n._legendItems_wpro0_11 {\n background-color: var(--color-background-raised);\n border: 1px solid var(--color-border);\n padding: 4px 8px;\n border-radius: 2px;\n overflow-y: auto;\n max-height: 100%;\n overflow: overlay;\n --scrollbar-color: #00000040;\n}\n._legendItems_wpro0_11::-webkit-scrollbar {\n display: block;\n width: 16px;\n z-index: 2;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-button {\n display: none;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-track {\n background-color: #00000000;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-track-piece {\n background-color: #00000000;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-thumb {\n background-color: #00000000;\n border: 5px solid transparent;\n border-radius: 24px;\n box-shadow: 4px 0px 0px 4px var(--scrollbar-color) inset;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-corner {\n background: rgba(0, 0, 0, 0);\n}\n._legend_wpro0_1._isDragging_wpro0_8 ._legendItems_wpro0_11._legendItems_wpro0_11 {\n pointer-events: none;\n}\n._legend_wpro0_1._isHidden_wpro0_47 ._legendItems_wpro0_11._legendItems_wpro0_11 {\n display: none;\n}\n._legendToggle_wpro0_50 {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: none;\n}\n._legend_wpro0_1._isHidden_wpro0_47 ._legendToggle_wpro0_50._legendToggle_wpro0_50,\n._legend_wpro0_1:hover ._legendToggle_wpro0_50._legendToggle_wpro0_50 {\n display: block;\n}\n._legend_wpro0_1:active ._legendToggle_wpro0_50._legendToggle_wpro0_50:not(:hover) {\n display: none;\n}\n._legend_wpro0_1._isHidden_wpro0_47 ._legendToggle_wpro0_50._legendToggle_wpro0_50 {\n position: static;\n transform: none;\n}\n._legend_wpro0_1._isDragging_wpro0_8 ._legendToggle_wpro0_50._legendToggle_wpro0_50 {\n display: none;\n}\n._legendItem_wpro0_11 {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n user-select: none;\n cursor: pointer;\n font-size: 12px;\n line-height: 16px;\n}\n._legendItemSymbol_wpro0_80 {\n display: flex;\n align-items: center;\n height: 16px;\n position: relative;\n flex-shrink: 0;\n}\nhtml[data-theme='dark'] ._legendItemSymbol_wpro0_80._legendItemSymbol_wpro0_80 {\n filter: invert(1) hue-rotate(180deg);\n}\n._legendItemBox_wpro0_90 {\n width: 100%;\n height: 12px;\n display: block;\n}\n._legendItemLine_wpro0_95 {\n position: absolute;\n display: flex;\n top: 50%;\n left: 0;\n width: 100%;\n transform: translateY(-50%);\n}\n._legendItemPoint_wpro0_103 {\n position: absolute;\n display: flex;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n._isHidden_wpro0_47 ._legendItemText_wpro0_110._legendItemText_wpro0_110 {\n text-decoration: line-through;\n}\n._scrollbars_wpro0_113 {\n overflow: overlay;\n --scrollbar-color: #00000040;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar {\n display: block;\n width: 16px;\n z-index: 2;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-button {\n display: none;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-track {\n background-color: #00000000;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-track-piece {\n background-color: #00000000;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-thumb {\n background-color: #00000000;\n border: 5px solid transparent;\n border-radius: 24px;\n box-shadow: 4px 0px 0px 4px var(--scrollbar-color) inset;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-corner {\n background: rgba(0, 0, 0, 0);\n}\n._dropzoneContainer_wpro0_140 {\n position: absolute;\n}\n._dropzone_wpro0_140 {\n position: absolute;\n width: 50%;\n height: 50%;\n display: flex;\n}\n._dropzone_wpro0_140._left_wpro0_149 {\n left: 0;\n justify-content: flex-start;\n}\n._dropzone_wpro0_140._right_wpro0_153 {\n right: 0;\n justify-content: flex-end;\n}\n._dropzone_wpro0_140._top_wpro0_157 {\n top: 0;\n align-items: flex-start;\n}\n._dropzone_wpro0_140._bottom_wpro0_161 {\n bottom: 0;\n align-items: flex-end;\n}\n._dropzonePlaceholder_wpro0_165 {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.05);\n display: none;\n}\n[data-theme='dark'] ._dropzonePlaceholder_wpro0_165 {\n background-color: rgba(255, 255, 255, 0.05);\n}\n._isActive_wpro0_173 ._dropzonePlaceholder_wpro0_165._dropzonePlaceholder_wpro0_165 {\n display: block;\n}\n._resizeContainer_wpro0_176 {\n position: absolute;\n inset: 0;\n z-index: -1;\n}\nhtml[data-theme='dark'] ._chart_1jdnu_1 canvas {\n filter: invert(1) hue-rotate(180deg);\n}\n._chart_1jdnu_1 {\n border: 1px solid rgba(255, 255, 255, 0);\n padding-top: 10px;\n position: relative;\n}\n._chart_1jdnu_1 canvas {\n width: 100% !important;\n height: 100% !important;\n}\n._chart_1jdnu_1._fixedHeight_1jdnu_13 {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n height: auto;\n}\n._chart_1jdnu_1._stretchHeight_1jdnu_19 {\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n height: 100%;\n}\n._chart_1jdnu_1:focus {\n border: 1px solid #85b7d9;\n outline: none;\n}\n._chart_1jdnu_1::-moz-focus-inner {\n border: 0;\n}\n._zoomForm_1jdnu_32 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n right: 0;\n}\n._zoomForm_1jdnu_32 ._zoomReset_1jdnu_40 {\n margin-left: 10px;\n}\n._zoomForm_1jdnu_32 ._help_1jdnu_43 {\n margin-left: 5px;\n line-height: 0;\n}\n._autoWeight_1jdnu_47 {\n width: 'auto';\n height: 'auto';\n}\nhtml[data-theme='dark'] ._chart_x1sru_1 canvas {\n filter: invert(1) hue-rotate(180deg);\n}\n._chart_x1sru_1 {\n border: 1px solid rgba(255, 255, 255, 0);\n position: relative;\n display: flex;\n flex-direction: column;\n}\n._chart_x1sru_1 ._canvas_x1sru_10 {\n flex-grow: 1;\n min-height: 0;\n position: relative;\n}\n._chart_x1sru_1 ._canvas_x1sru_10 canvas {\n width: 100% !important;\n height: 100% !important;\n}\n._chart_x1sru_1._fixedHeight_x1sru_19 {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n height: auto;\n}\n._chart_x1sru_1._stretchHeight_x1sru_25 {\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n height: 100%;\n}\n._chart_x1sru_1:focus {\n border: 1px solid #85b7d9;\n outline: none;\n}\n._chart_x1sru_1::-moz-focus-inner {\n border: 0;\n}\n._zoomForm_x1sru_38 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n right: 0;\n}\n._zoomForm_x1sru_38 ._zoomReset_x1sru_46 {\n margin-left: 10px;\n}\n._zoomForm_x1sru_38 ._help_x1sru_49 {\n margin-left: 5px;\n line-height: 0;\n}\n._autoWeight_x1sru_53 {\n width: auto;\n height: auto;\n}\n._actions_x1sru_57 {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\nhtml[data-theme='dark'] ._chart_1jdnu_1 canvas {\n filter: invert(1) hue-rotate(180deg);\n}\n._chart_1jdnu_1 {\n border: 1px solid rgba(255, 255, 255, 0);\n padding-top: 10px;\n position: relative;\n}\n._chart_1jdnu_1 canvas {\n width: 100% !important;\n height: 100% !important;\n}\n._chart_1jdnu_1._fixedHeight_1jdnu_13 {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n height: auto;\n}\n._chart_1jdnu_1._stretchHeight_1jdnu_19 {\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n height: 100%;\n}\n._chart_1jdnu_1:focus {\n border: 1px solid #85b7d9;\n outline: none;\n}\n._chart_1jdnu_1::-moz-focus-inner {\n border: 0;\n}\n._zoomForm_1jdnu_32 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n right: 0;\n}\n._zoomForm_1jdnu_32 ._zoomReset_1jdnu_40 {\n margin-left: 10px;\n}\n._zoomForm_1jdnu_32 ._help_1jdnu_43 {\n margin-left: 5px;\n line-height: 0;\n}\n._autoWeight_1jdnu_47 {\n width: 'auto';\n height: 'auto';\n}"));
39871
40454
  document.head.appendChild(elementStyle);
39872
40455
  }
39873
40456
  } catch (e) {