@oliasoft-open-source/charts-library 4.3.0-beta-1 → 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,14 +4,14 @@ 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";
11
11
  import { round as round$2, displayNumber, isCloseTo, roundByMagnitude } from "@oliasoft-open-source/units";
12
12
  import cx from "classnames";
13
13
  import { Icon, Tooltip as Tooltip$2, Button, Flex, Text, Menu, Popover, Field, InputGroup, NumberInput, InputGroupAddon, Select, ButtonGroup, Spacer, Portal } from "@oliasoft-open-source/react-ui-library";
14
- import { isEmpty, isArray as isArray$2, some, has, cloneDeep, defaultTo, findIndex, set as set$2, debounce as debounce$3, map as map$3, find, get as get$1, values } from "lodash";
14
+ import { isEmpty, isArray as isArray$2, some, has, cloneDeep, defaultTo, findIndex, set as set$2, debounce as debounce$3, isNil, map as map$3, find, get as get$1, values } from "lodash";
15
15
  import { roundNumberToPrecision } from "@oliasoft-open-source/units/dist/rounding/rounding";
16
16
  /*!
17
17
  * @kurkle/color v0.3.2
@@ -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,8 +25317,9 @@ 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;
@@ -25199,64 +25330,138 @@ const annotationEnter = (element, chart2) => {
25199
25330
  element.label.options.display = true;
25200
25331
  element.options.label.enabled = true;
25201
25332
  }
25333
+ if (annotation2 == null ? void 0 : annotation2.enableDrag) {
25334
+ chart2.hoveredAnnotationId = element.options.id || null;
25335
+ chart2.update();
25336
+ }
25202
25337
  chart2.draw();
25203
- chart2.canvas.style.cursor = CursorStyle.Pointer;
25204
- return true;
25205
25338
  };
25206
- const annotationLeave = (element, chart2) => {
25339
+ const handleLineLeave = (element, chart2, annotation2) => {
25207
25340
  element.options.borderWidth = BORDER_WIDTH.INITIAL;
25341
+ chart2.canvas.style.cursor = CursorStyle.Initial;
25342
+ chart2.hoveredAnnotationId = null;
25208
25343
  if (element.options.label) {
25209
25344
  element.label.options.display = false;
25210
25345
  element.options.label.enabled = false;
25211
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
+ }
25212
25387
  chart2.draw();
25213
- chart2.canvas.style.cursor = CursorStyle.Initial;
25214
- return true;
25215
25388
  };
25216
25389
  const generateAnnotations = (annotationsData) => {
25217
25390
  return annotationsData == null ? void 0 : annotationsData.map((ann, idx) => {
25391
+ var _a2, _b2, _c2, _d2, _e2;
25218
25392
  const scaleID = (ann == null ? void 0 : ann.annotationAxis) ?? void 0;
25219
- const color2 = (ann == null ? void 0 : ann.color) || COLORS[idx];
25220
- 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;
25221
25395
  const adjustScaleRange2 = ann == null ? void 0 : ann.adjustScaleRange;
25222
25396
  const borderColor = {
25223
25397
  [AnnotationType.LINE]: color2,
25224
25398
  [AnnotationType.POINT]: color2,
25225
25399
  [AnnotationType.BOX]: color2
25226
25400
  }[type] || "transparent";
25227
- const borderWidth = type == "line" ? BORDER_WIDTH.INITIAL : 0;
25228
- const borderDash = type == "line" ? ANNOTATION_DASH : void 0;
25229
- const label = type === "line" ? {
25230
- backgroundColor: color2,
25231
- content: ann == null ? void 0 : ann.label,
25232
- display: false,
25233
- position: Position.Top
25234
- } : {
25235
- content: ann == null ? void 0 : ann.label,
25236
- display: true,
25237
- font: { weight: "normal" }
25238
- };
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";
25239
25428
  const enter = ({
25240
25429
  element
25241
25430
  }, {
25242
25431
  chart: chart2
25243
25432
  }) => {
25244
- if (type !== "line" && !ann.enableDrag)
25245
- return;
25246
- 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
+ }
25247
25444
  };
25248
25445
  const leave = ({
25249
25446
  element
25250
25447
  }, {
25251
25448
  chart: chart2
25252
25449
  }) => {
25253
- if (type !== "line" && !ann.enableDrag)
25254
- return;
25255
- 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
+ }
25256
25461
  };
25257
- const onDragStart = () => (cord) => (ann == null ? void 0 : ann.onDragStart) ? ann == null ? void 0 : ann.onDragStart(cord) : void 0;
25258
- const onDrag = () => (cord) => (ann == null ? void 0 : ann.onDrag) ? ann == null ? void 0 : ann.onDrag(cord) : void 0;
25259
- 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;
25260
25465
  return {
25261
25466
  ...ann,
25262
25467
  display: ann == null ? void 0 : ann.display,
@@ -25838,31 +26043,18 @@ const getMousePositionInCoordinates = (event, canvas2, scales) => {
25838
26043
  const yValue = ((_b2 = scales == null ? void 0 : scales.y) == null ? void 0 : _b2.getValueForPixel(y2)) ?? -1;
25839
26044
  return { x: xValue, y: yValue };
25840
26045
  };
25841
- const getActiveAnnotation = (x2, y2, annotations) => {
25842
- var _a2;
25843
- return ((_a2 = Object.values(annotations)) == null ? void 0 : _a2.find((annotation2) => {
25844
- const { xMin, xMax, yMin, yMax, xValue, yValue } = annotation2 ?? {};
25845
- let condtion;
25846
- if (xMin && xMax && yMin && yMax && (annotation2 == null ? void 0 : annotation2.type) === AnnotationType.BOX) {
25847
- condtion = x2 >= xMin && x2 <= xMax && y2 >= yMin && y2 <= yMax;
25848
- } else if (xValue && yValue && (annotation2 == null ? void 0 : annotation2.type) === AnnotationType.POINT) {
25849
- condtion = x2 >= xValue - 2 && x2 <= xValue + 2 && y2 >= yValue - 2 && y2 <= yValue + 2;
25850
- }
25851
- return condtion;
25852
- })) ?? {};
25853
- };
25854
26046
  const calculateAnnotationMetricsInValues = (annotation2) => {
25855
26047
  const { xMin, xMax, yMin, yMax, xValue, yValue, type } = annotation2 ?? {};
25856
26048
  let centerX;
25857
26049
  let centerY;
25858
26050
  let width;
25859
26051
  let height;
25860
- if (xMin && xMax && yMin && yMax && type === AnnotationType.BOX) {
26052
+ if (!isNil(xMin) && !isNil(xMax) && !isNil(yMin) && !isNil(yMax) && type === AnnotationType.BOX) {
25861
26053
  centerX = (xMin + xMax) / 2;
25862
26054
  centerY = (yMin + yMax) / 2;
25863
26055
  width = xMax - xMin;
25864
26056
  height = yMax - yMin;
25865
- } else if (xValue && yValue && type === AnnotationType.POINT) {
26057
+ } else if (!isNil(xValue) && !isNil(yValue) && type === AnnotationType.POINT) {
25866
26058
  centerX = xValue;
25867
26059
  centerY = yValue;
25868
26060
  width = 0;
@@ -25876,14 +26068,13 @@ const calculateAnnotationMetricsInValues = (annotation2) => {
25876
26068
  };
25877
26069
  };
25878
26070
  const calculateAnnotationMetricsInValuesInPixels = (annotation2, scales) => {
25879
- var _a2, _b2, _c2, _d2;
25880
26071
  const { xMin, xMax, yMin, yMax, xValue, yValue, type } = annotation2 ?? {};
25881
26072
  const { x: x2, y: y2 } = scales ?? {};
25882
26073
  let centerX;
25883
26074
  let centerY;
25884
26075
  let width;
25885
26076
  let height;
25886
- if (xMin && xMax && yMin && yMax && type === AnnotationType.BOX) {
26077
+ if (!isNil(xMin) && !isNil(xMax) && !isNil(yMin) && !isNil(yMax) && type === AnnotationType.BOX) {
25887
26078
  const xCenterValue = (xMin + xMax) / 2;
25888
26079
  const yCenterValue = (yMin + yMax) / 2;
25889
26080
  const xMinValue = (x2 == null ? void 0 : x2.getPixelForValue(xMin)) ?? 0;
@@ -25892,13 +26083,13 @@ const calculateAnnotationMetricsInValuesInPixels = (annotation2, scales) => {
25892
26083
  const yMaxValue = (y2 == null ? void 0 : y2.getPixelForValue(yMax)) ?? 0;
25893
26084
  width = xMinValue - xMaxValue;
25894
26085
  height = yMinValue - yMaxValue;
25895
- centerX = ((_a2 = scales == null ? void 0 : scales.x) == null ? void 0 : _a2.getPixelForValue(xCenterValue)) ?? -1;
25896
- centerY = ((_b2 = scales == null ? void 0 : scales.y) == null ? void 0 : _b2.getPixelForValue(yCenterValue)) ?? -1;
25897
- } else if (xValue && yValue && type === AnnotationType.POINT) {
26086
+ centerX = (x2 == null ? void 0 : x2.getPixelForValue(xCenterValue)) ?? -1;
26087
+ centerY = (y2 == null ? void 0 : y2.getPixelForValue(yCenterValue)) ?? -1;
26088
+ } else if (!isNil(xValue) && !isNil(yValue) && type === AnnotationType.POINT) {
25898
26089
  width = 0;
25899
26090
  height = 0;
25900
- centerX = ((_c2 = scales == null ? void 0 : scales.x) == null ? void 0 : _c2.getPixelForValue(xValue)) ?? -1;
25901
- centerY = ((_d2 = scales == null ? void 0 : scales.y) == null ? void 0 : _d2.getPixelForValue(yValue)) ?? -1;
26091
+ centerX = (x2 == null ? void 0 : x2.getPixelForValue(xValue)) ?? -1;
26092
+ centerY = (y2 == null ? void 0 : y2.getPixelForValue(yValue)) ?? -1;
25902
26093
  }
25903
26094
  return {
25904
26095
  centerX,
@@ -25907,23 +26098,25 @@ const calculateAnnotationMetricsInValuesInPixels = (annotation2, scales) => {
25907
26098
  height
25908
26099
  };
25909
26100
  };
25910
- const handleAnnotationMouseDown = (event, canvas2, scales, annotations, setDraggingState) => {
26101
+ const handleAnnotationMouseDown = (event, canvas2, scales, annotations, setDraggingState, hoveredAnnotationId) => {
25911
26102
  const { x: x2, y: y2 } = getMousePositionInCoordinates(event, canvas2, scales);
25912
- const annotation2 = getActiveAnnotation(x2, y2, annotations);
26103
+ const annotation2 = hoveredAnnotationId ? annotations == null ? void 0 : annotations[hoveredAnnotationId] : null;
26104
+ if (!annotation2)
26105
+ return;
25913
26106
  const metrics = calculateAnnotationMetricsInValues(annotation2);
25914
- console.log(cloneDeep(annotations));
25915
- console.log(metrics);
25916
26107
  if (annotation2 && annotation2.enableDrag && metrics.centerY && metrics.centerX) {
26108
+ canvas2.style.cursor = CursorStyle.Move;
25917
26109
  const dragStartX = x2 - metrics.centerX;
25918
26110
  const dragStartY = y2 - metrics.centerY;
25919
26111
  setDraggingState(true, annotation2, dragStartX, dragStartY);
25920
26112
  if (annotation2 == null ? void 0 : annotation2.onDragStart) {
25921
- annotation2.onDragStart({ x: x2, y: y2 });
26113
+ annotation2.onDragStart({ x: x2, y: y2 }, cloneDeep(annotation2));
25922
26114
  }
25923
26115
  }
25924
26116
  };
25925
26117
  const handleAnnotationMouseMove = (event, canvas2, scales, isDragging2, activeAnnotation, dragStartX, dragStartY, chart2) => {
25926
26118
  if (isDragging2 && activeAnnotation) {
26119
+ canvas2.style.cursor = CursorStyle.Move;
25927
26120
  const { x: x2, y: y2 } = getMousePositionInCoordinates(event, canvas2, scales);
25928
26121
  const metrics = calculateAnnotationMetricsInValues(activeAnnotation);
25929
26122
  let newCenterX = x2 - dragStartX;
@@ -25943,7 +26136,7 @@ const handleAnnotationMouseMove = (event, canvas2, scales, isDragging2, activeAn
25943
26136
  }
25944
26137
  chart2.update();
25945
26138
  if (activeAnnotation == null ? void 0 : activeAnnotation.onDrag) {
25946
- activeAnnotation.onDrag({ x: x2, y: y2 });
26139
+ activeAnnotation.onDrag({ x: x2, y: y2 }, cloneDeep(activeAnnotation));
25947
26140
  }
25948
26141
  const { ctx, width, height } = chart2;
25949
26142
  const { centerX, centerY } = calculateAnnotationMetricsInValues(activeAnnotation) ?? {};
@@ -25974,18 +26167,64 @@ const handleAnnotationMouseUp = (isDragging2, activeAnnotation, chart2, setDragg
25974
26167
  if (activeAnnotation) {
25975
26168
  const { centerX = -1, centerY = -1 } = calculateAnnotationMetricsInValues(activeAnnotation) ?? {};
25976
26169
  if (activeAnnotation == null ? void 0 : activeAnnotation.onDragEnd) {
25977
- activeAnnotation.onDragEnd({ x: centerX, y: centerY });
26170
+ activeAnnotation.onDragEnd(
26171
+ { x: centerX, y: centerY },
26172
+ cloneDeep(activeAnnotation)
26173
+ );
25978
26174
  }
26175
+ chart2.canvas.style.cursor = CursorStyle.Pointer;
25979
26176
  setDraggingState(false, null);
25980
26177
  }
25981
26178
  chart2.update();
25982
26179
  }
25983
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
+ };
25984
26212
  const annotationDraggerPlugin = {
25985
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
+ },
25986
26225
  afterUpdate(chart2) {
25987
26226
  var _a2, _b2, _c2, _d2;
25988
- const { canvas: canvas2, scales } = chart2;
26227
+ const { canvas: canvas2, scales, hoveredAnnotationId } = chart2;
25989
26228
  const pluginOptions = ((_b2 = (_a2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _a2.plugins) == null ? void 0 : _b2.annotationDraggerPlugin) || {
25990
26229
  enabled: false
25991
26230
  };
@@ -26004,14 +26243,15 @@ const annotationDraggerPlugin = {
26004
26243
  dragStartY = startY;
26005
26244
  }
26006
26245
  };
26007
- if (!canvas2.dataset.annotationDraggerInitialized && pluginOptions.enabled) {
26246
+ if (!canvas2.dataset.annotationDraggerInitialized && pluginOptions.enabled && hoveredAnnotationId) {
26008
26247
  canvas2.addEventListener(MouseEvents.MOUSEDOWN, (event) => {
26009
26248
  handleAnnotationMouseDown(
26010
26249
  event,
26011
26250
  canvas2,
26012
26251
  typedScales,
26013
26252
  annotations,
26014
- setDraggingState
26253
+ setDraggingState,
26254
+ chart2.hoveredAnnotationId
26015
26255
  );
26016
26256
  });
26017
26257
  canvas2.addEventListener(MouseEvents.MOUSEMOVE, (event) => {
@@ -26150,7 +26390,7 @@ const bottom = "_bottom_wpro0_161";
26150
26390
  const dropzonePlaceholder = "_dropzonePlaceholder_wpro0_165";
26151
26391
  const isActive = "_isActive_wpro0_173";
26152
26392
  const resizeContainer = "_resizeContainer_wpro0_176";
26153
- const styles$2 = {
26393
+ const styles$3 = {
26154
26394
  legend,
26155
26395
  isDragging,
26156
26396
  legendItems,
@@ -26180,6 +26420,11 @@ var ChartType = /* @__PURE__ */ ((ChartType2) => {
26180
26420
  ChartType2["SCATTER"] = "scatter";
26181
26421
  return ChartType2;
26182
26422
  })(ChartType || {});
