@hybridcore/ui 1.6.30 → 1.6.32
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/components/charts/_common/utils.js +50 -31
- package/dist/components/charts/candlestick/logic.js +83 -86
- package/dist/components/charts/column-line-mix/logic.js +66 -70
- package/dist/components/charts/donut-chart/logic.js +61 -64
- package/dist/components/charts/drill-down-treemap/logic.js +69 -69
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +75 -75
- package/dist/components/charts/forecast-cone/logic.js +110 -114
- package/dist/components/charts/heatmap/logic.js +115 -119
- package/dist/components/charts/highlighting-line-data/logic.js +65 -64
- package/dist/components/charts/histogram/logic.js +66 -70
- package/dist/components/charts/line/logic.js +95 -99
- package/dist/components/charts/logaritmic-scale/logic.js +79 -83
- package/dist/components/charts/multiple-value-axes/logic.js +65 -69
- package/dist/components/charts/nested-pie/logic.js +49 -53
- package/dist/components/charts/packed-circles/logic.js +139 -139
- package/dist/components/charts/pie-chart/logic.js +55 -59
- package/dist/components/charts/stacked-area-radar/logic.js +92 -96
- package/dist/components/charts/stacked-column-chart/logic.js +64 -68
- package/dist/components/charts/xy-chart/logic.js +82 -86
- package/dist/components/metric-card/MetricChart.js +6 -4
- package/dist/components/paginated-list/index.js +16 -15
- package/dist/components/paginated-list/styled.js +34 -17
- package/package.json +1 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
1
|
+
import { R as $, A as J } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as K, useTheme as Q } from "@mui/material";
|
|
3
|
+
import Z from "dayjs";
|
|
4
4
|
import T from "lodash";
|
|
5
|
-
import { useId as
|
|
6
|
-
import { applyValueFormat as ie, colorSetFromPalette as se } from "../_common/utils.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { C as
|
|
11
|
-
import {
|
|
5
|
+
import { useId as ee, useRef as te, useEffect as re } from "react";
|
|
6
|
+
import { applyValueFormat as ae, applyInterfaceColors as ie, colorSetFromPalette as se } from "../_common/utils.js";
|
|
7
|
+
import { X as oe } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
8
|
+
import { A as ne, a as le } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
9
|
+
import { C as V } from "../../../CategoryAxis-B6NqW8qd.js";
|
|
10
|
+
import { C as Y, L as B, a as he, b as ce, T as U } from "../../../Tooltip-vyZRZWih.js";
|
|
11
|
+
import { m as E, f as ue, C as S, b as c, p as R, c as me } from "../../../Entity-BJCuhdq_.js";
|
|
12
12
|
import { R as de } from "../../../RoundedRectangle-BKLX1LKM.js";
|
|
13
|
-
import { L as
|
|
14
|
-
import { C as
|
|
15
|
-
class
|
|
13
|
+
import { L as pe } from "../../../LinearGradient-CxQyCSEB.js";
|
|
14
|
+
import { C as fe } from "../../../ColumnSeries-CtRTsn-E.js";
|
|
15
|
+
class L extends Y {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), Object.defineProperty(this, "labelContainer", {
|
|
18
18
|
enumerable: !0,
|
|
19
19
|
configurable: !0,
|
|
20
20
|
writable: !0,
|
|
21
|
-
value: this.children.push(
|
|
21
|
+
value: this.children.push(Y.new(this._root, {}))
|
|
22
22
|
}), Object.defineProperty(this, "markerContainer", {
|
|
23
23
|
enumerable: !0,
|
|
24
24
|
configurable: !0,
|
|
25
25
|
writable: !0,
|
|
26
|
-
value: this.children.push(
|
|
26
|
+
value: this.children.push(Y.new(this._root, {}))
|
|
27
27
|
}), Object.defineProperty(this, "startLabel", {
|
|
28
28
|
enumerable: !0,
|
|
29
29
|
configurable: !0,
|
|
30
30
|
writable: !0,
|
|
31
|
-
value: this.labelContainer.children.push(
|
|
31
|
+
value: this.labelContainer.children.push(B.new(this._root, { themeTags: ["start"] }))
|
|
32
32
|
}), Object.defineProperty(this, "endLabel", {
|
|
33
33
|
enumerable: !0,
|
|
34
34
|
configurable: !0,
|
|
35
35
|
writable: !0,
|
|
36
|
-
value: this.labelContainer.children.push(
|
|
36
|
+
value: this.labelContainer.children.push(B.new(this._root, { themeTags: ["end"] }))
|
|
37
37
|
}), Object.defineProperty(this, "markers", {
|
|
38
38
|
enumerable: !0,
|
|
39
39
|
configurable: !0,
|
|
40
40
|
writable: !0,
|
|
41
|
-
value: this.addDisposer(new ce
|
|
41
|
+
value: this.addDisposer(new he(ce.new({}), () => de._new(this._root, {
|
|
42
42
|
themeTags: E(this.markers.template.get("themeTags", []), [this.get("orientation"), "heatlegend", "marker"])
|
|
43
43
|
}, [this.markers.template])))
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
_afterNew() {
|
|
47
|
-
this._settings.themeTags = E(this._settings.themeTags, ["heatlegend", this._settings.orientation]), super._afterNew(), this.set("tooltip",
|
|
47
|
+
this._settings.themeTags = E(this._settings.themeTags, ["heatlegend", this._settings.orientation]), super._afterNew(), this.set("tooltip", U.new(this._root, {
|
|
48
48
|
themeTags: ["heatlegend"]
|
|
49
49
|
}));
|
|
50
50
|
}
|
|
@@ -66,92 +66,88 @@ class _ extends L {
|
|
|
66
66
|
*/
|
|
67
67
|
showValue(s, a, t) {
|
|
68
68
|
const i = this.getTooltip();
|
|
69
|
-
if (i &&
|
|
70
|
-
const
|
|
71
|
-
let r = (s -
|
|
69
|
+
if (i && ue(s)) {
|
|
70
|
+
const u = this.get("startValue", 0), o = this.get("endValue", 1);
|
|
71
|
+
let r = (s - u) / (o - u);
|
|
72
72
|
(r == 1 / 0 || r == -1 / 0 || isNaN(r)) && (r = 0.5);
|
|
73
73
|
const f = this.get("startColor"), y = this.get("endColor");
|
|
74
74
|
a || (a = this.getNumberFormatter().format(s)), t || (t = S.interpolate(r, f, y)), i.label.set("text", a);
|
|
75
|
-
let
|
|
76
|
-
this.get("orientation") == "vertical" ?
|
|
77
|
-
let
|
|
78
|
-
|
|
75
|
+
let m;
|
|
76
|
+
this.get("orientation") == "vertical" ? m = this.markerContainer.toGlobal({ x: 0, y: this.innerHeight() * (1 - r) }) : m = this.markerContainer.toGlobal({ x: this.innerWidth() * r, y: 0 });
|
|
77
|
+
let n = i.get("background");
|
|
78
|
+
n && n.set("fill", t), i.set("pointTo", m), i.show();
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
_prepareChildren() {
|
|
82
82
|
super._prepareChildren();
|
|
83
|
-
const s = this.labelContainer, a = this.get("orientation"), t = this.startLabel, i = this.endLabel,
|
|
84
|
-
if (this.isDirty("orientation") && (a == "vertical" ? (this.markerContainer.setAll({ layout: this._root.verticalLayout, height:
|
|
85
|
-
const o = this.get("stepCount", 1), r = this.get("startColor"), f = this.get("endColor"), y = this.get("startOpacity", 1),
|
|
83
|
+
const s = this.labelContainer, a = this.get("orientation"), t = this.startLabel, i = this.endLabel, u = this.getTooltip();
|
|
84
|
+
if (this.isDirty("orientation") && (a == "vertical" ? (this.markerContainer.setAll({ layout: this._root.verticalLayout, height: c }), this.set("layout", this._root.horizontalLayout), t.setAll({ y: c, x: void 0, centerY: c, centerX: c }), i.setAll({ y: 0, x: void 0, centerY: 0, centerX: c }), s.setAll({ height: c, width: void 0 }), u && u.set("pointerOrientation", "horizontal")) : (this.markerContainer.setAll({ layout: this._root.horizontalLayout, width: c }), this.set("layout", this._root.verticalLayout), t.setAll({ x: 0, y: void 0, centerX: 0, centerY: 0 }), i.setAll({ x: c, y: void 0, centerX: c, centerY: 0 }), s.setAll({ width: c, height: void 0 }), u && u.set("pointerOrientation", "vertical"))), this.isDirty("stepCount")) {
|
|
85
|
+
const o = this.get("stepCount", 1), r = this.get("startColor"), f = this.get("endColor"), y = this.get("startOpacity", 1), m = this.get("endOpacity", 1);
|
|
86
86
|
if (this.markerContainer.children.clear(), o > 1)
|
|
87
|
-
for (let
|
|
88
|
-
const
|
|
89
|
-
a == "vertical" ? this.markerContainer.children.moveValue(
|
|
90
|
-
fill: S.interpolate(
|
|
91
|
-
fillOpacity:
|
|
87
|
+
for (let n = 0; n < o; n++) {
|
|
88
|
+
const l = this.makeMarker();
|
|
89
|
+
a == "vertical" ? this.markerContainer.children.moveValue(l, 0) : this.markerContainer.children.push(l), r && f && l.setAll({
|
|
90
|
+
fill: S.interpolate(n / o, r, f),
|
|
91
|
+
fillOpacity: R(n / o * 100).interpolate(y, m)
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
else if (o == 1) {
|
|
95
|
-
const
|
|
96
|
-
this.markerContainer.children.push(
|
|
97
|
-
const
|
|
95
|
+
const n = this.makeMarker();
|
|
96
|
+
this.markerContainer.children.push(n);
|
|
97
|
+
const l = pe.new(this._root, {
|
|
98
98
|
stops: [{
|
|
99
99
|
color: r,
|
|
100
100
|
opacity: y
|
|
101
101
|
}, {
|
|
102
102
|
color: f,
|
|
103
|
-
opacity:
|
|
103
|
+
opacity: m
|
|
104
104
|
}]
|
|
105
105
|
});
|
|
106
106
|
if (a == "vertical") {
|
|
107
|
-
|
|
108
|
-
let b =
|
|
107
|
+
l.set("rotation", 90);
|
|
108
|
+
let b = l.get("stops");
|
|
109
109
|
b && b.reverse();
|
|
110
110
|
} else
|
|
111
|
-
|
|
112
|
-
r && f &&
|
|
111
|
+
l.set("rotation", 0);
|
|
112
|
+
r && f && n.set("fillGradient", l);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
(this.isDirty("startText") || this.isDirty("startValue")) && t.set("text", this.get("startText", this.getNumberFormatter().format(this.get("startValue", 0)))), (this.isDirty("endText") || this.isDirty("endValue")) && i.set("text", this.get("endText", this.getNumberFormatter().format(this.get("endValue", 1))));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
Object.defineProperty(
|
|
118
|
+
Object.defineProperty(L, "className", {
|
|
119
119
|
enumerable: !0,
|
|
120
120
|
configurable: !0,
|
|
121
121
|
writable: !0,
|
|
122
122
|
value: "HeatLegend"
|
|
123
123
|
});
|
|
124
|
-
Object.defineProperty(
|
|
124
|
+
Object.defineProperty(L, "classNames", {
|
|
125
125
|
enumerable: !0,
|
|
126
126
|
configurable: !0,
|
|
127
127
|
writable: !0,
|
|
128
|
-
value:
|
|
128
|
+
value: Y.classNames.concat([L.className])
|
|
129
129
|
});
|
|
130
|
-
const
|
|
131
|
-
const s =
|
|
130
|
+
const Oe = (P) => {
|
|
131
|
+
const s = K({ props: P, name: "HCHeatmap" }), {
|
|
132
132
|
dimensions: a,
|
|
133
133
|
values: t,
|
|
134
134
|
data: i,
|
|
135
|
-
initDelay:
|
|
135
|
+
initDelay: u = 0,
|
|
136
136
|
baseInterval: o,
|
|
137
137
|
colors: r,
|
|
138
138
|
sx: f,
|
|
139
139
|
...y
|
|
140
|
-
} = s,
|
|
140
|
+
} = s, m = Q(), l = `hc-heatmap-${ee().replace(/:/g, "")}`, b = te(null);
|
|
141
141
|
let x = null;
|
|
142
|
-
a.length < 2 ? x = "Heatmap requires at least 2 dimensions" : t.length < 1 && (x = "Heatmap requires at least 1 value"),
|
|
142
|
+
a.length < 2 ? x = "Heatmap requires at least 2 dimensions" : t.length < 1 && (x = "Heatmap requires at least 1 value"), re(() => {
|
|
143
143
|
if (x) return;
|
|
144
|
-
let
|
|
145
|
-
return
|
|
146
|
-
var
|
|
147
|
-
const e =
|
|
148
|
-
b.current = e,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
stroke: Y(n.palette.divider)
|
|
152
|
-
});
|
|
153
|
-
const m = e.container.children.push(
|
|
154
|
-
ne.new(e, {
|
|
144
|
+
let _;
|
|
145
|
+
return _ = setTimeout(() => {
|
|
146
|
+
var H, j, I;
|
|
147
|
+
const e = $.new(l);
|
|
148
|
+
b.current = e, ae(e, (H = t == null ? void 0 : t[0]) == null ? void 0 : H.format), e.setThemes([J.new(e)]), ie(e, m);
|
|
149
|
+
const d = e.container.children.push(
|
|
150
|
+
oe.new(e, {
|
|
155
151
|
panX: !1,
|
|
156
152
|
panY: !1,
|
|
157
153
|
wheelX: "none",
|
|
@@ -159,64 +155,64 @@ const De = (X) => {
|
|
|
159
155
|
layout: e.verticalLayout
|
|
160
156
|
})
|
|
161
157
|
);
|
|
162
|
-
|
|
163
|
-
const
|
|
158
|
+
d.set("colors", se(e, r));
|
|
159
|
+
const D = ne.new(e, {
|
|
164
160
|
visible: !1,
|
|
165
161
|
minGridDistance: 30
|
|
166
162
|
});
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
let k,
|
|
170
|
-
if (
|
|
163
|
+
D.grid.template.set("visible", !1);
|
|
164
|
+
const h = a[0];
|
|
165
|
+
let k, C = i;
|
|
166
|
+
if (h.type === "date") {
|
|
171
167
|
const p = (o == null ? void 0 : o.timeUnit) || "day";
|
|
172
|
-
let
|
|
173
|
-
p === "month" ?
|
|
174
|
-
|
|
175
|
-
categoryField:
|
|
176
|
-
renderer:
|
|
168
|
+
let v = "DD/MM/YYYY";
|
|
169
|
+
p === "month" ? v = "MM YYYY" : p === "year" && (v = "YYYY"), k = d.xAxes.push(
|
|
170
|
+
V.new(e, {
|
|
171
|
+
categoryField: h.value,
|
|
172
|
+
renderer: D
|
|
177
173
|
})
|
|
178
|
-
),
|
|
174
|
+
), C = T.orderBy(i, [h.value]), C = C.map((w) => ({
|
|
179
175
|
...w,
|
|
180
|
-
[
|
|
176
|
+
[h.value]: Z(w[h.value]).format(v)
|
|
181
177
|
}));
|
|
182
178
|
} else
|
|
183
|
-
k =
|
|
184
|
-
|
|
185
|
-
categoryField:
|
|
186
|
-
renderer:
|
|
187
|
-
tooltip:
|
|
179
|
+
k = d.xAxes.push(
|
|
180
|
+
V.new(e, {
|
|
181
|
+
categoryField: h.value,
|
|
182
|
+
renderer: D,
|
|
183
|
+
tooltip: U.new(e, {})
|
|
188
184
|
})
|
|
189
185
|
);
|
|
190
|
-
const
|
|
191
|
-
if (k.data.setAll(
|
|
192
|
-
const p = a[1].value,
|
|
186
|
+
const X = T.uniqBy(C, h.value);
|
|
187
|
+
if (k.data.setAll(X), t.length === 1 && a.length > 1) {
|
|
188
|
+
const p = a[1].value, v = le.new(e, {
|
|
193
189
|
visible: !1,
|
|
194
190
|
minGridDistance: 20,
|
|
195
191
|
inversed: !0
|
|
196
192
|
});
|
|
197
|
-
|
|
198
|
-
const w =
|
|
199
|
-
|
|
193
|
+
v.grid.template.set("visible", !1);
|
|
194
|
+
const w = d.yAxes.push(
|
|
195
|
+
V.new(e, {
|
|
200
196
|
maxDeviation: 0,
|
|
201
|
-
renderer:
|
|
197
|
+
renderer: v,
|
|
202
198
|
categoryField: p
|
|
203
199
|
})
|
|
204
|
-
),
|
|
205
|
-
|
|
200
|
+
), M = e.interfaceColors.get("background"), O = d.bottomAxesContainer.children.push(
|
|
201
|
+
L.new(e, {
|
|
206
202
|
orientation: "horizontal",
|
|
207
|
-
startColor:
|
|
208
|
-
endColor: (
|
|
203
|
+
startColor: M,
|
|
204
|
+
endColor: (j = d.get("colors")) == null ? void 0 : j.getIndex(0),
|
|
209
205
|
startOpacity: 1,
|
|
210
206
|
endOpacity: 1
|
|
211
207
|
})
|
|
212
|
-
), g =
|
|
213
|
-
|
|
208
|
+
), g = d.series.push(
|
|
209
|
+
fe.new(e, {
|
|
214
210
|
calculateAggregates: !0,
|
|
215
|
-
stroke:
|
|
211
|
+
stroke: me(16777215),
|
|
216
212
|
clustered: !1,
|
|
217
213
|
xAxis: k,
|
|
218
214
|
yAxis: w,
|
|
219
|
-
categoryXField:
|
|
215
|
+
categoryXField: h.value,
|
|
220
216
|
categoryYField: p,
|
|
221
217
|
valueField: t[0].dataFieldName
|
|
222
218
|
})
|
|
@@ -225,45 +221,45 @@ const De = (X) => {
|
|
|
225
221
|
tooltipText: "{categoryY}, {categoryX}: {value}",
|
|
226
222
|
strokeOpacity: 1,
|
|
227
223
|
strokeWidth: 2,
|
|
228
|
-
width:
|
|
229
|
-
height:
|
|
230
|
-
}), g.columns.template.events.on("pointerover", function(
|
|
231
|
-
const A =
|
|
232
|
-
A &&
|
|
224
|
+
width: R(100),
|
|
225
|
+
height: R(100)
|
|
226
|
+
}), g.columns.template.events.on("pointerover", function(N) {
|
|
227
|
+
const A = N.target.dataItem;
|
|
228
|
+
A && O.showValue(A.get(p, 0));
|
|
233
229
|
}), g.events.on("datavalidated", function() {
|
|
234
|
-
|
|
230
|
+
O.set("startValue", g.getPrivate("valueLow")), O.set("endValue", g.getPrivate("valueHigh"));
|
|
235
231
|
}), g.set("heatRules", [
|
|
236
232
|
{
|
|
237
233
|
target: g.columns.template,
|
|
238
|
-
min:
|
|
239
|
-
max: (
|
|
234
|
+
min: M,
|
|
235
|
+
max: (I = d.get("colors")) == null ? void 0 : I.getIndex(0),
|
|
240
236
|
dataField: "value",
|
|
241
237
|
key: "fill"
|
|
242
238
|
}
|
|
243
239
|
]);
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
[
|
|
240
|
+
const G = T.uniqBy(C, p), F = [];
|
|
241
|
+
X.forEach((N) => {
|
|
242
|
+
G.forEach((A) => {
|
|
243
|
+
const q = {
|
|
244
|
+
[h.value]: N[h.value],
|
|
249
245
|
[p]: A[p]
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
...
|
|
246
|
+
}, z = T.find(C, q);
|
|
247
|
+
z === void 0 ? F.push({
|
|
248
|
+
...q,
|
|
253
249
|
[t[0].dataFieldName]: 0
|
|
254
|
-
}) :
|
|
250
|
+
}) : F.push(z);
|
|
255
251
|
});
|
|
256
|
-
}), w.data.setAll(
|
|
252
|
+
}), w.data.setAll(G), g.data.setAll(F);
|
|
257
253
|
}
|
|
258
|
-
|
|
259
|
-
},
|
|
254
|
+
d.appear(1e3, 100);
|
|
255
|
+
}, u), () => {
|
|
260
256
|
var e;
|
|
261
|
-
|
|
257
|
+
_ && clearTimeout(_), (e = b.current) == null || e.dispose(), b.current = null;
|
|
262
258
|
};
|
|
263
|
-
}, [i, a, t,
|
|
264
|
-
const
|
|
265
|
-
return { chartId:
|
|
259
|
+
}, [i, a, t, m.palette.mode, r]);
|
|
260
|
+
const W = { ...s };
|
|
261
|
+
return { chartId: l, ownerState: W, sx: f, error: x, other: y };
|
|
266
262
|
};
|
|
267
263
|
export {
|
|
268
|
-
|
|
264
|
+
Oe as useHeatmapLogic
|
|
269
265
|
};
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import { useRef as d, useLayoutEffect as
|
|
4
|
-
import {
|
|
5
|
-
import { X as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { R as W, A as S } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as z, useTheme as F } from "@mui/material";
|
|
3
|
+
import { useRef as d, useLayoutEffect as V } from "react";
|
|
4
|
+
import { applyInterfaceColors as G } from "../_common/utils.js";
|
|
5
|
+
import { X as M, V as N } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
6
|
+
import { X as P } from "../../../XYCursor-CVUSpqb9.js";
|
|
7
|
+
import { D as U } from "../../../DateAxis-DEXKps1S.js";
|
|
8
|
+
import { A as Z, a as j } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
9
|
+
import { C as q } from "../../../ColorSet-cyPmWGwh.js";
|
|
10
|
+
import { c as B, p as v } from "../../../Entity-BJCuhdq_.js";
|
|
11
|
+
import { L as J } from "../../../LineSeries-D_IL2qGF.js";
|
|
12
|
+
import { T as K } from "../../../Tooltip-vyZRZWih.js";
|
|
13
|
+
import { L as Q } from "../../../Legend-CFvQiIfn.js";
|
|
14
|
+
const pe = (A) => {
|
|
15
|
+
const u = z({
|
|
16
|
+
props: A,
|
|
16
17
|
name: "HCHighlightLineChart"
|
|
17
|
-
}), {
|
|
18
|
-
seriesData:
|
|
19
|
-
height:
|
|
20
|
-
width:
|
|
18
|
+
}), f = F(), {
|
|
19
|
+
seriesData: c,
|
|
20
|
+
height: k = "500px",
|
|
21
|
+
width: g = "100%",
|
|
21
22
|
chartId: p = "highlight-line-chart",
|
|
22
23
|
showLegend: l = !0,
|
|
23
|
-
loading:
|
|
24
|
-
emptyMessage:
|
|
25
|
-
sx:
|
|
24
|
+
loading: x = !1,
|
|
25
|
+
emptyMessage: w = "No data available",
|
|
26
|
+
sx: y,
|
|
26
27
|
...L
|
|
27
|
-
} = u,
|
|
28
|
+
} = u, C = {
|
|
28
29
|
...u,
|
|
29
|
-
height:
|
|
30
|
-
width:
|
|
30
|
+
height: k,
|
|
31
|
+
width: g,
|
|
31
32
|
chartId: p,
|
|
32
33
|
showLegend: l,
|
|
33
|
-
loading:
|
|
34
|
-
emptyMessage:
|
|
35
|
-
}, X = d(null),
|
|
36
|
-
return
|
|
34
|
+
loading: x,
|
|
35
|
+
emptyMessage: w
|
|
36
|
+
}, X = d(null), R = d(null), h = d(null);
|
|
37
|
+
return V(() => {
|
|
37
38
|
if (!h.current) return;
|
|
38
|
-
const e =
|
|
39
|
-
|
|
39
|
+
const e = W.new(h.current);
|
|
40
|
+
R.current = e, e.setThemes([S.new(e)]), G(e, f);
|
|
40
41
|
const o = e.container.children.push(
|
|
41
|
-
|
|
42
|
+
M.new(e, {
|
|
42
43
|
panX: !0,
|
|
43
44
|
panY: !0,
|
|
44
45
|
// The widget lives in a scrollable dashboard, so the wheel must reach the
|
|
@@ -50,81 +51,81 @@ const ie = (v) => {
|
|
|
50
51
|
);
|
|
51
52
|
X.current = o, o.set(
|
|
52
53
|
"cursor",
|
|
53
|
-
|
|
54
|
+
P.new(e, {
|
|
54
55
|
behavior: "zoomX"
|
|
55
56
|
})
|
|
56
57
|
).lineY.set("visible", !1);
|
|
57
|
-
const
|
|
58
|
-
|
|
58
|
+
const Y = o.xAxes.push(
|
|
59
|
+
U.new(e, {
|
|
59
60
|
maxDeviation: 0.3,
|
|
60
61
|
baseInterval: { timeUnit: "day", count: 1 },
|
|
61
|
-
renderer:
|
|
62
|
+
renderer: Z.new(e, {
|
|
62
63
|
minorGridEnabled: !0
|
|
63
64
|
})
|
|
64
65
|
})
|
|
65
|
-
),
|
|
66
|
-
|
|
67
|
-
renderer:
|
|
66
|
+
), T = o.yAxes.push(
|
|
67
|
+
N.new(e, {
|
|
68
|
+
renderer: j.new(e, {})
|
|
68
69
|
})
|
|
69
|
-
),
|
|
70
|
-
|
|
71
|
-
const s = t.color ?
|
|
72
|
-
|
|
70
|
+
), m = [], b = q.new(e, {});
|
|
71
|
+
c.forEach((t, i) => {
|
|
72
|
+
const s = t.color ? B(t.color) : b.getIndex(i), r = o.series.push(
|
|
73
|
+
J.new(e, {
|
|
73
74
|
name: t.name,
|
|
74
|
-
xAxis:
|
|
75
|
-
yAxis:
|
|
75
|
+
xAxis: Y,
|
|
76
|
+
yAxis: T,
|
|
76
77
|
valueYField: "value",
|
|
77
78
|
valueXField: "date",
|
|
78
79
|
stroke: s,
|
|
79
80
|
fill: s,
|
|
80
|
-
tooltip:
|
|
81
|
+
tooltip: K.new(e, {
|
|
81
82
|
labelText: "{name}: {valueY}"
|
|
82
83
|
})
|
|
83
84
|
})
|
|
84
85
|
);
|
|
85
86
|
r.strokes.template.setAll({
|
|
86
87
|
strokeWidth: 2
|
|
87
|
-
}), r.data.setAll(t.data),
|
|
88
|
+
}), r.data.setAll(t.data), m.push(r);
|
|
88
89
|
});
|
|
89
90
|
let n = null;
|
|
90
91
|
l && (n = o.children.push(
|
|
91
|
-
|
|
92
|
-
centerX:
|
|
93
|
-
x:
|
|
92
|
+
Q.new(e, {
|
|
93
|
+
centerX: v(50),
|
|
94
|
+
x: v(50),
|
|
94
95
|
layout: e.horizontalLayout
|
|
95
96
|
})
|
|
96
97
|
), n.data.setAll(o.series.values));
|
|
97
|
-
const E = 1,
|
|
98
|
+
const E = 1, I = 0.2, O = 4, D = (t) => {
|
|
98
99
|
var r;
|
|
99
100
|
const s = (r = t.target.dataItem) == null ? void 0 : r.dataContext;
|
|
100
|
-
s && (s.strokes.template.set("strokeOpacity", 1), s.strokes.template.set("strokeWidth",
|
|
101
|
-
a !== s && (a.strokes.template.set("strokeOpacity",
|
|
101
|
+
s && (s.strokes.template.set("strokeOpacity", 1), s.strokes.template.set("strokeWidth", O), m.forEach((a) => {
|
|
102
|
+
a !== s && (a.strokes.template.set("strokeOpacity", I), a.strokes.template.set("strokeWidth", 1));
|
|
102
103
|
}));
|
|
103
104
|
}, H = (t) => {
|
|
104
105
|
var r;
|
|
105
|
-
((r = t.target.dataItem) == null ? void 0 : r.dataContext) &&
|
|
106
|
+
((r = t.target.dataItem) == null ? void 0 : r.dataContext) && m.forEach((a) => {
|
|
106
107
|
a.strokes.template.set("strokeOpacity", E), a.strokes.template.set("strokeWidth", 2);
|
|
107
108
|
});
|
|
108
109
|
};
|
|
109
|
-
return n && (n.markers.template.events.on("pointerover", D), n.markers.template.events.on("pointerout", H)), o.appear(1e3, 100),
|
|
110
|
+
return n && (n.markers.template.events.on("pointerover", D), n.markers.template.events.on("pointerout", H)), o.appear(1e3, 100), m.forEach((t, i) => {
|
|
110
111
|
t.appear(1e3, 100 * (i + 1));
|
|
111
112
|
}), () => {
|
|
112
113
|
e.dispose();
|
|
113
114
|
};
|
|
114
|
-
}, [p,
|
|
115
|
+
}, [p, c, l, f.palette.mode]), {
|
|
115
116
|
chartDivRef: h,
|
|
116
|
-
seriesData:
|
|
117
|
-
height:
|
|
118
|
-
width:
|
|
117
|
+
seriesData: c,
|
|
118
|
+
height: k,
|
|
119
|
+
width: g,
|
|
119
120
|
chartId: p,
|
|
120
121
|
showLegend: l,
|
|
121
|
-
loading:
|
|
122
|
-
emptyMessage:
|
|
123
|
-
sx:
|
|
122
|
+
loading: x,
|
|
123
|
+
emptyMessage: w,
|
|
124
|
+
sx: y,
|
|
124
125
|
other: L,
|
|
125
|
-
ownerState:
|
|
126
|
+
ownerState: C
|
|
126
127
|
};
|
|
127
128
|
};
|
|
128
129
|
export {
|
|
129
|
-
|
|
130
|
+
pe as useHighlightLineChartLogic
|
|
130
131
|
};
|