@oliasoft-open-source/charts-library 4.2.1 → 4.3.0-beta-2
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 +488 -675
- package/dist/index.js.map +1 -1
- package/dist/src/components/common/common.interface.d.ts +15 -0
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +14 -4
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +14 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +15 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +6 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +22 -0
- package/dist/src/components/line-chart/constants/default-translations.d.ts +1 -0
- package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +4 -1
- package/dist/src/components/line-chart/controls/drag-options.d.ts +1 -1
- package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +1 -0
- package/dist/src/components/line-chart/line-chart.stories.d.ts +93 -0
- package/dist/src/components/line-chart/state/action-types.d.ts +1 -0
- package/dist/src/components/line-chart/state/state.interfaces.d.ts +1 -0
- package/package.json +1 -1
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;
|
|
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,130 +4914,6 @@ 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);
|
|
5041
4917
|
function abstract$1() {
|
|
5042
4918
|
throw new Error("This method is not implemented: Check that a complete date adapter is provided.");
|
|
5043
4919
|
}
|
|
@@ -5927,7 +5803,7 @@ function _detectPlatform$1(canvas2) {
|
|
|
5927
5803
|
}
|
|
5928
5804
|
return DomPlatform$1;
|
|
5929
5805
|
}
|
|
5930
|
-
let Element$2 = (
|
|
5806
|
+
let Element$2 = (_f = class {
|
|
5931
5807
|
constructor() {
|
|
5932
5808
|
__publicField(this, "x");
|
|
5933
5809
|
__publicField(this, "y");
|
|
@@ -5959,7 +5835,7 @@ let Element$2 = (_g = class {
|
|
|
5959
5835
|
});
|
|
5960
5836
|
return ret;
|
|
5961
5837
|
}
|
|
5962
|
-
}, __publicField(
|
|
5838
|
+
}, __publicField(_f, "defaults", {}), __publicField(_f, "defaultRoutes"), _f);
|
|
5963
5839
|
function autoSkip$1(scale, ticks) {
|
|
5964
5840
|
const tickOpts = scale.options.ticks;
|
|
5965
5841
|
const determinedMaxTicks = determineMaxTicks$1(scale);
|
|
@@ -8046,7 +7922,7 @@ function getDatasetArea(meta, chartArea) {
|
|
|
8046
7922
|
}
|
|
8047
7923
|
return chartArea;
|
|
8048
7924
|
}
|
|
8049
|
-
let Chart$2 = (
|
|
7925
|
+
let Chart$2 = (_g = class {
|
|
8050
7926
|
static register(...items) {
|
|
8051
7927
|
registry$1.add(...items);
|
|
8052
7928
|
invalidatePlugins$1();
|
|
@@ -8866,7 +8742,7 @@ let Chart$2 = (_h = class {
|
|
|
8866
8742
|
const hoverOptions = this.options.hover;
|
|
8867
8743
|
return this.getElementsAtEventForMode(e2, hoverOptions.mode, hoverOptions, useFinalPosition);
|
|
8868
8744
|
}
|
|
8869
|
-
}, __publicField(
|
|
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);
|
|
8870
8746
|
function invalidatePlugins$1() {
|
|
8871
8747
|
return each$1(Chart$2.instances, (chart2) => chart2._plugins.invalidate());
|
|
8872
8748
|
}
|
|
@@ -9028,7 +8904,7 @@ function drawBorder$1(ctx, element, offset, spacing, circular) {
|
|
|
9028
8904
|
ctx.stroke();
|
|
9029
8905
|
}
|
|
9030
8906
|
}
|
|
9031
|
-
let ArcElement$1 = (
|
|
8907
|
+
let ArcElement$1 = (_h = class extends Element$2 {
|
|
9032
8908
|
constructor(cfg) {
|
|
9033
8909
|
super();
|
|
9034
8910
|
__publicField(this, "circumference");
|
|
@@ -9113,7 +8989,7 @@ let ArcElement$1 = (_i = class extends Element$2 {
|
|
|
9113
8989
|
drawBorder$1(ctx, this, radiusOffset, spacing, circular);
|
|
9114
8990
|
ctx.restore();
|
|
9115
8991
|
}
|
|
9116
|
-
}, __publicField(
|
|
8992
|
+
}, __publicField(_h, "id", "arc"), __publicField(_h, "defaults", {
|
|
9117
8993
|
borderAlign: "center",
|
|
9118
8994
|
borderColor: "#fff",
|
|
9119
8995
|
borderDash: [],
|
|
@@ -9125,12 +9001,12 @@ let ArcElement$1 = (_i = class extends Element$2 {
|
|
|
9125
9001
|
spacing: 0,
|
|
9126
9002
|
angle: void 0,
|
|
9127
9003
|
circular: true
|
|
9128
|
-
}), __publicField(
|
|
9004
|
+
}), __publicField(_h, "defaultRoutes", {
|
|
9129
9005
|
backgroundColor: "backgroundColor"
|
|
9130
|
-
}), __publicField(
|
|
9006
|
+
}), __publicField(_h, "descriptors", {
|
|
9131
9007
|
_scriptable: true,
|
|
9132
9008
|
_indexable: (name) => name !== "borderDash"
|
|
9133
|
-
}),
|
|
9009
|
+
}), _h);
|
|
9134
9010
|
function setStyle$1(ctx, options, style = options) {
|
|
9135
9011
|
ctx.lineCap = valueOrDefault$1(style.borderCapStyle, options.borderCapStyle);
|
|
9136
9012
|
ctx.setLineDash(valueOrDefault$1(style.borderDash, options.borderDash));
|
|
@@ -9283,7 +9159,7 @@ function draw$3(ctx, line, start, count) {
|
|
|
9283
9159
|
strokePathDirect$1(ctx, line, start, count);
|
|
9284
9160
|
}
|
|
9285
9161
|
}
|
|
9286
|
-
let LineElement$1 = (
|
|
9162
|
+
let LineElement$1 = (_i = class extends Element$2 {
|
|
9287
9163
|
constructor(cfg) {
|
|
9288
9164
|
super();
|
|
9289
9165
|
this.animated = true;
|
|
@@ -9393,7 +9269,7 @@ let LineElement$1 = (_j = class extends Element$2 {
|
|
|
9393
9269
|
this._path = void 0;
|
|
9394
9270
|
}
|
|
9395
9271
|
}
|
|
9396
|
-
}, __publicField(
|
|
9272
|
+
}, __publicField(_i, "id", "line"), __publicField(_i, "defaults", {
|
|
9397
9273
|
borderCapStyle: "butt",
|
|
9398
9274
|
borderDash: [],
|
|
9399
9275
|
borderDashOffset: 0,
|
|
@@ -9405,13 +9281,13 @@ let LineElement$1 = (_j = class extends Element$2 {
|
|
|
9405
9281
|
spanGaps: false,
|
|
9406
9282
|
stepped: false,
|
|
9407
9283
|
tension: 0
|
|
9408
|
-
}), __publicField(
|
|
9284
|
+
}), __publicField(_i, "defaultRoutes", {
|
|
9409
9285
|
backgroundColor: "backgroundColor",
|
|
9410
9286
|
borderColor: "borderColor"
|
|
9411
|
-
}), __publicField(
|
|
9287
|
+
}), __publicField(_i, "descriptors", {
|
|
9412
9288
|
_scriptable: true,
|
|
9413
9289
|
_indexable: (name) => name !== "borderDash" && name !== "fill"
|
|
9414
|
-
}),
|
|
9290
|
+
}), _i);
|
|
9415
9291
|
function inRange$1$1(el, pos, axis, useFinalPosition) {
|
|
9416
9292
|
const options = el.options;
|
|
9417
9293
|
const { [axis]: value } = el.getProps([
|
|
@@ -9419,7 +9295,7 @@ function inRange$1$1(el, pos, axis, useFinalPosition) {
|
|
|
9419
9295
|
], useFinalPosition);
|
|
9420
9296
|
return Math.abs(pos - value) < options.radius + options.hitRadius;
|
|
9421
9297
|
}
|
|
9422
|
-
let PointElement$1 = (
|
|
9298
|
+
let PointElement$1 = (_j = class extends Element$2 {
|
|
9423
9299
|
constructor(cfg) {
|
|
9424
9300
|
super();
|
|
9425
9301
|
__publicField(this, "parsed");
|
|
@@ -9478,10 +9354,10 @@ let PointElement$1 = (_k = class extends Element$2 {
|
|
|
9478
9354
|
const options = this.options || {};
|
|
9479
9355
|
return options.radius + options.hitRadius;
|
|
9480
9356
|
}
|
|
9481
|
-
}, __publicField(
|
|
9357
|
+
}, __publicField(_j, "id", "point"), /**
|
|
9482
9358
|
* @type {any}
|
|
9483
9359
|
*/
|
|
9484
|
-
__publicField(
|
|
9360
|
+
__publicField(_j, "defaults", {
|
|
9485
9361
|
borderWidth: 1,
|
|
9486
9362
|
hitRadius: 1,
|
|
9487
9363
|
hoverBorderWidth: 1,
|
|
@@ -9492,10 +9368,10 @@ __publicField(_k, "defaults", {
|
|
|
9492
9368
|
}), /**
|
|
9493
9369
|
* @type {any}
|
|
9494
9370
|
*/
|
|
9495
|
-
__publicField(
|
|
9371
|
+
__publicField(_j, "defaultRoutes", {
|
|
9496
9372
|
backgroundColor: "backgroundColor",
|
|
9497
9373
|
borderColor: "borderColor"
|
|
9498
|
-
}),
|
|
9374
|
+
}), _j);
|
|
9499
9375
|
function getBarBounds$1(bar, useFinalPosition) {
|
|
9500
9376
|
const { x: x2, y: y2, base, width, height } = bar.getProps([
|
|
9501
9377
|
"x",
|
|
@@ -9609,7 +9485,7 @@ function inflateRect$1(rect, amount, refRect = {}) {
|
|
|
9609
9485
|
radius: rect.radius
|
|
9610
9486
|
};
|
|
9611
9487
|
}
|
|
9612
|
-
let BarElement$1 = (
|
|
9488
|
+
let BarElement$1 = (_k = class extends Element$2 {
|
|
9613
9489
|
constructor(cfg) {
|
|
9614
9490
|
super();
|
|
9615
9491
|
this.options = void 0;
|
|
@@ -9665,16 +9541,16 @@ let BarElement$1 = (_l = class extends Element$2 {
|
|
|
9665
9541
|
getRange(axis) {
|
|
9666
9542
|
return axis === "x" ? this.width / 2 : this.height / 2;
|
|
9667
9543
|
}
|
|
9668
|
-
}, __publicField(
|
|
9544
|
+
}, __publicField(_k, "id", "bar"), __publicField(_k, "defaults", {
|
|
9669
9545
|
borderSkipped: "start",
|
|
9670
9546
|
borderWidth: 0,
|
|
9671
9547
|
borderRadius: 0,
|
|
9672
9548
|
inflateAmount: "auto",
|
|
9673
9549
|
pointStyle: void 0
|
|
9674
|
-
}), __publicField(
|
|
9550
|
+
}), __publicField(_k, "defaultRoutes", {
|
|
9675
9551
|
backgroundColor: "backgroundColor",
|
|
9676
9552
|
borderColor: "borderColor"
|
|
9677
|
-
}),
|
|
9553
|
+
}), _k);
|
|
9678
9554
|
function _segments(line, target, property) {
|
|
9679
9555
|
const segments = line.segments;
|
|
9680
9556
|
const points = line.points;
|
|
@@ -11243,7 +11119,7 @@ function invokeCallbackWithFallback(callbacks, name, ctx, arg) {
|
|
|
11243
11119
|
}
|
|
11244
11120
|
return result;
|
|
11245
11121
|
}
|
|
11246
|
-
let Tooltip$1 = (
|
|
11122
|
+
let Tooltip$1 = (_l = class extends Element$2 {
|
|
11247
11123
|
constructor(config2) {
|
|
11248
11124
|
super();
|
|
11249
11125
|
this.opacity = 0;
|
|
@@ -11782,7 +11658,7 @@ let Tooltip$1 = (_m = class extends Element$2 {
|
|
|
11782
11658
|
const position = positioners$2[options.position].call(this, active, e2);
|
|
11783
11659
|
return position !== false && (caretX !== position.x || caretY !== position.y);
|
|
11784
11660
|
}
|
|
11785
|
-
}, __publicField(
|
|
11661
|
+
}, __publicField(_l, "positioners", positioners$2), _l);
|
|
11786
11662
|
var plugin_tooltip = {
|
|
11787
11663
|
id: "tooltip",
|
|
11788
11664
|
_element: Tooltip$1,
|
|
@@ -11937,7 +11813,7 @@ function _getLabelForValue(value) {
|
|
|
11937
11813
|
}
|
|
11938
11814
|
return value;
|
|
11939
11815
|
}
|
|
11940
|
-
let CategoryScale$1 = (
|
|
11816
|
+
let CategoryScale$1 = (_m = class extends Scale$1 {
|
|
11941
11817
|
constructor(cfg) {
|
|
11942
11818
|
super(cfg);
|
|
11943
11819
|
this._startValue = void 0;
|
|
@@ -12023,11 +11899,11 @@ let CategoryScale$1 = (_n = class extends Scale$1 {
|
|
|
12023
11899
|
getBasePixel() {
|
|
12024
11900
|
return this.bottom;
|
|
12025
11901
|
}
|
|
12026
|
-
}, __publicField(
|
|
11902
|
+
}, __publicField(_m, "id", "category"), __publicField(_m, "defaults", {
|
|
12027
11903
|
ticks: {
|
|
12028
11904
|
callback: _getLabelForValue
|
|
12029
11905
|
}
|
|
12030
|
-
}),
|
|
11906
|
+
}), _m);
|
|
12031
11907
|
function generateTicks$1$1(generationOptions, dataRange) {
|
|
12032
11908
|
const ticks = [];
|
|
12033
11909
|
const MIN_SPACING = 1e-14;
|
|
@@ -12250,7 +12126,7 @@ let LinearScaleBase$1 = class LinearScaleBase extends Scale$1 {
|
|
|
12250
12126
|
return formatNumber$1(value, this.chart.options.locale, this.options.ticks.format);
|
|
12251
12127
|
}
|
|
12252
12128
|
};
|
|
12253
|
-
let LinearScale$1 = (
|
|
12129
|
+
let LinearScale$1 = (_n = class extends LinearScaleBase$1 {
|
|
12254
12130
|
determineDataLimits() {
|
|
12255
12131
|
const { min, max } = this.getMinMax(true);
|
|
12256
12132
|
this.min = isNumberFinite$1(min) ? min : 0;
|
|
@@ -12271,11 +12147,11 @@ let LinearScale$1 = (_o = class extends LinearScaleBase$1 {
|
|
|
12271
12147
|
getValueForPixel(pixel) {
|
|
12272
12148
|
return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;
|
|
12273
12149
|
}
|
|
12274
|
-
}, __publicField(
|
|
12150
|
+
}, __publicField(_n, "id", "linear"), __publicField(_n, "defaults", {
|
|
12275
12151
|
ticks: {
|
|
12276
12152
|
callback: Ticks$1.formatters.numeric
|
|
12277
12153
|
}
|
|
12278
|
-
}),
|
|
12154
|
+
}), _n);
|
|
12279
12155
|
const log10Floor = (v2) => Math.floor(log10$1(v2));
|
|
12280
12156
|
const changeExponent = (v2, m2) => Math.pow(10, log10Floor(v2) + m2);
|
|
12281
12157
|
function isMajor$1(tickVal) {
|
|
@@ -12337,7 +12213,7 @@ function generateTicks$2(generationOptions, { min, max }) {
|
|
|
12337
12213
|
});
|
|
12338
12214
|
return ticks;
|
|
12339
12215
|
}
|
|
12340
|
-
let LogarithmicScale$1 = (
|
|
12216
|
+
let LogarithmicScale$1 = (_o = class extends Scale$1 {
|
|
12341
12217
|
constructor(cfg) {
|
|
12342
12218
|
super(cfg);
|
|
12343
12219
|
this.start = void 0;
|
|
@@ -12434,14 +12310,14 @@ let LogarithmicScale$1 = (_p = class extends Scale$1 {
|
|
|
12434
12310
|
const decimal = this.getDecimalForPixel(pixel);
|
|
12435
12311
|
return Math.pow(10, this._startValue + decimal * this._valueRange);
|
|
12436
12312
|
}
|
|
12437
|
-
}, __publicField(
|
|
12313
|
+
}, __publicField(_o, "id", "logarithmic"), __publicField(_o, "defaults", {
|
|
12438
12314
|
ticks: {
|
|
12439
12315
|
callback: Ticks$1.formatters.logarithmic,
|
|
12440
12316
|
major: {
|
|
12441
12317
|
enabled: true
|
|
12442
12318
|
}
|
|
12443
12319
|
}
|
|
12444
|
-
}),
|
|
12320
|
+
}), _o);
|
|
12445
12321
|
const INTERVALS$1 = {
|
|
12446
12322
|
millisecond: {
|
|
12447
12323
|
common: true,
|
|
@@ -12577,7 +12453,7 @@ function ticksFromTimestamps$1(scale, values2, majorUnit) {
|
|
|
12577
12453
|
}
|
|
12578
12454
|
return ilen === 0 || !majorUnit ? ticks : setMajorTicks$1(scale, ticks, map2, majorUnit);
|
|
12579
12455
|
}
|
|
12580
|
-
let TimeScale$1 = (
|
|
12456
|
+
let TimeScale$1 = (_p = class extends Scale$1 {
|
|
12581
12457
|
constructor(props) {
|
|
12582
12458
|
super(props);
|
|
12583
12459
|
this._cache = {
|
|
@@ -12843,7 +12719,7 @@ let TimeScale$1 = (_q = class extends Scale$1 {
|
|
|
12843
12719
|
normalize(values2) {
|
|
12844
12720
|
return _arrayUnique$1(values2.sort(sorter$1));
|
|
12845
12721
|
}
|
|
12846
|
-
}, __publicField(
|
|
12722
|
+
}, __publicField(_p, "id", "time"), __publicField(_p, "defaults", {
|
|
12847
12723
|
bounds: "data",
|
|
12848
12724
|
adapters: {},
|
|
12849
12725
|
time: {
|
|
@@ -12861,7 +12737,7 @@ let TimeScale$1 = (_q = class extends Scale$1 {
|
|
|
12861
12737
|
enabled: false
|
|
12862
12738
|
}
|
|
12863
12739
|
}
|
|
12864
|
-
}),
|
|
12740
|
+
}), _p);
|
|
12865
12741
|
function interpolate$2(table2, val, reverse) {
|
|
12866
12742
|
let lo = 0;
|
|
12867
12743
|
let hi = table2.length - 1;
|
|
@@ -12882,7 +12758,7 @@ function interpolate$2(table2, val, reverse) {
|
|
|
12882
12758
|
const span = nextSource - prevSource;
|
|
12883
12759
|
return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;
|
|
12884
12760
|
}
|
|
12885
|
-
let TimeSeriesScale$1 = (
|
|
12761
|
+
let TimeSeriesScale$1 = (_q = class extends TimeScale$1 {
|
|
12886
12762
|
constructor(props) {
|
|
12887
12763
|
super(props);
|
|
12888
12764
|
this._table = [];
|
|
@@ -12967,7 +12843,7 @@ let TimeSeriesScale$1 = (_r = class extends TimeScale$1 {
|
|
|
12967
12843
|
const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;
|
|
12968
12844
|
return interpolate$2(this._table, decimal * this._tableRange + this._minPos, true);
|
|
12969
12845
|
}
|
|
12970
|
-
}, __publicField(
|
|
12846
|
+
}, __publicField(_q, "id", "timeseries"), __publicField(_q, "defaults", TimeScale$1.defaults), _q);
|
|
12971
12847
|
const defaultDatasetIdKey = "label";
|
|
12972
12848
|
function reforwardRef(ref, value) {
|
|
12973
12849
|
if (typeof ref === "function") {
|
|
@@ -13104,7 +12980,6 @@ function createTypedChart(type, registerables) {
|
|
|
13104
12980
|
const Line = /* @__PURE__ */ createTypedChart("line", LineController$1);
|
|
13105
12981
|
const Bar = /* @__PURE__ */ createTypedChart("bar", BarController$1);
|
|
13106
12982
|
const Pie = /* @__PURE__ */ createTypedChart("pie", PieController$1);
|
|
13107
|
-
const Scatter = /* @__PURE__ */ createTypedChart("scatter", ScatterController$1);
|
|
13108
12983
|
function getDefaultExportFromCjs(x2) {
|
|
13109
12984
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
13110
12985
|
}
|
|
@@ -22173,26 +22048,26 @@ class HTML5BackendImpl {
|
|
|
22173
22048
|
const HTML5Backend = function createBackend(manager, context, options) {
|
|
22174
22049
|
return new HTML5BackendImpl(manager, context, options);
|
|
22175
22050
|
};
|
|
22176
|
-
const chart$
|
|
22051
|
+
const chart$2 = "_chart_e3qdd_1";
|
|
22177
22052
|
const canvas$1 = "_canvas_e3qdd_11";
|
|
22178
|
-
const fixedHeight$
|
|
22179
|
-
const stretchHeight$
|
|
22053
|
+
const fixedHeight$2 = "_fixedHeight_e3qdd_20";
|
|
22054
|
+
const stretchHeight$2 = "_stretchHeight_e3qdd_26";
|
|
22180
22055
|
const squareAspectRatio = "_squareAspectRatio_e3qdd_32";
|
|
22181
|
-
const zoomForm$
|
|
22182
|
-
const zoomReset$
|
|
22183
|
-
const help$
|
|
22184
|
-
const autoWeight$
|
|
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";
|
|
22185
22060
|
const table = "_table_e3qdd_62";
|
|
22186
|
-
const styles$
|
|
22187
|
-
chart: chart$
|
|
22061
|
+
const styles$4 = {
|
|
22062
|
+
chart: chart$2,
|
|
22188
22063
|
canvas: canvas$1,
|
|
22189
|
-
fixedHeight: fixedHeight$
|
|
22190
|
-
stretchHeight: stretchHeight$
|
|
22064
|
+
fixedHeight: fixedHeight$2,
|
|
22065
|
+
stretchHeight: stretchHeight$2,
|
|
22191
22066
|
squareAspectRatio,
|
|
22192
|
-
zoomForm: zoomForm$
|
|
22193
|
-
zoomReset: zoomReset$
|
|
22194
|
-
help: help$
|
|
22195
|
-
autoWeight: autoWeight$
|
|
22067
|
+
zoomForm: zoomForm$2,
|
|
22068
|
+
zoomReset: zoomReset$2,
|
|
22069
|
+
help: help$2,
|
|
22070
|
+
autoWeight: autoWeight$2,
|
|
22196
22071
|
table
|
|
22197
22072
|
};
|
|
22198
22073
|
const TOGGLE_ZOOM = "TOGGLE_ZOOM";
|
|
@@ -22205,6 +22080,7 @@ const SAVE_INITIAL_AXES_RANGES = "SAVE_INITIAL_AXES_RANGES";
|
|
|
22205
22080
|
const RESET_AXES_RANGES = "RESET_AXES_RANGES";
|
|
22206
22081
|
const UPDATE_AXES_RANGES = "UPDATE_AXES_RANGES";
|
|
22207
22082
|
const TOGGLE_DRAG_POINTS = "TOGGLE_DRAG_POINTS";
|
|
22083
|
+
const TOGGLE_DRAG_ANNOTATION = "TOGGLE_DRAG_ANNOTATION";
|
|
22208
22084
|
const DISABLE_DRAG_OPTIONS = "DISABLE_DRAG_OPTIONS";
|
|
22209
22085
|
const reducer$1 = (state, action) => {
|
|
22210
22086
|
return produce(state, (draft) => {
|
|
@@ -22273,6 +22149,16 @@ const reducer$1 = (state, action) => {
|
|
|
22273
22149
|
}
|
|
22274
22150
|
break;
|
|
22275
22151
|
}
|
|
22152
|
+
case TOGGLE_DRAG_ANNOTATION: {
|
|
22153
|
+
draft.enableDragAnnotation = !draft.enableDragAnnotation;
|
|
22154
|
+
if (draft.panEnabled) {
|
|
22155
|
+
draft.panEnabled = false;
|
|
22156
|
+
}
|
|
22157
|
+
if (draft.zoomEnabled) {
|
|
22158
|
+
draft.zoomEnabled = false;
|
|
22159
|
+
}
|
|
22160
|
+
break;
|
|
22161
|
+
}
|
|
22276
22162
|
case DISABLE_DRAG_OPTIONS: {
|
|
22277
22163
|
if (draft.enableDragPoints || draft.panEnabled || draft.zoomEnabled) {
|
|
22278
22164
|
draft.enableDragPoints = false;
|
|
@@ -22316,10 +22202,10 @@ var ScaleType = /* @__PURE__ */ ((ScaleType2) => {
|
|
|
22316
22202
|
ScaleType2["Logarithmic"] = "logarithmic";
|
|
22317
22203
|
return ScaleType2;
|
|
22318
22204
|
})(ScaleType || {});
|
|
22319
|
-
var ChartDirection
|
|
22205
|
+
var ChartDirection = /* @__PURE__ */ ((ChartDirection2) => {
|
|
22320
22206
|
ChartDirection2["Vertical"] = "vertical";
|
|
22321
22207
|
return ChartDirection2;
|
|
22322
|
-
})(ChartDirection
|
|
22208
|
+
})(ChartDirection || {});
|
|
22323
22209
|
var TooltipLabel = /* @__PURE__ */ ((TooltipLabel2) => {
|
|
22324
22210
|
TooltipLabel2["Y"] = "yLabel";
|
|
22325
22211
|
TooltipLabel2["X"] = "xLabel";
|
|
@@ -22333,13 +22219,13 @@ var AlignOptions = /* @__PURE__ */ ((AlignOptions2) => {
|
|
|
22333
22219
|
AlignOptions2["Left"] = "left";
|
|
22334
22220
|
return AlignOptions2;
|
|
22335
22221
|
})(AlignOptions || {});
|
|
22336
|
-
var AnnotationType = /* @__PURE__ */ ((AnnotationType2) => {
|
|
22222
|
+
var AnnotationType$1 = /* @__PURE__ */ ((AnnotationType2) => {
|
|
22337
22223
|
AnnotationType2["Box"] = "box";
|
|
22338
22224
|
AnnotationType2["Ellipse"] = "ellipse";
|
|
22339
22225
|
AnnotationType2["Line"] = "line";
|
|
22340
22226
|
AnnotationType2["Text"] = "text";
|
|
22341
22227
|
return AnnotationType2;
|
|
22342
|
-
})(AnnotationType || {});
|
|
22228
|
+
})(AnnotationType$1 || {});
|
|
22343
22229
|
var PointStyle = /* @__PURE__ */ ((PointStyle2) => {
|
|
22344
22230
|
PointStyle2["Circle"] = "circle";
|
|
22345
22231
|
return PointStyle2;
|
|
@@ -22538,7 +22424,7 @@ const getTitle = (options) => {
|
|
|
22538
22424
|
} : {};
|
|
22539
22425
|
};
|
|
22540
22426
|
const isVertical = (direction) => {
|
|
22541
|
-
return direction === ChartDirection
|
|
22427
|
+
return direction === ChartDirection.Vertical;
|
|
22542
22428
|
};
|
|
22543
22429
|
const getAxisPosition = (axisType, i2) => {
|
|
22544
22430
|
const [positionA, positionB] = axisType === AxisType.Y ? [Position.Left, Position.Right] : [Position.Top, Position.Bottom];
|
|
@@ -22692,7 +22578,8 @@ const initialState = ({ options, persistenceId }) => {
|
|
|
22692
22578
|
axes,
|
|
22693
22579
|
chartOptions: { enableZoom, enablePan, showPoints, showLine },
|
|
22694
22580
|
legend: { display },
|
|
22695
|
-
dragData
|
|
22581
|
+
dragData,
|
|
22582
|
+
annotations: { enableDragAnnotation }
|
|
22696
22583
|
} = options;
|
|
22697
22584
|
const getStateAxesByType = (axisType, customAxesRange2) => {
|
|
22698
22585
|
var _a2, _b2, _c2, _d2, _e2;
|
|
@@ -22739,7 +22626,8 @@ const initialState = ({ options, persistenceId }) => {
|
|
|
22739
22626
|
pointsEnabled,
|
|
22740
22627
|
lineEnabled,
|
|
22741
22628
|
legendEnabled,
|
|
22742
|
-
enableDragPoints
|
|
22629
|
+
enableDragPoints,
|
|
22630
|
+
enableDragAnnotation: enableDragAnnotationStorage
|
|
22743
22631
|
} = getChartStateFromStorage(persistenceId) || {};
|
|
22744
22632
|
return {
|
|
22745
22633
|
zoomEnabled: zoomEnabled ?? enableZoom,
|
|
@@ -22750,6 +22638,7 @@ const initialState = ({ options, persistenceId }) => {
|
|
|
22750
22638
|
axes: stateAxes,
|
|
22751
22639
|
showTable: false,
|
|
22752
22640
|
enableDragPoints: (dragData == null ? void 0 : dragData.enableDragData) && enableDragPoints,
|
|
22641
|
+
enableDragAnnotation: enableDragAnnotation && enableDragAnnotationStorage,
|
|
22753
22642
|
initialAxesRanges: []
|
|
22754
22643
|
};
|
|
22755
22644
|
};
|
|
@@ -22909,7 +22798,10 @@ const DragOptions = ({
|
|
|
22909
22798
|
panEnabled,
|
|
22910
22799
|
zoomEnabled,
|
|
22911
22800
|
enableDragPoints,
|
|
22801
|
+
enableDragAnnotation,
|
|
22912
22802
|
isDragDataAllowed,
|
|
22803
|
+
isDragAnnotationAllowed,
|
|
22804
|
+
onToggleDragAnnotation,
|
|
22913
22805
|
onToggleDragPoints,
|
|
22914
22806
|
onDisableDragOptions,
|
|
22915
22807
|
translations: {
|
|
@@ -22918,7 +22810,8 @@ const DragOptions = ({
|
|
|
22918
22810
|
dragToPan,
|
|
22919
22811
|
orDoubleClickToCanvas,
|
|
22920
22812
|
dragToMovePoints,
|
|
22921
|
-
dragDisabled
|
|
22813
|
+
dragDisabled,
|
|
22814
|
+
dragToMoveAnnotation
|
|
22922
22815
|
}
|
|
22923
22816
|
}) => {
|
|
22924
22817
|
const options = useMemo(
|
|
@@ -22952,10 +22845,19 @@ const DragOptions = ({
|
|
|
22952
22845
|
onClick: onToggleDragPoints
|
|
22953
22846
|
}
|
|
22954
22847
|
] : [],
|
|
22848
|
+
...isDragAnnotationAllowed ? [
|
|
22849
|
+
{
|
|
22850
|
+
label: dragToMoveAnnotation,
|
|
22851
|
+
icon: /* @__PURE__ */ jsx(TbHandStop, {}),
|
|
22852
|
+
selected: enableDragAnnotation,
|
|
22853
|
+
type: "Option",
|
|
22854
|
+
onClick: onToggleDragAnnotation
|
|
22855
|
+
}
|
|
22856
|
+
] : [],
|
|
22955
22857
|
{
|
|
22956
22858
|
label: dragDisabled,
|
|
22957
22859
|
icon: /* @__PURE__ */ jsx(TbBan, {}),
|
|
22958
|
-
selected: !zoomEnabled && !panEnabled && !enableDragPoints,
|
|
22860
|
+
selected: !zoomEnabled && !panEnabled && !enableDragPoints && !enableDragAnnotation,
|
|
22959
22861
|
onClick: onDisableDragOptions
|
|
22960
22862
|
}
|
|
22961
22863
|
],
|
|
@@ -22993,7 +22895,7 @@ const DragOptions = ({
|
|
|
22993
22895
|
};
|
|
22994
22896
|
const controls = "_controls_gbo9q_1";
|
|
22995
22897
|
const buttons = "_buttons_gbo9q_7";
|
|
22996
|
-
const styles$
|
|
22898
|
+
const styles$3 = {
|
|
22997
22899
|
controls,
|
|
22998
22900
|
buttons
|
|
22999
22901
|
};
|
|
@@ -23012,6 +22914,7 @@ const useToggleHandlers = (dispatch) => {
|
|
|
23012
22914
|
onToggleTable: createToggleHandler(TOGGLE_TABLE),
|
|
23013
22915
|
onToggleZoom: createToggleHandler(TOGGLE_ZOOM),
|
|
23014
22916
|
onToggleDragPoints: createToggleHandler(TOGGLE_DRAG_POINTS),
|
|
22917
|
+
onToggleDragAnnotation: createToggleHandler(TOGGLE_DRAG_ANNOTATION),
|
|
23015
22918
|
onDisableDragOptions: createToggleHandler(DISABLE_DRAG_OPTIONS)
|
|
23016
22919
|
};
|
|
23017
22920
|
return toggleHandlers;
|
|
@@ -24432,9 +24335,10 @@ const Controls = ({
|
|
|
24432
24335
|
panEnabled,
|
|
24433
24336
|
pointsEnabled,
|
|
24434
24337
|
showTable,
|
|
24435
|
-
zoomEnabled
|
|
24338
|
+
zoomEnabled,
|
|
24339
|
+
enableDragAnnotation
|
|
24436
24340
|
} = state;
|
|
24437
|
-
const { dragData, depthType } = options;
|
|
24341
|
+
const { dragData, depthType, annotations } = options;
|
|
24438
24342
|
const {
|
|
24439
24343
|
onToggleLine,
|
|
24440
24344
|
onTogglePan,
|
|
@@ -24442,6 +24346,7 @@ const Controls = ({
|
|
|
24442
24346
|
onToggleTable,
|
|
24443
24347
|
onToggleZoom,
|
|
24444
24348
|
onToggleDragPoints,
|
|
24349
|
+
onToggleDragAnnotation,
|
|
24445
24350
|
onDisableDragOptions
|
|
24446
24351
|
} = useToggleHandlers(dispatch);
|
|
24447
24352
|
const { handleDownload, controlsAxesLabels, onResetAxes, onUpdateAxes } = useChartFunctions({
|
|
@@ -24452,10 +24357,10 @@ const Controls = ({
|
|
|
24452
24357
|
generatedDatasets
|
|
24453
24358
|
});
|
|
24454
24359
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24455
|
-
/* @__PURE__ */ jsxs("div", { className: styles$
|
|
24360
|
+
/* @__PURE__ */ jsxs("div", { className: styles$3.controls, children: [
|
|
24456
24361
|
!!options.title && /* @__PURE__ */ jsx(Text, { bold: true, children: options.title }),
|
|
24457
24362
|
headerComponent,
|
|
24458
|
-
/* @__PURE__ */ jsx(ControlsPortal, { controlsPortalId: controlsPortalId ?? "", children: /* @__PURE__ */ jsxs("div", { className: styles$
|
|
24363
|
+
/* @__PURE__ */ jsx(ControlsPortal, { controlsPortalId: controlsPortalId ?? "", children: /* @__PURE__ */ jsxs("div", { className: styles$3.buttons, children: [
|
|
24459
24364
|
!showTable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24460
24365
|
/* @__PURE__ */ jsx(
|
|
24461
24366
|
AxesOptions,
|
|
@@ -24505,7 +24410,10 @@ const Controls = ({
|
|
|
24505
24410
|
onTogglePan,
|
|
24506
24411
|
onToggleZoom,
|
|
24507
24412
|
enableDragPoints,
|
|
24413
|
+
enableDragAnnotation,
|
|
24508
24414
|
isDragDataAllowed: dragData == null ? void 0 : dragData.enableDragData,
|
|
24415
|
+
isDragAnnotationAllowed: annotations == null ? void 0 : annotations.enableDragAnnotation,
|
|
24416
|
+
onToggleDragAnnotation,
|
|
24509
24417
|
onToggleDragPoints,
|
|
24510
24418
|
onDisableDragOptions,
|
|
24511
24419
|
translations
|
|
@@ -24557,11 +24465,11 @@ const defaultAxis = (position) => ({
|
|
|
24557
24465
|
}
|
|
24558
24466
|
}
|
|
24559
24467
|
});
|
|
24560
|
-
const defaultAxes$
|
|
24468
|
+
const defaultAxes$1 = (axes) => ({
|
|
24561
24469
|
x: (axes == null ? void 0 : axes.x) || [defaultAxis("bottom")],
|
|
24562
24470
|
y: (axes == null ? void 0 : axes.y) || [defaultAxis("left")]
|
|
24563
24471
|
});
|
|
24564
|
-
const defaultAdditionalAxesOptions$
|
|
24472
|
+
const defaultAdditionalAxesOptions$1 = (options) => ({
|
|
24565
24473
|
chartScaleType: (options == null ? void 0 : options.chartScaleType) || "linear",
|
|
24566
24474
|
reverse: (options == null ? void 0 : options.reverse) || false,
|
|
24567
24475
|
beginAtZero: (options == null ? void 0 : options.beginAtZero) ?? false,
|
|
@@ -24571,7 +24479,7 @@ const defaultAdditionalAxesOptions$2 = (options) => ({
|
|
|
24571
24479
|
range: options == null ? void 0 : options.range,
|
|
24572
24480
|
autoAxisPadding: (options == null ? void 0 : options.autoAxisPadding) ?? false
|
|
24573
24481
|
});
|
|
24574
|
-
const defaultChartStyling$
|
|
24482
|
+
const defaultChartStyling$2 = (options) => ({
|
|
24575
24483
|
width: options == null ? void 0 : options.width,
|
|
24576
24484
|
height: options == null ? void 0 : options.height,
|
|
24577
24485
|
maintainAspectRatio: (options == null ? void 0 : options.maintainAspectRatio) ?? false,
|
|
@@ -24585,22 +24493,22 @@ const defaultChartStyling$3 = (options) => ({
|
|
|
24585
24493
|
right: 0
|
|
24586
24494
|
}
|
|
24587
24495
|
});
|
|
24588
|
-
const defaultTooltip$
|
|
24496
|
+
const defaultTooltip$2 = (tooltip) => ({
|
|
24589
24497
|
tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
|
|
24590
24498
|
showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) ?? false,
|
|
24591
24499
|
hideSimulationName: (tooltip == null ? void 0 : tooltip.hideSimulationName) ?? false,
|
|
24592
24500
|
scientificNotation: (tooltip == null ? void 0 : tooltip.scientificNotation) ?? true
|
|
24593
24501
|
});
|
|
24594
|
-
const defaultGraph$
|
|
24502
|
+
const defaultGraph$2 = (graph) => ({
|
|
24595
24503
|
lineTension: (graph == null ? void 0 : graph.lineTension) ?? 0.01,
|
|
24596
24504
|
spanGaps: (graph == null ? void 0 : graph.spanGaps) ?? false,
|
|
24597
24505
|
showDataLabels: (graph == null ? void 0 : graph.showDataLabels) ?? false,
|
|
24598
24506
|
showMinorGridlines: (graph == null ? void 0 : graph.showMinorGridlines) ?? false
|
|
24599
24507
|
});
|
|
24600
|
-
const defaultAnnotationsData$
|
|
24508
|
+
const defaultAnnotationsData$1 = (annotationsData) => {
|
|
24601
24509
|
return annotationsData ? annotationsData.map((ann) => ({ ...ann, display: (ann == null ? void 0 : ann.display) ?? true })) : [];
|
|
24602
24510
|
};
|
|
24603
|
-
const defaultAnnotations$
|
|
24511
|
+
const defaultAnnotations$1 = (annotations) => {
|
|
24604
24512
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
24605
24513
|
return {
|
|
24606
24514
|
labelAnnotation: {
|
|
@@ -24615,10 +24523,11 @@ const defaultAnnotations$2 = (annotations) => {
|
|
|
24615
24523
|
},
|
|
24616
24524
|
showAnnotations: (annotations == null ? void 0 : annotations.showAnnotations) ?? false,
|
|
24617
24525
|
controlAnnotation: (annotations == null ? void 0 : annotations.controlAnnotation) ?? false,
|
|
24618
|
-
|
|
24526
|
+
enableDragAnnotation: (annotations == null ? void 0 : annotations.enableDragAnnotation) ?? false,
|
|
24527
|
+
annotationsData: defaultAnnotationsData$1(annotations == null ? void 0 : annotations.annotationsData)
|
|
24619
24528
|
};
|
|
24620
24529
|
};
|
|
24621
|
-
const defaultLegend$
|
|
24530
|
+
const defaultLegend$2 = (legend2) => ({
|
|
24622
24531
|
display: (legend2 == null ? void 0 : legend2.display) ?? true,
|
|
24623
24532
|
position: (legend2 == null ? void 0 : legend2.position) ?? Position.BottomLeft,
|
|
24624
24533
|
align: (legend2 == null ? void 0 : legend2.align) ?? AlignOptions.Center,
|
|
@@ -24628,14 +24537,14 @@ const defaultLegend$3 = (legend2) => ({
|
|
|
24628
24537
|
},
|
|
24629
24538
|
usePointStyle: (legend2 == null ? void 0 : legend2.usePointStyle) ?? true
|
|
24630
24539
|
});
|
|
24631
|
-
const defaultChartOptions$
|
|
24540
|
+
const defaultChartOptions$2 = (options) => ({
|
|
24632
24541
|
showPoints: (options == null ? void 0 : options.showPoints) ?? true,
|
|
24633
24542
|
enableZoom: (options == null ? void 0 : options.enableZoom) ?? true,
|
|
24634
24543
|
enablePan: (options == null ? void 0 : options.enablePan) ?? false,
|
|
24635
24544
|
showLine: (options == null ? void 0 : options.showLine) ?? true,
|
|
24636
24545
|
closeOnOutsideClick: (options == null ? void 0 : options.closeOnOutsideClick) ?? false
|
|
24637
24546
|
});
|
|
24638
|
-
const defaultInteractions$
|
|
24547
|
+
const defaultInteractions$2 = (interactions) => ({
|
|
24639
24548
|
onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
|
|
24640
24549
|
onHover: interactions == null ? void 0 : interactions.onHover,
|
|
24641
24550
|
onUnhover: interactions == null ? void 0 : interactions.onUnhover,
|
|
@@ -24651,7 +24560,7 @@ const defaultDragData$1 = (dragData) => ({
|
|
|
24651
24560
|
onDrag: dragData == null ? void 0 : dragData.onDrag,
|
|
24652
24561
|
onDragEnd: dragData == null ? void 0 : dragData.onDragEnd
|
|
24653
24562
|
});
|
|
24654
|
-
const getDefaultProps$
|
|
24563
|
+
const getDefaultProps$2 = (props) => {
|
|
24655
24564
|
const chart2 = (props == null ? void 0 : props.chart) || {};
|
|
24656
24565
|
const options = (chart2 == null ? void 0 : chart2.options) || {};
|
|
24657
24566
|
return {
|
|
@@ -24662,17 +24571,17 @@ const getDefaultProps$3 = (props) => {
|
|
|
24662
24571
|
options: {
|
|
24663
24572
|
title: (options == null ? void 0 : options.title) ?? "",
|
|
24664
24573
|
scales: (options == null ? void 0 : options.scales) ?? {},
|
|
24665
|
-
axes: defaultAxes$
|
|
24666
|
-
additionalAxesOptions: defaultAdditionalAxesOptions$
|
|
24574
|
+
axes: defaultAxes$1(options == null ? void 0 : options.axes),
|
|
24575
|
+
additionalAxesOptions: defaultAdditionalAxesOptions$1(
|
|
24667
24576
|
options == null ? void 0 : options.additionalAxesOptions
|
|
24668
24577
|
),
|
|
24669
|
-
chartStyling: defaultChartStyling$
|
|
24670
|
-
tooltip: defaultTooltip$
|
|
24671
|
-
graph: defaultGraph$
|
|
24672
|
-
annotations: defaultAnnotations$
|
|
24673
|
-
legend: defaultLegend$
|
|
24674
|
-
chartOptions: defaultChartOptions$
|
|
24675
|
-
interactions: defaultInteractions$
|
|
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),
|
|
24676
24585
|
dragData: defaultDragData$1(options == null ? void 0 : options.dragData),
|
|
24677
24586
|
depthType: (options == null ? void 0 : options.depthType) ?? {}
|
|
24678
24587
|
}
|
|
@@ -25115,7 +25024,7 @@ const getUnitsFromLabel = (label) => {
|
|
|
25115
25024
|
const units = matches && (matches == null ? void 0 : matches.length) > 0 ? matches == null ? void 0 : matches[0] : "";
|
|
25116
25025
|
return units;
|
|
25117
25026
|
};
|
|
25118
|
-
const customFormatNumber
|
|
25027
|
+
const customFormatNumber = (labelNumber, scientificNotation) => {
|
|
25119
25028
|
let roundOptions = {};
|
|
25120
25029
|
if (!scientificNotation) {
|
|
25121
25030
|
roundOptions = { scientific: false };
|
|
@@ -25151,21 +25060,21 @@ const getLineChartToolTips = (options) => {
|
|
|
25151
25060
|
};
|
|
25152
25061
|
}
|
|
25153
25062
|
};
|
|
25154
|
-
const
|
|
25063
|
+
const titleCallback = (tooltipItem) => {
|
|
25155
25064
|
const labels = getTooltipLabels(tooltipItem[0].dataset);
|
|
25156
25065
|
const { titleLabel, titleAxisLabel } = labels ?? {};
|
|
25157
25066
|
const formattedValue = titleLabel === TooltipLabel.Y ? tooltipItem[0].parsed.y : tooltipItem[0].parsed.x;
|
|
25158
|
-
const roundedValue = customFormatNumber
|
|
25067
|
+
const roundedValue = customFormatNumber(formattedValue, scientificNotation);
|
|
25159
25068
|
return `${roundedValue} ${titleAxisLabel}`;
|
|
25160
25069
|
};
|
|
25161
|
-
const
|
|
25070
|
+
const labelCallback = (tooltipItem) => {
|
|
25162
25071
|
const { showLabelsInTooltips } = options.tooltip;
|
|
25163
25072
|
let label = tooltipItem.dataset.label || "";
|
|
25164
25073
|
const labels = getTooltipLabels(tooltipItem.dataset);
|
|
25165
25074
|
const { valueLabel = "", valueAxisLabel = "" } = labels ?? {};
|
|
25166
25075
|
const getTooltipItemValue = () => {
|
|
25167
25076
|
const labelNumber = valueLabel === TooltipLabel.X ? tooltipItem.parsed.x : tooltipItem.parsed.y;
|
|
25168
|
-
return customFormatNumber
|
|
25077
|
+
return customFormatNumber(labelNumber, scientificNotation);
|
|
25169
25078
|
};
|
|
25170
25079
|
const tooltipItemValue = getTooltipItemValue();
|
|
25171
25080
|
const units = getUnitsFromLabel(valueAxisLabel);
|
|
@@ -25182,8 +25091,8 @@ const getLineChartToolTips = (options) => {
|
|
|
25182
25091
|
boxHeight: LEGEND_LABEL_BOX_SIZE,
|
|
25183
25092
|
boxPadding: TOOLTIP_BOX_PADDING,
|
|
25184
25093
|
callbacks: {
|
|
25185
|
-
title:
|
|
25186
|
-
label:
|
|
25094
|
+
title: titleCallback,
|
|
25095
|
+
label: labelCallback,
|
|
25187
25096
|
afterLabel: afterLabelCallback
|
|
25188
25097
|
}
|
|
25189
25098
|
};
|
|
@@ -25265,6 +25174,19 @@ const legendReducer = (state, action) => {
|
|
|
25265
25174
|
return state;
|
|
25266
25175
|
}
|
|
25267
25176
|
};
|
|
25177
|
+
var MouseEvents = /* @__PURE__ */ ((MouseEvents2) => {
|
|
25178
|
+
MouseEvents2["MOUSEDOWN"] = "mousedown";
|
|
25179
|
+
MouseEvents2["MOUSEMOVE"] = "mousemove";
|
|
25180
|
+
MouseEvents2["MOUSEUP"] = "mouseup";
|
|
25181
|
+
return MouseEvents2;
|
|
25182
|
+
})(MouseEvents || {});
|
|
25183
|
+
var AnnotationType = /* @__PURE__ */ ((AnnotationType2) => {
|
|
25184
|
+
AnnotationType2["POINT"] = "point";
|
|
25185
|
+
AnnotationType2["BOX"] = "box";
|
|
25186
|
+
AnnotationType2["LINE"] = "line";
|
|
25187
|
+
AnnotationType2["ELLIPSE"] = "ellipse";
|
|
25188
|
+
return AnnotationType2;
|
|
25189
|
+
})(AnnotationType || {});
|
|
25268
25190
|
const annotationEnter = (element, chart2) => {
|
|
25269
25191
|
var _a2;
|
|
25270
25192
|
if ((_a2 = element.options.scaleID) == null ? void 0 : _a2.includes(AxisType.X)) {
|
|
@@ -25273,21 +25195,25 @@ const annotationEnter = (element, chart2) => {
|
|
|
25273
25195
|
}
|
|
25274
25196
|
}
|
|
25275
25197
|
element.options.borderWidth = BORDER_WIDTH.HOVERED;
|
|
25198
|
+
chart2.hoveredAnnotationId = element.options.id || null;
|
|
25276
25199
|
if (element.options.label) {
|
|
25277
25200
|
element.label.options.display = true;
|
|
25278
25201
|
element.options.label.enabled = true;
|
|
25279
25202
|
}
|
|
25280
25203
|
chart2.draw();
|
|
25204
|
+
chart2.update();
|
|
25281
25205
|
chart2.canvas.style.cursor = CursorStyle.Pointer;
|
|
25282
25206
|
return true;
|
|
25283
25207
|
};
|
|
25284
25208
|
const annotationLeave = (element, chart2) => {
|
|
25285
25209
|
element.options.borderWidth = BORDER_WIDTH.INITIAL;
|
|
25210
|
+
chart2.hoveredAnnotationId = null;
|
|
25286
25211
|
if (element.options.label) {
|
|
25287
25212
|
element.label.options.display = false;
|
|
25288
25213
|
element.options.label.enabled = false;
|
|
25289
25214
|
}
|
|
25290
25215
|
chart2.draw();
|
|
25216
|
+
chart2.update();
|
|
25291
25217
|
chart2.canvas.style.cursor = CursorStyle.Initial;
|
|
25292
25218
|
return true;
|
|
25293
25219
|
};
|
|
@@ -25297,9 +25223,13 @@ const generateAnnotations = (annotationsData) => {
|
|
|
25297
25223
|
const color2 = (ann == null ? void 0 : ann.color) || COLORS[idx];
|
|
25298
25224
|
const type = (ann == null ? void 0 : ann.type) || "line";
|
|
25299
25225
|
const adjustScaleRange2 = ann == null ? void 0 : ann.adjustScaleRange;
|
|
25300
|
-
const borderColor =
|
|
25301
|
-
|
|
25302
|
-
|
|
25226
|
+
const borderColor = {
|
|
25227
|
+
[AnnotationType.LINE]: color2,
|
|
25228
|
+
[AnnotationType.POINT]: color2,
|
|
25229
|
+
[AnnotationType.BOX]: color2
|
|
25230
|
+
}[type] || "transparent";
|
|
25231
|
+
const borderWidth = type == "line" ? BORDER_WIDTH.INITIAL : 0;
|
|
25232
|
+
const borderDash = type == "line" ? ANNOTATION_DASH : void 0;
|
|
25303
25233
|
const label = type === "line" ? {
|
|
25304
25234
|
backgroundColor: color2,
|
|
25305
25235
|
content: ann == null ? void 0 : ann.label,
|
|
@@ -25315,7 +25245,7 @@ const generateAnnotations = (annotationsData) => {
|
|
|
25315
25245
|
}, {
|
|
25316
25246
|
chart: chart2
|
|
25317
25247
|
}) => {
|
|
25318
|
-
if (type !== "line")
|
|
25248
|
+
if (type !== "line" && !ann.enableDrag)
|
|
25319
25249
|
return;
|
|
25320
25250
|
annotationEnter(element, chart2);
|
|
25321
25251
|
};
|
|
@@ -25324,10 +25254,13 @@ const generateAnnotations = (annotationsData) => {
|
|
|
25324
25254
|
}, {
|
|
25325
25255
|
chart: chart2
|
|
25326
25256
|
}) => {
|
|
25327
|
-
if (type !== "line")
|
|
25257
|
+
if (type !== "line" && !ann.enableDrag)
|
|
25328
25258
|
return;
|
|
25329
25259
|
annotationLeave(element, chart2);
|
|
25330
25260
|
};
|
|
25261
|
+
const onDragStart = () => (cord) => (ann == null ? void 0 : ann.onDragStart) ? ann == null ? void 0 : ann.onDragStart(cord) : void 0;
|
|
25262
|
+
const onDrag = () => (cord) => (ann == null ? void 0 : ann.onDrag) ? ann == null ? void 0 : ann.onDrag(cord) : void 0;
|
|
25263
|
+
const onDragEnd = () => (cord) => (ann == null ? void 0 : ann.onDragEnd) ? ann == null ? void 0 : ann.onDragEnd(cord) : void 0;
|
|
25331
25264
|
return {
|
|
25332
25265
|
...ann,
|
|
25333
25266
|
display: ann == null ? void 0 : ann.display,
|
|
@@ -25342,7 +25275,10 @@ const generateAnnotations = (annotationsData) => {
|
|
|
25342
25275
|
type,
|
|
25343
25276
|
adjustScaleRange: adjustScaleRange2,
|
|
25344
25277
|
enter,
|
|
25345
|
-
leave
|
|
25278
|
+
leave,
|
|
25279
|
+
onDragStart,
|
|
25280
|
+
onDrag,
|
|
25281
|
+
onDragEnd
|
|
25346
25282
|
};
|
|
25347
25283
|
});
|
|
25348
25284
|
};
|
|
@@ -25538,6 +25474,9 @@ const useChartOptions = ({
|
|
|
25538
25474
|
);
|
|
25539
25475
|
const plugins = {
|
|
25540
25476
|
datalabels,
|
|
25477
|
+
annotationDraggerPlugin: {
|
|
25478
|
+
enabled: state.enableDragAnnotation
|
|
25479
|
+
},
|
|
25541
25480
|
annotation: toAnnotationObject(annotation2),
|
|
25542
25481
|
zoom: { pan: panOptions, zoom: zoomOptions },
|
|
25543
25482
|
tooltip,
|
|
@@ -25894,6 +25833,211 @@ const chartAreaTextPlugin = {
|
|
|
25894
25833
|
});
|
|
25895
25834
|
}
|
|
25896
25835
|
};
|
|
25836
|
+
const getMousePositionInCoordinates = (event, canvas2, scales) => {
|
|
25837
|
+
var _a2, _b2;
|
|
25838
|
+
const rect = canvas2.getBoundingClientRect();
|
|
25839
|
+
const x2 = event.clientX - rect.left;
|
|
25840
|
+
const y2 = event.clientY - rect.top;
|
|
25841
|
+
const xValue = ((_a2 = scales == null ? void 0 : scales.x) == null ? void 0 : _a2.getValueForPixel(x2)) ?? -1;
|
|
25842
|
+
const yValue = ((_b2 = scales == null ? void 0 : scales.y) == null ? void 0 : _b2.getValueForPixel(y2)) ?? -1;
|
|
25843
|
+
return { x: xValue, y: yValue };
|
|
25844
|
+
};
|
|
25845
|
+
const calculateAnnotationMetricsInValues = (annotation2) => {
|
|
25846
|
+
const { xMin, xMax, yMin, yMax, xValue, yValue, type } = annotation2 ?? {};
|
|
25847
|
+
let centerX;
|
|
25848
|
+
let centerY;
|
|
25849
|
+
let width;
|
|
25850
|
+
let height;
|
|
25851
|
+
if (!isNil(xMin) && !isNil(xMax) && !isNil(yMin) && !isNil(yMax) && type === AnnotationType.BOX) {
|
|
25852
|
+
centerX = (xMin + xMax) / 2;
|
|
25853
|
+
centerY = (yMin + yMax) / 2;
|
|
25854
|
+
width = xMax - xMin;
|
|
25855
|
+
height = yMax - yMin;
|
|
25856
|
+
} else if (!isNil(xValue) && !isNil(yValue) && type === AnnotationType.POINT) {
|
|
25857
|
+
centerX = xValue;
|
|
25858
|
+
centerY = yValue;
|
|
25859
|
+
width = 0;
|
|
25860
|
+
height = 0;
|
|
25861
|
+
}
|
|
25862
|
+
return {
|
|
25863
|
+
centerX,
|
|
25864
|
+
centerY,
|
|
25865
|
+
width,
|
|
25866
|
+
height
|
|
25867
|
+
};
|
|
25868
|
+
};
|
|
25869
|
+
const calculateAnnotationMetricsInValuesInPixels = (annotation2, scales) => {
|
|
25870
|
+
const { xMin, xMax, yMin, yMax, xValue, yValue, type } = annotation2 ?? {};
|
|
25871
|
+
const { x: x2, y: y2 } = scales ?? {};
|
|
25872
|
+
let centerX;
|
|
25873
|
+
let centerY;
|
|
25874
|
+
let width;
|
|
25875
|
+
let height;
|
|
25876
|
+
if (!isNil(xMin) && !isNil(xMax) && !isNil(yMin) && !isNil(yMax) && type === AnnotationType.BOX) {
|
|
25877
|
+
const xCenterValue = (xMin + xMax) / 2;
|
|
25878
|
+
const yCenterValue = (yMin + yMax) / 2;
|
|
25879
|
+
const xMinValue = (x2 == null ? void 0 : x2.getPixelForValue(xMin)) ?? 0;
|
|
25880
|
+
const xMaxValue = (x2 == null ? void 0 : x2.getPixelForValue(xMax)) ?? 0;
|
|
25881
|
+
const yMinValue = (y2 == null ? void 0 : y2.getPixelForValue(yMin)) ?? 0;
|
|
25882
|
+
const yMaxValue = (y2 == null ? void 0 : y2.getPixelForValue(yMax)) ?? 0;
|
|
25883
|
+
width = xMinValue - xMaxValue;
|
|
25884
|
+
height = yMinValue - yMaxValue;
|
|
25885
|
+
centerX = (x2 == null ? void 0 : x2.getPixelForValue(xCenterValue)) ?? -1;
|
|
25886
|
+
centerY = (y2 == null ? void 0 : y2.getPixelForValue(yCenterValue)) ?? -1;
|
|
25887
|
+
} else if (!isNil(xValue) && !isNil(yValue) && type === AnnotationType.POINT) {
|
|
25888
|
+
width = 0;
|
|
25889
|
+
height = 0;
|
|
25890
|
+
centerX = (x2 == null ? void 0 : x2.getPixelForValue(xValue)) ?? -1;
|
|
25891
|
+
centerY = (y2 == null ? void 0 : y2.getPixelForValue(yValue)) ?? -1;
|
|
25892
|
+
}
|
|
25893
|
+
return {
|
|
25894
|
+
centerX,
|
|
25895
|
+
centerY,
|
|
25896
|
+
width,
|
|
25897
|
+
height
|
|
25898
|
+
};
|
|
25899
|
+
};
|
|
25900
|
+
const handleAnnotationMouseDown = (event, canvas2, scales, annotations, setDraggingState, hoveredAnnotationId) => {
|
|
25901
|
+
const { x: x2, y: y2 } = getMousePositionInCoordinates(event, canvas2, scales);
|
|
25902
|
+
const annotation2 = hoveredAnnotationId ? annotations == null ? void 0 : annotations[hoveredAnnotationId] : null;
|
|
25903
|
+
if (!annotation2)
|
|
25904
|
+
return;
|
|
25905
|
+
const metrics = calculateAnnotationMetricsInValues(annotation2);
|
|
25906
|
+
if (annotation2 && annotation2.enableDrag && metrics.centerY && metrics.centerX) {
|
|
25907
|
+
const dragStartX = x2 - metrics.centerX;
|
|
25908
|
+
const dragStartY = y2 - metrics.centerY;
|
|
25909
|
+
setDraggingState(true, annotation2, dragStartX, dragStartY);
|
|
25910
|
+
if (annotation2 == null ? void 0 : annotation2.onDragStart) {
|
|
25911
|
+
annotation2.onDragStart({ x: x2, y: y2 });
|
|
25912
|
+
}
|
|
25913
|
+
}
|
|
25914
|
+
};
|
|
25915
|
+
const handleAnnotationMouseMove = (event, canvas2, scales, isDragging2, activeAnnotation, dragStartX, dragStartY, chart2) => {
|
|
25916
|
+
if (isDragging2 && activeAnnotation) {
|
|
25917
|
+
const { x: x2, y: y2 } = getMousePositionInCoordinates(event, canvas2, scales);
|
|
25918
|
+
const metrics = calculateAnnotationMetricsInValues(activeAnnotation);
|
|
25919
|
+
let newCenterX = x2 - dragStartX;
|
|
25920
|
+
let newCenterY = y2 - dragStartY;
|
|
25921
|
+
if ((activeAnnotation == null ? void 0 : activeAnnotation.type) === AnnotationType.POINT) {
|
|
25922
|
+
newCenterX = x2 - dragStartX;
|
|
25923
|
+
newCenterY = y2 - dragStartY;
|
|
25924
|
+
activeAnnotation.xValue = newCenterX;
|
|
25925
|
+
activeAnnotation.yValue = newCenterY;
|
|
25926
|
+
} else if ((activeAnnotation == null ? void 0 : activeAnnotation.type) === AnnotationType.BOX) {
|
|
25927
|
+
if ((metrics == null ? void 0 : metrics.width) && metrics.height) {
|
|
25928
|
+
activeAnnotation.xMin = newCenterX - metrics.width / 2;
|
|
25929
|
+
activeAnnotation.xMax = newCenterX + metrics.width / 2;
|
|
25930
|
+
activeAnnotation.yMin = newCenterY - metrics.height / 2;
|
|
25931
|
+
activeAnnotation.yMax = newCenterY + metrics.height / 2;
|
|
25932
|
+
}
|
|
25933
|
+
}
|
|
25934
|
+
chart2.update();
|
|
25935
|
+
if (activeAnnotation == null ? void 0 : activeAnnotation.onDrag) {
|
|
25936
|
+
activeAnnotation.onDrag({ x: x2, y: y2 });
|
|
25937
|
+
}
|
|
25938
|
+
const { ctx, width, height } = chart2;
|
|
25939
|
+
const { centerX, centerY } = calculateAnnotationMetricsInValues(activeAnnotation) ?? {};
|
|
25940
|
+
const { centerX: xValue, centerY: yValue } = calculateAnnotationMetricsInValuesInPixels(activeAnnotation, scales);
|
|
25941
|
+
if (centerX && centerY && xValue && yValue) {
|
|
25942
|
+
ctx.save();
|
|
25943
|
+
ctx.clearRect(0, 0, width, height);
|
|
25944
|
+
chart2.draw();
|
|
25945
|
+
ctx.font = DEFAULT_FONT_FAMILY;
|
|
25946
|
+
ctx.fillStyle = "black";
|
|
25947
|
+
let labelX = xValue - 45;
|
|
25948
|
+
let labelY = yValue - 20;
|
|
25949
|
+
const labelText = `X: ${round$2(centerX, 2)}, Y: ${round$2(centerY, 2)}`;
|
|
25950
|
+
const labelHeight = 14;
|
|
25951
|
+
if (labelY - labelHeight < 0) {
|
|
25952
|
+
labelY = yValue + labelHeight + 15;
|
|
25953
|
+
}
|
|
25954
|
+
if (labelY > height) {
|
|
25955
|
+
labelY = height - 7;
|
|
25956
|
+
}
|
|
25957
|
+
ctx.fillText(labelText, labelX, labelY);
|
|
25958
|
+
ctx.restore();
|
|
25959
|
+
}
|
|
25960
|
+
}
|
|
25961
|
+
};
|
|
25962
|
+
const handleAnnotationMouseUp = (isDragging2, activeAnnotation, chart2, setDraggingState) => {
|
|
25963
|
+
if (isDragging2) {
|
|
25964
|
+
if (activeAnnotation) {
|
|
25965
|
+
const { centerX = -1, centerY = -1 } = calculateAnnotationMetricsInValues(activeAnnotation) ?? {};
|
|
25966
|
+
if (activeAnnotation == null ? void 0 : activeAnnotation.onDragEnd) {
|
|
25967
|
+
activeAnnotation.onDragEnd({ x: centerX, y: centerY });
|
|
25968
|
+
}
|
|
25969
|
+
setDraggingState(false, null);
|
|
25970
|
+
}
|
|
25971
|
+
chart2.update();
|
|
25972
|
+
}
|
|
25973
|
+
};
|
|
25974
|
+
const annotationDraggerPlugin = {
|
|
25975
|
+
id: "annotationDraggerPlugin",
|
|
25976
|
+
afterUpdate(chart2) {
|
|
25977
|
+
var _a2, _b2, _c2, _d2;
|
|
25978
|
+
const { canvas: canvas2, scales, hoveredAnnotationId } = chart2;
|
|
25979
|
+
const pluginOptions = ((_b2 = (_a2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _a2.plugins) == null ? void 0 : _b2.annotationDraggerPlugin) || {
|
|
25980
|
+
enabled: false
|
|
25981
|
+
};
|
|
25982
|
+
const typedScales = { x: scales.x, y: scales.y };
|
|
25983
|
+
let annotations = ((_d2 = (_c2 = chart2.options.plugins) == null ? void 0 : _c2.annotation) == null ? void 0 : _d2.annotations) ?? {};
|
|
25984
|
+
if (!annotations)
|
|
25985
|
+
return;
|
|
25986
|
+
let isDragging2 = false;
|
|
25987
|
+
let dragStartX, dragStartY;
|
|
25988
|
+
let activeAnnotation = null;
|
|
25989
|
+
const setDraggingState = (dragging, annotation2, startX, startY) => {
|
|
25990
|
+
isDragging2 = dragging;
|
|
25991
|
+
activeAnnotation = annotation2;
|
|
25992
|
+
if (startX !== void 0 && startY !== void 0) {
|
|
25993
|
+
dragStartX = startX;
|
|
25994
|
+
dragStartY = startY;
|
|
25995
|
+
}
|
|
25996
|
+
};
|
|
25997
|
+
if (!canvas2.dataset.annotationDraggerInitialized && pluginOptions.enabled && hoveredAnnotationId) {
|
|
25998
|
+
canvas2.addEventListener(MouseEvents.MOUSEDOWN, (event) => {
|
|
25999
|
+
handleAnnotationMouseDown(
|
|
26000
|
+
event,
|
|
26001
|
+
canvas2,
|
|
26002
|
+
typedScales,
|
|
26003
|
+
annotations,
|
|
26004
|
+
setDraggingState,
|
|
26005
|
+
chart2.hoveredAnnotationId
|
|
26006
|
+
);
|
|
26007
|
+
});
|
|
26008
|
+
canvas2.addEventListener(MouseEvents.MOUSEMOVE, (event) => {
|
|
26009
|
+
handleAnnotationMouseMove(
|
|
26010
|
+
event,
|
|
26011
|
+
canvas2,
|
|
26012
|
+
typedScales,
|
|
26013
|
+
isDragging2,
|
|
26014
|
+
activeAnnotation,
|
|
26015
|
+
dragStartX,
|
|
26016
|
+
dragStartY,
|
|
26017
|
+
chart2
|
|
26018
|
+
);
|
|
26019
|
+
});
|
|
26020
|
+
canvas2.addEventListener(MouseEvents.MOUSEUP, () => {
|
|
26021
|
+
handleAnnotationMouseUp(
|
|
26022
|
+
isDragging2,
|
|
26023
|
+
activeAnnotation,
|
|
26024
|
+
chart2,
|
|
26025
|
+
setDraggingState
|
|
26026
|
+
);
|
|
26027
|
+
});
|
|
26028
|
+
canvas2.dataset.annotationDraggerInitialized = "true";
|
|
26029
|
+
}
|
|
26030
|
+
if (!pluginOptions.enabled) {
|
|
26031
|
+
canvas2.removeEventListener(MouseEvents.MOUSEDOWN, () => {
|
|
26032
|
+
});
|
|
26033
|
+
canvas2.removeEventListener(MouseEvents.MOUSEMOVE, () => {
|
|
26034
|
+
});
|
|
26035
|
+
canvas2.removeEventListener(MouseEvents.MOUSEUP, () => {
|
|
26036
|
+
});
|
|
26037
|
+
canvas2.dataset.annotationDraggerInitialized = "";
|
|
26038
|
+
}
|
|
26039
|
+
}
|
|
26040
|
+
};
|
|
25897
26041
|
var defaultTranslations = /* @__PURE__ */ ((defaultTranslations2) => {
|
|
25898
26042
|
defaultTranslations2["label"] = "Label";
|
|
25899
26043
|
defaultTranslations2["pointsLines"] = "Points & lines";
|
|
@@ -25908,6 +26052,7 @@ var defaultTranslations = /* @__PURE__ */ ((defaultTranslations2) => {
|
|
|
25908
26052
|
defaultTranslations2["dragToZoom"] = "Drag to zoom";
|
|
25909
26053
|
defaultTranslations2["dragToPan"] = "Drag to pan";
|
|
25910
26054
|
defaultTranslations2["dragToMovePoints"] = "Drag to move points";
|
|
26055
|
+
defaultTranslations2["dragToMoveAnnotation"] = "Drag to move annotation";
|
|
25911
26056
|
defaultTranslations2["dragDisabled"] = "Drag disabled";
|
|
25912
26057
|
defaultTranslations2["hideLegend"] = "Hide Legend";
|
|
25913
26058
|
defaultTranslations2["showLegend"] = "Show Legend";
|
|
@@ -25996,7 +26141,7 @@ const bottom = "_bottom_wpro0_161";
|
|
|
25996
26141
|
const dropzonePlaceholder = "_dropzonePlaceholder_wpro0_165";
|
|
25997
26142
|
const isActive = "_isActive_wpro0_173";
|
|
25998
26143
|
const resizeContainer = "_resizeContainer_wpro0_176";
|
|
25999
|
-
const styles$
|
|
26144
|
+
const styles$2 = {
|
|
26000
26145
|
legend,
|
|
26001
26146
|
isDragging,
|
|
26002
26147
|
legendItems,
|
|
@@ -26026,11 +26171,6 @@ var ChartType = /* @__PURE__ */ ((ChartType2) => {
|
|
|
26026
26171
|
ChartType2["SCATTER"] = "scatter";
|
|
26027
26172
|
return ChartType2;
|
|
26028
26173
|
})(ChartType || {});
|
|
26029
|
-
var ChartDirection = /* @__PURE__ */ ((ChartDirection2) => {
|
|
26030
|
-
ChartDirection2["VERTICAL"] = "vertical";
|
|
26031
|
-
ChartDirection2["HORIZONTAL"] = "horizontal";
|
|
26032
|
-
return ChartDirection2;
|
|
26033
|
-
})(ChartDirection || {});
|
|
26034
26174
|
const circleSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiIGZpbGw9ImN1cnJlbnRDb2xvciIgLz48L3N2Zz4=";
|
|
26035
26175
|
const rectSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHJlY3QgeD0iMiIgeT0iMiIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIiBmaWxsPSJjdXJyZW50Q29sb3IiIC8+PC9zdmc+";
|
|
26036
26176
|
const rectRotSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHJlY3QgeD0iMyIgeT0iMyIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiBmaWxsPSJjdXJyZW50Q29sb3IiIHRyYW5zZm9ybT0ncm90YXRlKDQ1IDEyIDEyKScgLz48L3N2Zz4=";
|
|
@@ -26041,7 +26181,7 @@ const LineItem = ({ dataset }) => {
|
|
|
26041
26181
|
const { borderColor, borderDash, borderWidth } = dataset;
|
|
26042
26182
|
const offset = borderDash.length ? (LEGEND_SYMBOL_SIZE$1 - borderDash[0]) / 2 % (borderDash[0] + borderDash[1]) * -1 : 0;
|
|
26043
26183
|
const borderDashString = ((_a2 = dataset.borderDash) == null ? void 0 : _a2.join(" ")) || "";
|
|
26044
|
-
return /* @__PURE__ */ jsx("span", { className: styles$
|
|
26184
|
+
return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemLine, children: /* @__PURE__ */ jsx(
|
|
26045
26185
|
"svg",
|
|
26046
26186
|
{
|
|
26047
26187
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -26073,7 +26213,7 @@ const PointItem = ({ dataset }) => {
|
|
|
26073
26213
|
rectRot: rectRotSvg,
|
|
26074
26214
|
rect: rectSvg
|
|
26075
26215
|
};
|
|
26076
|
-
return /* @__PURE__ */ jsx("span", { className: styles$
|
|
26216
|
+
return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemPoint, children: /* @__PURE__ */ jsx(
|
|
26077
26217
|
Icon,
|
|
26078
26218
|
{
|
|
26079
26219
|
icon: icons[pointStyle] || circleSvg,
|
|
@@ -26085,15 +26225,15 @@ const PointItem = ({ dataset }) => {
|
|
|
26085
26225
|
const BoxItem = ({ dataset }) => {
|
|
26086
26226
|
const { backgroundColor } = dataset;
|
|
26087
26227
|
const style = { backgroundColor };
|
|
26088
|
-
return /* @__PURE__ */ jsx("span", { className: styles$
|
|
26228
|
+
return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemBox, style });
|
|
26089
26229
|
};
|
|
26090
26230
|
const LegendItemLine = ({ dataset }) => {
|
|
26091
26231
|
const { annotationType, showLine } = dataset;
|
|
26092
26232
|
switch (annotationType) {
|
|
26093
|
-
case AnnotationType.Box:
|
|
26094
|
-
case AnnotationType.Ellipse:
|
|
26233
|
+
case AnnotationType$1.Box:
|
|
26234
|
+
case AnnotationType$1.Ellipse:
|
|
26095
26235
|
return /* @__PURE__ */ jsx(BoxItem, { dataset });
|
|
26096
|
-
case AnnotationType.Line:
|
|
26236
|
+
case AnnotationType$1.Line:
|
|
26097
26237
|
return /* @__PURE__ */ jsx(LineItem, { dataset });
|
|
26098
26238
|
default:
|
|
26099
26239
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -26108,11 +26248,11 @@ const renderLegendItemSymbol = (dataset, chartType) => {
|
|
|
26108
26248
|
case ChartType.LINE:
|
|
26109
26249
|
return /* @__PURE__ */ jsx(LegendItemLine, { dataset });
|
|
26110
26250
|
case ChartType.BAR:
|
|
26111
|
-
return /* @__PURE__ */ jsx("span", { className: styles$
|
|
26251
|
+
return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemBox, children: /* @__PURE__ */ jsx(TbSquareFilled, { color: dataset.borderColor }) });
|
|
26112
26252
|
case ChartType.PIE:
|
|
26113
|
-
return /* @__PURE__ */ jsx("span", { className: styles$
|
|
26253
|
+
return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemPoint, children: /* @__PURE__ */ jsx(Icon, { icon: circleSvg }) });
|
|
26114
26254
|
case ChartType.SCATTER:
|
|
26115
|
-
return /* @__PURE__ */ jsx("span", { className: styles$
|
|
26255
|
+
return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemPoint, children: /* @__PURE__ */ jsx(TbCircleFilled, { color: dataset.borderColor }) });
|
|
26116
26256
|
default:
|
|
26117
26257
|
return null;
|
|
26118
26258
|
}
|
|
@@ -26126,18 +26266,18 @@ const LegendItem = ({
|
|
|
26126
26266
|
return /* @__PURE__ */ jsxs(
|
|
26127
26267
|
"div",
|
|
26128
26268
|
{
|
|
26129
|
-
className: cx(styles$
|
|
26269
|
+
className: cx(styles$2.legendItem, hidden && styles$2.isHidden),
|
|
26130
26270
|
onClick: handleClick,
|
|
26131
26271
|
children: [
|
|
26132
26272
|
/* @__PURE__ */ jsx(
|
|
26133
26273
|
"span",
|
|
26134
26274
|
{
|
|
26135
|
-
className: styles$
|
|
26275
|
+
className: styles$2.legendItemSymbol,
|
|
26136
26276
|
style: { width: LEGEND_SYMBOL_SIZE },
|
|
26137
26277
|
children: renderLegendItemSymbol(dataset, chartType)
|
|
26138
26278
|
}
|
|
26139
26279
|
),
|
|
26140
|
-
/* @__PURE__ */ jsx("span", { className: styles$
|
|
26280
|
+
/* @__PURE__ */ jsx("span", { className: styles$2.legendItemText, children: dataset.label })
|
|
26141
26281
|
]
|
|
26142
26282
|
}
|
|
26143
26283
|
);
|
|
@@ -26204,7 +26344,7 @@ const LegendItems = ({
|
|
|
26204
26344
|
datasets,
|
|
26205
26345
|
legendClick,
|
|
26206
26346
|
chartType
|
|
26207
|
-
}) => /* @__PURE__ */ jsx("div", { className: styles$
|
|
26347
|
+
}) => /* @__PURE__ */ jsx("div", { className: styles$2.legendItems, children: items.map((item) => {
|
|
26208
26348
|
if (datasets[item.datasetIndex].hideLegend) {
|
|
26209
26349
|
return null;
|
|
26210
26350
|
}
|
|
@@ -26237,13 +26377,13 @@ const LegendPanel = forwardRef(
|
|
|
26237
26377
|
{
|
|
26238
26378
|
ref,
|
|
26239
26379
|
className: cx(
|
|
26240
|
-
styles$
|
|
26241
|
-
!legendEnabled && styles$
|
|
26242
|
-
isDragging2 && styles$
|
|
26380
|
+
styles$2.legend,
|
|
26381
|
+
!legendEnabled && styles$2.isHidden,
|
|
26382
|
+
isDragging2 && styles$2.isDragging
|
|
26243
26383
|
),
|
|
26244
26384
|
style,
|
|
26245
26385
|
children: [
|
|
26246
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
26386
|
+
/* @__PURE__ */ jsx("div", { className: styles$2.legendToggle, children: /* @__PURE__ */ jsx(
|
|
26247
26387
|
Button,
|
|
26248
26388
|
{
|
|
26249
26389
|
onClick: () => setLegendEnabled(!legendEnabled),
|
|
@@ -26282,17 +26422,17 @@ const LegendDropZone = (legendDropZoneProps) => {
|
|
|
26282
26422
|
{
|
|
26283
26423
|
ref: dropRef,
|
|
26284
26424
|
className: cx(
|
|
26285
|
-
styles$
|
|
26286
|
-
isActive2 && styles$
|
|
26287
|
-
position.includes("left") && styles$
|
|
26288
|
-
position.includes("right") && styles$
|
|
26289
|
-
position.includes("top") && styles$
|
|
26290
|
-
position.includes("bottom") && styles$
|
|
26425
|
+
styles$2.dropzone,
|
|
26426
|
+
isActive2 && styles$2.isActive,
|
|
26427
|
+
position.includes("left") && styles$2.left,
|
|
26428
|
+
position.includes("right") && styles$2.right,
|
|
26429
|
+
position.includes("top") && styles$2.top,
|
|
26430
|
+
position.includes("bottom") && styles$2.bottom
|
|
26291
26431
|
),
|
|
26292
26432
|
children: /* @__PURE__ */ jsx(
|
|
26293
26433
|
"div",
|
|
26294
26434
|
{
|
|
26295
|
-
className: styles$
|
|
26435
|
+
className: styles$2.dropzonePlaceholder,
|
|
26296
26436
|
style: { ...placeholderSize, margin: LEGEND_MARGIN }
|
|
26297
26437
|
}
|
|
26298
26438
|
)
|
|
@@ -26311,7 +26451,7 @@ const LegendDropZones = (legendDropZonesProps) => {
|
|
|
26311
26451
|
return /* @__PURE__ */ jsx(
|
|
26312
26452
|
"div",
|
|
26313
26453
|
{
|
|
26314
|
-
className: styles$
|
|
26454
|
+
className: styles$2.dropzoneContainer,
|
|
26315
26455
|
style: {
|
|
26316
26456
|
top: top2,
|
|
26317
26457
|
left: left2,
|
|
@@ -26353,7 +26493,7 @@ const Legend2 = ({ chartRef, legendConfig }) => {
|
|
|
26353
26493
|
})
|
|
26354
26494
|
}));
|
|
26355
26495
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26356
|
-
/* @__PURE__ */ jsx("div", { ref: resizeRef, className: styles$
|
|
26496
|
+
/* @__PURE__ */ jsx("div", { ref: resizeRef, className: styles$2.resizeContainer }),
|
|
26357
26497
|
/* @__PURE__ */ jsx(
|
|
26358
26498
|
LegendPanel,
|
|
26359
26499
|
{
|
|
@@ -26391,7 +26531,8 @@ Chart$2.register(
|
|
|
26391
26531
|
plugin$1,
|
|
26392
26532
|
plugin,
|
|
26393
26533
|
annotation,
|
|
26394
|
-
chartAreaTextPlugin
|
|
26534
|
+
chartAreaTextPlugin,
|
|
26535
|
+
annotationDraggerPlugin
|
|
26395
26536
|
);
|
|
26396
26537
|
const LineChart = (props) => {
|
|
26397
26538
|
var _a2, _b2;
|
|
@@ -26399,7 +26540,7 @@ const LineChart = (props) => {
|
|
|
26399
26540
|
const chartRef = useRef(null);
|
|
26400
26541
|
const { table: table2 } = props;
|
|
26401
26542
|
const { translations, languageKey } = getConfig();
|
|
26402
|
-
const chart2 = getDefaultProps$
|
|
26543
|
+
const chart2 = getDefaultProps$2(props);
|
|
26403
26544
|
const {
|
|
26404
26545
|
data: { datasets } = { datasets: [] },
|
|
26405
26546
|
options,
|
|
@@ -26446,7 +26587,7 @@ const LineChart = (props) => {
|
|
|
26446
26587
|
return /* @__PURE__ */ jsxs(
|
|
26447
26588
|
"div",
|
|
26448
26589
|
{
|
|
26449
|
-
className: getClassName(chartStyling, styles$
|
|
26590
|
+
className: getClassName(chartStyling, styles$4),
|
|
26450
26591
|
style: {
|
|
26451
26592
|
width: chartStyling.width || AUTO,
|
|
26452
26593
|
height: chartStyling.height || AUTO
|
|
@@ -26469,7 +26610,7 @@ const LineChart = (props) => {
|
|
|
26469
26610
|
controlsPortalId
|
|
26470
26611
|
}
|
|
26471
26612
|
),
|
|
26472
|
-
table2 && state.showTable ? /* @__PURE__ */ jsx("div", { className: styles$
|
|
26613
|
+
table2 && state.showTable ? /* @__PURE__ */ jsx("div", { className: styles$4.table, children: table2 }) : /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsxs("div", { className: styles$4.canvas, id: "canvas", children: [
|
|
26473
26614
|
/* @__PURE__ */ jsx(
|
|
26474
26615
|
Line,
|
|
26475
26616
|
{
|
|
@@ -26497,6 +26638,7 @@ const LineChart = (props) => {
|
|
|
26497
26638
|
},
|
|
26498
26639
|
generateKey([
|
|
26499
26640
|
state.enableDragPoints,
|
|
26641
|
+
state.enableDragAnnotation,
|
|
26500
26642
|
state.zoomEnabled,
|
|
26501
26643
|
state.panEnabled,
|
|
26502
26644
|
languageKey
|
|
@@ -26504,7 +26646,7 @@ const LineChart = (props) => {
|
|
|
26504
26646
|
);
|
|
26505
26647
|
};
|
|
26506
26648
|
const LineChartWithLegend = (props) => {
|
|
26507
|
-
const { options } = getDefaultProps$
|
|
26649
|
+
const { options } = getDefaultProps$2(props);
|
|
26508
26650
|
return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(LineChart, { ...props }) });
|
|
26509
26651
|
};
|
|
26510
26652
|
const initializeLineChart = ({ languageKey = "en", ...options }) => {
|
|
@@ -26518,73 +26660,73 @@ const initializeLineChart = ({ languageKey = "en", ...options }) => {
|
|
|
26518
26660
|
}
|
|
26519
26661
|
});
|
|
26520
26662
|
};
|
|
26521
|
-
const chart$
|
|
26522
|
-
const fixedHeight$
|
|
26523
|
-
const stretchHeight$
|
|
26524
|
-
const zoomForm$
|
|
26525
|
-
const zoomReset$
|
|
26526
|
-
const help$
|
|
26527
|
-
const autoWeight$
|
|
26528
|
-
const styles$
|
|
26529
|
-
chart: chart$
|
|
26530
|
-
fixedHeight: fixedHeight$
|
|
26531
|
-
stretchHeight: stretchHeight$
|
|
26532
|
-
zoomForm: zoomForm$
|
|
26533
|
-
zoomReset: zoomReset$
|
|
26534
|
-
help: help$
|
|
26535
|
-
autoWeight: autoWeight$
|
|
26663
|
+
const chart$1 = "_chart_1jdnu_1";
|
|
26664
|
+
const fixedHeight$1 = "_fixedHeight_1jdnu_13";
|
|
26665
|
+
const stretchHeight$1 = "_stretchHeight_1jdnu_19";
|
|
26666
|
+
const zoomForm$1 = "_zoomForm_1jdnu_32";
|
|
26667
|
+
const zoomReset$1 = "_zoomReset_1jdnu_40";
|
|
26668
|
+
const help$1 = "_help_1jdnu_43";
|
|
26669
|
+
const autoWeight$1 = "_autoWeight_1jdnu_47";
|
|
26670
|
+
const styles$1 = {
|
|
26671
|
+
chart: chart$1,
|
|
26672
|
+
fixedHeight: fixedHeight$1,
|
|
26673
|
+
stretchHeight: stretchHeight$1,
|
|
26674
|
+
zoomForm: zoomForm$1,
|
|
26675
|
+
zoomReset: zoomReset$1,
|
|
26676
|
+
help: help$1,
|
|
26677
|
+
autoWeight: autoWeight$1
|
|
26536
26678
|
};
|
|
26537
|
-
const defaultChartStyling$
|
|
26679
|
+
const defaultChartStyling$1 = (styling) => ({
|
|
26538
26680
|
width: styling == null ? void 0 : styling.width,
|
|
26539
26681
|
height: styling == null ? void 0 : styling.height,
|
|
26540
26682
|
maintainAspectRatio: (styling == null ? void 0 : styling.maintainAspectRatio) || false,
|
|
26541
26683
|
staticChartHeight: (styling == null ? void 0 : styling.staticChartHeight) || false,
|
|
26542
26684
|
performanceMode: (styling == null ? void 0 : styling.performanceMode) ?? true
|
|
26543
26685
|
});
|
|
26544
|
-
const defaultTooltip$
|
|
26686
|
+
const defaultTooltip$1 = (tooltip) => ({
|
|
26545
26687
|
tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
|
|
26546
26688
|
showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) || false
|
|
26547
26689
|
});
|
|
26548
|
-
const defaultGraph$
|
|
26690
|
+
const defaultGraph$1 = (graph) => ({
|
|
26549
26691
|
showDataLabels: (graph == null ? void 0 : graph.showDataLabels) || false,
|
|
26550
26692
|
stacked: (graph == null ? void 0 : graph.stacked) || false,
|
|
26551
26693
|
cutout: (graph == null ? void 0 : graph.cutout) || 0
|
|
26552
26694
|
});
|
|
26553
|
-
const defaultLegend$
|
|
26695
|
+
const defaultLegend$1 = (legend2) => ({
|
|
26554
26696
|
display: (legend2 == null ? void 0 : legend2.display) ?? true,
|
|
26555
26697
|
useDataset: (legend2 == null ? void 0 : legend2.useDataset) || false,
|
|
26556
26698
|
position: (legend2 == null ? void 0 : legend2.position) || Position.Bottom,
|
|
26557
26699
|
align: (legend2 == null ? void 0 : legend2.align) || AlignOptions.Center
|
|
26558
26700
|
});
|
|
26559
|
-
const defaultChartOptions$
|
|
26701
|
+
const defaultChartOptions$1 = (options) => ({
|
|
26560
26702
|
enableZoom: (options == null ? void 0 : options.enableZoom) || false,
|
|
26561
26703
|
enablePan: (options == null ? void 0 : options.enablePan) || false
|
|
26562
26704
|
});
|
|
26563
|
-
const defaultInteractions$
|
|
26705
|
+
const defaultInteractions$1 = (interactions) => ({
|
|
26564
26706
|
onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
|
|
26565
26707
|
onHover: interactions == null ? void 0 : interactions.onHover,
|
|
26566
26708
|
onUnhover: interactions == null ? void 0 : interactions.onUnhover
|
|
26567
26709
|
});
|
|
26568
|
-
const defaultChartData
|
|
26710
|
+
const defaultChartData = (data) => {
|
|
26569
26711
|
return {
|
|
26570
26712
|
labels: (data == null ? void 0 : data.labels) || [],
|
|
26571
26713
|
datasets: (data == null ? void 0 : data.datasets) || []
|
|
26572
26714
|
};
|
|
26573
26715
|
};
|
|
26574
|
-
const getDefaultProps$
|
|
26716
|
+
const getDefaultProps$1 = (props) => {
|
|
26575
26717
|
const chart2 = (props == null ? void 0 : props.chart) || {};
|
|
26576
26718
|
const options = (chart2 == null ? void 0 : chart2.options) || {};
|
|
26577
26719
|
return {
|
|
26578
26720
|
testId: (chart2 == null ? void 0 : chart2.testId) ?? null,
|
|
26579
|
-
data: defaultChartData
|
|
26721
|
+
data: defaultChartData(chart2 == null ? void 0 : chart2.data),
|
|
26580
26722
|
options: {
|
|
26581
26723
|
title: (options == null ? void 0 : options.title) || "",
|
|
26582
|
-
chartStyling: defaultChartStyling$
|
|
26583
|
-
tooltip: defaultTooltip$
|
|
26584
|
-
graph: defaultGraph$
|
|
26585
|
-
legend: defaultLegend$
|
|
26586
|
-
chartOptions: defaultChartOptions$
|
|
26587
|
-
interactions: defaultInteractions$
|
|
26724
|
+
chartStyling: defaultChartStyling$1(options == null ? void 0 : options.chartStyling),
|
|
26725
|
+
tooltip: defaultTooltip$1(options == null ? void 0 : options.tooltip),
|
|
26726
|
+
graph: defaultGraph$1(options == null ? void 0 : options.graph),
|
|
26727
|
+
legend: defaultLegend$1(options == null ? void 0 : options.legend),
|
|
26728
|
+
chartOptions: defaultChartOptions$1(options == null ? void 0 : options.chartOptions),
|
|
26729
|
+
interactions: defaultInteractions$1(options == null ? void 0 : options.interactions)
|
|
26588
26730
|
}
|
|
26589
26731
|
};
|
|
26590
26732
|
};
|
|
@@ -26772,7 +26914,7 @@ Chart$2.register(
|
|
|
26772
26914
|
);
|
|
26773
26915
|
const PieChart = (props) => {
|
|
26774
26916
|
setDefaultTheme();
|
|
26775
|
-
const chart2 = getDefaultProps$
|
|
26917
|
+
const chart2 = getDefaultProps$1(props);
|
|
26776
26918
|
const chartRef = useRef(null);
|
|
26777
26919
|
const { data, options, testId } = chart2;
|
|
26778
26920
|
const {
|
|
@@ -26788,8 +26930,8 @@ const PieChart = (props) => {
|
|
|
26788
26930
|
"div",
|
|
26789
26931
|
{
|
|
26790
26932
|
className: cx(
|
|
26791
|
-
styles$
|
|
26792
|
-
!options.chartStyling.width || !options.chartStyling.height ? options.chartStyling.staticChartHeight ? styles$
|
|
26933
|
+
styles$1.chart,
|
|
26934
|
+
!options.chartStyling.width || !options.chartStyling.height ? options.chartStyling.staticChartHeight ? styles$1.fixedHeight : styles$1.stretchHeight : ""
|
|
26793
26935
|
),
|
|
26794
26936
|
style: {
|
|
26795
26937
|
width: options.chartStyling.width || "auto",
|
|
@@ -26833,7 +26975,7 @@ const PieChart = (props) => {
|
|
|
26833
26975
|
);
|
|
26834
26976
|
};
|
|
26835
26977
|
const PieChartWithLegend = (props) => {
|
|
26836
|
-
const { options } = getDefaultProps$
|
|
26978
|
+
const { options } = getDefaultProps$1(props);
|
|
26837
26979
|
return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(PieChart, { ...props }) });
|
|
26838
26980
|
};
|
|
26839
26981
|
/*!
|
|
@@ -39422,7 +39564,7 @@ const getBarChartToolTips = (options) => {
|
|
|
39422
39564
|
valueUnit: (yAxis == null ? void 0 : yAxis.unit) || ""
|
|
39423
39565
|
};
|
|
39424
39566
|
};
|
|
39425
|
-
const
|
|
39567
|
+
const titleCallback = (tooltipItems, _data) => {
|
|
39426
39568
|
var _a3, _b2;
|
|
39427
39569
|
const barLabel = ((_a3 = tooltipItems == null ? void 0 : tooltipItems[0]) == null ? void 0 : _a3.label) || "";
|
|
39428
39570
|
const labels = getTooltipLabels((_b2 = tooltipItems == null ? void 0 : tooltipItems[0]) == null ? void 0 : _b2.dataset);
|
|
@@ -39437,7 +39579,7 @@ const getBarChartToolTips = (options) => {
|
|
|
39437
39579
|
}
|
|
39438
39580
|
return displayNumber(roundByMagnitude(labelNumber), roundOptions);
|
|
39439
39581
|
};
|
|
39440
|
-
const
|
|
39582
|
+
const labelCallback = (tooltipItem) => {
|
|
39441
39583
|
var _a3;
|
|
39442
39584
|
const { showLabelsInTooltips = false } = (options == null ? void 0 : options.tooltip) || {};
|
|
39443
39585
|
let label = ((_a3 = tooltipItem.dataset) == null ? void 0 : _a3.label) || "";
|
|
@@ -39479,8 +39621,8 @@ const getBarChartToolTips = (options) => {
|
|
|
39479
39621
|
boxHeight: LEGEND_LABEL_BOX_SIZE,
|
|
39480
39622
|
boxPadding: TOOLTIP_BOX_PADDING,
|
|
39481
39623
|
callbacks: {
|
|
39482
|
-
title:
|
|
39483
|
-
label:
|
|
39624
|
+
title: titleCallback,
|
|
39625
|
+
label: labelCallback,
|
|
39484
39626
|
afterLabel: afterLabelCallback
|
|
39485
39627
|
}
|
|
39486
39628
|
};
|
|
@@ -39523,31 +39665,31 @@ const useBarChartOptions = ({
|
|
|
39523
39665
|
}
|
|
39524
39666
|
};
|
|
39525
39667
|
};
|
|
39526
|
-
const chart
|
|
39668
|
+
const chart = "_chart_x1sru_1";
|
|
39527
39669
|
const canvas = "_canvas_x1sru_10";
|
|
39528
|
-
const fixedHeight
|
|
39529
|
-
const stretchHeight
|
|
39530
|
-
const zoomForm
|
|
39531
|
-
const zoomReset
|
|
39532
|
-
const help
|
|
39533
|
-
const autoWeight
|
|
39670
|
+
const fixedHeight = "_fixedHeight_x1sru_19";
|
|
39671
|
+
const stretchHeight = "_stretchHeight_x1sru_25";
|
|
39672
|
+
const zoomForm = "_zoomForm_x1sru_38";
|
|
39673
|
+
const zoomReset = "_zoomReset_x1sru_46";
|
|
39674
|
+
const help = "_help_x1sru_49";
|
|
39675
|
+
const autoWeight = "_autoWeight_x1sru_53";
|
|
39534
39676
|
const actions = "_actions_x1sru_57";
|
|
39535
|
-
const styles
|
|
39536
|
-
chart
|
|
39677
|
+
const styles = {
|
|
39678
|
+
chart,
|
|
39537
39679
|
canvas,
|
|
39538
|
-
fixedHeight
|
|
39539
|
-
stretchHeight
|
|
39540
|
-
zoomForm
|
|
39541
|
-
zoomReset
|
|
39542
|
-
help
|
|
39543
|
-
autoWeight
|
|
39680
|
+
fixedHeight,
|
|
39681
|
+
stretchHeight,
|
|
39682
|
+
zoomForm,
|
|
39683
|
+
zoomReset,
|
|
39684
|
+
help,
|
|
39685
|
+
autoWeight,
|
|
39544
39686
|
actions
|
|
39545
39687
|
};
|
|
39546
|
-
const defaultAxes
|
|
39688
|
+
const defaultAxes = (axes) => ({
|
|
39547
39689
|
x: (axes == null ? void 0 : axes.x) || [{}],
|
|
39548
39690
|
y: (axes == null ? void 0 : axes.y) || [{}]
|
|
39549
39691
|
});
|
|
39550
|
-
const defaultAdditionalAxesOptions
|
|
39692
|
+
const defaultAdditionalAxesOptions = (options) => ({
|
|
39551
39693
|
chartScaleType: (options == null ? void 0 : options.chartScaleType) || "linear",
|
|
39552
39694
|
reverse: (options == null ? void 0 : options.reverse) || false,
|
|
39553
39695
|
stacked: (options == null ? void 0 : options.stacked) || false,
|
|
@@ -39558,30 +39700,30 @@ const defaultAdditionalAxesOptions$1 = (options) => ({
|
|
|
39558
39700
|
min: options == null ? void 0 : options.min,
|
|
39559
39701
|
max: options == null ? void 0 : options.max
|
|
39560
39702
|
});
|
|
39561
|
-
const defaultChartStyling
|
|
39703
|
+
const defaultChartStyling = (styling) => ({
|
|
39562
39704
|
width: styling == null ? void 0 : styling.width,
|
|
39563
39705
|
height: styling == null ? void 0 : styling.height,
|
|
39564
39706
|
maintainAspectRatio: (styling == null ? void 0 : styling.maintainAspectRatio) || false,
|
|
39565
39707
|
staticChartHeight: (styling == null ? void 0 : styling.staticChartHeight) || false,
|
|
39566
39708
|
performanceMode: (styling == null ? void 0 : styling.performanceMode) ?? true
|
|
39567
39709
|
});
|
|
39568
|
-
const defaultTooltip
|
|
39710
|
+
const defaultTooltip = (tooltip) => ({
|
|
39569
39711
|
tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
|
|
39570
39712
|
showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) || false
|
|
39571
39713
|
});
|
|
39572
|
-
const defaultGraph
|
|
39714
|
+
const defaultGraph = (graph) => ({
|
|
39573
39715
|
showDataLabels: (graph == null ? void 0 : graph.showDataLabels) || false,
|
|
39574
39716
|
showMinorGridlines: (graph == null ? void 0 : graph.showMinorGridlines) || false
|
|
39575
39717
|
});
|
|
39576
|
-
const defaultAnnotationsData
|
|
39718
|
+
const defaultAnnotationsData = (annotationsData) => {
|
|
39577
39719
|
return annotationsData ? annotationsData.map((ann) => ({ ...ann, display: (ann == null ? void 0 : ann.display) ?? true })) : [];
|
|
39578
39720
|
};
|
|
39579
|
-
const defaultAnnotations
|
|
39721
|
+
const defaultAnnotations = (annotations) => ({
|
|
39580
39722
|
showAnnotations: (annotations == null ? void 0 : annotations.showAnnotations) ?? true,
|
|
39581
39723
|
controlAnnotation: (annotations == null ? void 0 : annotations.controlAnnotation) || false,
|
|
39582
|
-
annotationsData: defaultAnnotationsData
|
|
39724
|
+
annotationsData: defaultAnnotationsData(annotations == null ? void 0 : annotations.annotationsData)
|
|
39583
39725
|
});
|
|
39584
|
-
const defaultLegend
|
|
39726
|
+
const defaultLegend = (legend2) => ({
|
|
39585
39727
|
display: (legend2 == null ? void 0 : legend2.display) ?? true,
|
|
39586
39728
|
position: (legend2 == null ? void 0 : legend2.position) || Position.TopLeft,
|
|
39587
39729
|
align: (legend2 == null ? void 0 : legend2.align) || AlignOptions.Center,
|
|
@@ -39590,11 +39732,11 @@ const defaultLegend$1 = (legend2) => ({
|
|
|
39590
39732
|
customLegendContainerID: ""
|
|
39591
39733
|
}
|
|
39592
39734
|
});
|
|
39593
|
-
const defaultChartOptions
|
|
39735
|
+
const defaultChartOptions = (options) => ({
|
|
39594
39736
|
enableZoom: (options == null ? void 0 : options.enableZoom) || false,
|
|
39595
39737
|
enablePan: (options == null ? void 0 : options.enablePan) || false
|
|
39596
39738
|
});
|
|
39597
|
-
const defaultInteractions
|
|
39739
|
+
const defaultInteractions = (interactions) => ({
|
|
39598
39740
|
onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
|
|
39599
39741
|
onHover: interactions == null ? void 0 : interactions.onHover,
|
|
39600
39742
|
onUnhover: interactions == null ? void 0 : interactions.onUnhover
|
|
@@ -39609,7 +39751,7 @@ const defaultDragData = (dragData) => ({
|
|
|
39609
39751
|
onDrag: dragData == null ? void 0 : dragData.onDrag,
|
|
39610
39752
|
onDragEnd: dragData == null ? void 0 : dragData.onDragEnd
|
|
39611
39753
|
});
|
|
39612
|
-
const getDefaultProps
|
|
39754
|
+
const getDefaultProps = (props) => {
|
|
39613
39755
|
const chart2 = (props == null ? void 0 : props.chart) || {};
|
|
39614
39756
|
const options = (chart2 == null ? void 0 : chart2.options) || {};
|
|
39615
39757
|
return {
|
|
@@ -39618,17 +39760,17 @@ const getDefaultProps$1 = (props) => {
|
|
|
39618
39760
|
options: {
|
|
39619
39761
|
title: (options == null ? void 0 : options.title) || "",
|
|
39620
39762
|
direction: (options == null ? void 0 : options.direction) || "vertical",
|
|
39621
|
-
axes: defaultAxes
|
|
39622
|
-
additionalAxesOptions: defaultAdditionalAxesOptions
|
|
39763
|
+
axes: defaultAxes(options == null ? void 0 : options.axes),
|
|
39764
|
+
additionalAxesOptions: defaultAdditionalAxesOptions(
|
|
39623
39765
|
options == null ? void 0 : options.additionalAxesOptions
|
|
39624
39766
|
),
|
|
39625
|
-
chartStyling: defaultChartStyling
|
|
39626
|
-
tooltip: defaultTooltip
|
|
39627
|
-
graph: defaultGraph
|
|
39628
|
-
annotations: defaultAnnotations
|
|
39629
|
-
legend: defaultLegend
|
|
39630
|
-
chartOptions: defaultChartOptions
|
|
39631
|
-
interactions: defaultInteractions
|
|
39767
|
+
chartStyling: defaultChartStyling(options == null ? void 0 : options.chartStyling),
|
|
39768
|
+
tooltip: defaultTooltip(options == null ? void 0 : options.tooltip),
|
|
39769
|
+
graph: defaultGraph(options == null ? void 0 : options.graph),
|
|
39770
|
+
annotations: defaultAnnotations(options == null ? void 0 : options.annotations),
|
|
39771
|
+
legend: defaultLegend(options == null ? void 0 : options.legend),
|
|
39772
|
+
chartOptions: defaultChartOptions(options == null ? void 0 : options.chartOptions),
|
|
39773
|
+
interactions: defaultInteractions(options == null ? void 0 : options.interactions),
|
|
39632
39774
|
dragData: defaultDragData(options == null ? void 0 : options.dragData)
|
|
39633
39775
|
}
|
|
39634
39776
|
};
|
|
@@ -39651,7 +39793,7 @@ const BarChart = (props) => {
|
|
|
39651
39793
|
var _a2, _b2, _c2, _d2;
|
|
39652
39794
|
setDefaultTheme();
|
|
39653
39795
|
const chartRef = useRef(null);
|
|
39654
|
-
const chart2 = getDefaultProps
|
|
39796
|
+
const chart2 = getDefaultProps(props);
|
|
39655
39797
|
const { translations, languageKey } = getConfig();
|
|
39656
39798
|
const { options, testId } = chart2;
|
|
39657
39799
|
const { chartStyling, graph } = options;
|
|
@@ -39661,14 +39803,14 @@ const BarChart = (props) => {
|
|
|
39661
39803
|
return /* @__PURE__ */ jsxs(
|
|
39662
39804
|
"div",
|
|
39663
39805
|
{
|
|
39664
|
-
className: getClassName(chartStyling, styles
|
|
39806
|
+
className: getClassName(chartStyling, styles),
|
|
39665
39807
|
style: {
|
|
39666
39808
|
width: chartStyling.width || AUTO,
|
|
39667
39809
|
height: chartStyling.height || AUTO
|
|
39668
39810
|
},
|
|
39669
39811
|
"data-testid": testId,
|
|
39670
39812
|
children: [
|
|
39671
|
-
/* @__PURE__ */ jsx("div", { className: styles
|
|
39813
|
+
/* @__PURE__ */ jsx("div", { className: styles.actions, children: /* @__PURE__ */ jsx(Tooltip$2, { text: translations.downloadAsPNG, placement: "bottom-end", children: /* @__PURE__ */ jsx(
|
|
39672
39814
|
Button,
|
|
39673
39815
|
{
|
|
39674
39816
|
small: true,
|
|
@@ -39679,7 +39821,7 @@ const BarChart = (props) => {
|
|
|
39679
39821
|
onClick: () => downloadPgn(chartRef)
|
|
39680
39822
|
}
|
|
39681
39823
|
) }) }),
|
|
39682
|
-
/* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsxs("div", { className: styles
|
|
39824
|
+
/* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsxs("div", { className: styles.canvas, id: "canvas", children: [
|
|
39683
39825
|
/* @__PURE__ */ jsx(
|
|
39684
39826
|
Bar,
|
|
39685
39827
|
{
|
|
@@ -39710,342 +39852,13 @@ const BarChart = (props) => {
|
|
|
39710
39852
|
);
|
|
39711
39853
|
};
|
|
39712
39854
|
const BarChartWithLegend = (props) => {
|
|
39713
|
-
const { options } = getDefaultProps$1(props);
|
|
39714
|
-
return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(BarChart, { ...props }) });
|
|
39715
|
-
};
|
|
39716
|
-
const customFormatNumber = (labelNumber) => {
|
|
39717
|
-
let roundOptions = {};
|
|
39718
|
-
if (Math.abs(labelNumber) < DISPLAY_SCIENTIFIC_LOWER_BOUND || Math.abs(labelNumber) > DISPLAY_SCIENTIFIC_UPPER_BOUND) {
|
|
39719
|
-
roundOptions = { roundScientificCoefficient: 3 };
|
|
39720
|
-
}
|
|
39721
|
-
return displayNumber(roundByMagnitude(labelNumber), roundOptions);
|
|
39722
|
-
};
|
|
39723
|
-
const titleCallback = (tooltipItems, options) => {
|
|
39724
|
-
var _a2;
|
|
39725
|
-
if ((_a2 = options == null ? void 0 : options.tooltip) == null ? void 0 : _a2.showLabelsInTooltips) {
|
|
39726
|
-
const item = tooltipItems[0];
|
|
39727
|
-
const { label } = (item == null ? void 0 : item.dataset) ?? {};
|
|
39728
|
-
return label;
|
|
39729
|
-
}
|
|
39730
|
-
};
|
|
39731
|
-
const labelCallback = (tooltipItem) => {
|
|
39732
|
-
const { raw, dataset } = tooltipItem ?? {};
|
|
39733
|
-
return `${dataset == null ? void 0 : dataset.label} ( x: ${customFormatNumber(
|
|
39734
|
-
raw == null ? void 0 : raw.x
|
|
39735
|
-
)} , y: ${customFormatNumber(raw == null ? void 0 : raw.y)} )`;
|
|
39736
|
-
};
|
|
39737
|
-
const getTooltipsConfig = (options) => {
|
|
39738
|
-
var _a2, _b2, _c2;
|
|
39739
|
-
return {
|
|
39740
|
-
enabled: (_a2 = options == null ? void 0 : options.tooltip) == null ? void 0 : _a2.enabled,
|
|
39741
|
-
callbacks: {
|
|
39742
|
-
title: (tooltipItems) => titleCallback(tooltipItems, options),
|
|
39743
|
-
label: labelCallback
|
|
39744
|
-
},
|
|
39745
|
-
backgroundColor: (_b2 = options == null ? void 0 : options.tooltip) == null ? void 0 : _b2.backgroundColor,
|
|
39746
|
-
displayColors: (_c2 = options == null ? void 0 : options.tooltip) == null ? void 0 : _c2.displayColors,
|
|
39747
|
-
padding: 7
|
|
39748
|
-
};
|
|
39749
|
-
};
|
|
39750
|
-
const getScatterChartAxis = ({
|
|
39751
|
-
options,
|
|
39752
|
-
axisType = AxisType.X,
|
|
39753
|
-
currentScale
|
|
39754
|
-
}) => {
|
|
39755
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
|
|
39756
|
-
const isDirectionVertical = isVertical(options.direction);
|
|
39757
|
-
const axisData = currentScale || ((_b2 = (_a2 = options == null ? void 0 : options.axes) == null ? void 0 : _a2[axisType]) == null ? void 0 : _b2[0]);
|
|
39758
|
-
const isDirectionCompatibleWithAxisType = isDirectionVertical && axisType === AxisType.Y || !isDirectionVertical && axisType === AxisType.X;
|
|
39759
|
-
const grid = (axisData == null ? void 0 : axisData.gridLines) || {};
|
|
39760
|
-
const getReverse = () => {
|
|
39761
|
-
var _a3;
|
|
39762
|
-
const axisWithReverse = isDirectionVertical ? AxisType.Y : AxisType.X;
|
|
39763
|
-
return axisType === axisWithReverse ? (_a3 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _a3.reverse : false;
|
|
39764
|
-
};
|
|
39765
|
-
const getTicks = () => {
|
|
39766
|
-
const additionalAxesOptions = options == null ? void 0 : options.additionalAxesOptions;
|
|
39767
|
-
const stepSize = {
|
|
39768
|
-
stepSize: (axisData == null ? void 0 : axisData.stepSize) ?? (axisType === AxisType.Y ? additionalAxesOptions == null ? void 0 : additionalAxesOptions.stepSize : void 0)
|
|
39769
|
-
};
|
|
39770
|
-
return {
|
|
39771
|
-
...stepSize,
|
|
39772
|
-
includeBounds: false,
|
|
39773
|
-
//OW-10088 disable irregular axis ticks
|
|
39774
|
-
font: {
|
|
39775
|
-
size: DEFAULT_FONT_SIZE
|
|
39776
|
-
}
|
|
39777
|
-
};
|
|
39778
|
-
};
|
|
39779
|
-
return {
|
|
39780
|
-
type: ScaleType.Linear,
|
|
39781
|
-
position: axisData == null ? void 0 : axisData.position,
|
|
39782
|
-
beginAtZero: (_c2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _c2.beginAtZero,
|
|
39783
|
-
reverse: getReverse(),
|
|
39784
|
-
suggestedMax: (_d2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _d2.suggestedMax,
|
|
39785
|
-
suggestedMin: (_e2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _e2.suggestedMin,
|
|
39786
|
-
min: isDirectionCompatibleWithAxisType ? (_f2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _f2.min : void 0,
|
|
39787
|
-
max: isDirectionCompatibleWithAxisType ? (_g2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _g2.max : void 0,
|
|
39788
|
-
title: {
|
|
39789
|
-
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),
|
|
39790
|
-
text: (axisData == null ? void 0 : axisData.label) || (axisData == null ? void 0 : axisData.unit),
|
|
39791
|
-
padding: 0
|
|
39792
|
-
},
|
|
39793
|
-
ticks: getTicks(),
|
|
39794
|
-
grid: {
|
|
39795
|
-
...grid
|
|
39796
|
-
}
|
|
39797
|
-
};
|
|
39798
|
-
};
|
|
39799
|
-
const getScatterChartScales = (options) => {
|
|
39800
|
-
const xAxis = getScatterChartAxis({ options, axisType: AxisType.X });
|
|
39801
|
-
const yAxis = getScatterChartAxis({ options, axisType: AxisType.Y });
|
|
39802
|
-
return {
|
|
39803
|
-
x: xAxis,
|
|
39804
|
-
y: yAxis
|
|
39805
|
-
};
|
|
39806
|
-
};
|
|
39807
|
-
const useScatterChartConfig = (chart2, chartRef) => {
|
|
39808
|
-
const { data, options: defaultOptions } = chart2;
|
|
39809
|
-
const { interactions, chartStyling } = defaultOptions;
|
|
39810
|
-
const [pointHover, setPointHover] = useState(false);
|
|
39811
|
-
const { legend: legend2, customLegendPlugin, legendClick } = useLegendState({
|
|
39812
|
-
chartRef,
|
|
39813
|
-
options: defaultOptions
|
|
39814
|
-
});
|
|
39815
|
-
const { state: legendState } = useLegend();
|
|
39816
|
-
const { annotation: annotation2 } = legendState;
|
|
39817
|
-
const generateDatasets = (datasets) => {
|
|
39818
|
-
return datasets.map(
|
|
39819
|
-
(scatterDataset, index2) => {
|
|
39820
|
-
const { borderWidth: inputBorderWidth = DEFAULT_BORDER_WIDTH } = scatterDataset ?? {};
|
|
39821
|
-
const borderWidth = parseFloat(String(inputBorderWidth)) || 1;
|
|
39822
|
-
const color2 = COLORS[index2];
|
|
39823
|
-
const borderColor = scatterDataset.borderColor ?? color2;
|
|
39824
|
-
const backgroundColor = scatterDataset.backgroundColor ?? color2;
|
|
39825
|
-
return {
|
|
39826
|
-
...scatterDataset,
|
|
39827
|
-
borderWidth,
|
|
39828
|
-
borderColor,
|
|
39829
|
-
backgroundColor
|
|
39830
|
-
};
|
|
39831
|
-
}
|
|
39832
|
-
);
|
|
39833
|
-
};
|
|
39834
|
-
const generatedDatasets = generateDatasets(
|
|
39835
|
-
data.datasets
|
|
39836
|
-
);
|
|
39837
|
-
const onClick = (_evt, _elements, chartInstance) => {
|
|
39838
|
-
chartInstance.resetZoom();
|
|
39839
|
-
};
|
|
39840
|
-
const onHover = (evt, hoveredItems) => {
|
|
39841
|
-
if (pointHover && !(hoveredItems == null ? void 0 : hoveredItems.length)) {
|
|
39842
|
-
setPointHover(false);
|
|
39843
|
-
if (interactions.onUnhover) {
|
|
39844
|
-
interactions.onUnhover(evt);
|
|
39845
|
-
}
|
|
39846
|
-
}
|
|
39847
|
-
if (!pointHover && (hoveredItems == null ? void 0 : hoveredItems.length)) {
|
|
39848
|
-
setPointHover(true);
|
|
39849
|
-
if (interactions.onHover) {
|
|
39850
|
-
const { index: index2, datasetIndex } = hoveredItems[0];
|
|
39851
|
-
interactions.onHover(evt, datasetIndex, index2, generatedDatasets);
|
|
39852
|
-
}
|
|
39853
|
-
}
|
|
39854
|
-
};
|
|
39855
|
-
const scatterOptions = {
|
|
39856
|
-
onClick,
|
|
39857
|
-
onHover,
|
|
39858
|
-
chartStyling,
|
|
39859
|
-
interactions: {
|
|
39860
|
-
onLegendClick: legendClick,
|
|
39861
|
-
onHover
|
|
39862
|
-
},
|
|
39863
|
-
scales: getScatterChartScales(chart2 == null ? void 0 : chart2.options),
|
|
39864
|
-
plugins: {
|
|
39865
|
-
legend: { ...legend2, display: false },
|
|
39866
|
-
// hide default legend
|
|
39867
|
-
customLegendPlugin,
|
|
39868
|
-
title: getTitle(defaultOptions),
|
|
39869
|
-
annotation: toAnnotationObject(annotation2),
|
|
39870
|
-
chartAreaBorder: {
|
|
39871
|
-
borderColor: BORDER_COLOR
|
|
39872
|
-
},
|
|
39873
|
-
datalabels: {
|
|
39874
|
-
display: defaultOptions.graph.showDataLabels
|
|
39875
|
-
},
|
|
39876
|
-
tooltip: getTooltipsConfig(defaultOptions)
|
|
39877
|
-
}
|
|
39878
|
-
};
|
|
39879
|
-
return {
|
|
39880
|
-
generatedDatasets,
|
|
39881
|
-
scatterOptions
|
|
39882
|
-
};
|
|
39883
|
-
};
|
|
39884
|
-
const defaultChartStyling = (styling) => ({
|
|
39885
|
-
width: (styling == null ? void 0 : styling.width) ?? AUTO,
|
|
39886
|
-
height: (styling == null ? void 0 : styling.height) ?? AUTO,
|
|
39887
|
-
maintainAspectRatio: (styling == null ? void 0 : styling.maintainAspectRatio) || false,
|
|
39888
|
-
staticChartHeight: (styling == null ? void 0 : styling.staticChartHeight) || false,
|
|
39889
|
-
performanceMode: (styling == null ? void 0 : styling.performanceMode) ?? true
|
|
39890
|
-
});
|
|
39891
|
-
const defaultTooltip = (tooltip) => ({
|
|
39892
|
-
enabled: (tooltip == null ? void 0 : tooltip.enabled) ?? true,
|
|
39893
|
-
tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
|
|
39894
|
-
showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) || false,
|
|
39895
|
-
backgroundColor: (tooltip == null ? void 0 : tooltip.backgroundColor) || "#333",
|
|
39896
|
-
displayColors: (tooltip == null ? void 0 : tooltip.displayColors) || false
|
|
39897
|
-
});
|
|
39898
|
-
const defaultGraph = (graph) => ({
|
|
39899
|
-
showMinorGridlines: (graph == null ? void 0 : graph.showMinorGridlines) ?? false,
|
|
39900
|
-
showDataLabels: (graph == null ? void 0 : graph.showDataLabels) ?? false
|
|
39901
|
-
});
|
|
39902
|
-
const defaultLegend = (legend2) => ({
|
|
39903
|
-
display: (legend2 == null ? void 0 : legend2.display) ?? true,
|
|
39904
|
-
useDataset: (legend2 == null ? void 0 : legend2.useDataset) || false,
|
|
39905
|
-
position: (legend2 == null ? void 0 : legend2.position) || Position.BottomLeft,
|
|
39906
|
-
align: (legend2 == null ? void 0 : legend2.align) || AlignOptions.Center
|
|
39907
|
-
});
|
|
39908
|
-
const defaultChartOptions = (options) => ({
|
|
39909
|
-
enableZoom: (options == null ? void 0 : options.enableZoom) || false,
|
|
39910
|
-
enablePan: (options == null ? void 0 : options.enablePan) || false
|
|
39911
|
-
});
|
|
39912
|
-
const defaultInteractions = (interactions) => ({
|
|
39913
|
-
onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
|
|
39914
|
-
onHover: interactions == null ? void 0 : interactions.onHover,
|
|
39915
|
-
onUnhover: interactions == null ? void 0 : interactions.onUnhover
|
|
39916
|
-
});
|
|
39917
|
-
const defaultChartData = (data) => {
|
|
39918
|
-
return {
|
|
39919
|
-
labels: (data == null ? void 0 : data.labels) || [],
|
|
39920
|
-
datasets: (data == null ? void 0 : data.datasets) || []
|
|
39921
|
-
};
|
|
39922
|
-
};
|
|
39923
|
-
const defaultAnnotationsData = (annotationsData) => {
|
|
39924
|
-
return annotationsData ? annotationsData.map((ann) => ({ ...ann, display: (ann == null ? void 0 : ann.display) ?? true })) : [];
|
|
39925
|
-
};
|
|
39926
|
-
const defaultAnnotations = (annotations) => ({
|
|
39927
|
-
showAnnotations: (annotations == null ? void 0 : annotations.showAnnotations) ?? true,
|
|
39928
|
-
controlAnnotation: (annotations == null ? void 0 : annotations.controlAnnotation) || false,
|
|
39929
|
-
annotationsData: defaultAnnotationsData(annotations == null ? void 0 : annotations.annotationsData)
|
|
39930
|
-
});
|
|
39931
|
-
const defaultAxes = (axes) => ({
|
|
39932
|
-
x: (axes == null ? void 0 : axes.x) || [{}],
|
|
39933
|
-
y: (axes == null ? void 0 : axes.y) || [{}]
|
|
39934
|
-
});
|
|
39935
|
-
const defaultAdditionalAxesOptions = (options) => ({
|
|
39936
|
-
reverse: (options == null ? void 0 : options.reverse) || false,
|
|
39937
|
-
stacked: (options == null ? void 0 : options.stacked) || false,
|
|
39938
|
-
beginAtZero: (options == null ? void 0 : options.beginAtZero) ?? true,
|
|
39939
|
-
stepSize: options == null ? void 0 : options.stepSize,
|
|
39940
|
-
suggestedMin: options == null ? void 0 : options.suggestedMin,
|
|
39941
|
-
suggestedMax: options == null ? void 0 : options.suggestedMax,
|
|
39942
|
-
min: options == null ? void 0 : options.min,
|
|
39943
|
-
max: options == null ? void 0 : options.max
|
|
39944
|
-
});
|
|
39945
|
-
const getDefaultProps = (props) => {
|
|
39946
|
-
const chart2 = (props == null ? void 0 : props.chart) || {};
|
|
39947
|
-
const options = (chart2 == null ? void 0 : chart2.options) || {};
|
|
39948
|
-
return {
|
|
39949
|
-
testId: (chart2 == null ? void 0 : chart2.testId) ?? null,
|
|
39950
|
-
data: defaultChartData(chart2 == null ? void 0 : chart2.data),
|
|
39951
|
-
options: {
|
|
39952
|
-
title: (options == null ? void 0 : options.title) || "",
|
|
39953
|
-
axes: defaultAxes(options == null ? void 0 : options.axes),
|
|
39954
|
-
additionalAxesOptions: defaultAdditionalAxesOptions(
|
|
39955
|
-
options == null ? void 0 : options.additionalAxesOptions
|
|
39956
|
-
),
|
|
39957
|
-
direction: (options == null ? void 0 : options.direction) || ChartDirection.VERTICAL,
|
|
39958
|
-
chartStyling: defaultChartStyling(options == null ? void 0 : options.chartStyling),
|
|
39959
|
-
tooltip: defaultTooltip(options == null ? void 0 : options.tooltip),
|
|
39960
|
-
graph: defaultGraph(options == null ? void 0 : options.graph),
|
|
39961
|
-
legend: defaultLegend(options == null ? void 0 : options.legend),
|
|
39962
|
-
annotations: defaultAnnotations(options == null ? void 0 : options.annotations),
|
|
39963
|
-
chartOptions: defaultChartOptions(options == null ? void 0 : options.chartOptions),
|
|
39964
|
-
interactions: defaultInteractions(options == null ? void 0 : options.interactions)
|
|
39965
|
-
}
|
|
39966
|
-
};
|
|
39967
|
-
};
|
|
39968
|
-
const chart = "_chart_1jdnu_1";
|
|
39969
|
-
const fixedHeight = "_fixedHeight_1jdnu_13";
|
|
39970
|
-
const stretchHeight = "_stretchHeight_1jdnu_19";
|
|
39971
|
-
const zoomForm = "_zoomForm_1jdnu_32";
|
|
39972
|
-
const zoomReset = "_zoomReset_1jdnu_40";
|
|
39973
|
-
const help = "_help_1jdnu_43";
|
|
39974
|
-
const autoWeight = "_autoWeight_1jdnu_47";
|
|
39975
|
-
const styles = {
|
|
39976
|
-
chart,
|
|
39977
|
-
fixedHeight,
|
|
39978
|
-
stretchHeight,
|
|
39979
|
-
zoomForm,
|
|
39980
|
-
zoomReset,
|
|
39981
|
-
help,
|
|
39982
|
-
autoWeight
|
|
39983
|
-
};
|
|
39984
|
-
Chart$2.register(
|
|
39985
|
-
LinearScale$1,
|
|
39986
|
-
PointElement$1,
|
|
39987
|
-
CategoryScale$1,
|
|
39988
|
-
plugin_legend,
|
|
39989
|
-
plugin_tooltip,
|
|
39990
|
-
plugin_title,
|
|
39991
|
-
plugin$1,
|
|
39992
|
-
plugin,
|
|
39993
|
-
annotation
|
|
39994
|
-
);
|
|
39995
|
-
const ScatterChart = (props) => {
|
|
39996
|
-
setDefaultTheme();
|
|
39997
|
-
const chartRef = useRef(null);
|
|
39998
|
-
const chart2 = getDefaultProps(props);
|
|
39999
|
-
const { options, testId } = chart2;
|
|
40000
|
-
const { scatterOptions, generatedDatasets } = useScatterChartConfig(
|
|
40001
|
-
chart2,
|
|
40002
|
-
chartRef
|
|
40003
|
-
);
|
|
40004
|
-
return /* @__PURE__ */ jsx(
|
|
40005
|
-
"div",
|
|
40006
|
-
{
|
|
40007
|
-
className: getClassName(options.chartStyling, styles),
|
|
40008
|
-
style: {
|
|
40009
|
-
width: options.chartStyling.width,
|
|
40010
|
-
height: options.chartStyling.height
|
|
40011
|
-
},
|
|
40012
|
-
"data-testid": testId,
|
|
40013
|
-
children: /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsxs("div", { className: styles.canvas, id: "canvas", children: [
|
|
40014
|
-
/* @__PURE__ */ jsx(
|
|
40015
|
-
Scatter,
|
|
40016
|
-
{
|
|
40017
|
-
ref: chartRef,
|
|
40018
|
-
data: {
|
|
40019
|
-
datasets: generatedDatasets
|
|
40020
|
-
},
|
|
40021
|
-
options: scatterOptions,
|
|
40022
|
-
plugins: getPlugins(options.graph, options.legend)
|
|
40023
|
-
}
|
|
40024
|
-
),
|
|
40025
|
-
!!generatedDatasets.length && /* @__PURE__ */ jsx(
|
|
40026
|
-
Legend2,
|
|
40027
|
-
{
|
|
40028
|
-
chartRef,
|
|
40029
|
-
legendConfig: {
|
|
40030
|
-
options,
|
|
40031
|
-
generatedDatasets,
|
|
40032
|
-
chartType: ChartType.SCATTER
|
|
40033
|
-
}
|
|
40034
|
-
}
|
|
40035
|
-
)
|
|
40036
|
-
] }) })
|
|
40037
|
-
}
|
|
40038
|
-
);
|
|
40039
|
-
};
|
|
40040
|
-
const ScatterChartWithLegend = (props) => {
|
|
40041
39855
|
const { options } = getDefaultProps(props);
|
|
40042
|
-
return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(
|
|
39856
|
+
return /* @__PURE__ */ jsx(LegendProvider, { options, children: /* @__PURE__ */ jsx(BarChart, { ...props }) });
|
|
40043
39857
|
};
|
|
40044
39858
|
export {
|
|
40045
39859
|
BarChartWithLegend as BarChart,
|
|
40046
39860
|
LineChartWithLegend as LineChart,
|
|
40047
39861
|
PieChartWithLegend as PieChart,
|
|
40048
|
-
ScatterChartWithLegend as ScatterChart,
|
|
40049
39862
|
initializeLineChart
|
|
40050
39863
|
};
|
|
40051
39864
|
//# sourceMappingURL=index.js.map
|
|
@@ -40054,7 +39867,7 @@ export {
|
|
|
40054
39867
|
try {
|
|
40055
39868
|
if (typeof document != "undefined") {
|
|
40056
39869
|
var elementStyle = document.createElement("style");
|
|
40057
|
-
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}
|
|
39870
|
+
elementStyle.appendChild(document.createTextNode("html[data-theme='dark'] ._chart_e3qdd_1 canvas {\n filter: invert(1) hue-rotate(180deg);\n}\n._chart_e3qdd_1 {\n border: 1px solid rgba(255, 255, 255, 0);\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n._chart_e3qdd_1 ._canvas_e3qdd_11 {\n flex-grow: 1;\n min-height: 0;\n position: relative;\n}\n._chart_e3qdd_1 ._canvas_e3qdd_11 canvas {\n width: 100% !important;\n height: 100% !important;\n}\n._chart_e3qdd_1._fixedHeight_e3qdd_20 {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n height: auto;\n}\n._chart_e3qdd_1._stretchHeight_e3qdd_26 {\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n height: 100%;\n}\n._chart_e3qdd_1._squareAspectRatio_e3qdd_32 {\n aspect-ratio: 1;\n min-height: 0;\n min-width: 0;\n}\n._chart_e3qdd_1:focus {\n outline: none;\n}\n._chart_e3qdd_1::-moz-focus-inner {\n border: 0;\n}\n._zoomForm_e3qdd_43 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n right: 0;\n}\n._zoomForm_e3qdd_43 ._zoomReset_e3qdd_51 {\n margin-left: 10px;\n}\n._zoomForm_e3qdd_43 ._help_e3qdd_54 {\n margin-left: 5px;\n line-height: 0;\n}\n._autoWeight_e3qdd_58 {\n width: auto;\n height: auto;\n}\n._table_e3qdd_62 {\n overflow: auto;\n}\n._controls_gbo9q_1 {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--padding-xs);\n}\n._buttons_gbo9q_7 {\n display: flex;\n align-items: flex-start;\n margin-left: auto;\n gap: var(--padding-xxs);\n}\n._legend_wpro0_1 {\n position: absolute;\n opacity: 0.9;\n display: flex;\n flex-direction: column;\n z-index: 1;\n}\n._legend_wpro0_1._isDragging_wpro0_8 {\n opacity: 0;\n}\n._legendItems_wpro0_11 {\n background-color: var(--color-background-raised);\n border: 1px solid var(--color-border);\n padding: 4px 8px;\n border-radius: 2px;\n overflow-y: auto;\n max-height: 100%;\n overflow: overlay;\n --scrollbar-color: #00000040;\n}\n._legendItems_wpro0_11::-webkit-scrollbar {\n display: block;\n width: 16px;\n z-index: 2;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-button {\n display: none;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-track {\n background-color: #00000000;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-track-piece {\n background-color: #00000000;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-thumb {\n background-color: #00000000;\n border: 5px solid transparent;\n border-radius: 24px;\n box-shadow: 4px 0px 0px 4px var(--scrollbar-color) inset;\n}\n._legendItems_wpro0_11::-webkit-scrollbar-corner {\n background: rgba(0, 0, 0, 0);\n}\n._legend_wpro0_1._isDragging_wpro0_8 ._legendItems_wpro0_11._legendItems_wpro0_11 {\n pointer-events: none;\n}\n._legend_wpro0_1._isHidden_wpro0_47 ._legendItems_wpro0_11._legendItems_wpro0_11 {\n display: none;\n}\n._legendToggle_wpro0_50 {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: none;\n}\n._legend_wpro0_1._isHidden_wpro0_47 ._legendToggle_wpro0_50._legendToggle_wpro0_50,\n._legend_wpro0_1:hover ._legendToggle_wpro0_50._legendToggle_wpro0_50 {\n display: block;\n}\n._legend_wpro0_1:active ._legendToggle_wpro0_50._legendToggle_wpro0_50:not(:hover) {\n display: none;\n}\n._legend_wpro0_1._isHidden_wpro0_47 ._legendToggle_wpro0_50._legendToggle_wpro0_50 {\n position: static;\n transform: none;\n}\n._legend_wpro0_1._isDragging_wpro0_8 ._legendToggle_wpro0_50._legendToggle_wpro0_50 {\n display: none;\n}\n._legendItem_wpro0_11 {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n user-select: none;\n cursor: pointer;\n font-size: 12px;\n line-height: 16px;\n}\n._legendItemSymbol_wpro0_80 {\n display: flex;\n align-items: center;\n height: 16px;\n position: relative;\n flex-shrink: 0;\n}\nhtml[data-theme='dark'] ._legendItemSymbol_wpro0_80._legendItemSymbol_wpro0_80 {\n filter: invert(1) hue-rotate(180deg);\n}\n._legendItemBox_wpro0_90 {\n width: 100%;\n height: 12px;\n display: block;\n}\n._legendItemLine_wpro0_95 {\n position: absolute;\n display: flex;\n top: 50%;\n left: 0;\n width: 100%;\n transform: translateY(-50%);\n}\n._legendItemPoint_wpro0_103 {\n position: absolute;\n display: flex;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n._isHidden_wpro0_47 ._legendItemText_wpro0_110._legendItemText_wpro0_110 {\n text-decoration: line-through;\n}\n._scrollbars_wpro0_113 {\n overflow: overlay;\n --scrollbar-color: #00000040;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar {\n display: block;\n width: 16px;\n z-index: 2;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-button {\n display: none;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-track {\n background-color: #00000000;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-track-piece {\n background-color: #00000000;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-thumb {\n background-color: #00000000;\n border: 5px solid transparent;\n border-radius: 24px;\n box-shadow: 4px 0px 0px 4px var(--scrollbar-color) inset;\n}\n._scrollbars_wpro0_113::-webkit-scrollbar-corner {\n background: rgba(0, 0, 0, 0);\n}\n._dropzoneContainer_wpro0_140 {\n position: absolute;\n}\n._dropzone_wpro0_140 {\n position: absolute;\n width: 50%;\n height: 50%;\n display: flex;\n}\n._dropzone_wpro0_140._left_wpro0_149 {\n left: 0;\n justify-content: flex-start;\n}\n._dropzone_wpro0_140._right_wpro0_153 {\n right: 0;\n justify-content: flex-end;\n}\n._dropzone_wpro0_140._top_wpro0_157 {\n top: 0;\n align-items: flex-start;\n}\n._dropzone_wpro0_140._bottom_wpro0_161 {\n bottom: 0;\n align-items: flex-end;\n}\n._dropzonePlaceholder_wpro0_165 {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.05);\n display: none;\n}\n[data-theme='dark'] ._dropzonePlaceholder_wpro0_165 {\n background-color: rgba(255, 255, 255, 0.05);\n}\n._isActive_wpro0_173 ._dropzonePlaceholder_wpro0_165._dropzonePlaceholder_wpro0_165 {\n display: block;\n}\n._resizeContainer_wpro0_176 {\n position: absolute;\n inset: 0;\n z-index: -1;\n}\nhtml[data-theme='dark'] ._chart_1jdnu_1 canvas {\n filter: invert(1) hue-rotate(180deg);\n}\n._chart_1jdnu_1 {\n border: 1px solid rgba(255, 255, 255, 0);\n padding-top: 10px;\n position: relative;\n}\n._chart_1jdnu_1 canvas {\n width: 100% !important;\n height: 100% !important;\n}\n._chart_1jdnu_1._fixedHeight_1jdnu_13 {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n height: auto;\n}\n._chart_1jdnu_1._stretchHeight_1jdnu_19 {\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n height: 100%;\n}\n._chart_1jdnu_1:focus {\n border: 1px solid #85b7d9;\n outline: none;\n}\n._chart_1jdnu_1::-moz-focus-inner {\n border: 0;\n}\n._zoomForm_1jdnu_32 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n right: 0;\n}\n._zoomForm_1jdnu_32 ._zoomReset_1jdnu_40 {\n margin-left: 10px;\n}\n._zoomForm_1jdnu_32 ._help_1jdnu_43 {\n margin-left: 5px;\n line-height: 0;\n}\n._autoWeight_1jdnu_47 {\n width: 'auto';\n height: 'auto';\n}\nhtml[data-theme='dark'] ._chart_x1sru_1 canvas {\n filter: invert(1) hue-rotate(180deg);\n}\n._chart_x1sru_1 {\n border: 1px solid rgba(255, 255, 255, 0);\n position: relative;\n display: flex;\n flex-direction: column;\n}\n._chart_x1sru_1 ._canvas_x1sru_10 {\n flex-grow: 1;\n min-height: 0;\n position: relative;\n}\n._chart_x1sru_1 ._canvas_x1sru_10 canvas {\n width: 100% !important;\n height: 100% !important;\n}\n._chart_x1sru_1._fixedHeight_x1sru_19 {\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n height: auto;\n}\n._chart_x1sru_1._stretchHeight_x1sru_25 {\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n height: 100%;\n}\n._chart_x1sru_1:focus {\n border: 1px solid #85b7d9;\n outline: none;\n}\n._chart_x1sru_1::-moz-focus-inner {\n border: 0;\n}\n._zoomForm_x1sru_38 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n right: 0;\n}\n._zoomForm_x1sru_38 ._zoomReset_x1sru_46 {\n margin-left: 10px;\n}\n._zoomForm_x1sru_38 ._help_x1sru_49 {\n margin-left: 5px;\n line-height: 0;\n}\n._autoWeight_x1sru_53 {\n width: auto;\n height: auto;\n}\n._actions_x1sru_57 {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}"));
|
|
40058
39871
|
document.head.appendChild(elementStyle);
|
|
40059
39872
|
}
|
|
40060
39873
|
} catch (e) {
|