26423
+ var ChartDirection = /* @__PURE__ */ ((ChartDirection2) => {
26424
+ ChartDirection2["VERTICAL"] = "vertical";
26425
+ ChartDirection2["HORIZONTAL"] = "horizontal";
26426
+ return ChartDirection2;
26427
+ })(ChartDirection || {});
26183
26428
  const circleSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiIGZpbGw9ImN1cnJlbnRDb2xvciIgLz48L3N2Zz4=";
26184
26429
  const rectSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHJlY3QgeD0iMiIgeT0iMiIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIiBmaWxsPSJjdXJyZW50Q29sb3IiIC8+PC9zdmc+";
26185
26430
  const rectRotSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHJlY3QgeD0iMyIgeT0iMyIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiBmaWxsPSJjdXJyZW50Q29sb3IiIHRyYW5zZm9ybT0ncm90YXRlKDQ1IDEyIDEyKScgLz48L3N2Zz4=";
@@ -26190,7 +26435,7 @@ const LineItem = ({ dataset }) => {
26190
26435
  const { borderColor, borderDash, borderWidth } = dataset;
26191
26436
  const offset = borderDash.length ? (LEGEND_SYMBOL_SIZE$1 - borderDash[0]) / 2 % (borderDash[0] + borderDash[1]) * -1 : 0;
26192
26437
  const borderDashString = ((_a2 = dataset.borderDash) == null ? void 0 : _a2.join(" ")) || "";
26193
- return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemLine, children: /* @__PURE__ */ jsx(
26438
+ return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemLine, children: /* @__PURE__ */ jsx(
26194
26439
  "svg",
26195
26440
  {
26196
26441
  xmlns: "http://www.w3.org/2000/svg",
@@ -26222,7 +26467,7 @@ const PointItem = ({ dataset }) => {
26222
26467
  rectRot: rectRotSvg,
26223
26468
  rect: rectSvg
26224
26469
  };
26225
- return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemPoint, children: /* @__PURE__ */ jsx(
26470
+ return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemPoint, children: /* @__PURE__ */ jsx(
26226
26471
  Icon,
26227
26472
  {
26228
26473
  icon: icons[pointStyle] || circleSvg,
@@ -26234,7 +26479,7 @@ const PointItem = ({ dataset }) => {
26234
26479
  const BoxItem = ({ dataset }) => {
26235
26480
  const { backgroundColor } = dataset;
26236
26481
  const style = { backgroundColor };
26237
- return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemBox, style });
26482
+ return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemBox, style });
26238
26483
  };
26239
26484
  const LegendItemLine = ({ dataset }) => {
26240
26485
  const { annotationType, showLine } = dataset;
@@ -26257,11 +26502,11 @@ const renderLegendItemSymbol = (dataset, chartType) => {
26257
26502
  case ChartType.LINE:
26258
26503
  return /* @__PURE__ */ jsx(LegendItemLine, { dataset });
26259
26504
  case ChartType.BAR:
26260
- 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 }) });
26261
26506
  case ChartType.PIE:
26262
- 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 }) });
26263
26508
  case ChartType.SCATTER:
