@oliasoft-open-source/charts-library 4.4.0-beta-1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +308 -289
- package/dist/index.js.map +1 -1
- package/dist/src/components/bar-chart/bar-chart.interface.d.ts +2 -0
- package/dist/src/components/bar-chart/bar-chart.stories.d.ts +32 -1
- package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +1 -1
- package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +54 -0
- package/dist/src/components/common/common.interface.d.ts +11 -2
- package/dist/src/components/common/helpers/chart-consts.d.ts +2 -0
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +1 -1
- package/dist/src/components/common/helpers/get-draggableData.d.ts +2 -2
- package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +10 -0
- package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +2 -0
- package/dist/src/components/line-chart/line-chart.stories.d.ts +1 -66
- package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +1 -1
- package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +112 -0
- package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +3 -2
- package/dist/src/components/scatter-chart/scatter-chart.stories.d.ts +20 -0
- package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +1 -1
- package/package.json +10 -4
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +0 -5
- /package/dist/src/components/{line-chart/controls → common}/controls-portal.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -6,12 +6,13 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
8
8
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
9
|
-
import
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import React__default, { forwardRef, useRef, useEffect, createContext as createContext$2, memo, useLayoutEffect, useState, useCallback, useMemo, isValidElement, cloneElement, useContext, useReducer } from "react";
|
|
10
11
|
import { produce } from "immer";
|
|
11
12
|
import { round as round$2, displayNumber, isCloseTo, roundByMagnitude } from "@oliasoft-open-source/units";
|
|
12
13
|
import cx from "classnames";
|
|
13
|
-
import { Icon, Tooltip as Tooltip$2, Button, Flex, Text, Menu, Popover, Field, InputGroup, NumberInput, InputGroupAddon, Select, ButtonGroup, Spacer
|
|
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
|
|
14
|
+
import { Portal, Icon, Tooltip as Tooltip$2, Button, Flex, Text, Menu, Popover, Field, InputGroup, NumberInput, InputGroupAddon, Select, ButtonGroup, Spacer } from "@oliasoft-open-source/react-ui-library";
|
|
15
|
+
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 } from "lodash";
|
|
15
16
|
import { roundNumberToPrecision } from "@oliasoft-open-source/units/dist/rounding/rounding";
|
|
16
17
|
/*!
|
|
17
18
|
* @kurkle/color v0.3.2
|
|
@@ -921,16 +922,16 @@ const _lookupByKey$1 = (table2, key, value, last) => _lookup$1(table2, value, la
|
|
|
921
922
|
return ti < value || ti === value && table2[index2 + 1][key] === value;
|
|
922
923
|
} : (index2) => table2[index2][key] < value);
|
|
923
924
|
const _rlookupByKey$1 = (table2, key, value) => _lookup$1(table2, value, (index2) => table2[index2][key] >= value);
|
|
924
|
-
function _filterBetween$1(
|
|
925
|
+
function _filterBetween$1(values, min, max) {
|
|
925
926
|
let start = 0;
|
|
926
|
-
let end =
|
|
927
|
-
while (start < end &&
|
|
927
|
+
let end = values.length;
|
|
928
|
+
while (start < end && values[start] < min) {
|
|
928
929
|
start++;
|
|
929
930
|
}
|
|
930
|
-
while (end > start &&
|
|
931
|
+
while (end > start && values[end - 1] > max) {
|
|
931
932
|
end--;
|
|
932
933
|
}
|
|
933
|
-
return start > 0 || end <
|
|
934
|
+
return start > 0 || end < values.length ? values.slice(start, end) : values;
|
|
934
935
|
}
|
|
935
936
|
const arrayEvents$1 = [
|
|
936
937
|
"push",
|
|
@@ -1404,9 +1405,9 @@ function getScope$1$1(node, key) {
|
|
|
1404
1405
|
}
|
|
1405
1406
|
return node;
|
|
1406
1407
|
}
|
|
1407
|
-
function set$1(root, scope2,
|
|
1408
|
+
function set$1(root, scope2, values) {
|
|
1408
1409
|
if (typeof scope2 === "string") {
|
|
1409
|
-
return merge$1(getScope$1$1(root, scope2),
|
|
1410
|
+
return merge$1(getScope$1$1(root, scope2), values);
|
|
1410
1411
|
}
|
|
1411
1412
|
return merge$1(getScope$1$1(root, ""), scope2);
|
|
1412
1413
|
}
|
|
@@ -1456,17 +1457,17 @@ let Defaults$1 = class Defaults {
|
|
|
1456
1457
|
this.describe(_descriptors2);
|
|
1457
1458
|
this.apply(_appliers);
|
|
1458
1459
|
}
|
|
1459
|
-
set(scope2,
|
|
1460
|
-
return set$1(this, scope2,
|
|
1460
|
+
set(scope2, values) {
|
|
1461
|
+
return set$1(this, scope2, values);
|
|
1461
1462
|
}
|
|
1462
1463
|
get(scope2) {
|
|
1463
1464
|
return getScope$1$1(this, scope2);
|
|
1464
1465
|
}
|
|
1465
|
-
describe(scope2,
|
|
1466
|
-
return set$1(descriptors$1, scope2,
|
|
1466
|
+
describe(scope2, values) {
|
|
1467
|
+
return set$1(descriptors$1, scope2, values);
|
|
1467
1468
|
}
|
|
1468
|
-
override(scope2,
|
|
1469
|
-
return set$1(overrides$1, scope2,
|
|
1469
|
+
override(scope2, values) {
|
|
1470
|
+
return set$1(overrides$1, scope2, values);
|
|
1470
1471
|
}
|
|
1471
1472
|
route(scope2, name, targetScope, targetName) {
|
|
1472
1473
|
const scopeObject = getScope$1$1(this, scope2);
|
|
@@ -3175,8 +3176,8 @@ let Animations$1 = class Animations {
|
|
|
3175
3176
|
});
|
|
3176
3177
|
});
|
|
3177
3178
|
}
|
|
3178
|
-
_animateOptions(target,
|
|
3179
|
-
const newOptions =
|
|
3179
|
+
_animateOptions(target, values) {
|
|
3180
|
+
const newOptions = values.options;
|
|
3180
3181
|
const options = resolveTargetOptions$1(target, newOptions);
|
|
3181
3182
|
if (!options) {
|
|
3182
3183
|
return [];
|
|
@@ -3190,11 +3191,11 @@ let Animations$1 = class Animations {
|
|
|
3190
3191
|
}
|
|
3191
3192
|
return animations;
|
|
3192
3193
|
}
|
|
3193
|
-
_createAnimations(target,
|
|
3194
|
+
_createAnimations(target, values) {
|
|
3194
3195
|
const animatedProps = this._properties;
|
|
3195
3196
|
const animations = [];
|
|
3196
3197
|
const running = target.$animations || (target.$animations = {});
|
|
3197
|
-
const props = Object.keys(
|
|
3198
|
+
const props = Object.keys(values);
|
|
3198
3199
|
const date = Date.now();
|
|
3199
3200
|
let i2;
|
|
3200
3201
|
for (i2 = props.length - 1; i2 >= 0; --i2) {
|
|
@@ -3203,10 +3204,10 @@ let Animations$1 = class Animations {
|
|
|
3203
3204
|
continue;
|
|
3204
3205
|
}
|
|
3205
3206
|
if (prop === "options") {
|
|
3206
|
-
animations.push(...this._animateOptions(target,
|
|
3207
|
+
animations.push(...this._animateOptions(target, values));
|
|
3207
3208
|
continue;
|
|
3208
3209
|
}
|
|
3209
|
-
const value =
|
|
3210
|
+
const value = values[prop];
|
|
3210
3211
|
let animation = running[prop];
|
|
3211
3212
|
const cfg = animatedProps.get(prop);
|
|
3212
3213
|
if (animation) {
|
|
@@ -3226,12 +3227,12 @@ let Animations$1 = class Animations {
|
|
|
3226
3227
|
}
|
|
3227
3228
|
return animations;
|
|
3228
3229
|
}
|
|
3229
|
-
update(target,
|
|
3230
|
+
update(target, values) {
|
|
3230
3231
|
if (this._properties.size === 0) {
|
|
3231
|
-
Object.assign(target,
|
|
3232
|
+
Object.assign(target, values);
|
|
3232
3233
|
return;
|
|
3233
3234
|
}
|
|
3234
|
-
const animations = this._createAnimations(target,
|
|
3235
|
+
const animations = this._createAnimations(target, values);
|
|
3235
3236
|
if (animations.length) {
|
|
3236
3237
|
animator$1.add(this._chart, animations);
|
|
3237
3238
|
return true;
|
|
@@ -3684,9 +3685,9 @@ let DatasetController$1 = (_a = class {
|
|
|
3684
3685
|
updateRangeFromParsed(range, scale, parsed, stack) {
|
|
3685
3686
|
const parsedValue = parsed[scale.axis];
|
|
3686
3687
|
let value = parsedValue === null ? NaN : parsedValue;
|
|
3687
|
-
const
|
|
3688
|
-
if (stack &&
|
|
3689
|
-
stack.values =
|
|
3688
|
+
const values = stack && parsed._stacks[scale.axis];
|
|
3689
|
+
if (stack && values) {
|
|
3690
|
+
stack.values = values;
|
|
3690
3691
|
value = applyStack$1(stack, parsedValue, this._cachedMeta.index);
|
|
3691
3692
|
}
|
|
3692
3693
|
range.min = Math.min(range.min, value);
|
|
@@ -3732,15 +3733,15 @@ let DatasetController$1 = (_a = class {
|
|
|
3732
3733
|
}
|
|
3733
3734
|
getAllParsedValues(scale) {
|
|
3734
3735
|
const parsed = this._cachedMeta._parsed;
|
|
3735
|
-
const
|
|
3736
|
+
const values = [];
|
|
3736
3737
|
let i2, ilen, value;
|
|
3737
3738
|
for (i2 = 0, ilen = parsed.length; i2 < ilen; ++i2) {
|
|
3738
3739
|
value = parsed[i2][scale.axis];
|
|
3739
3740
|
if (isNumberFinite$1(value)) {
|
|
3740
|
-
|
|
3741
|
+
values.push(value);
|
|
3741
3742
|
}
|
|
3742
3743
|
}
|
|
3743
|
-
return
|
|
3744
|
+
return values;
|
|
3744
3745
|
}
|
|
3745
3746
|
getMaxOverflow() {
|
|
3746
3747
|
return false;
|
|
@@ -3842,12 +3843,12 @@ let DatasetController$1 = (_a = class {
|
|
|
3842
3843
|
const scopes = config2.getOptionScopes(this.getDataset(), scopeKeys);
|
|
3843
3844
|
const names2 = Object.keys(defaults$2.elements[elementType]);
|
|
3844
3845
|
const context = () => this.getContext(index2, active, mode);
|
|
3845
|
-
const
|
|
3846
|
-
if (
|
|
3847
|
-
|
|
3848
|
-
cache2[cacheKey] = Object.freeze(cloneIfNotShared$1(
|
|
3846
|
+
const values = config2.resolveNamedOptions(scopes, names2, context, prefixes);
|
|
3847
|
+
if (values.$shared) {
|
|
3848
|
+
values.$shared = sharing;
|
|
3849
|
+
cache2[cacheKey] = Object.freeze(cloneIfNotShared$1(values, sharing));
|
|
3849
3850
|
}
|
|
3850
|
-
return
|
|
3851
|
+
return values;
|
|
3851
3852
|
}
|
|
3852
3853
|
_resolveAnimations(index2, transition, active) {
|
|
3853
3854
|
const chart2 = this.chart;
|
|
@@ -4043,17 +4044,17 @@ let DatasetController$1 = (_a = class {
|
|
|
4043
4044
|
function getAllScaleValues$1(scale, type) {
|
|
4044
4045
|
if (!scale._cache.$bar) {
|
|
4045
4046
|
const visibleMetas = scale.getMatchingVisibleMetas(type);
|
|
4046
|
-
let
|
|
4047
|
+
let values = [];
|
|
4047
4048
|
for (let i2 = 0, ilen = visibleMetas.length; i2 < ilen; i2++) {
|
|
4048
|
-
|
|
4049
|
+
values = values.concat(visibleMetas[i2].controller.getAllParsedValues(scale));
|
|
4049
4050
|
}
|
|
4050
|
-
scale._cache.$bar = _arrayUnique$1(
|
|
4051
|
+
scale._cache.$bar = _arrayUnique$1(values.sort((a2, b2) => a2 - b2));
|
|
4051
4052
|
}
|
|
4052
4053
|
return scale._cache.$bar;
|
|
4053
4054
|
}
|
|
4054
4055
|
function computeMinSampleSize$1(meta) {
|
|
4055
4056
|
const scale = meta.iScale;
|
|
4056
|
-
const
|
|
4057
|
+
const values = getAllScaleValues$1(scale, meta.type);
|
|
4057
4058
|
let min = scale._length;
|
|
4058
4059
|
let i2, ilen, curr, prev;
|
|
4059
4060
|
const updateMinAndPrev = () => {
|
|
@@ -4065,8 +4066,8 @@ function computeMinSampleSize$1(meta) {
|
|
|
4065
4066
|
}
|
|
4066
4067
|
prev = curr;
|
|
4067
4068
|
};
|
|
4068
|
-
for (i2 = 0, ilen =
|
|
4069
|
-
curr = scale.getPixelForValue(
|
|
4069
|
+
for (i2 = 0, ilen = values.length; i2 < ilen; ++i2) {
|
|
4070
|
+
curr = scale.getPixelForValue(values[i2]);
|
|
4070
4071
|
updateMinAndPrev();
|
|
4071
4072
|
}
|
|
4072
4073
|
prev = void 0;
|
|
@@ -12562,13 +12563,13 @@ function setMajorTicks$1(scale, ticks, map2, majorUnit) {
|
|
|
12562
12563
|
}
|
|
12563
12564
|
return ticks;
|
|
12564
12565
|
}
|
|
12565
|
-
function ticksFromTimestamps$1(scale,
|
|
12566
|
+
function ticksFromTimestamps$1(scale, values, majorUnit) {
|
|
12566
12567
|
const ticks = [];
|
|
12567
12568
|
const map2 = {};
|
|
12568
|
-
const ilen =
|
|
12569
|
+
const ilen = values.length;
|
|
12569
12570
|
let i2, value;
|
|
12570
12571
|
for (i2 = 0; i2 < ilen; ++i2) {
|
|
12571
|
-
value =
|
|
12572
|
+
value = values[i2];
|
|
12572
12573
|
map2[value] = i2;
|
|
12573
12574
|
ticks.push({
|
|
12574
12575
|
value,
|
|
@@ -12840,8 +12841,8 @@ let TimeScale$1 = (_q = class extends Scale$1 {
|
|
|
12840
12841
|
}
|
|
12841
12842
|
return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);
|
|
12842
12843
|
}
|
|
12843
|
-
normalize(
|
|
12844
|
-
return _arrayUnique$1(
|
|
12844
|
+
normalize(values) {
|
|
12845
|
+
return _arrayUnique$1(values.sort(sorter$1));
|
|
12845
12846
|
}
|
|
12846
12847
|
}, __publicField(_q, "id", "time"), __publicField(_q, "defaults", {
|
|
12847
12848
|
bounds: "data",
|
|
@@ -13086,7 +13087,7 @@ function ChartComponent(props, ref) {
|
|
|
13086
13087
|
renderChart();
|
|
13087
13088
|
return () => destroyChart();
|
|
13088
13089
|
}, []);
|
|
13089
|
-
return /* @__PURE__ */
|
|
13090
|
+
return /* @__PURE__ */ React__default.createElement("canvas", Object.assign({
|
|
13090
13091
|
ref: canvasRef,
|
|
13091
13092
|
role: "img",
|
|
13092
13093
|
height,
|
|
@@ -13096,7 +13097,7 @@ function ChartComponent(props, ref) {
|
|
|
13096
13097
|
const Chart$1 = /* @__PURE__ */ forwardRef(ChartComponent);
|
|
13097
13098
|
function createTypedChart(type, registerables) {
|
|
13098
13099
|
Chart$2.register(registerables);
|
|
13099
|
-
return /* @__PURE__ */ forwardRef((props, ref) => /* @__PURE__ */
|
|
13100
|
+
return /* @__PURE__ */ forwardRef((props, ref) => /* @__PURE__ */ React__default.createElement(Chart$1, Object.assign({}, props, {
|
|
13100
13101
|
ref,
|
|
13101
13102
|
type
|
|
13102
13103
|
})));
|
|
@@ -13266,14 +13267,14 @@ var hammer = { exports: {} };
|
|
|
13266
13267
|
}
|
|
13267
13268
|
function uniqueArray(src, key, sort) {
|
|
13268
13269
|
var results = [];
|
|
13269
|
-
var
|
|
13270
|
+
var values = [];
|
|
13270
13271
|
var i2 = 0;
|
|
13271
13272
|
while (i2 < src.length) {
|
|
13272
13273
|
var val = key ? src[i2][key] : src[i2];
|
|
13273
|
-
if (inArray(
|
|
13274
|
+
if (inArray(values, val) < 0) {
|
|
13274
13275
|
results.push(src[i2]);
|
|
13275
13276
|
}
|
|
13276
|
-
|
|
13277
|
+
values[i2] = val;
|
|
13277
13278
|
i2++;
|
|
13278
13279
|
}
|
|
13279
13280
|
if (sort) {
|
|
@@ -22173,127 +22174,6 @@ class HTML5BackendImpl {
|
|
|
22173
22174
|
const HTML5Backend = function createBackend(manager, context, options) {
|
|
22174
22175
|
return new HTML5BackendImpl(manager, context, options);
|
|
22175
22176
|
};
|
|
22176
|
-
const BORDER_WIDTH = {
|
|
22177
|
-
INITIAL: 2,
|
|
22178
|
-
HOVERED: 6,
|
|
22179
|
-
POINT_HOVERED: 8
|
|
22180
|
-
};
|
|
22181
|
-
const BORDER_COLOR = "rgba(0,0,0,0.1)";
|
|
22182
|
-
const ANNOTATION_DASH = [10, 2];
|
|
22183
|
-
const DEFAULT_FONT_SIZE = 12;
|
|
22184
|
-
const DEFAULT_FONT_FAMILY = '"Roobert", "Noto Sans", sans-serif';
|
|
22185
|
-
const DEFAULT_COLOR = "hsl(60, 10.34482759%, 12.5%)";
|
|
22186
|
-
const LEGEND_LABEL_BOX_SIZE = 12;
|
|
22187
|
-
const TOOLTIP_PADDING = 8;
|
|
22188
|
-
const TOOLTIP_BOX_PADDING = 4;
|
|
22189
|
-
const TRANSPARENT = "transparent";
|
|
22190
|
-
const LOGARITHMIC_STEPS = [1, 10, 100, 1e3, 1e4];
|
|
22191
|
-
const COLORS = [
|
|
22192
|
-
"#3366cc",
|
|
22193
|
-
"#dc3912",
|
|
22194
|
-
"#ff9900",
|
|
22195
|
-
"#109618",
|
|
22196
|
-
"#990099",
|
|
22197
|
-
"#0099c6",
|
|
22198
|
-
"#dd4477",
|
|
22199
|
-
"#66aa00",
|
|
22200
|
-
"#b82e2e",
|
|
22201
|
-
"#316395",
|
|
22202
|
-
"#994499",
|
|
22203
|
-
"#22aa99",
|
|
22204
|
-
"#aaaa11",
|
|
22205
|
-
"#6633cc",
|
|
22206
|
-
"#e67300",
|
|
22207
|
-
"#8b0707",
|
|
22208
|
-
"#651067",
|
|
22209
|
-
"#329262",
|
|
22210
|
-
"#5574a6",
|
|
22211
|
-
"#3b3eac"
|
|
22212
|
-
];
|
|
22213
|
-
const ALPHA_CHANEL = "99";
|
|
22214
|
-
const WHITE_COLOR_AS_DECIMAL = 16777215;
|
|
22215
|
-
const AUTO = "auto";
|
|
22216
|
-
const ANIMATION_DURATION = {
|
|
22217
|
-
NO: 0,
|
|
22218
|
-
SLOW: 400,
|
|
22219
|
-
FAST: 1e3
|
|
22220
|
-
};
|
|
22221
|
-
const DEFAULT_CHART_NAME = "new_chart";
|
|
22222
|
-
const CUSTOM_LEGEND_PLUGIN_NAME = "htmlLegend";
|
|
22223
|
-
const DECIMAL_POINT_TOLERANCE = 9;
|
|
22224
|
-
const MAX_DECIMAL_DIFF = 1 / 10 ** DECIMAL_POINT_TOLERANCE;
|
|
22225
|
-
const findRadii = (points, mainPoint, isXReverse, isYReverse) => {
|
|
22226
|
-
if ((points == null ? void 0 : points.length) === 0) {
|
|
22227
|
-
throw new Error("Array of points is empty");
|
|
22228
|
-
}
|
|
22229
|
-
let top2 = mainPoint;
|
|
22230
|
-
let bottom2 = mainPoint;
|
|
22231
|
-
let left2 = mainPoint;
|
|
22232
|
-
let right2 = mainPoint;
|
|
22233
|
-
for (const point of points) {
|
|
22234
|
-
if (isYReverse ? point.y < top2.y : point.y > top2.y) {
|
|
22235
|
-
top2 = point;
|
|
22236
|
-
}
|
|
22237
|
-
if (isYReverse ? point.y > bottom2.y : point.y < bottom2.y) {
|
|
22238
|
-
bottom2 = point;
|
|
22239
|
-
}
|
|
22240
|
-
if (isXReverse ? point.x > left2.x : point.x < left2.x) {
|
|
22241
|
-
left2 = point;
|
|
22242
|
-
}
|
|
22243
|
-
if (isXReverse ? point.x < right2.x : point.x > right2.x) {
|
|
22244
|
-
right2 = point;
|
|
22245
|
-
}
|
|
22246
|
-
}
|
|
22247
|
-
const radiusX = Math.abs(right2.x - left2.x) / 2;
|
|
22248
|
-
const radiusY = Math.abs(bottom2.y - top2.y) / 2;
|
|
22249
|
-
return { radiusX, radiusY };
|
|
22250
|
-
};
|
|
22251
|
-
const ellipsisAnnotationPlugin = {
|
|
22252
|
-
id: "ellipsisAnnotationPlugin",
|
|
22253
|
-
afterDraw: (chart2) => {
|
|
22254
|
-
var _a2, _b2, _c2, _d2;
|
|
22255
|
-
const {
|
|
22256
|
-
ctx,
|
|
22257
|
-
scales: { x: x2, y: y2 },
|
|
22258
|
-
data: { datasets },
|
|
22259
|
-
options
|
|
22260
|
-
} = chart2;
|
|
22261
|
-
const isXReverse = ((_b2 = (_a2 = options == null ? void 0 : options.scales) == null ? void 0 : _a2.x) == null ? void 0 : _b2.reverse) || false;
|
|
22262
|
-
const isYReverse = ((_d2 = (_c2 = options == null ? void 0 : options.scales) == null ? void 0 : _c2.y) == null ? void 0 : _d2.reverse) || false;
|
|
22263
|
-
datasets.forEach((dataset) => {
|
|
22264
|
-
dataset.data.forEach((item) => {
|
|
22265
|
-
if (item.ellipsePoints && item.ellipsePoints.length) {
|
|
22266
|
-
const centerX = x2.getPixelForValue(item.x);
|
|
22267
|
-
const centerY = y2.getPixelForValue(item.y);
|
|
22268
|
-
const points = item.ellipsePoints.map((point) => ({
|
|
22269
|
-
x: x2.getPixelForValue(point.x),
|
|
22270
|
-
y: y2.getPixelForValue(point.y)
|
|
22271
|
-
}));
|
|
22272
|
-
const mainPoint = { x: centerX, y: centerY };
|
|
22273
|
-
const { radiusX, radiusY } = findRadii(
|
|
22274
|
-
points,
|
|
22275
|
-
mainPoint,
|
|
22276
|
-
isXReverse,
|
|
22277
|
-
isYReverse
|
|
22278
|
-
);
|
|
22279
|
-
const rotationAngle = item.ellipseRotation * Math.PI / 180;
|
|
22280
|
-
ctx.beginPath();
|
|
22281
|
-
ctx.ellipse(
|
|
22282
|
-
centerX,
|
|
22283
|
-
centerY,
|
|
22284
|
-
radiusX,
|
|
22285
|
-
radiusY,
|
|
22286
|
-
rotationAngle,
|
|
22287
|
-
0,
|
|
22288
|
-
2 * Math.PI
|
|
22289
|
-
);
|
|
22290
|
-
ctx.strokeStyle = (dataset == null ? void 0 : dataset.borderColor) ?? DEFAULT_COLOR;
|
|
22291
|
-
ctx.stroke();
|
|
22292
|
-
}
|
|
22293
|
-
});
|
|
22294
|
-
});
|
|
22295
|
-
}
|
|
22296
|
-
};
|
|
22297
22177
|
const chart$3 = "_chart_e3qdd_1";
|
|
22298
22178
|
const canvas$1 = "_canvas_e3qdd_11";
|
|
22299
22179
|
const fixedHeight$3 = "_fixedHeight_e3qdd_20";
|
|
@@ -22587,6 +22467,67 @@ const chartMinorGridlinesPlugin = {
|
|
|
22587
22467
|
Object.keys(scales).forEach((id) => drawMinorTicksForScale(scales[id]));
|
|
22588
22468
|
}
|
|
22589
22469
|
};
|
|
22470
|
+
const BORDER_WIDTH = {
|
|
22471
|
+
INITIAL: 2,
|
|
22472
|
+
HOVERED: 6,
|
|
22473
|
+
POINT_HOVERED: 8
|
|
22474
|
+
};
|
|
22475
|
+
const BORDER_COLOR = "rgba(0,0,0,0.1)";
|
|
22476
|
+
const ANNOTATION_DASH = [10, 2];
|
|
22477
|
+
const DEFAULT_FONT_SIZE = 12;
|
|
22478
|
+
const DEFAULT_FONT_FAMILY = '"Roobert", "Noto Sans", sans-serif';
|
|
22479
|
+
const DEFAULT_COLOR = "hsl(60, 10.34482759%, 12.5%)";
|
|
22480
|
+
const LEGEND_LABEL_BOX_SIZE = 12;
|
|
22481
|
+
const TOOLTIP_PADDING = 8;
|
|
22482
|
+
const TOOLTIP_BOX_PADDING = 4;
|
|
22483
|
+
const TRANSPARENT = "transparent";
|
|
22484
|
+
const LOGARITHMIC_STEPS = [1, 10, 100, 1e3, 1e4];
|
|
22485
|
+
const COLORS = [
|
|
22486
|
+
"#3366cc",
|
|
22487
|
+
"#dc3912",
|
|
22488
|
+
"#ff9900",
|
|
22489
|
+
"#109618",
|
|
22490
|
+
"#990099",
|
|
22491
|
+
"#0099c6",
|
|
22492
|
+
"#dd4477",
|
|
22493
|
+
"#66aa00",
|
|
22494
|
+
"#b82e2e",
|
|
22495
|
+
"#316395",
|
|
22496
|
+
"#994499",
|
|
22497
|
+
"#22aa99",
|
|
22498
|
+
"#aaaa11",
|
|
22499
|
+
"#6633cc",
|
|
22500
|
+
"#e67300",
|
|
22501
|
+
"#8b0707",
|
|
22502
|
+
"#651067",
|
|
22503
|
+
"#329262",
|
|
22504
|
+
"#5574a6",
|
|
22505
|
+
"#3b3eac"
|
|
22506
|
+
];
|
|
22507
|
+
const ALPHA_CHANEL = "99";
|
|
22508
|
+
const WHITE_COLOR_AS_DECIMAL = 16777215;
|
|
22509
|
+
const AUTO = "auto";
|
|
22510
|
+
const ANIMATION_DURATION = {
|
|
22511
|
+
NO: 0,
|
|
22512
|
+
SLOW: 400,
|
|
22513
|
+
FAST: 1e3
|
|
22514
|
+
};
|
|
22515
|
+
const DEFAULT_CHART_NAME = "new_chart";
|
|
22516
|
+
const CUSTOM_LEGEND_PLUGIN_NAME = "htmlLegend";
|
|
22517
|
+
const DECIMAL_POINT_TOLERANCE = 9;
|
|
22518
|
+
const MAX_DECIMAL_DIFF = 1 / 10 ** DECIMAL_POINT_TOLERANCE;
|
|
22519
|
+
const GRADIENT_COLORS = [
|
|
22520
|
+
{ offset: 0, color: "rgba(144,238,144,0.8)" },
|
|
22521
|
+
// Light green
|
|
22522
|
+
{ offset: 0.6, color: "rgba(255,255,224,0.8)" },
|
|
22523
|
+
// Light yellow
|
|
22524
|
+
{ offset: 0.8, color: "rgba(255,255,224,0.8)" },
|
|
22525
|
+
// Light yellow
|
|
22526
|
+
{ offset: 0.92, color: "rgba(255,182,193,0.5)" },
|
|
22527
|
+
// Light red
|
|
22528
|
+
{ offset: 0.99, color: "rgba(255,182,193,0.8)" }
|
|
22529
|
+
// Light red
|
|
22530
|
+
];
|
|
22590
22531
|
const chartAreaBorderPlugin = {
|
|
22591
22532
|
id: "chartAreaBorder",
|
|
22592
22533
|
beforeDraw(chart2, _2, options) {
|
|
@@ -22732,8 +22673,8 @@ const getAxisTypeFromKey = (string) => {
|
|
|
22732
22673
|
var _a2;
|
|
22733
22674
|
return ((_a2 = string == null ? void 0 : string.match(/[^0-9/]+/gi)) == null ? void 0 : _a2[0]) ?? "";
|
|
22734
22675
|
};
|
|
22735
|
-
const generateKey = (
|
|
22736
|
-
const key =
|
|
22676
|
+
const generateKey = (values) => {
|
|
22677
|
+
const key = values.join("");
|
|
22737
22678
|
return key;
|
|
22738
22679
|
};
|
|
22739
22680
|
const isPrimitiveValue = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null;
|
|
@@ -22855,9 +22796,18 @@ const initialState = ({ options, persistenceId }) => {
|
|
|
22855
22796
|
initialAxesRanges: []
|
|
22856
22797
|
};
|
|
22857
22798
|
};
|
|
22858
|
-
const
|
|
22859
|
-
|
|
22860
|
-
|
|
22799
|
+
const ControlsPortal = ({
|
|
22800
|
+
children,
|
|
22801
|
+
controlsPortalId
|
|
22802
|
+
}) => {
|
|
22803
|
+
if (controlsPortalId) {
|
|
22804
|
+
return /* @__PURE__ */ jsx(Portal, { id: controlsPortalId, children });
|
|
22805
|
+
}
|
|
22806
|
+
return children;
|
|
22807
|
+
};
|
|
22808
|
+
const SvgLineOnly = (props) => /* @__PURE__ */ React.createElement("svg", { fill: "currentColor", height: "1em", viewBox: "0 0 12 12", width: "1em", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", ...props }, /* @__PURE__ */ React.createElement("clipPath", { id: "a" }, /* @__PURE__ */ React.createElement("path", { d: "m0 0h12v12h-12z" })), /* @__PURE__ */ React.createElement("g", { clipPath: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "m.5 6.5v-1h11v1c-4.16104 0-6.63549 0-11 0z" })));
|
|
22809
|
+
const SvgPointOnly = (props) => /* @__PURE__ */ React.createElement("svg", { fill: "currentColor", height: "1em", viewBox: "0 0 12 12", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("circle", { cx: 6, cy: 6, r: 2 }));
|
|
22810
|
+
const SvgLineAndPoint = (props) => /* @__PURE__ */ React.createElement("svg", { fill: "currentColor", height: "1em", viewBox: "0 0 12 12", width: "1em", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", ...props }, /* @__PURE__ */ React.createElement("clipPath", { id: "a" }, /* @__PURE__ */ React.createElement("path", { d: "m0 0h12v12h-12z" })), /* @__PURE__ */ React.createElement("g", { clipPath: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "m7.937 6.5c-.11122.42912-.36179.80916-.71237 1.08047-.35058.2713-.78133.4185-1.22463.4185s-.87405-.1472-1.22463-.4185c-.35058-.27131-.60115-.65135-.71237-1.08047h-3.563v-1h3.563c.11122-.42912.36179-.80916.71237-1.08046s.78133-.41851 1.22463-.41851.87405.14721 1.22463.41851.60115.65134.71237 1.08046h3.563v1z" })));
|
|
22861
22811
|
const LineOptions = ({
|
|
22862
22812
|
lineEnabled,
|
|
22863
22813
|
onToggleLine,
|
|
@@ -22868,7 +22818,7 @@ const LineOptions = ({
|
|
|
22868
22818
|
const options = [
|
|
22869
22819
|
{
|
|
22870
22820
|
label: translations.pointsLines,
|
|
22871
|
-
icon: /* @__PURE__ */ jsx(Icon, { icon:
|
|
22821
|
+
icon: /* @__PURE__ */ jsx(Icon, { icon: /* @__PURE__ */ jsx(SvgLineAndPoint, {}) }),
|
|
22872
22822
|
selected: pointsEnabled && lineEnabled,
|
|
22873
22823
|
onClick: () => {
|
|
22874
22824
|
onTogglePoints();
|
|
@@ -22876,7 +22826,7 @@ const LineOptions = ({
|
|
|
22876
22826
|
},
|
|
22877
22827
|
{
|
|
22878
22828
|
label: translations.linesOnly,
|
|
22879
|
-
icon: /* @__PURE__ */ jsx(Icon, { icon:
|
|
22829
|
+
icon: /* @__PURE__ */ jsx(Icon, { icon: /* @__PURE__ */ jsx(SvgLineOnly, {}) }),
|
|
22880
22830
|
selected: !pointsEnabled && lineEnabled,
|
|
22881
22831
|
onClick: () => {
|
|
22882
22832
|
onTogglePoints();
|
|
@@ -22885,7 +22835,7 @@ const LineOptions = ({
|
|
|
22885
22835
|
},
|
|
22886
22836
|
{
|
|
22887
22837
|
label: translations.pointsOnly,
|
|
22888
|
-
icon: /* @__PURE__ */ jsx(Icon, { icon:
|
|
22838
|
+
icon: /* @__PURE__ */ jsx(Icon, { icon: /* @__PURE__ */ jsx(SvgPointOnly, {}) }),
|
|
22889
22839
|
selected: pointsEnabled && !lineEnabled,
|
|
22890
22840
|
onClick: () => {
|
|
22891
22841
|
onToggleLine();
|
|
@@ -22912,7 +22862,7 @@ var DefaultContext = {
|
|
|
22912
22862
|
style: void 0,
|
|
22913
22863
|
attr: void 0
|
|
22914
22864
|
};
|
|
22915
|
-
var IconContext =
|
|
22865
|
+
var IconContext = React__default.createContext && React__default.createContext(DefaultContext);
|
|
22916
22866
|
var __assign = globalThis && globalThis.__assign || function() {
|
|
22917
22867
|
__assign = Object.assign || function(t) {
|
|
22918
22868
|
for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
|
|
@@ -22939,14 +22889,14 @@ var __rest = globalThis && globalThis.__rest || function(s2, e2) {
|
|
|
22939
22889
|
};
|
|
22940
22890
|
function Tree2Element(tree) {
|
|
22941
22891
|
return tree && tree.map(function(node, i2) {
|
|
22942
|
-
return
|
|
22892
|
+
return React__default.createElement(node.tag, __assign({
|
|
22943
22893
|
key: i2
|
|
22944
22894
|
}, node.attr), Tree2Element(node.child));
|
|
22945
22895
|
});
|
|
22946
22896
|
}
|
|
22947
22897
|
function GenIcon(data) {
|
|
22948
22898
|
return function(props) {
|
|
22949
|
-
return
|
|
22899
|
+
return React__default.createElement(IconBase, __assign({
|
|
22950
22900
|
attr: __assign({}, data.attr)
|
|
22951
22901
|
}, props), Tree2Element(data.child));
|
|
22952
22902
|
};
|
|
@@ -22960,7 +22910,7 @@ function IconBase(props) {
|
|
|
22960
22910
|
className = conf.className;
|
|
22961
22911
|
if (props.className)
|
|
22962
22912
|
className = (className ? className + " " : "") + props.className;
|
|
22963
|
-
return
|
|
22913
|
+
return React__default.createElement("svg", __assign({
|
|
22964
22914
|
stroke: "currentColor",
|
|
22965
22915
|
fill: "currentColor",
|
|
22966
22916
|
strokeWidth: "0"
|
|
@@ -22972,9 +22922,9 @@ function IconBase(props) {
|
|
|
22972
22922
|
height: computedSize,
|
|
22973
22923
|
width: computedSize,
|
|
22974
22924
|
xmlns: "http://www.w3.org/2000/svg"
|
|
22975
|
-
}), title &&
|
|
22925
|
+
}), title && React__default.createElement("title", null, title), props.children);
|
|
22976
22926
|
};
|
|
22977
|
-
return IconContext !== void 0 ?
|
|
22927
|
+
return IconContext !== void 0 ? React__default.createElement(IconContext.Consumer, null, function(conf) {
|
|
22978
22928
|
return elem(conf);
|
|
22979
22929
|
}) : elem(DefaultContext);
|
|
22980
22930
|
}
|
|
@@ -23868,7 +23818,7 @@ async function toPng(node, options = {}) {
|
|
|
23868
23818
|
var dist = { exports: {} };
|
|
23869
23819
|
(function(module, exports) {
|
|
23870
23820
|
!function(e2, t) {
|
|
23871
|
-
module.exports = t(
|
|
23821
|
+
module.exports = t(React__default);
|
|
23872
23822
|
}(window, function(e2) {
|
|
23873
23823
|
return function(e3) {
|
|
23874
23824
|
var t = {};
|
|
@@ -24520,15 +24470,6 @@ const AxesOptions = (optionsPopover) => {
|
|
|
24520
24470
|
}
|
|
24521
24471
|
);
|
|
24522
24472
|
};
|
|
24523
|
-
const ControlsPortal = ({
|
|
24524
|
-
children,
|
|
24525
|
-
controlsPortalId
|
|
24526
|
-
}) => {
|
|
24527
|
-
if (controlsPortalId && document.getElementById(controlsPortalId)) {
|
|
24528
|
-
return /* @__PURE__ */ jsx(Portal, { id: controlsPortalId, children });
|
|
24529
|
-
}
|
|
24530
|
-
return children;
|
|
24531
|
-
};
|
|
24532
24473
|
const Controls = ({
|
|
24533
24474
|
headerComponent,
|
|
24534
24475
|
subheaderComponent,
|
|
@@ -25471,21 +25412,17 @@ const handlePointLeave = (element, chart2, annotation2) => {
|
|
|
25471
25412
|
};
|
|
25472
25413
|
const generateAnnotations = (annotationsData) => {
|
|
25473
25414
|
return annotationsData == null ? void 0 : annotationsData.map((ann, idx) => {
|
|
25474
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
25415
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
25475
25416
|
const scaleID = (ann == null ? void 0 : ann.annotationAxis) ?? void 0;
|
|
25476
25417
|
const color2 = (ann == null ? void 0 : ann.color) ?? COLORS[idx];
|
|
25477
|
-
const type = (ann == null ? void 0 : ann.type)
|
|
25418
|
+
const type = (ann == null ? void 0 : ann.type) ?? AnnotationType.LINE;
|
|
25478
25419
|
const adjustScaleRange2 = ann == null ? void 0 : ann.adjustScaleRange;
|
|
25479
25420
|
const borderColor = {
|
|
25480
25421
|
[AnnotationType.LINE]: color2,
|
|
25481
25422
|
[AnnotationType.POINT]: color2,
|
|
25482
|
-
[AnnotationType.BOX]: color2
|
|
25483
|
-
[AnnotationType.ELLIPSE]: color2
|
|
25423
|
+
[AnnotationType.BOX]: color2
|
|
25484
25424
|
}[type] || TRANSPARENT;
|
|
25485
|
-
const borderWidth =
|
|
25486
|
-
[AnnotationType.LINE]: BORDER_WIDTH.INITIAL,
|
|
25487
|
-
[AnnotationType.ELLIPSE]: (ann == null ? void 0 : ann.borderWidth) ?? 0
|
|
25488
|
-
}[type] ?? 0;
|
|
25425
|
+
const borderWidth = type === AnnotationType.LINE ? BORDER_WIDTH.INITIAL : 0;
|
|
25489
25426
|
const borderDash = type === AnnotationType.LINE ? ANNOTATION_DASH : void 0;
|
|
25490
25427
|
const defLabel = {
|
|
25491
25428
|
content: ann == null ? void 0 : ann.label,
|
|
@@ -25502,14 +25439,14 @@ const generateAnnotations = (annotationsData) => {
|
|
|
25502
25439
|
[AnnotationType.POINT]: {
|
|
25503
25440
|
backgroundColor: ((_a2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _a2.backgroundColor) ?? TRANSPARENT,
|
|
25504
25441
|
content: ann == null ? void 0 : ann.label,
|
|
25505
|
-
display: !!(ann == null ? void 0 : ann.label),
|
|
25506
|
-
position: ((
|
|
25507
|
-
color: ((
|
|
25508
|
-
font: ((
|
|
25442
|
+
display: ((_b2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _b2.display) ?? !!(ann == null ? void 0 : ann.label),
|
|
25443
|
+
position: ((_c2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _c2.position) ?? Position.Bottom,
|
|
25444
|
+
color: ((_d2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _d2.color) ?? DEFAULT_COLOR,
|
|
25445
|
+
font: ((_e2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _e2.font) ?? `12px ${DEFAULT_FONT_FAMILY}`,
|
|
25509
25446
|
borderWidth: BORDER_WIDTH.INITIAL,
|
|
25510
25447
|
padding: 5,
|
|
25511
25448
|
borderRadius: 3,
|
|
25512
|
-
borderColor: ((
|
|
25449
|
+
borderColor: ((_f2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _f2.borderColor) ?? TRANSPARENT
|
|
25513
25450
|
},
|
|
25514
25451
|
[AnnotationType.BOX]: defLabel,
|
|
25515
25452
|
[AnnotationType.ELLIPSE]: defLabel
|
|
@@ -25559,7 +25496,7 @@ const generateAnnotations = (annotationsData) => {
|
|
|
25559
25496
|
id: `${ann == null ? void 0 : ann.label}-${ann == null ? void 0 : ann.value}-${idx}`,
|
|
25560
25497
|
scaleID,
|
|
25561
25498
|
label,
|
|
25562
|
-
backgroundColor:
|
|
25499
|
+
backgroundColor: color2,
|
|
25563
25500
|
borderColor,
|
|
25564
25501
|
borderWidth,
|
|
25565
25502
|
borderDash,
|
|
@@ -26523,6 +26460,7 @@ const styles$3 = {
|
|
|
26523
26460
|
isActive,
|
|
26524
26461
|
resizeContainer
|
|
26525
26462
|
};
|
|
26463
|
+
const SvgCircle = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("circle", { cx: 12, cy: 12, r: 12, fill: "currentColor" }));
|
|
26526
26464
|
var ChartType = /* @__PURE__ */ ((ChartType2) => {
|
|
26527
26465
|
ChartType2["LINE"] = "line";
|
|
26528
26466
|
ChartType2["BAR"] = "bar";
|
|
@@ -26535,10 +26473,9 @@ var ChartDirection = /* @__PURE__ */ ((ChartDirection2) => {
|
|
|
26535
26473
|
ChartDirection2["HORIZONTAL"] = "horizontal";
|
|
26536
26474
|
return ChartDirection2;
|
|
26537
26475
|
})(ChartDirection || {});
|
|
26538
|
-
const
|
|
26539
|
-
const
|
|
26540
|
-
const
|
|
26541
|
-
const triangleSvg = "data:image/svg+xml;base64,PHN2ZyAgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxjbGlwUGF0aCBpZD0iYSI+PHBhdGggZD0ibTAgMGgyNHYyNGgtMjR6Ii8+PC9jbGlwUGF0aD48ZyBjbGlwLXBhdGg9InVybCgjYSkiPjxwYXRoIGQ9Im0yMi43OTk4IDIyLjA2MjNoLTIxLjU5OTZjLS4yMTA2Ni4wMDAxLS40MTc2MTctLjA1NTQtLjYwMDA2Ny0uMTYwNy0uMTgyNDUxLS4xMDUzLS4zMzM5NjUtLjI1NjctLjQzOTMxMS0uNDM5Mi0uMTA1MzQ2NC0uMTgyNC0uMTYwODEyMjgtLjM4OTMtLjE2MDgyMi0uNnMuMDU1NDM3Mi0uNDE3Ni4xNjA3NjctLjZsMTAuNzk5ODMzLTE4LjcwNTE4Yy4xMTM5LS4xNzEzNy4yNjg0LS4zMTE5MS40NDk3LS40MDkxMy4xODE0LS4wOTcyMi4zODM5LS4xNDgwOS41ODk3LS4xNDgwOXMuNDA4My4wNTA4Ny41ODk3LjE0ODA5Yy4xODEzLjA5NzIyLjMzNTguMjM3NzYuNDQ5Ny40MDkxM2wxMC43OTk4IDE4LjcwNTE4Yy4xMDU0LjE4MjQuMTYwOC4zODkzLjE2MDguNnMtLjA1NTUuNDE3Ni0uMTYwOC42Yy0uMTA1NC4xODI1LS4yNTY5LjMzMzktLjQzOTMuNDM5Mi0uMTgyNS4xMDUzLS4zODk0LjE2MDgtLjYwMDEuMTYwN3oiIGZpbGw9ImN1cnJlbnRDb2xvciIvPjwvZz48L3N2Zz4=";
|
|
26476
|
+
const SvgRect = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("rect", { x: 2, y: 2, width: 20, height: 20, fill: "currentColor" }));
|
|
26477
|
+
const SvgRectRot = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("rect", { x: 3, y: 3, width: 18, height: 18, fill: "currentColor", transform: "rotate(45 12 12)" }));
|
|
26478
|
+
const SvgTriangle = (props) => /* @__PURE__ */ React.createElement("svg", { height: 24, viewBox: "0 0 24 24", width: 24, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", ...props }, /* @__PURE__ */ React.createElement("clipPath", { id: "a" }, /* @__PURE__ */ React.createElement("path", { d: "m0 0h24v24h-24z" })), /* @__PURE__ */ React.createElement("g", { clipPath: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "m22.7998 22.0623h-21.5996c-.21066.0001-.417617-.0554-.600067-.1607-.182451-.1053-.333965-.2567-.439311-.4392-.1053464-.1824-.16081228-.3893-.160822-.6s.0554372-.4176.160767-.6l10.799833-18.70518c.1139-.17137.2684-.31191.4497-.40913.1814-.09722.3839-.14809.5897-.14809s.4083.05087.5897.14809c.1813.09722.3358.23776.4497.40913l10.7998 18.70518c.1054.1824.1608.3893.1608.6s-.0555.4176-.1608.6c-.1054.1825-.2569.3339-.4393.4392-.1825.1053-.3894.1608-.6001.1607z", fill: "currentColor" })));
|
|
26542
26479
|
const LEGEND_SYMBOL_SIZE$1 = 16;
|
|
26543
26480
|
const LineItem = ({ dataset }) => {
|
|
26544
26481
|
var _a2;
|
|
@@ -26572,15 +26509,15 @@ const PointItem = ({ dataset }) => {
|
|
|
26572
26509
|
return null;
|
|
26573
26510
|
const size = pointRadius * 2;
|
|
26574
26511
|
const icons = {
|
|
26575
|
-
circle:
|
|
26576
|
-
triangle:
|
|
26577
|
-
rectRot:
|
|
26578
|
-
rect:
|
|
26512
|
+
circle: /* @__PURE__ */ jsx(SvgCircle, {}),
|
|
26513
|
+
triangle: /* @__PURE__ */ jsx(SvgTriangle, {}),
|
|
26514
|
+
rectRot: /* @__PURE__ */ jsx(SvgRectRot, {}),
|
|
26515
|
+
rect: /* @__PURE__ */ jsx(SvgRect, {})
|
|
26579
26516
|
};
|
|
26580
26517
|
return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemPoint, children: /* @__PURE__ */ jsx(
|
|
26581
26518
|
Icon,
|
|
26582
26519
|
{
|
|
26583
|
-
icon: icons[pointStyle]
|
|
26520
|
+
icon: icons[pointStyle] ?? /* @__PURE__ */ jsx(SvgCircle, {}),
|
|
26584
26521
|
size,
|
|
26585
26522
|
color: pointBackgroundColor
|
|
26586
26523
|
}
|
|
@@ -26614,7 +26551,7 @@ const renderLegendItemSymbol = (dataset, chartType) => {
|
|
|
26614
26551
|
case ChartType.BAR:
|
|
26615
26552
|
return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemBox, children: /* @__PURE__ */ jsx(TbSquareFilled, { color: dataset.borderColor }) });
|
|
26616
26553
|
case ChartType.PIE:
|
|
26617
|
-
return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemPoint, children: /* @__PURE__ */ jsx(Icon, { icon:
|
|
26554
|
+
return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemPoint, children: /* @__PURE__ */ jsx(Icon, { icon: /* @__PURE__ */ jsx(SvgCircle, {}) }) });
|
|
26618
26555
|
case ChartType.SCATTER:
|
|
26619
26556
|
return /* @__PURE__ */ jsx("span", { className: styles$3.legendItemPoint, children: /* @__PURE__ */ jsx(TbCircleFilled, { color: dataset.borderColor }) });
|
|
26620
26557
|
default:
|
|
@@ -26647,13 +26584,15 @@ const LegendItem = ({
|
|
|
26647
26584
|
);
|
|
26648
26585
|
};
|
|
26649
26586
|
const generateAnnotationLabels = (chart2) => {
|
|
26650
|
-
const annotations =
|
|
26651
|
-
|
|
26587
|
+
const annotations = get$1(
|
|
26588
|
+
chart2,
|
|
26589
|
+
"options.plugins.annotation.annotations",
|
|
26590
|
+
null
|
|
26652
26591
|
);
|
|
26653
26592
|
if (!annotations || !Object.keys(annotations).length) {
|
|
26654
26593
|
return [];
|
|
26655
26594
|
}
|
|
26656
|
-
return values(annotations);
|
|
26595
|
+
return Object.values(annotations);
|
|
26657
26596
|
};
|
|
26658
26597
|
const generatedLabels = (chart2) => {
|
|
26659
26598
|
var _a2, _b2, _c2, _d2, _e2;
|
|
@@ -26896,8 +26835,7 @@ Chart$2.register(
|
|
|
26896
26835
|
plugin,
|
|
26897
26836
|
annotation,
|
|
26898
26837
|
chartAreaTextPlugin,
|
|
26899
|
-
annotationDraggerPlugin
|
|
26900
|
-
ellipsisAnnotationPlugin
|
|
26838
|
+
annotationDraggerPlugin
|
|
26901
26839
|
);
|
|
26902
26840
|
const LineChart = (props) => {
|
|
26903
26841
|
var _a2, _b2;
|
|
@@ -27671,16 +27609,16 @@ function _lookup(table2, value, cmp) {
|
|
|
27671
27609
|
}
|
|
27672
27610
|
const _lookupByKey = (table2, key, value, last) => _lookup(table2, value, last ? (index2) => table2[index2][key] <= value : (index2) => table2[index2][key] < value);
|
|
27673
27611
|
const _rlookupByKey = (table2, key, value) => _lookup(table2, value, (index2) => table2[index2][key] >= value);
|
|
27674
|
-
function _filterBetween(
|
|
27612
|
+
function _filterBetween(values, min, max) {
|
|
27675
27613
|
let start = 0;
|
|
27676
|
-
let end =
|
|
27677
|
-
while (start < end &&
|
|
27614
|
+
let end = values.length;
|
|
27615
|
+
while (start < end && values[start] < min) {
|
|
27678
27616
|
start++;
|
|
27679
27617
|
}
|
|
27680
|
-
while (end > start &&
|
|
27618
|
+
while (end > start && values[end - 1] > max) {
|
|
27681
27619
|
end--;
|
|
27682
27620
|
}
|
|
27683
|
-
return start > 0 || end <
|
|
27621
|
+
return start > 0 || end < values.length ? values.slice(start, end) : values;
|
|
27684
27622
|
}
|
|
27685
27623
|
const arrayEvents = ["push", "pop", "shift", "splice", "unshift"];
|
|
27686
27624
|
function listenArrayEvents(array, listener) {
|
|
@@ -28483,9 +28421,9 @@ function getScope$1(node, key) {
|
|
|
28483
28421
|
}
|
|
28484
28422
|
return node;
|
|
28485
28423
|
}
|
|
28486
|
-
function set(root, scope2,
|
|
28424
|
+
function set(root, scope2, values) {
|
|
28487
28425
|
if (typeof scope2 === "string") {
|
|
28488
|
-
return merge(getScope$1(root, scope2),
|
|
28426
|
+
return merge(getScope$1(root, scope2), values);
|
|
28489
28427
|
}
|
|
28490
28428
|
return merge(getScope$1(root, ""), scope2);
|
|
28491
28429
|
}
|
|
@@ -28534,17 +28472,17 @@ class Defaults2 {
|
|
|
28534
28472
|
this.drawActiveElementsOnTop = true;
|
|
28535
28473
|
this.describe(_descriptors2);
|
|
28536
28474
|
}
|
|
28537
|
-
set(scope2,
|
|
28538
|
-
return set(this, scope2,
|
|
28475
|
+
set(scope2, values) {
|
|
28476
|
+
return set(this, scope2, values);
|
|
28539
28477
|
}
|
|
28540
28478
|
get(scope2) {
|
|
28541
28479
|
return getScope$1(this, scope2);
|
|
28542
28480
|
}
|
|
28543
|
-
describe(scope2,
|
|
28544
|
-
return set(descriptors, scope2,
|
|
28481
|
+
describe(scope2, values) {
|
|
28482
|
+
return set(descriptors, scope2, values);
|
|
28545
28483
|
}
|
|
28546
|
-
override(scope2,
|
|
28547
|
-
return set(overrides, scope2,
|
|
28484
|
+
override(scope2, values) {
|
|
28485
|
+
return set(overrides, scope2, values);
|
|
28548
28486
|
}
|
|
28549
28487
|
route(scope2, name, targetScope, targetName) {
|
|
28550
28488
|
const scopeObject = getScope$1(this, scope2);
|
|
@@ -30209,8 +30147,8 @@ class Animations2 {
|
|
|
30209
30147
|
});
|
|
30210
30148
|
});
|
|
30211
30149
|
}
|
|
30212
|
-
_animateOptions(target,
|
|
30213
|
-
const newOptions =
|
|
30150
|
+
_animateOptions(target, values) {
|
|
30151
|
+
const newOptions = values.options;
|
|
30214
30152
|
const options = resolveTargetOptions(target, newOptions);
|
|
30215
30153
|
if (!options) {
|
|
30216
30154
|
return [];
|
|
@@ -30224,11 +30162,11 @@ class Animations2 {
|
|
|
30224
30162
|
}
|
|
30225
30163
|
return animations;
|
|
30226
30164
|
}
|
|
30227
|
-
_createAnimations(target,
|
|
30165
|
+
_createAnimations(target, values) {
|
|
30228
30166
|
const animatedProps = this._properties;
|
|
30229
30167
|
const animations = [];
|
|
30230
30168
|
const running = target.$animations || (target.$animations = {});
|
|
30231
|
-
const props = Object.keys(
|
|
30169
|
+
const props = Object.keys(values);
|
|
30232
30170
|
const date = Date.now();
|
|
30233
30171
|
let i2;
|
|
30234
30172
|
for (i2 = props.length - 1; i2 >= 0; --i2) {
|
|
@@ -30237,10 +30175,10 @@ class Animations2 {
|
|
|
30237
30175
|
continue;
|
|
30238
30176
|
}
|
|
30239
30177
|
if (prop === "options") {
|
|
30240
|
-
animations.push(...this._animateOptions(target,
|
|
30178
|
+
animations.push(...this._animateOptions(target, values));
|
|
30241
30179
|
continue;
|
|
30242
30180
|
}
|
|
30243
|
-
const value =
|
|
30181
|
+
const value = values[prop];
|
|
30244
30182
|
let animation = running[prop];
|
|
30245
30183
|
const cfg = animatedProps.get(prop);
|
|
30246
30184
|
if (animation) {
|
|
@@ -30260,12 +30198,12 @@ class Animations2 {
|
|
|
30260
30198
|
}
|
|
30261
30199
|
return animations;
|
|
30262
30200
|
}
|
|
30263
|
-
update(target,
|
|
30201
|
+
update(target, values) {
|
|
30264
30202
|
if (this._properties.size === 0) {
|
|
30265
|
-
Object.assign(target,
|
|
30203
|
+
Object.assign(target, values);
|
|
30266
30204
|
return;
|
|
30267
30205
|
}
|
|
30268
|
-
const animations = this._createAnimations(target,
|
|
30206
|
+
const animations = this._createAnimations(target, values);
|
|
30269
30207
|
if (animations.length) {
|
|
30270
30208
|
animator.add(this._chart, animations);
|
|
30271
30209
|
return true;
|
|
@@ -30703,9 +30641,9 @@ class DatasetController {
|
|
|
30703
30641
|
updateRangeFromParsed(range, scale, parsed, stack) {
|
|
30704
30642
|
const parsedValue = parsed[scale.axis];
|
|
30705
30643
|
let value = parsedValue === null ? NaN : parsedValue;
|
|
30706
|
-
const
|
|
30707
|
-
if (stack &&
|
|
30708
|
-
stack.values =
|
|
30644
|
+
const values = stack && parsed._stacks[scale.axis];
|
|
30645
|
+
if (stack && values) {
|
|
30646
|
+
stack.values = values;
|
|
30709
30647
|
value = applyStack(stack, parsedValue, this._cachedMeta.index);
|
|
30710
30648
|
}
|
|
30711
30649
|
range.min = Math.min(range.min, value);
|
|
@@ -30748,15 +30686,15 @@ class DatasetController {
|
|
|
30748
30686
|
}
|
|
30749
30687
|
getAllParsedValues(scale) {
|
|
30750
30688
|
const parsed = this._cachedMeta._parsed;
|
|
30751
|
-
const
|
|
30689
|
+
const values = [];
|
|
30752
30690
|
let i2, ilen, value;
|
|
30753
30691
|
for (i2 = 0, ilen = parsed.length; i2 < ilen; ++i2) {
|
|
30754
30692
|
value = parsed[i2][scale.axis];
|
|
30755
30693
|
if (isNumberFinite(value)) {
|
|
30756
|
-
|
|
30694
|
+
values.push(value);
|
|
30757
30695
|
}
|
|
30758
30696
|
}
|
|
30759
|
-
return
|
|
30697
|
+
return values;
|
|
30760
30698
|
}
|
|
30761
30699
|
getMaxOverflow() {
|
|
30762
30700
|
return false;
|
|
@@ -30850,12 +30788,12 @@ class DatasetController {
|
|
|
30850
30788
|
const scopes = config2.getOptionScopes(this.getDataset(), scopeKeys);
|
|
30851
30789
|
const names2 = Object.keys(defaults.elements[elementType]);
|
|
30852
30790
|
const context = () => this.getContext(index2, active);
|
|
30853
|
-
const
|
|
30854
|
-
if (
|
|
30855
|
-
|
|
30856
|
-
cache2[cacheKey] = Object.freeze(cloneIfNotShared(
|
|
30791
|
+
const values = config2.resolveNamedOptions(scopes, names2, context, prefixes);
|
|
30792
|
+
if (values.$shared) {
|
|
30793
|
+
values.$shared = sharing;
|
|
30794
|
+
cache2[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));
|
|
30857
30795
|
}
|
|
30858
|
-
return
|
|
30796
|
+
return values;
|
|
30859
30797
|
}
|
|
30860
30798
|
_resolveAnimations(index2, transition, active) {
|
|
30861
30799
|
const chart2 = this.chart;
|
|
@@ -31024,17 +30962,17 @@ DatasetController.prototype.dataElementType = null;
|
|
|
31024
30962
|
function getAllScaleValues(scale, type) {
|
|
31025
30963
|
if (!scale._cache.$bar) {
|
|
31026
30964
|
const visibleMetas = scale.getMatchingVisibleMetas(type);
|
|
31027
|
-
let
|
|
30965
|
+
let values = [];
|
|
31028
30966
|
for (let i2 = 0, ilen = visibleMetas.length; i2 < ilen; i2++) {
|
|
31029
|
-
|
|
30967
|
+
values = values.concat(visibleMetas[i2].controller.getAllParsedValues(scale));
|
|
31030
30968
|
}
|
|
31031
|
-
scale._cache.$bar = _arrayUnique(
|
|
30969
|
+
scale._cache.$bar = _arrayUnique(values.sort((a2, b2) => a2 - b2));
|
|
31032
30970
|
}
|
|
31033
30971
|
return scale._cache.$bar;
|
|
31034
30972
|
}
|
|
31035
30973
|
function computeMinSampleSize(meta) {
|
|
31036
30974
|
const scale = meta.iScale;
|
|
31037
|
-
const
|
|
30975
|
+
const values = getAllScaleValues(scale, meta.type);
|
|
31038
30976
|
let min = scale._length;
|
|
31039
30977
|
let i2, ilen, curr, prev;
|
|
31040
30978
|
const updateMinAndPrev = () => {
|
|
@@ -31046,8 +30984,8 @@ function computeMinSampleSize(meta) {
|
|
|
31046
30984
|
}
|
|
31047
30985
|
prev = curr;
|
|
31048
30986
|
};
|
|
31049
|
-
for (i2 = 0, ilen =
|
|
31050
|
-
curr = scale.getPixelForValue(
|
|
30987
|
+
for (i2 = 0, ilen = values.length; i2 < ilen; ++i2) {
|
|
30988
|
+
curr = scale.getPixelForValue(values[i2]);
|
|
31051
30989
|
updateMinAndPrev();
|
|
31052
30990
|
}
|
|
31053
30991
|
prev = void 0;
|
|
@@ -31547,16 +31485,16 @@ class BubbleController extends DatasetController {
|
|
|
31547
31485
|
}
|
|
31548
31486
|
resolveDataElementOptions(index2, mode) {
|
|
31549
31487
|
const parsed = this.getParsed(index2);
|
|
31550
|
-
let
|
|
31551
|
-
if (
|
|
31552
|
-
|
|
31488
|
+
let values = super.resolveDataElementOptions(index2, mode);
|
|
31489
|
+
if (values.$shared) {
|
|
31490
|
+
values = Object.assign({}, values, { $shared: false });
|
|
31553
31491
|
}
|
|
31554
|
-
const radius =
|
|
31492
|
+
const radius = values.radius;
|
|
31555
31493
|
if (mode !== "active") {
|
|
31556
|
-
|
|
31494
|
+
values.radius = 0;
|
|
31557
31495
|
}
|
|
31558
|
-
|
|
31559
|
-
return
|
|
31496
|
+
values.radius += valueOrDefault(parsed && parsed._custom, radius);
|
|
31497
|
+
return values;
|
|
31560
31498
|
}
|
|
31561
31499
|
}
|
|
31562
31500
|
BubbleController.id = "bubble";
|
|
@@ -38579,13 +38517,13 @@ function setMajorTicks(scale, ticks, map2, majorUnit) {
|
|
|
38579
38517
|
}
|
|
38580
38518
|
return ticks;
|
|
38581
38519
|
}
|
|
38582
|
-
function ticksFromTimestamps(scale,
|
|
38520
|
+
function ticksFromTimestamps(scale, values, majorUnit) {
|
|
38583
38521
|
const ticks = [];
|
|
38584
38522
|
const map2 = {};
|
|
38585
|
-
const ilen =
|
|
38523
|
+
const ilen = values.length;
|
|
38586
38524
|
let i2, value;
|
|
38587
38525
|
for (i2 = 0; i2 < ilen; ++i2) {
|
|
38588
|
-
value =
|
|
38526
|
+
value = values[i2];
|
|
38589
38527
|
map2[value] = i2;
|
|
38590
38528
|
ticks.push({
|
|
38591
38529
|
value,
|
|
@@ -38835,8 +38773,8 @@ class TimeScale extends Scale2 {
|
|
|
38835
38773
|
}
|
|
38836
38774
|
return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);
|
|
38837
38775
|
}
|
|
38838
|
-
normalize(
|
|
38839
|
-
return _arrayUnique(
|
|
38776
|
+
normalize(values) {
|
|
38777
|
+
return _arrayUnique(values.sort(sorter));
|
|
38840
38778
|
}
|
|
38841
38779
|
}
|
|
38842
38780
|
TimeScale.id = "time";
|
|
@@ -39895,9 +39833,14 @@ const getBarChartDataLabels = (options) => {
|
|
|
39895
39833
|
dataLabel = Number.isInteger(dataElement) ? dataElement : dataElement.toFixed(2);
|
|
39896
39834
|
}
|
|
39897
39835
|
if (Array.isArray(dataElement)) {
|
|
39898
|
-
|
|
39899
|
-
|
|
39900
|
-
|
|
39836
|
+
if (dataElement.length === 2) {
|
|
39837
|
+
const sum = dataElement[1] - dataElement[0];
|
|
39838
|
+
dataLabel = sum < 0 ? round$2(sum, 2) : `+${round$2(sum, 2)}`;
|
|
39839
|
+
} else {
|
|
39840
|
+
dataLabel = dataElement.reduce((acc, curr, i2) => {
|
|
39841
|
+
return i2 === 0 ? `${acc} ${curr}` : `${acc}, ${curr}`;
|
|
39842
|
+
}, "");
|
|
39843
|
+
}
|
|
39901
39844
|
}
|
|
39902
39845
|
return dataLabel;
|
|
39903
39846
|
};
|
|
@@ -39973,8 +39916,7 @@ const getBarChartToolTips = (options) => {
|
|
|
39973
39916
|
},
|
|
39974
39917
|
""
|
|
39975
39918
|
);
|
|
39976
|
-
}
|
|
39977
|
-
if (typeof tooltipItem.raw === "object") {
|
|
39919
|
+
} else if (typeof tooltipItem.raw === "object") {
|
|
39978
39920
|
tooltipItemValue2 = labelNumberFormatted;
|
|
39979
39921
|
}
|
|
39980
39922
|
return tooltipItemValue2;
|
|
@@ -40132,6 +40074,7 @@ const getDefaultProps$1 = (props) => {
|
|
|
40132
40074
|
const options = (chart2 == null ? void 0 : chart2.options) || {};
|
|
40133
40075
|
return {
|
|
40134
40076
|
testId: (chart2 == null ? void 0 : chart2.testId) ?? "",
|
|
40077
|
+
controlsPortalId: (chart2 == null ? void 0 : chart2.controlsPortalId) ?? "",
|
|
40135
40078
|
data: chart2 == null ? void 0 : chart2.data,
|
|
40136
40079
|
options: {
|
|
40137
40080
|
title: (options == null ? void 0 : options.title) || "",
|
|
@@ -40173,7 +40116,7 @@ const BarChart = (props) => {
|
|
|
40173
40116
|
const chartRef = useRef(null);
|
|
40174
40117
|
const chart2 = getDefaultProps$1(props);
|
|
40175
40118
|
const { translations, languageKey } = getConfig();
|
|
40176
|
-
const { options, testId } = chart2;
|
|
40119
|
+
const { options, testId, controlsPortalId } = chart2;
|
|
40177
40120
|
const { chartStyling, graph } = options;
|
|
40178
40121
|
const { generatedDatasets } = useBarChartConfig(chartRef, chart2);
|
|
40179
40122
|
const barChartOptions = useBarChartOptions({ chart: chart2, chartRef });
|
|
@@ -40188,7 +40131,7 @@ const BarChart = (props) => {
|
|
|
40188
40131
|
},
|
|
40189
40132
|
"data-testid": testId,
|
|
40190
40133
|
children: [
|
|
40191
|
-
/* @__PURE__ */ jsx("div", { className: styles$1.actions, children: /* @__PURE__ */ jsx(Tooltip$2, { text: translations.downloadAsPNG, placement: "bottom-end", children: /* @__PURE__ */ jsx(
|
|
40134
|
+
/* @__PURE__ */ jsx(ControlsPortal, { controlsPortalId, children: /* @__PURE__ */ jsx("div", { className: styles$1.actions, children: /* @__PURE__ */ jsx(Tooltip$2, { text: translations.downloadAsPNG, placement: "bottom-end", children: /* @__PURE__ */ jsx(
|
|
40192
40135
|
Button,
|
|
40193
40136
|
{
|
|
40194
40137
|
small: true,
|
|
@@ -40198,7 +40141,7 @@ const BarChart = (props) => {
|
|
|
40198
40141
|
icon: "download",
|
|
40199
40142
|
onClick: () => downloadPgn(chartRef)
|
|
40200
40143
|
}
|
|
40201
|
-
) }) }),
|
|
40144
|
+
) }) }) }),
|
|
40202
40145
|
/* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsxs("div", { className: styles$1.canvas, id: "canvas", children: [
|
|
40203
40146
|
/* @__PURE__ */ jsx(
|
|
40204
40147
|
Bar,
|
|
@@ -40375,12 +40318,18 @@ const useScatterChartConfig = (chart2, chartRef) => {
|
|
|
40375
40318
|
const scatterOptions = {
|
|
40376
40319
|
onClick,
|
|
40377
40320
|
onHover,
|
|
40378
|
-
chartStyling,
|
|
40321
|
+
...chartStyling,
|
|
40379
40322
|
interactions: {
|
|
40380
40323
|
onLegendClick: legendClick,
|
|
40381
40324
|
onHover
|
|
40382
40325
|
},
|
|
40383
40326
|
scales: getScatterChartScales(chart2 == null ? void 0 : chart2.options),
|
|
40327
|
+
animation: chartStyling.performanceMode ? {
|
|
40328
|
+
duration: ANIMATION_DURATION.NO
|
|
40329
|
+
} : {
|
|
40330
|
+
duration: ANIMATION_DURATION.FAST,
|
|
40331
|
+
onComplete: interactions == null ? void 0 : interactions.onAnimationComplete
|
|
40332
|
+
},
|
|
40384
40333
|
plugins: {
|
|
40385
40334
|
legend: { ...legend2, display: false },
|
|
40386
40335
|
// hide default legend
|
|
@@ -40401,12 +40350,29 @@ const useScatterChartConfig = (chart2, chartRef) => {
|
|
|
40401
40350
|
scatterOptions
|
|
40402
40351
|
};
|
|
40403
40352
|
};
|
|
40353
|
+
var GradientDirection = /* @__PURE__ */ ((GradientDirection2) => {
|
|
40354
|
+
GradientDirection2[GradientDirection2["TopToBottom"] = 0] = "TopToBottom";
|
|
40355
|
+
GradientDirection2[GradientDirection2["BottomToTop"] = 1] = "BottomToTop";
|
|
40356
|
+
GradientDirection2[GradientDirection2["LeftToRight"] = 2] = "LeftToRight";
|
|
40357
|
+
GradientDirection2[GradientDirection2["RightToLeft"] = 3] = "RightToLeft";
|
|
40358
|
+
GradientDirection2[GradientDirection2["TopLeftToBottomRight"] = 4] = "TopLeftToBottomRight";
|
|
40359
|
+
GradientDirection2[GradientDirection2["BottomRightToTopLeft"] = 5] = "BottomRightToTopLeft";
|
|
40360
|
+
GradientDirection2[GradientDirection2["BottomLeftToTopRight"] = 6] = "BottomLeftToTopRight";
|
|
40361
|
+
GradientDirection2[GradientDirection2["TopRightToBottomLeft"] = 7] = "TopRightToBottomLeft";
|
|
40362
|
+
return GradientDirection2;
|
|
40363
|
+
})(GradientDirection || {});
|
|
40364
|
+
const defaultChartGradient = (gradient) => ({
|
|
40365
|
+
display: (gradient == null ? void 0 : gradient.display) ?? false,
|
|
40366
|
+
gradientColors: (gradient == null ? void 0 : gradient.gradientColors) ?? GRADIENT_COLORS,
|
|
40367
|
+
direction: (gradient == null ? void 0 : gradient.direction) ?? GradientDirection.BottomLeftToTopRight
|
|
40368
|
+
});
|
|
40404
40369
|
const defaultChartStyling = (styling) => ({
|
|
40405
40370
|
width: (styling == null ? void 0 : styling.width) ?? AUTO,
|
|
40406
40371
|
height: (styling == null ? void 0 : styling.height) ?? AUTO,
|
|
40407
40372
|
maintainAspectRatio: (styling == null ? void 0 : styling.maintainAspectRatio) || false,
|
|
40408
40373
|
staticChartHeight: (styling == null ? void 0 : styling.staticChartHeight) || false,
|
|
40409
|
-
performanceMode: (styling == null ? void 0 : styling.performanceMode) ?? true
|
|
40374
|
+
performanceMode: (styling == null ? void 0 : styling.performanceMode) ?? true,
|
|
40375
|
+
gradient: defaultChartGradient(styling == null ? void 0 : styling.gradient)
|
|
40410
40376
|
});
|
|
40411
40377
|
const defaultTooltip = (tooltip) => ({
|
|
40412
40378
|
enabled: (tooltip == null ? void 0 : tooltip.enabled) ?? true,
|
|
@@ -40432,7 +40398,8 @@ const defaultChartOptions = (options) => ({
|
|
|
40432
40398
|
const defaultInteractions = (interactions) => ({
|
|
40433
40399
|
onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
|
|
40434
40400
|
onHover: interactions == null ? void 0 : interactions.onHover,
|
|
40435
|
-
onUnhover: interactions == null ? void 0 : interactions.onUnhover
|
|
40401
|
+
onUnhover: interactions == null ? void 0 : interactions.onUnhover,
|
|
40402
|
+
onAnimationComplete: interactions == null ? void 0 : interactions.onAnimationComplete
|
|
40436
40403
|
});
|
|
40437
40404
|
const defaultChartData = (data) => {
|
|
40438
40405
|
return {
|
|
@@ -40485,6 +40452,57 @@ const getDefaultProps = (props) => {
|
|
|
40485
40452
|
}
|
|
40486
40453
|
};
|
|
40487
40454
|
};
|
|
40455
|
+
const getGradientCoordinates = (direction, chartArea) => {
|
|
40456
|
+
switch (direction) {
|
|
40457
|
+
case GradientDirection.TopToBottom:
|
|
40458
|
+
return [chartArea.left, chartArea.top, chartArea.left, chartArea.bottom];
|
|
40459
|
+
case GradientDirection.BottomToTop:
|
|
40460
|
+
return [chartArea.left, chartArea.bottom, chartArea.left, chartArea.top];
|
|
40461
|
+
case GradientDirection.LeftToRight:
|
|
40462
|
+
return [chartArea.left, chartArea.top, chartArea.right, chartArea.top];
|
|
40463
|
+
case GradientDirection.RightToLeft:
|
|
40464
|
+
return [chartArea.right, chartArea.top, chartArea.left, chartArea.top];
|
|
40465
|
+
case GradientDirection.TopLeftToBottomRight:
|
|
40466
|
+
return [chartArea.left, chartArea.top, chartArea.right, chartArea.bottom];
|
|
40467
|
+
case GradientDirection.BottomRightToTopLeft:
|
|
40468
|
+
return [chartArea.right, chartArea.bottom, chartArea.left, chartArea.top];
|
|
40469
|
+
case GradientDirection.BottomLeftToTopRight:
|
|
40470
|
+
return [chartArea.left, chartArea.bottom, chartArea.right, chartArea.top];
|
|
40471
|
+
case GradientDirection.TopRightToBottomLeft:
|
|
40472
|
+
return [chartArea.right, chartArea.top, chartArea.left, chartArea.bottom];
|
|
40473
|
+
default:
|
|
40474
|
+
return [chartArea.left, chartArea.bottom, chartArea.right, chartArea.top];
|
|
40475
|
+
}
|
|
40476
|
+
};
|
|
40477
|
+
const gradientBackgroundPlugin = {
|
|
40478
|
+
id: "gradientBackgroundPlugin",
|
|
40479
|
+
beforeDraw: (chart2) => {
|
|
40480
|
+
const { ctx, chartArea, options } = chart2;
|
|
40481
|
+
const gradientOptions = options.gradient;
|
|
40482
|
+
const {
|
|
40483
|
+
display = false,
|
|
40484
|
+
gradientColors,
|
|
40485
|
+
direction = GradientDirection.BottomLeftToTopRight
|
|
40486
|
+
} = gradientOptions ?? {};
|
|
40487
|
+
if (!display || !gradientColors || gradientColors.length === 0)
|
|
40488
|
+
return;
|
|
40489
|
+
const [x0, y0, x1, y1] = getGradientCoordinates(direction, chartArea);
|
|
40490
|
+
const gradient = ctx.createLinearGradient(x0, y0, x1, y1);
|
|
40491
|
+
gradientColors.forEach(({ offset, color: color2 }) => {
|
|
40492
|
+
gradient.addColorStop(offset, color2);
|
|
40493
|
+
});
|
|
40494
|
+
ctx.save();
|
|
40495
|
+
ctx.globalCompositeOperation = "destination-over";
|
|
40496
|
+
ctx.fillStyle = gradient;
|
|
40497
|
+
ctx.fillRect(
|
|
40498
|
+
chartArea.left,
|
|
40499
|
+
chartArea.top,
|
|
40500
|
+
chartArea.right - chartArea.left,
|
|
40501
|
+
chartArea.bottom - chartArea.top
|
|
40502
|
+
);
|
|
40503
|
+
ctx.restore();
|
|
40504
|
+
}
|
|
40505
|
+
};
|
|
40488
40506
|
const chart = "_chart_1jdnu_1";
|
|
40489
40507
|
const fixedHeight = "_fixedHeight_1jdnu_13";
|
|
40490
40508
|
const stretchHeight = "_stretchHeight_1jdnu_19";
|
|
@@ -40510,7 +40528,8 @@ Chart$2.register(
|
|
|
40510
40528
|
plugin_title,
|
|
40511
40529
|
plugin$1,
|
|
40512
40530
|
plugin,
|
|
40513
|
-
annotation
|
|
40531
|
+
annotation,
|
|
40532
|
+
gradientBackgroundPlugin
|
|
40514
40533
|
);
|
|
40515
40534
|
const ScatterChart = (props) => {
|
|
40516
40535
|
setDefaultTheme();
|