@hybridcore/ui 1.6.21 → 1.6.23
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/CATALOG.md +1 -0
- package/dist/components/button/index.js +10 -7
- package/dist/components/charts/chart-wrapper/index.js +34 -32
- package/dist/components/charts/column-line-mix/logic.js +65 -69
- package/dist/components/charts/forecast-cone/index.js +58 -45
- package/dist/components/charts/forecast-cone/logic.js +347 -244
- package/dist/components/charts/histogram/index.js +11 -0
- package/dist/components/charts/histogram/logic.js +133 -0
- package/dist/components/charts/histogram/styled.js +12 -0
- package/dist/components/charts/line/logic.js +48 -48
- package/dist/components/charts/logaritmic-scale/logic.js +257 -91
- package/dist/components/charts/multiple-value-axes/logic.js +70 -70
- package/dist/components/charts/xy-chart/logic.js +9 -1
- package/dist/main.d.ts +65 -8
- package/dist/main.js +158 -156
- package/package.json +1 -1
- package/dist/Scrollbar-CTI7_8Qw.js +0 -171
|
@@ -1,45 +1,211 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import { humanizeLabel as
|
|
1
|
+
import { R as O, A as L } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as X, useTheme as S } from "@mui/material";
|
|
3
|
+
import j from "lodash";
|
|
4
|
+
import { useId as E, useRef as Y, useEffect as z } from "react";
|
|
5
|
+
import { humanizeLabel as I } from "../_common/format.js";
|
|
6
6
|
import { attachCombinedAxisTooltip as q } from "../_common/tooltip.js";
|
|
7
|
-
import { colorSetFromPalette as
|
|
8
|
-
import { c as
|
|
9
|
-
import { X as
|
|
10
|
-
import { X as
|
|
11
|
-
import { A as
|
|
12
|
-
import { C as
|
|
13
|
-
import { L as
|
|
14
|
-
import { D as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
7
|
+
import { colorSetFromPalette as H, applyDateAxisLabelFormat as U, applyValueFormat as W } from "../_common/utils.js";
|
|
8
|
+
import { m as R, q as Z, f as x, c as f } from "../../../Entity-BJCuhdq_.js";
|
|
9
|
+
import { X as $, V as J } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
10
|
+
import { X as K } from "../../../XYCursor-CVUSpqb9.js";
|
|
11
|
+
import { A as N, a as Q } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
12
|
+
import { C as tt } from "../../../CategoryAxis-B6NqW8qd.js";
|
|
13
|
+
import { L as et } from "../../../LineSeries-D_IL2qGF.js";
|
|
14
|
+
import { D as st, G as it } from "../../../GaplessDateAxis-B2g2jgSG.js";
|
|
15
|
+
import { R as V } from "../../../RoundedRectangle-BKLX1LKM.js";
|
|
16
|
+
import { C, G as rt } from "../../../Tooltip-vyZRZWih.js";
|
|
17
|
+
import { B as at } from "../../../Button-BLY4PVJC.js";
|
|
18
|
+
import { D as nt } from "../../../DateAxis-DEXKps1S.js";
|
|
19
|
+
class D extends C {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments), Object.defineProperty(this, "thumb", {
|
|
22
|
+
enumerable: !0,
|
|
23
|
+
configurable: !0,
|
|
24
|
+
writable: !0,
|
|
25
|
+
value: this._makeThumb()
|
|
26
|
+
}), Object.defineProperty(this, "startGrip", {
|
|
27
|
+
enumerable: !0,
|
|
28
|
+
configurable: !0,
|
|
29
|
+
writable: !0,
|
|
30
|
+
value: this._makeButton()
|
|
31
|
+
}), Object.defineProperty(this, "endGrip", {
|
|
32
|
+
enumerable: !0,
|
|
33
|
+
configurable: !0,
|
|
34
|
+
writable: !0,
|
|
35
|
+
value: this._makeButton()
|
|
36
|
+
}), Object.defineProperty(this, "_thumbBusy", {
|
|
37
|
+
enumerable: !0,
|
|
38
|
+
configurable: !0,
|
|
39
|
+
writable: !0,
|
|
40
|
+
value: !1
|
|
41
|
+
}), Object.defineProperty(this, "_startDown", {
|
|
42
|
+
enumerable: !0,
|
|
43
|
+
configurable: !0,
|
|
44
|
+
writable: !0,
|
|
45
|
+
value: !1
|
|
46
|
+
}), Object.defineProperty(this, "_endDown", {
|
|
47
|
+
enumerable: !0,
|
|
48
|
+
configurable: !0,
|
|
49
|
+
writable: !0,
|
|
50
|
+
value: !1
|
|
51
|
+
}), Object.defineProperty(this, "_thumbDown", {
|
|
52
|
+
enumerable: !0,
|
|
53
|
+
configurable: !0,
|
|
54
|
+
writable: !0,
|
|
55
|
+
value: !1
|
|
56
|
+
}), Object.defineProperty(this, "_gripDown", {
|
|
57
|
+
enumerable: !0,
|
|
58
|
+
configurable: !0,
|
|
59
|
+
writable: !0,
|
|
60
|
+
value: void 0
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
_addOrientationClass() {
|
|
64
|
+
this._settings.themeTags = R(this._settings.themeTags, ["scrollbar", this._settings.orientation]), this._settings.background || (this._settings.background = V.new(this._root, {
|
|
65
|
+
themeTags: R(this._settings.themeTags, ["main", "background"])
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
_makeButton() {
|
|
69
|
+
return this.children.push(at.new(this._root, {
|
|
70
|
+
themeTags: ["resize", "button", this.get("orientation")],
|
|
71
|
+
icon: rt.new(this._root, {
|
|
72
|
+
themeTags: ["icon"]
|
|
73
|
+
})
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
_makeThumb() {
|
|
77
|
+
return this.children.push(V.new(this._root, {
|
|
78
|
+
themeTags: ["thumb", this.get("orientation")]
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
_handleAnimation(t) {
|
|
82
|
+
t && this._disposers.push(t.events.on("stopped", () => {
|
|
83
|
+
this.setPrivateRaw("isBusy", !1), this._thumbBusy = !1;
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
_afterNew() {
|
|
87
|
+
this._addOrientationClass(), super._afterNew();
|
|
88
|
+
const t = this.startGrip, e = this.endGrip, i = this.thumb, o = this.get("background");
|
|
89
|
+
o && this._disposers.push(o.events.on("click", (s) => {
|
|
90
|
+
this.setPrivateRaw("isBusy", !0);
|
|
91
|
+
const n = this._display.toLocal(s.point), h = this.width(), l = this.height(), d = this.get("orientation");
|
|
92
|
+
let u;
|
|
93
|
+
d == "vertical" ? u = (n.y - i.height() / 2) / l : u = (n.x - i.width() / 2) / h;
|
|
94
|
+
let a, p;
|
|
95
|
+
d == "vertical" ? (a = u * l, p = "y") : (a = u * h, p = "x");
|
|
96
|
+
const m = this.get("animationDuration", 0);
|
|
97
|
+
m > 0 ? (this._thumbBusy = !0, this._handleAnimation(this.thumb.animate({ key: p, to: a, duration: m, easing: this.get("animationEasing") }))) : (this.thumb.set(p, a), this._root.events.once("frameended", () => {
|
|
98
|
+
this.setPrivateRaw("isBusy", !1);
|
|
99
|
+
}));
|
|
100
|
+
})), this._disposers.push(i.events.on("dblclick", (s) => {
|
|
101
|
+
if (!Z(s.originalEvent, this))
|
|
102
|
+
return;
|
|
103
|
+
const n = this.get("animationDuration", 0), h = this.get("animationEasing");
|
|
104
|
+
this.animate({ key: "start", to: 0, duration: n, easing: h }), this.animate({ key: "end", to: 1, duration: n, easing: h });
|
|
105
|
+
})), this._disposers.push(t.events.on("pointerdown", () => {
|
|
106
|
+
this.setPrivateRaw("isBusy", !0), this._startDown = !0, this._gripDown = "start";
|
|
107
|
+
})), this._disposers.push(e.events.on("pointerdown", () => {
|
|
108
|
+
this.setPrivateRaw("isBusy", !0), this._endDown = !0, this._gripDown = "end";
|
|
109
|
+
})), this._disposers.push(i.events.on("pointerdown", () => {
|
|
110
|
+
this.setPrivateRaw("isBusy", !0), this._thumbDown = !0, this._gripDown = void 0;
|
|
111
|
+
})), this._disposers.push(t.events.on("globalpointerup", () => {
|
|
112
|
+
this._startDown && (this.setPrivateRaw("isBusy", !1), this._released()), this._startDown = !1;
|
|
113
|
+
})), this._disposers.push(e.events.on("globalpointerup", () => {
|
|
114
|
+
this._endDown && (this.setPrivateRaw("isBusy", !1), this._released()), this._endDown = !1;
|
|
115
|
+
})), this._disposers.push(i.events.on("globalpointerup", () => {
|
|
116
|
+
this._thumbDown && (this.setPrivateRaw("isBusy", !1), this._released()), this._thumbDown = !1;
|
|
117
|
+
})), this._disposers.push(t.on("x", () => {
|
|
118
|
+
this._updateThumb();
|
|
119
|
+
})), this._disposers.push(e.on("x", () => {
|
|
120
|
+
this._updateThumb();
|
|
121
|
+
})), this._disposers.push(t.on("y", () => {
|
|
122
|
+
this._updateThumb();
|
|
123
|
+
})), this._disposers.push(e.on("y", () => {
|
|
124
|
+
this._updateThumb();
|
|
125
|
+
})), this._disposers.push(i.events.on("positionchanged", () => {
|
|
126
|
+
this._updateGripsByThumb();
|
|
127
|
+
})), this.get("orientation") == "vertical" ? (t.set("x", 0), e.set("x", 0), this._disposers.push(i.adapters.add("y", (s) => Math.max(Math.min(Number(s), this.height() - i.height()), 0))), this._disposers.push(i.adapters.add("x", (s) => this.width() / 2)), this._disposers.push(t.adapters.add("x", (s) => this.width() / 2)), this._disposers.push(e.adapters.add("x", (s) => this.width() / 2)), this._disposers.push(t.adapters.add("y", (s) => Math.max(Math.min(Number(s), this.height()), 0))), this._disposers.push(e.adapters.add("y", (s) => Math.max(Math.min(Number(s), this.height()), 0)))) : (t.set("y", 0), e.set("y", 0), this._disposers.push(i.adapters.add("x", (s) => Math.max(Math.min(Number(s), this.width() - i.width()), 0))), this._disposers.push(i.adapters.add("y", (s) => this.height() / 2)), this._disposers.push(t.adapters.add("y", (s) => this.height() / 2)), this._disposers.push(e.adapters.add("y", (s) => this.height() / 2)), this._disposers.push(t.adapters.add("x", (s) => Math.max(Math.min(Number(s), this.width()), 0))), this._disposers.push(e.adapters.add("x", (s) => Math.max(Math.min(Number(s), this.width()), 0))));
|
|
128
|
+
}
|
|
129
|
+
_updateChildren() {
|
|
130
|
+
super._updateChildren(), (this.isDirty("end") || this.isDirty("start") || this._sizeDirty) && this.updateGrips();
|
|
131
|
+
}
|
|
132
|
+
_changed() {
|
|
133
|
+
if (super._changed(), this.isDirty("start") || this.isDirty("end")) {
|
|
134
|
+
const t = "rangechanged";
|
|
135
|
+
this.events.isEnabled(t) && this.events.dispatch(t, { type: t, target: this, start: this.get("start", 0), end: this.get("end", 1), grip: this._gripDown });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
_released() {
|
|
139
|
+
const t = "released";
|
|
140
|
+
this.events.isEnabled(t) && this.events.dispatch(t, { type: t, target: this });
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @ignore
|
|
144
|
+
*/
|
|
145
|
+
updateGrips() {
|
|
146
|
+
const t = this.startGrip, e = this.endGrip, i = this.get("orientation"), o = this.height(), s = this.width();
|
|
147
|
+
i == "vertical" ? (t.set("y", o * this.get("start", 0)), e.set("y", o * this.get("end", 1))) : (t.set("x", s * this.get("start", 0)), e.set("x", s * this.get("end", 1)));
|
|
148
|
+
const n = this.getPrivate("positionTextFunction"), h = Math.round(this.get("start", 0) * 100), l = Math.round(this.get("end", 0) * 100);
|
|
149
|
+
let d, u;
|
|
150
|
+
n ? (d = n.call(this, this.get("start", 0)), u = n.call(this, this.get("end", 0))) : (d = h + "%", u = l + "%"), t.set("ariaLabel", this._t("From %1", void 0, d)), t.set("ariaValueNow", "" + h), t.set("ariaValueText", h + "%"), t.set("ariaValueMin", "0"), t.set("ariaValueMax", "100"), e.set("ariaLabel", this._t("To %1", void 0, u)), e.set("ariaValueNow", "" + l), e.set("ariaValueText", l + "%"), e.set("ariaValueMin", "0"), e.set("ariaValueMax", "100");
|
|
151
|
+
}
|
|
152
|
+
_updateThumb() {
|
|
153
|
+
const t = this.thumb, e = this.startGrip, i = this.endGrip, o = this.height(), s = this.width();
|
|
154
|
+
let n = e.x(), h = i.x(), l = e.y(), d = i.y(), u = 0, a = 1;
|
|
155
|
+
this.get("orientation") == "vertical" ? x(l) && x(d) && (!this._thumbBusy && !t.isDragging() && (t.set("height", d - l), t.set("y", l)), u = l / o, a = d / o) : x(n) && x(h) && (!this._thumbBusy && !t.isDragging() && (t.set("width", h - n), t.set("x", n)), u = n / s, a = h / s), this.getPrivate("isBusy") && (this.get("start") != u || this.get("end") != a) && (this.set("start", u), this.set("end", a));
|
|
156
|
+
const p = this.getPrivate("positionTextFunction"), m = Math.round(this.get("start", 0) * 100), _ = Math.round(this.get("end", 0) * 100);
|
|
157
|
+
let g, w;
|
|
158
|
+
p ? (g = p.call(this, this.get("start", 0)), w = p.call(this, this.get("end", 0))) : (g = m + "%", w = _ + "%"), t.set("ariaLabel", this._t("From %1 to %2", void 0, g, w)), t.set("ariaValueNow", "" + m), t.set("ariaValueText", m + "%");
|
|
159
|
+
}
|
|
160
|
+
_updateGripsByThumb() {
|
|
161
|
+
const t = this.thumb, e = this.startGrip, i = this.endGrip;
|
|
162
|
+
if (this.get("orientation") == "vertical") {
|
|
163
|
+
const o = t.height();
|
|
164
|
+
e.set("y", t.y()), i.set("y", t.y() + o);
|
|
165
|
+
} else {
|
|
166
|
+
const o = t.width();
|
|
167
|
+
e.set("x", t.x()), i.set("x", t.x() + o);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
Object.defineProperty(D, "className", {
|
|
172
|
+
enumerable: !0,
|
|
173
|
+
configurable: !0,
|
|
174
|
+
writable: !0,
|
|
175
|
+
value: "Scrollbar"
|
|
176
|
+
});
|
|
177
|
+
Object.defineProperty(D, "classNames", {
|
|
178
|
+
enumerable: !0,
|
|
179
|
+
configurable: !0,
|
|
180
|
+
writable: !0,
|
|
181
|
+
value: C.classNames.concat([D.className])
|
|
182
|
+
});
|
|
183
|
+
const Gt = (G) => {
|
|
184
|
+
const t = X({ props: G, name: "HCLogaritmicScale" }), {
|
|
185
|
+
dimensions: e,
|
|
186
|
+
values: i,
|
|
187
|
+
data: o,
|
|
188
|
+
initDelay: s = 0,
|
|
189
|
+
baseInterval: n,
|
|
190
|
+
colors: h,
|
|
191
|
+
skipEmptyDates: l = !1,
|
|
192
|
+
sx: d,
|
|
193
|
+
...u
|
|
194
|
+
} = t, a = S(), m = `hc-logaritmic-scale-${E().replace(/:/g, "")}`, _ = Y(null);
|
|
195
|
+
let g = null;
|
|
196
|
+
e.length < 1 ? g = "LogaritmicScale requires at least 1 dimension" : i.length < 1 && (g = "LogaritmicScale requires at least 1 value"), z(() => {
|
|
197
|
+
if (g) return;
|
|
198
|
+
let T;
|
|
199
|
+
return T = setTimeout(() => {
|
|
200
|
+
var P, B, M, F;
|
|
201
|
+
const r = O.new(m);
|
|
202
|
+
_.current = r, r.setThemes([L.new(r)]), r.interfaceColors.setAll({
|
|
203
|
+
text: f(a.palette.text.primary),
|
|
204
|
+
grid: f(a.palette.divider),
|
|
205
|
+
stroke: f(a.palette.divider)
|
|
40
206
|
});
|
|
41
|
-
const
|
|
42
|
-
|
|
207
|
+
const c = r.container.children.push(
|
|
208
|
+
$.new(r, {
|
|
43
209
|
panX: !0,
|
|
44
210
|
panY: !0,
|
|
45
211
|
wheelX: "none",
|
|
@@ -48,81 +214,81 @@ const xe = (k) => {
|
|
|
48
214
|
pinchZoomX: !0
|
|
49
215
|
})
|
|
50
216
|
);
|
|
51
|
-
|
|
217
|
+
c.set("colors", H(r, h)), c.set(
|
|
52
218
|
"cursor",
|
|
53
|
-
|
|
219
|
+
K.new(r, { behavior: "none" })
|
|
54
220
|
).lineY.set("visible", !1);
|
|
55
|
-
let
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
221
|
+
let b, A = o;
|
|
222
|
+
if (e[0].type === "date") {
|
|
223
|
+
A = j.orderBy(o, [e[0].value]);
|
|
224
|
+
const y = l ? it : nt;
|
|
225
|
+
b = c.xAxes.push(
|
|
226
|
+
y.new(r, {
|
|
61
227
|
maxDeviation: 0.1,
|
|
62
228
|
groupData: !1,
|
|
63
|
-
baseInterval:
|
|
64
|
-
renderer:
|
|
229
|
+
baseInterval: n || { timeUnit: "day", count: 1 },
|
|
230
|
+
renderer: N.new(r, {})
|
|
65
231
|
})
|
|
66
|
-
), (
|
|
67
|
-
stroke:
|
|
232
|
+
), (P = b.get("renderer")) == null || P.grid.template.setAll({
|
|
233
|
+
stroke: f(a.palette.divider),
|
|
68
234
|
strokeOpacity: 1
|
|
69
|
-
}),
|
|
235
|
+
}), U(b, e[0]);
|
|
70
236
|
} else
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
categoryField:
|
|
74
|
-
renderer:
|
|
237
|
+
b = c.xAxes.push(
|
|
238
|
+
tt.new(r, {
|
|
239
|
+
categoryField: e[0].value,
|
|
240
|
+
renderer: N.new(r, {})
|
|
75
241
|
})
|
|
76
|
-
),
|
|
242
|
+
), r.numberFormatter.setAll({
|
|
77
243
|
numberFormat: "#",
|
|
78
244
|
numericFields: ["valueX"]
|
|
79
|
-
}),
|
|
80
|
-
stroke:
|
|
245
|
+
}), b.data.setAll(A), (B = b.get("renderer")) == null || B.grid.template.setAll({
|
|
246
|
+
stroke: f(a.palette.divider),
|
|
81
247
|
strokeOpacity: 1
|
|
82
248
|
});
|
|
83
|
-
const
|
|
84
|
-
|
|
249
|
+
const k = c.yAxes.push(
|
|
250
|
+
J.new(r, {
|
|
85
251
|
logarithmic: !0,
|
|
86
|
-
renderer:
|
|
252
|
+
renderer: Q.new(r, { minorGridEnabled: !0 })
|
|
87
253
|
})
|
|
88
254
|
);
|
|
89
|
-
(
|
|
90
|
-
stroke:
|
|
255
|
+
(M = k.get("renderer")) == null || M.grid.template.setAll({
|
|
256
|
+
stroke: f(a.palette.divider),
|
|
91
257
|
strokeOpacity: 1
|
|
92
|
-
}),
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
name:
|
|
96
|
-
xAxis:
|
|
97
|
-
yAxis:
|
|
98
|
-
valueYField:
|
|
99
|
-
...
|
|
258
|
+
}), i.forEach((y) => {
|
|
259
|
+
const v = c.series.push(
|
|
260
|
+
et.new(r, {
|
|
261
|
+
name: y.label ?? I(y.name),
|
|
262
|
+
xAxis: b,
|
|
263
|
+
yAxis: k,
|
|
264
|
+
valueYField: y.dataFieldName,
|
|
265
|
+
...e[0].type === "date" ? { valueXField: e[0].value } : { categoryXField: e[0].value }
|
|
100
266
|
})
|
|
101
267
|
);
|
|
102
|
-
|
|
268
|
+
v.strokes.template.setAll({ strokeWidth: 3 }), e[0].type === "date" && (v.data.processor = st.new(r, {
|
|
103
269
|
dateFormat: "i",
|
|
104
|
-
dateFields: [
|
|
105
|
-
})),
|
|
270
|
+
dateFields: [e[0].value]
|
|
271
|
+
})), v.data.setAll(A), v.appear(1e3);
|
|
106
272
|
}), q({
|
|
107
|
-
root:
|
|
108
|
-
chart:
|
|
109
|
-
xAxis:
|
|
273
|
+
root: r,
|
|
274
|
+
chart: c,
|
|
275
|
+
xAxis: b,
|
|
110
276
|
theme: a,
|
|
111
|
-
isDateAxis:
|
|
112
|
-
baseInterval:
|
|
277
|
+
isDateAxis: e[0].type === "date",
|
|
278
|
+
baseInterval: n,
|
|
113
279
|
follow: !0
|
|
114
|
-
}),
|
|
280
|
+
}), c.set(
|
|
115
281
|
"scrollbarX",
|
|
116
|
-
|
|
117
|
-
),
|
|
118
|
-
},
|
|
119
|
-
var
|
|
120
|
-
|
|
282
|
+
D.new(r, { orientation: "horizontal" })
|
|
283
|
+
), W(r, (F = i == null ? void 0 : i[0]) == null ? void 0 : F.format), c.appear(1e3, 100);
|
|
284
|
+
}, s), () => {
|
|
285
|
+
var r;
|
|
286
|
+
T && clearTimeout(T), (r = _.current) == null || r.dispose(), _.current = null;
|
|
121
287
|
};
|
|
122
|
-
}, [
|
|
123
|
-
const
|
|
124
|
-
return { chartId:
|
|
288
|
+
}, [o, e, i, a.palette.mode, h, l]);
|
|
289
|
+
const w = { ...t };
|
|
290
|
+
return { chartId: m, ownerState: w, sx: d, error: g, other: u };
|
|
125
291
|
};
|
|
126
292
|
export {
|
|
127
|
-
|
|
293
|
+
Gt as useLogaritmicScaleLogic
|
|
128
294
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { R as j, A as q } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
2
|
import { useThemeProps as z, useTheme as U } from "@mui/material";
|
|
3
|
-
import
|
|
3
|
+
import N from "lodash";
|
|
4
4
|
import { useId as H, useRef as $, useEffect as J } from "react";
|
|
5
5
|
import { humanizeLabel as P } from "../_common/format.js";
|
|
6
6
|
import { attachCombinedAxisTooltip as K } from "../_common/tooltip.js";
|
|
7
7
|
import { colorSetFromPalette as Q, applyDateAxisLabelFormat as Z, applyValueFormat as ee } from "../_common/utils.js";
|
|
8
|
-
import { c as
|
|
8
|
+
import { c as v, a as g } from "../../../Entity-BJCuhdq_.js";
|
|
9
9
|
import { X as te, V as re } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
10
10
|
import { L as se } from "../../../Legend-CFvQiIfn.js";
|
|
11
11
|
import { A as X, a as ae } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
@@ -14,10 +14,10 @@ import { X as oe } from "../../../XYCursor-CVUSpqb9.js";
|
|
|
14
14
|
import { G as le, D as ne } from "../../../GaplessDateAxis-B2g2jgSG.js";
|
|
15
15
|
import { D as ce } from "../../../DateAxis-DEXKps1S.js";
|
|
16
16
|
import { L as me } from "../../../LineSeries-D_IL2qGF.js";
|
|
17
|
-
import { G, R as
|
|
18
|
-
import { C as
|
|
17
|
+
import { G, R as pe } from "../../../Tooltip-vyZRZWih.js";
|
|
18
|
+
import { C as ue } from "../../../Circle-BnfBNKBD.js";
|
|
19
19
|
import { B as de } from "../../../Bullet-Djj7Vs9T.js";
|
|
20
|
-
class
|
|
20
|
+
class x extends G {
|
|
21
21
|
_beforeChanged() {
|
|
22
22
|
super._beforeChanged(), (this.isDirty("width") || this.isDirty("height") || this.isPrivateDirty("width") || this.isPrivateDirty("height")) && (this._clear = !0);
|
|
23
23
|
}
|
|
@@ -32,41 +32,41 @@ class y extends G {
|
|
|
32
32
|
this.markDirty(), this._clear = !0;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
Object.defineProperty(
|
|
35
|
+
Object.defineProperty(x, "className", {
|
|
36
36
|
enumerable: !0,
|
|
37
37
|
configurable: !0,
|
|
38
38
|
writable: !0,
|
|
39
39
|
value: "Triangle"
|
|
40
40
|
});
|
|
41
|
-
Object.defineProperty(
|
|
41
|
+
Object.defineProperty(x, "classNames", {
|
|
42
42
|
enumerable: !0,
|
|
43
43
|
configurable: !0,
|
|
44
44
|
writable: !0,
|
|
45
|
-
value: G.classNames.concat([
|
|
45
|
+
value: G.classNames.concat([x.className])
|
|
46
46
|
});
|
|
47
|
-
const
|
|
48
|
-
const c = z({ props:
|
|
47
|
+
const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ge = (C) => {
|
|
48
|
+
const c = z({ props: C, name: "HCMultipleValueAxes" }), {
|
|
49
49
|
dimensions: s,
|
|
50
50
|
values: t,
|
|
51
|
-
data:
|
|
51
|
+
data: y,
|
|
52
52
|
initDelay: I = 0,
|
|
53
|
-
baseInterval:
|
|
54
|
-
colors:
|
|
55
|
-
skipEmptyDates:
|
|
53
|
+
baseInterval: T,
|
|
54
|
+
colors: L,
|
|
55
|
+
skipEmptyDates: R = !1,
|
|
56
56
|
sx: Y,
|
|
57
57
|
...V
|
|
58
|
-
} = c,
|
|
59
|
-
let
|
|
60
|
-
s.length < 1 ?
|
|
61
|
-
if (
|
|
58
|
+
} = c, p = U(), E = `hc-multiple-value-axes-${H().replace(/:/g, "")}`, w = $(null);
|
|
59
|
+
let u = null;
|
|
60
|
+
s.length < 1 ? u = "MultipleValueAxes requires at least 1 dimension" : t.length < 1 && (u = "MultipleValueAxes requires at least 1 value"), J(() => {
|
|
61
|
+
if (u) return;
|
|
62
62
|
let b;
|
|
63
63
|
return b = setTimeout(() => {
|
|
64
|
-
var
|
|
65
|
-
const e = j.new(
|
|
64
|
+
var F;
|
|
65
|
+
const e = j.new(E);
|
|
66
66
|
w.current = e, e.setThemes([q.new(e)]), e.interfaceColors.setAll({
|
|
67
|
-
text:
|
|
68
|
-
grid:
|
|
69
|
-
stroke:
|
|
67
|
+
text: v(p.palette.text.primary),
|
|
68
|
+
grid: v(p.palette.divider),
|
|
69
|
+
stroke: v(p.palette.divider)
|
|
70
70
|
});
|
|
71
71
|
const r = e.container.children.push(
|
|
72
72
|
te.new(e, {
|
|
@@ -78,75 +78,75 @@ const x = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ge = (T) => {
|
|
|
78
78
|
layout: e.verticalLayout
|
|
79
79
|
})
|
|
80
80
|
);
|
|
81
|
-
r.set("colors", Q(e,
|
|
82
|
-
const
|
|
83
|
-
se.new(e, { centerX:
|
|
84
|
-
),
|
|
85
|
-
let l,
|
|
86
|
-
if (
|
|
87
|
-
const a =
|
|
81
|
+
r.set("colors", Q(e, L)), r.get("colors", {}).set("step", 3);
|
|
82
|
+
const S = r.children.push(
|
|
83
|
+
se.new(e, { centerX: g, x: g })
|
|
84
|
+
), o = s[0];
|
|
85
|
+
let l, d = y;
|
|
86
|
+
if (o.type === "date") {
|
|
87
|
+
const a = R ? le : ce;
|
|
88
88
|
l = r.xAxes.push(
|
|
89
89
|
a.new(e, {
|
|
90
90
|
maxDeviation: 0.1,
|
|
91
91
|
groupData: !1,
|
|
92
|
-
baseInterval:
|
|
92
|
+
baseInterval: T || { timeUnit: "day", count: 1 },
|
|
93
93
|
renderer: X.new(e, {})
|
|
94
94
|
})
|
|
95
|
-
), Z(l,
|
|
95
|
+
), Z(l, o), d = N.orderBy(y, [o.value]);
|
|
96
96
|
} else
|
|
97
97
|
l = r.xAxes.push(
|
|
98
98
|
ie.new(e, {
|
|
99
|
-
categoryField:
|
|
99
|
+
categoryField: o.value,
|
|
100
100
|
renderer: X.new(e, {})
|
|
101
101
|
})
|
|
102
102
|
), e.numberFormatter.setAll({
|
|
103
103
|
numberFormat: "#",
|
|
104
104
|
numericFields: ["valueX"]
|
|
105
|
-
}),
|
|
106
|
-
function
|
|
107
|
-
const
|
|
108
|
-
re.new(e, { maxDeviation: 1, renderer:
|
|
105
|
+
}), l.data.setAll(d);
|
|
106
|
+
function _(a, n, m, B, W, D, M) {
|
|
107
|
+
const h = ae.new(e, { opposite: W }), k = r.yAxes.push(
|
|
108
|
+
re.new(e, { maxDeviation: 1, renderer: h })
|
|
109
109
|
);
|
|
110
110
|
r.yAxes.indexOf(k) > 0 && k.set("syncWithAxis", r.yAxes.getIndex(0));
|
|
111
|
-
const
|
|
111
|
+
const i = r.series.push(
|
|
112
112
|
me.new(e, {
|
|
113
113
|
name: n,
|
|
114
114
|
xAxis: l,
|
|
115
115
|
yAxis: k,
|
|
116
|
-
valueYField:
|
|
117
|
-
...
|
|
116
|
+
valueYField: B,
|
|
117
|
+
...o.type === "date" ? { valueXField: m } : { categoryXField: m }
|
|
118
118
|
})
|
|
119
119
|
);
|
|
120
|
-
|
|
121
|
-
stroke:
|
|
120
|
+
i.strokes.template.setAll({ strokeWidth: 2 }), h.grid.template.set("strokeOpacity", 0.05), h.labels.template.set("fill", i.get("fill")), h.setAll({
|
|
121
|
+
stroke: i.get("fill"),
|
|
122
122
|
strokeOpacity: 1,
|
|
123
123
|
opacity: 1
|
|
124
|
-
}), M === "date" && (
|
|
124
|
+
}), M === "date" && (i.data.processor = ne.new(e, {
|
|
125
125
|
dateFormat: "i",
|
|
126
126
|
dateFields: [m]
|
|
127
|
-
})), D !== void 0 &&
|
|
128
|
-
let
|
|
129
|
-
return D === "RECTANGLE" ?
|
|
127
|
+
})), D !== void 0 && i.bullets.push(function() {
|
|
128
|
+
let f;
|
|
129
|
+
return D === "RECTANGLE" ? f = pe.new(e, {
|
|
130
130
|
width: 10,
|
|
131
131
|
height: 10,
|
|
132
|
-
centerX:
|
|
133
|
-
centerY:
|
|
132
|
+
centerX: g,
|
|
133
|
+
centerY: g,
|
|
134
134
|
strokeWidth: 2,
|
|
135
|
-
stroke:
|
|
135
|
+
stroke: i.get("stroke"),
|
|
136
136
|
fill: e.interfaceColors.get("background")
|
|
137
|
-
}) : D === "TRIANGLE" ?
|
|
137
|
+
}) : D === "TRIANGLE" ? f = x.new(e, {
|
|
138
138
|
width: 10,
|
|
139
139
|
height: 10,
|
|
140
140
|
strokeWidth: 2,
|
|
141
|
-
stroke:
|
|
141
|
+
stroke: i.get("stroke"),
|
|
142
142
|
fill: e.interfaceColors.get("background")
|
|
143
|
-
}) :
|
|
143
|
+
}) : f = ue.new(e, {
|
|
144
144
|
strokeWidth: 2,
|
|
145
145
|
radius: 4,
|
|
146
|
-
stroke:
|
|
146
|
+
stroke: i.get("stroke"),
|
|
147
147
|
fill: e.interfaceColors.get("background")
|
|
148
|
-
}), de.new(e, { sprite:
|
|
149
|
-
}),
|
|
148
|
+
}), de.new(e, { sprite: f });
|
|
149
|
+
}), i.data.setAll(a);
|
|
150
150
|
}
|
|
151
151
|
if (r.set(
|
|
152
152
|
"cursor",
|
|
@@ -155,42 +155,42 @@ const x = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ge = (T) => {
|
|
|
155
155
|
root: e,
|
|
156
156
|
chart: r,
|
|
157
157
|
xAxis: l,
|
|
158
|
-
theme:
|
|
159
|
-
isDateAxis:
|
|
160
|
-
baseInterval:
|
|
158
|
+
theme: p,
|
|
159
|
+
isDateAxis: o.type === "date",
|
|
160
|
+
baseInterval: T,
|
|
161
161
|
follow: !0
|
|
162
162
|
}), s.length > 1) {
|
|
163
|
-
const a =
|
|
163
|
+
const a = N.groupBy(d, s[1].value);
|
|
164
164
|
Object.keys(a).forEach((n, m) => {
|
|
165
|
-
|
|
165
|
+
_(
|
|
166
166
|
a[n],
|
|
167
167
|
P(n),
|
|
168
168
|
s[0].value,
|
|
169
169
|
t[0].dataFieldName,
|
|
170
170
|
m !== 0,
|
|
171
|
-
|
|
171
|
+
A[m % A.length]
|
|
172
172
|
);
|
|
173
173
|
});
|
|
174
174
|
} else
|
|
175
175
|
t.forEach((a, n) => {
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
_(
|
|
177
|
+
d,
|
|
178
178
|
a.label ?? P(a.name),
|
|
179
|
-
|
|
179
|
+
o.value,
|
|
180
180
|
a.dataFieldName,
|
|
181
181
|
n !== 0,
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
A[n % A.length],
|
|
183
|
+
o.type
|
|
184
184
|
);
|
|
185
185
|
});
|
|
186
|
-
|
|
186
|
+
S.data.setAll(r.series.values), ee(e, (F = t == null ? void 0 : t[0]) == null ? void 0 : F.format), r.appear(1e3, 100);
|
|
187
187
|
}, I), () => {
|
|
188
188
|
var e;
|
|
189
189
|
b && clearTimeout(b), (e = w.current) == null || e.dispose(), w.current = null;
|
|
190
190
|
};
|
|
191
|
-
}, [
|
|
192
|
-
const
|
|
193
|
-
return { chartId:
|
|
191
|
+
}, [y, s, t, p.palette.mode, L, R]);
|
|
192
|
+
const O = { ...c };
|
|
193
|
+
return { chartId: E, ownerState: O, sx: Y, error: u, other: V };
|
|
194
194
|
};
|
|
195
195
|
export {
|
|
196
196
|
Ge as useMultipleValueAxesLogic
|