26264
- 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 }) });
26265
26510
  default:
26266
26511
  return null;
26267
26512
  }
@@ -26275,18 +26520,18 @@ const LegendItem = ({
26275
26520
  return /* @__PURE__ */ jsxs(
26276
26521
  "div",
26277
26522
  {
26278
- className: cx(styles$2.legendItem, hidden && styles$2.isHidden),
26523
+ className: cx(styles$3.legendItem, hidden && styles$3.isHidden),
26279
26524
  onClick: handleClick,
26280
26525
  children: [
26281
26526
  /* @__PURE__ */ jsx(
26282
26527
  "span",
26283
26528
  {
26284
- className: styles$2.legendItemSymbol,
26529
+ className: styles$3.legendItemSymbol,
26285
26530
  style: { width: LEGEND_SYMBOL_SIZE },
26286
26531
  children: renderLegendItemSymbol(dataset, chartType)
26287
26532
  }
26288
26533
  ),
26289
- /* @__PURE__ */ jsx("span", { className: styles$2.legendItemText, children: dataset.label })
26534
+ /* @__PURE__ */ jsx("span", { className: styles$3.legendItemText, children: dataset.label })
26290
26535
  ]
26291
26536
  }
26292
26537
  );
@@ -26353,7 +26598,7 @@ const LegendItems = ({
26353
26598
  datasets,
26354
26599
  legendClick,
26355
26600
  chartType
26356
- }) => /* @__PURE__ */ jsx("div", { className: styles$2.legendItems, children: items.map((item) => {
26601
+ }) => /* @__PURE__ */ jsx("div", { className: styles$3.legendItems, children: items.map((item) => {
26357
26602
  if (datasets[item.datasetIndex].hideLegend) {
26358
26603
  return null;
26359
26604
  }
@@ -26386,13 +26631,13 @@ const LegendPanel = forwardRef(
26386
26631
  {
26387
26632
  ref,
26388
26633
  className: cx(
26389
- styles$2.legend,
26390
- !legendEnabled && styles$2.isHidden,
26391
- isDragging2 && styles$2.isDragging
26634
+ styles$3.legend,
26635
+ !legendEnabled && styles$3.isHidden,
26636
+ isDragging2 && styles$3.isDragging
26392
26637
  ),
26393
26638
  style,
26394
26639
  children: [
26395
- /* @__PURE__ */ jsx("div", { className: styles$2.legendToggle, children: /* @__PURE__ */ jsx(
26640
+ /* @__PURE__ */ jsx("div", { className: styles$3.legendToggle, children: /* @__PURE__ */ jsx(
26396
26641
  Button,
26397
26642
  {
26398
26643
  onClick: () => setLegendEnabled(!legendEnabled),
@@ -26431,17 +26676,17 @@ const LegendDropZone = (legendDropZoneProps) => {
26431
26676
  {
26432
26677
  ref: dropRef,
26433
26678
  className: cx(
26434
- styles$2.dropzone,
26435
- isActive2 && styles$2.isActive,
26436
- position.includes("left") && styles$2.left,
26437
- position.includes("right") && styles$2.right,
26438
- position.includes("top") && styles$2.top,
26439
- 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
26440
26685
  ),
26441
26686
  children: /* @__PURE__ */ jsx(
26442
26687
  "div",
26443
26688
  {
26444
- className: styles$2.dropzonePlaceholder,
26689
+ className: styles$3.dropzonePlaceholder,
26445
26690
  style: { ...placeholderSize, margin: LEGEND_MARGIN }
26446
26691
  }
26447
26692
  )
@@ -26460,7 +26705,7 @@ const LegendDropZones = (legendDropZonesProps) => {
26460
26705
  return /* @__PURE__ */ jsx(
26461
26706
  "div",
26462
26707
  {
26463
- className: styles$2.dropzoneContainer,
26708
+ className: styles$3.dropzoneContainer,
26464
26709
  style: {
26465
26710
  top: top2,
26466
26711
  left: left2,
@@ -26502,7 +26747,7 @@ const Legend2 = ({ chartRef, legendConfig }) => {
26502
26747
  })
26503
26748
  }));
26504
26749
  return /* @__PURE__ */ jsxs(Fragment, { children: [
26505
- /* @__PURE__ */ jsx("div", { ref: resizeRef, className: styles$2.resizeContainer }),
26750
+ /* @__PURE__ */ jsx("div", { ref: resizeRef, className: styles$3.resizeContainer }),
26506
26751
  /* @__PURE__ */ jsx(
26507
26752
  LegendPanel,
26508
26753
  {
@@ -26549,7 +26794,7 @@ const LineChart = (props) => {
26549
26794
  const chartRef = useRef(null);
26550
26795
  const { table: table2 } = props;
26551
26796
  const { translations, languageKey } = getConfig();
26552
- const chart2 = getDefaultProps$2(props);
26797
+ const chart2 = getDefaultProps$3(props);
26553
26798
  const {
26554
26799
  data: { datasets } = { datasets: [] },
26555
26800
  options,
@@ -26596,7 +26841,7 @@ const LineChart = (props) => {
26596
26841
  return /* @__PURE__ */ jsxs(
26597
26842
  "div",
26598
26843
  {
26599
- className: getClassName(chartStyling, styles$4),
26844
+ className: getClassName(chartStyling, styles$5),
26600
26845
  style: {
26601
26846
  width: chartStyling.width || AUTO,
26602
26847
  height: chartStyling.height || AUTO
@@ -26619,7 +26864,7 @@ const LineChart = (props) => {
26619
26864
  controlsPortalId
26620
26865
  }
26621
26866
  ),
26622
- 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: [
26623
26868
  /* @__PURE__ */ jsx(
26624
26869
  Line,
26625
26870
  {
@@ -26655,7 +26900,7 @@ const LineChart = (props) => {
26655
26900
  );
26656
26901
  };
26657
26902
  const LineChartWithLegend = (props) => {
26658
- const { options } = getDefaultProps$2(props);
26903
+ const { options } = getDefaultProps$3(props);
26659
26904
  return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(LineChart, { ...props }) });
26660
26905
  };
26661
26906
  const initializeLineChart = ({ languageKey = "en", ...options }) => {
@@ -26669,73 +26914,73 @@ const initializeLineChart = ({ languageKey = "en", ...options }) => {
26669
26914
  }
26670
26915
  });
26671
26916
  };
26672
- const chart$1 = "_chart_1jdnu_1";
26673
- const fixedHeight$1 = "_fixedHeight_1jdnu_13";
26674
- const stretchHeight$1 = "_stretchHeight_1jdnu_19";
26675
- const zoomForm$1 = "_zoomForm_1jdnu_32";
26676
- const zoomReset$1 = "_zoomReset_1jdnu_40";
26677
- const help$1 = "_help_1jdnu_43";
26678
- const autoWeight$1 = "_autoWeight_1jdnu_47";
26679
- const styles$1 = {
26680
- chart: chart$1,
26681
- fixedHeight: fixedHeight$1,
26682
- stretchHeight: stretchHeight$1,
26683
- zoomForm: zoomForm$1,
26684
- zoomReset: zoomReset$1,
26685
- help: help$1,
26686
- 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
26687
26932
  };
26688
- const defaultChartStyling$1 = (styling) => ({
26933
+ const defaultChartStyling$2 = (styling) => ({
26689
26934
  width: styling == null ? void 0 : styling.width,
26690
26935
  height: styling == null ? void 0 : styling.height,
26691
26936
  maintainAspectRatio: (styling == null ? void 0 : styling.maintainAspectRatio) || false,
26692
26937
  staticChartHeight: (styling == null ? void 0 : styling.staticChartHeight) || false,
26693
26938
  performanceMode: (styling == null ? void 0 : styling.performanceMode) ?? true
26694
26939
  });
26695
- const defaultTooltip$1 = (tooltip) => ({
26940
+ const defaultTooltip$2 = (tooltip) => ({
26696
26941
  tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
26697
26942
  showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) || false
26698
26943
  });
26699
- const defaultGraph$1 = (graph) => ({
26944
+ const defaultGraph$2 = (graph) => ({
26700
26945
  showDataLabels: (graph == null ? void 0 : graph.showDataLabels) || false,
26701
26946
  stacked: (graph == null ? void 0 : graph.stacked) || false,
26702
26947
  cutout: (graph == null ? void 0 : graph.cutout) || 0
26703
26948
  });
26704
- const defaultLegend$1 = (legend2) => ({
26949
+ const defaultLegend$2 = (legend2) => ({
26705
26950
  display: (legend2 == null ? void 0 : legend2.display) ?? true,
26706
26951
  useDataset: (legend2 == null ? void 0 : legend2.useDataset) || false,
26707
26952
  position: (legend2 == null ? void 0 : legend2.position) || Position.Bottom,
26708
26953
  align: (legend2 == null ? void 0 : legend2.align) || AlignOptions.Center
26709
26954
  });
26710
- const defaultChartOptions$1 = (options) => ({
26955
+ const defaultChartOptions$2 = (options) => ({
26711
26956
  enableZoom: (options == null ? void 0 : options.enableZoom) || false,
26712
26957
  enablePan: (options == null ? void 0 : options.enablePan) || false
26713
26958
  });
26714
- const defaultInteractions$1 = (interactions) => ({
26959
+ const defaultInteractions$2 = (interactions) => ({
26715
26960
  onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
26716
26961
  onHover: interactions == null ? void 0 : interactions.onHover,
26717
26962
  onUnhover: interactions == null ? void 0 : interactions.onUnhover
26718
26963
  });
26719
- const defaultChartData = (data) => {
26964
+ const defaultChartData$1 = (data) => {
26720
26965
  return {
26721
26966
  labels: (data == null ? void 0 : data.labels) || [],
26722
26967
  datasets: (data == null ? void 0 : data.datasets) || []
26723
26968
  };
26724
26969
  };
26725
- const getDefaultProps$1 = (props) => {
26970
+ const getDefaultProps$2 = (props) => {
26726
26971
  const chart2 = (props == null ? void 0 : props.chart) || {};
26727
26972
  const options = (chart2 == null ? void 0 : chart2.options) || {};
26728
26973
  return {
26729
26974
  testId: (chart2 == null ? void 0 : chart2.testId) ?? null,
26730
- data: defaultChartData(chart2 == null ? void 0 : chart2.data),
26975
+ data: defaultChartData$1(chart2 == null ? void 0 : chart2.data),
26731
26976
  options: {
26732
26977
  title: (options == null ? void 0 : options.title) || "",
26733
- chartStyling: defaultChartStyling$1(options == null ? void 0 : options.chartStyling),
26734
- tooltip: defaultTooltip$1(options == null ? void 0 : options.tooltip),
26735
- graph: defaultGraph$1(options == null ? void 0 : options.graph),
26736
- legend: defaultLegend$1(options == null ? void 0 : options.legend),
26737
- chartOptions: defaultChartOptions$1(options == null ? void 0 : options.chartOptions),
26738
- 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)
26739
26984
  }
26740
26985
  };
26741
26986
  };
@@ -26923,7 +27168,7 @@ Chart$2.register(
26923
27168
  );
26924
27169
  const PieChart = (props) => {
26925
27170
  setDefaultTheme();
26926
- const chart2 = getDefaultProps$1(props);
27171
+ const chart2 = getDefaultProps$2(props);
26927
27172
  const chartRef = useRef(null);
26928
27173
  const { data, options, testId } = chart2;
26929
27174
  const {
@@ -26939,8 +27184,8 @@ const PieChart = (props) => {
26939
27184
  "div",
26940
27185
  {
26941
27186
  className: cx(
26942
- styles$1.chart,
26943
- !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 : ""
26944
27189
  ),
26945
27190
  style: {
26946
27191
  width: options.chartStyling.width || "auto",
@@ -26984,7 +27229,7 @@ const PieChart = (props) => {
26984
27229
  );
26985
27230
  };
26986
27231
  const PieChartWithLegend = (props) => {
26987
- const { options } = getDefaultProps$1(props);
27232
+ const { options } = getDefaultProps$2(props);
26988
27233
  return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(PieChart, { ...props }) });
26989
27234
  };
26990
27235
  /*!
@@ -39573,7 +39818,7 @@ const getBarChartToolTips = (options) => {
39573
39818
  valueUnit: (yAxis == null ? void 0 : yAxis.unit) || ""
39574
39819
  };
39575
39820
  };
39576
- const titleCallback = (tooltipItems, _data) => {
39821
+ const titleCallback2 = (tooltipItems, _data) => {
39577
39822
  var _a3, _b2;
39578
39823
  const barLabel = ((_a3 = tooltipItems == null ? void 0 : tooltipItems[0]) == null ? void 0 : _a3.label) || "";
39579
39824
  const labels = getTooltipLabels((_b2 = tooltipItems == null ? void 0 : tooltipItems[0]) == null ? void 0 : _b2.dataset);
@@ -39588,7 +39833,7 @@ const getBarChartToolTips = (options) => {
39588
39833
  }
39589
39834
  return displayNumber(roundByMagnitude(labelNumber), roundOptions);
39590
39835
  };
39591
- const labelCallback = (tooltipItem) => {
39836
+ const labelCallback2 = (tooltipItem) => {
39592
39837
  var _a3;
39593
39838
  const { showLabelsInTooltips = false } = (options == null ? void 0 : options.tooltip) || {};
39594
39839
  let label = ((_a3 = tooltipItem.dataset) == null ? void 0 : _a3.label) || "";
@@ -39630,8 +39875,8 @@ const getBarChartToolTips = (options) => {
39630
39875
  boxHeight: LEGEND_LABEL_BOX_SIZE,
39631
39876
  boxPadding: TOOLTIP_BOX_PADDING,
39632
39877
  callbacks: {
39633
- title: titleCallback,
39634
- label: labelCallback,
39878
+ title: titleCallback2,
39879
+ label: labelCallback2,
39635
39880
  afterLabel: afterLabelCallback
39636
39881
  }
39637
39882
  };
@@ -39674,31 +39919,31 @@ const useBarChartOptions = ({
39674
39919
  }
39675
39920
  };
39676
39921
  };
39677
- const chart = "_chart_x1sru_1";
39922
+ const chart$1 = "_chart_x1sru_1";
39678
39923
  const canvas = "_canvas_x1sru_10";
39679
- const fixedHeight = "_fixedHeight_x1sru_19";
39680
- const stretchHeight = "_stretchHeight_x1sru_25";
39681
- const zoomForm = "_zoomForm_x1sru_38";
39682
- const zoomReset = "_zoomReset_x1sru_46";
39683
- const help = "_help_x1sru_49";
39684
- 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";
39685
39930
  const actions = "_actions_x1sru_57";
39686
- const styles = {
39687
- chart,
39931
+ const styles$1 = {
39932
+ chart: chart$1,
39688
39933
  canvas,
39689
- fixedHeight,
39690
- stretchHeight,
39691
- zoomForm,
39692
- zoomReset,
39693
- help,
39694
- 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,
39695
39940
  actions
39696
39941
  };
39697
- const defaultAxes = (axes) => ({
39942
+ const defaultAxes$1 = (axes) => ({
39698
39943
  x: (axes == null ? void 0 : axes.x) || [{}],
39699
39944
  y: (axes == null ? void 0 : axes.y) || [{}]
39700
39945
  });
39701
- const defaultAdditionalAxesOptions = (options) => ({
39946
+ const defaultAdditionalAxesOptions$1 = (options) => ({
39702
39947
  chartScaleType: (options == null ? void 0 : options.chartScaleType) || "linear",
39703
39948
  reverse: (options == null ? void 0 : options.reverse) || false,
39704
39949
  stacked: (options == null ? void 0 : options.stacked) || false,
@@ -39709,30 +39954,30 @@ const defaultAdditionalAxesOptions = (options) => ({
39709
39954
  min: options == null ? void 0 : options.min,
39710
39955
  max: options == null ? void 0 : options.max
39711
39956
  });
39712
- const defaultChartStyling = (styling) => ({
39957
+ const defaultChartStyling$1 = (styling) => ({
39713
39958
  width: styling == null ? void 0 : styling.width,
39714
39959
  height: styling == null ? void 0 : styling.height,
39715
39960
  maintainAspectRatio: (styling == null ? void 0 : styling.maintainAspectRatio) || false,
39716
39961
  staticChartHeight: (styling == null ? void 0 : styling.staticChartHeight) || false,
39717
39962
  performanceMode: (styling == null ? void 0 : styling.performanceMode) ?? true
39718
39963
  });
39719
- const defaultTooltip = (tooltip) => ({
39964
+ const defaultTooltip$1 = (tooltip) => ({
39720
39965
  tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
39721
39966
  showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) || false
39722
39967
  });
39723
- const defaultGraph = (graph) => ({
39968
+ const defaultGraph$1 = (graph) => ({
39724
39969
  showDataLabels: (graph == null ? void 0 : graph.showDataLabels) || false,
39725
39970
  showMinorGridlines: (graph == null ? void 0 : graph.showMinorGridlines) || false
39726
39971
  });
39727
- const defaultAnnotationsData = (annotationsData) => {
39972
+ const defaultAnnotationsData$1 = (annotationsData) => {
39728
39973
  return annotationsData ? annotationsData.map((ann) => ({ ...ann, display: (ann == null ? void 0 : ann.display) ?? true })) : [];
39729
39974
  };
39730
- const defaultAnnotations = (annotations) => ({
39975
+ const defaultAnnotations$1 = (annotations) => ({
39731
39976
  showAnnotations: (annotations == null ? void 0 : annotations.showAnnotations) ?? true,
39732
39977
  controlAnnotation: (annotations == null ? void 0 : annotations.controlAnnotation) || false,
39733
- annotationsData: defaultAnnotationsData(annotations == null ? void 0 : annotations.annotationsData)
39978
+ annotationsData: defaultAnnotationsData$1(annotations == null ? void 0 : annotations.annotationsData)
39734
39979
  });
39735
- const defaultLegend = (legend2) => ({
39980
+ const defaultLegend$1 = (legend2) => ({
39736
39981
  display: (legend2 == null ? void 0 : legend2.display) ?? true,
39737
39982
  position: (legend2 == null ? void 0 : legend2.position) || Position.TopLeft,
39738
39983
  align: (legend2 == null ? void 0 : legend2.align) || AlignOptions.Center,
@@ -39741,11 +39986,11 @@ const defaultLegend = (legend2) => ({
39741
39986
  customLegendContainerID: ""
39742
39987
  }
39743
39988
  });
39744
- const defaultChartOptions = (options) => ({
39989
+ const defaultChartOptions$1 = (options) => ({
39745
39990
  enableZoom: (options == null ? void 0 : options.enableZoom) || false,
39746
39991
  enablePan: (options == null ? void 0 : options.enablePan) || false
39747
39992
  });
39748
- const defaultInteractions = (interactions) => ({
39993
+ const defaultInteractions$1 = (interactions) => ({
39749
39994
  onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
39750
39995
  onHover: interactions == null ? void 0 : interactions.onHover,
39751
39996
  onUnhover: interactions == null ? void 0 : interactions.onUnhover
@@ -39760,7 +40005,7 @@ const defaultDragData = (dragData) => ({
39760
40005
  onDrag: dragData == null ? void 0 : dragData.onDrag,
39761
40006
  onDragEnd: dragData == null ? void 0 : dragData.onDragEnd
39762
40007
  });
39763
- const getDefaultProps = (props) => {
40008
+ const getDefaultProps$1 = (props) => {
39764
40009
  const chart2 = (props == null ? void 0 : props.chart) || {};
39765
40010
  const options = (chart2 == null ? void 0 : chart2.options) || {};
39766
40011
  return {
@@ -39769,17 +40014,17 @@ const getDefaultProps = (props) => {
39769
40014
  options: {
39770
40015
  title: (options == null ? void 0 : options.title) || "",
39771
40016
  direction: (options == null ? void 0 : options.direction) || "vertical",
39772
- axes: defaultAxes(options == null ? void 0 : options.axes),
39773
- additionalAxesOptions: defaultAdditionalAxesOptions(
40017
+ axes: defaultAxes$1(options == null ? void 0 : options.axes),
40018
+ additionalAxesOptions: defaultAdditionalAxesOptions$1(
39774
40019
  options == null ? void 0 : options.additionalAxesOptions
39775
40020
  ),
39776
- chartStyling: defaultChartStyling(options == null ? void 0 : options.chartStyling),
39777
- tooltip: defaultTooltip(options == null ? void 0 : options.tooltip),
39778
- graph: defaultGraph(options == null ? void 0 : options.graph),
39779
- annotations: defaultAnnotations(options == null ? void 0 : options.annotations),
39780
- legend: defaultLegend(options == null ? void 0 : options.legend),
39781
- chartOptions: defaultChartOptions(options == null ? void 0 : options.chartOptions),
39782
- 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),
39783
40028
  dragData: defaultDragData(options == null ? void 0 : options.dragData)
39784
40029
  }
39785
40030
  };
@@ -39802,7 +40047,7 @@ const BarChart = (props) => {
39802
40047
  var _a2, _b2, _c2, _d2;
39803
40048
  setDefaultTheme();
39804
40049
  const chartRef = useRef(null);
39805
- const chart2 = getDefaultProps(props);
40050
+ const chart2 = getDefaultProps$1(props);
39806
40051
  const { translations, languageKey } = getConfig();
39807
40052
  const { options, testId } = chart2;
39808
40053
  const { chartStyling, graph } = options;
@@ -39812,14 +40057,14 @@ const BarChart = (props) => {
39812
40057
  return /* @__PURE__ */ jsxs(
39813
40058
  "div",
39814
40059
  {
39815
- className: getClassName(chartStyling, styles),
40060
+ className: getClassName(chartStyling, styles$1),
39816
40061
  style: {
39817
40062
  width: chartStyling.width || AUTO,
39818
40063
  height: chartStyling.height || AUTO
39819
40064
  },
39820
40065
  "data-testid": testId,
39821
40066
  children: [
39822
- /* @__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(
39823
40068
  Button,
39824
40069
  {
39825
40070
  small: true,
@@ -39830,7 +40075,7 @@ const BarChart = (props) => {
39830
40075
  onClick: () => downloadPgn(chartRef)
39831
40076
  }
39832
40077
  ) }) }),
39833
- /* @__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: [
39834
40079
  /* @__PURE__ */ jsx(
39835
40080
  Bar,
39836
40081
  {
@@ -39861,13 +40106,342 @@ const BarChart = (props) => {
39861
40106
  );
39862
40107
  };
39863
40108
  const BarChartWithLegend = (props) => {
39864
- const { options } = getDefaultProps(props);
40109
+ const { options } = getDefaultProps$1(props);
39865
40110
  return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(BarChart, { ...props }) });
39866
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
+ };
39867
40440
  export {
39868
40441
  BarChartWithLegend as BarChart,
39869
40442
  LineChartWithLegend as LineChart,
39870
40443
  PieChartWithLegend as PieChart,
40444
+ ScatterChartWithLegend as ScatterChart,
39871
40445
  initializeLineChart
39872
40446
  };
39873
40447
  //# sourceMappingURL=index.js.map
@@ -39876,7 +40450,7 @@ export {
39876
40450
  try {
39877
40451
  if (typeof document != "undefined") {
39878
40452
  var elementStyle = document.createElement("style");
39879
- 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}"));
39880
40454
  document.head.appendChild(elementStyle);
39881
40455
  }
39882
40456
  } catch (e) {