@hybridcore/ui 1.6.5 → 1.6.7
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/IconX-C2wmVYSK.js +11 -0
- package/dist/components/charts/_common/format.js +55 -0
- package/dist/components/charts/_common/utils.js +12 -7
- package/dist/components/charts/chart-wrapper/helpers.js +46 -21
- package/dist/components/charts/chart-wrapper/logic.js +57 -40
- package/dist/components/charts/column-line-mix/logic.js +87 -86
- package/dist/components/charts/donut-chart/logic.js +37 -36
- package/dist/components/charts/drill-down-treemap/logic.js +123 -123
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +253 -252
- package/dist/components/charts/heatmap/logic.js +73 -73
- package/dist/components/charts/line/logic.js +201 -103
- package/dist/components/charts/logaritmic-scale/logic.js +65 -65
- package/dist/components/charts/multiple-value-axes/logic.js +96 -94
- package/dist/components/charts/nested-pie/logic.js +43 -42
- package/dist/components/charts/packed-circles/logic.js +111 -110
- package/dist/components/charts/pie-chart/logic.js +40 -39
- package/dist/components/charts/stacked-area-radar/logic.js +68 -67
- package/dist/components/charts/stacked-column-chart/logic.js +71 -70
- package/dist/components/charts/xy-chart/logic.js +82 -76
- package/dist/components/color-picker/index.js +1645 -1602
- package/dist/components/color-picker/logic.js +21 -12
- package/dist/components/color-picker/styled.js +4 -2
- package/dist/components/date-range-picker/index.js +359 -365
- package/dist/components/metric-card/helpers.js +12 -5
- package/dist/components/metric-card/index.js +58 -54
- package/dist/components/metric-card/logic.js +78 -61
- package/dist/components/metric-card/styled.js +63 -45
- package/dist/components/simple-pivot-table/index.js +129 -54
- package/dist/components/simple-pivot-table/logic.js +111 -45
- package/dist/components/simple-pivot-table/styled.js +31 -11
- package/dist/main.d.ts +125 -8
- package/dist/main.js +145 -141
- package/dist/{styled-Db1RdcPA.js → styled-SoqbyrkW.js} +116 -89
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { C as L, L as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
1
|
+
import { C as L, L as E, k as J, l as K, T as W, R as Q, A as Z } from "../../../AnimatedTheme-jnasw6rT.js";
|
|
2
|
+
import { useThemeProps as ee, useTheme as te } from "@mui/material";
|
|
3
|
+
import re from "dayjs";
|
|
4
4
|
import T from "lodash";
|
|
5
|
-
import { useId as
|
|
6
|
-
import { colorSetFromPalette as
|
|
7
|
-
import { m as
|
|
8
|
-
import { X as
|
|
9
|
-
import { A as
|
|
5
|
+
import { useId as ae, useRef as ie, useEffect as se } from "react";
|
|
6
|
+
import { applyValueFormat as oe, colorSetFromPalette as ne } from "../_common/utils.js";
|
|
7
|
+
import { m as S, f as le, u as U, b as u, p as P, c as Y } from "../../../ColorSet-C7vpNXhM.js";
|
|
8
|
+
import { X as he } from "../../../AxisRenderer-DTyLLA6c.js";
|
|
9
|
+
import { A as ce, a as ue } from "../../../AxisRendererY-C_ItLPNV.js";
|
|
10
10
|
import { C as R } from "../../../CategoryAxis-CwnfaGc8.js";
|
|
11
|
-
import { R as
|
|
12
|
-
import { L as
|
|
13
|
-
import { C as
|
|
11
|
+
import { R as de } from "../../../RoundedRectangle-CWLi2PXn.js";
|
|
12
|
+
import { L as me } from "../../../LinearGradient-DiRq5YcI.js";
|
|
13
|
+
import { C as pe } from "../../../ColumnSeries-CjgdJ2QL.js";
|
|
14
14
|
class _ extends L {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments), Object.defineProperty(this, "labelContainer", {
|
|
@@ -27,23 +27,23 @@ class _ extends L {
|
|
|
27
27
|
enumerable: !0,
|
|
28
28
|
configurable: !0,
|
|
29
29
|
writable: !0,
|
|
30
|
-
value: this.labelContainer.children.push(
|
|
30
|
+
value: this.labelContainer.children.push(E.new(this._root, { themeTags: ["start"] }))
|
|
31
31
|
}), Object.defineProperty(this, "endLabel", {
|
|
32
32
|
enumerable: !0,
|
|
33
33
|
configurable: !0,
|
|
34
34
|
writable: !0,
|
|
35
|
-
value: this.labelContainer.children.push(
|
|
35
|
+
value: this.labelContainer.children.push(E.new(this._root, { themeTags: ["end"] }))
|
|
36
36
|
}), Object.defineProperty(this, "markers", {
|
|
37
37
|
enumerable: !0,
|
|
38
38
|
configurable: !0,
|
|
39
39
|
writable: !0,
|
|
40
|
-
value: this.addDisposer(new
|
|
41
|
-
themeTags:
|
|
40
|
+
value: this.addDisposer(new J(K.new({}), () => de._new(this._root, {
|
|
41
|
+
themeTags: S(this.markers.template.get("themeTags", []), [this.get("orientation"), "heatlegend", "marker"])
|
|
42
42
|
}, [this.markers.template])))
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
_afterNew() {
|
|
46
|
-
this._settings.themeTags =
|
|
46
|
+
this._settings.themeTags = S(this._settings.themeTags, ["heatlegend", this._settings.orientation]), super._afterNew(), this.set("tooltip", W.new(this._root, {
|
|
47
47
|
themeTags: ["heatlegend"]
|
|
48
48
|
}));
|
|
49
49
|
}
|
|
@@ -63,55 +63,55 @@ class _ extends L {
|
|
|
63
63
|
* @param text Text
|
|
64
64
|
* @param color Color
|
|
65
65
|
*/
|
|
66
|
-
showValue(s,
|
|
66
|
+
showValue(s, a, t) {
|
|
67
67
|
const i = this.getTooltip();
|
|
68
|
-
if (i &&
|
|
68
|
+
if (i && le(s)) {
|
|
69
69
|
const d = this.get("startValue", 0), o = this.get("endValue", 1);
|
|
70
|
-
let
|
|
71
|
-
(
|
|
70
|
+
let r = (s - d) / (o - d);
|
|
71
|
+
(r == 1 / 0 || r == -1 / 0 || isNaN(r)) && (r = 0.5);
|
|
72
72
|
const f = this.get("startColor"), y = this.get("endColor");
|
|
73
|
-
|
|
73
|
+
a || (a = this.getNumberFormatter().format(s)), t || (t = U.interpolate(r, f, y)), i.label.set("text", a);
|
|
74
74
|
let n;
|
|
75
|
-
this.get("orientation") == "vertical" ? n = this.markerContainer.toGlobal({ x: 0, y: this.innerHeight() * (1 -
|
|
75
|
+
this.get("orientation") == "vertical" ? n = this.markerContainer.toGlobal({ x: 0, y: this.innerHeight() * (1 - r) }) : n = this.markerContainer.toGlobal({ x: this.innerWidth() * r, y: 0 });
|
|
76
76
|
let l = i.get("background");
|
|
77
|
-
l && l.set("fill",
|
|
77
|
+
l && l.set("fill", t), i.set("pointTo", n), i.show();
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
_prepareChildren() {
|
|
81
81
|
super._prepareChildren();
|
|
82
|
-
const s = this.labelContainer,
|
|
83
|
-
if (this.isDirty("orientation") && (
|
|
84
|
-
const o = this.get("stepCount", 1),
|
|
82
|
+
const s = this.labelContainer, a = this.get("orientation"), t = this.startLabel, i = this.endLabel, d = this.getTooltip();
|
|
83
|
+
if (this.isDirty("orientation") && (a == "vertical" ? (this.markerContainer.setAll({ layout: this._root.verticalLayout, height: u }), this.set("layout", this._root.horizontalLayout), t.setAll({ y: u, x: void 0, centerY: u, centerX: u }), i.setAll({ y: 0, x: void 0, centerY: 0, centerX: u }), s.setAll({ height: u, width: void 0 }), d && d.set("pointerOrientation", "horizontal")) : (this.markerContainer.setAll({ layout: this._root.horizontalLayout, width: u }), this.set("layout", this._root.verticalLayout), t.setAll({ x: 0, y: void 0, centerX: 0, centerY: 0 }), i.setAll({ x: u, y: void 0, centerX: u, centerY: 0 }), s.setAll({ width: u, height: void 0 }), d && d.set("pointerOrientation", "vertical"))), this.isDirty("stepCount")) {
|
|
84
|
+
const o = this.get("stepCount", 1), r = this.get("startColor"), f = this.get("endColor"), y = this.get("startOpacity", 1), n = this.get("endOpacity", 1);
|
|
85
85
|
if (this.markerContainer.children.clear(), o > 1)
|
|
86
86
|
for (let l = 0; l < o; l++) {
|
|
87
87
|
const h = this.makeMarker();
|
|
88
|
-
|
|
89
|
-
fill:
|
|
88
|
+
a == "vertical" ? this.markerContainer.children.moveValue(h, 0) : this.markerContainer.children.push(h), r && f && h.setAll({
|
|
89
|
+
fill: U.interpolate(l / o, r, f),
|
|
90
90
|
fillOpacity: P(l / o * 100).interpolate(y, n)
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
else if (o == 1) {
|
|
94
94
|
const l = this.makeMarker();
|
|
95
95
|
this.markerContainer.children.push(l);
|
|
96
|
-
const h =
|
|
96
|
+
const h = me.new(this._root, {
|
|
97
97
|
stops: [{
|
|
98
|
-
color:
|
|
98
|
+
color: r,
|
|
99
99
|
opacity: y
|
|
100
100
|
}, {
|
|
101
101
|
color: f,
|
|
102
102
|
opacity: n
|
|
103
103
|
}]
|
|
104
104
|
});
|
|
105
|
-
if (
|
|
105
|
+
if (a == "vertical") {
|
|
106
106
|
h.set("rotation", 90);
|
|
107
107
|
let b = h.get("stops");
|
|
108
108
|
b && b.reverse();
|
|
109
109
|
} else
|
|
110
110
|
h.set("rotation", 0);
|
|
111
|
-
|
|
111
|
+
r && f && l.set("fillGradient", h);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
(this.isDirty("startText") || this.isDirty("startValue")) &&
|
|
114
|
+
(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))));
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
Object.defineProperty(_, "className", {
|
|
@@ -126,31 +126,31 @@ Object.defineProperty(_, "classNames", {
|
|
|
126
126
|
writable: !0,
|
|
127
127
|
value: L.classNames.concat([_.className])
|
|
128
128
|
});
|
|
129
|
-
const
|
|
130
|
-
const s =
|
|
131
|
-
dimensions:
|
|
132
|
-
values:
|
|
129
|
+
const _e = (X) => {
|
|
130
|
+
const s = ee({ props: X, name: "HCHeatmap" }), {
|
|
131
|
+
dimensions: a,
|
|
132
|
+
values: t,
|
|
133
133
|
data: i,
|
|
134
134
|
initDelay: d = 0,
|
|
135
135
|
baseInterval: o,
|
|
136
|
-
colors:
|
|
136
|
+
colors: r,
|
|
137
137
|
sx: f,
|
|
138
138
|
...y
|
|
139
|
-
} = s, n =
|
|
139
|
+
} = s, n = te(), h = `hc-heatmap-${ae().replace(/:/g, "")}`, b = ie(null);
|
|
140
140
|
let x = null;
|
|
141
|
-
|
|
141
|
+
a.length < 2 ? x = "Heatmap requires at least 2 dimensions" : t.length < 1 && (x = "Heatmap requires at least 1 value"), se(() => {
|
|
142
142
|
if (x) return;
|
|
143
143
|
let D;
|
|
144
144
|
return D = setTimeout(() => {
|
|
145
|
-
var j, M;
|
|
146
|
-
const e =
|
|
147
|
-
b.current = e, e.setThemes([
|
|
145
|
+
var j, M, G;
|
|
146
|
+
const e = Q.new(h);
|
|
147
|
+
b.current = e, oe(e, (j = t == null ? void 0 : t[0]) == null ? void 0 : j.format), e.setThemes([Z.new(e)]), e.interfaceColors.setAll({
|
|
148
148
|
text: Y(n.palette.text.primary),
|
|
149
149
|
grid: Y(n.palette.divider),
|
|
150
150
|
stroke: Y(n.palette.divider)
|
|
151
151
|
});
|
|
152
152
|
const m = e.container.children.push(
|
|
153
|
-
|
|
153
|
+
he.new(e, {
|
|
154
154
|
panX: !1,
|
|
155
155
|
panY: !1,
|
|
156
156
|
wheelX: "none",
|
|
@@ -158,13 +158,13 @@ const Ye = (X) => {
|
|
|
158
158
|
layout: e.verticalLayout
|
|
159
159
|
})
|
|
160
160
|
);
|
|
161
|
-
m.set("colors",
|
|
162
|
-
const O =
|
|
161
|
+
m.set("colors", ne(e, r));
|
|
162
|
+
const O = ce.new(e, {
|
|
163
163
|
visible: !1,
|
|
164
164
|
minGridDistance: 30
|
|
165
165
|
});
|
|
166
166
|
O.grid.template.set("visible", !1);
|
|
167
|
-
const c =
|
|
167
|
+
const c = a[0];
|
|
168
168
|
let k, v = i;
|
|
169
169
|
if (c.type === "date") {
|
|
170
170
|
const p = (o == null ? void 0 : o.timeUnit) || "day";
|
|
@@ -176,19 +176,19 @@ const Ye = (X) => {
|
|
|
176
176
|
})
|
|
177
177
|
), v = T.orderBy(i, [c.value]), v = v.map((w) => ({
|
|
178
178
|
...w,
|
|
179
|
-
[c.value]:
|
|
179
|
+
[c.value]: re(w[c.value]).format(C)
|
|
180
180
|
}));
|
|
181
181
|
} else
|
|
182
182
|
k = m.xAxes.push(
|
|
183
183
|
R.new(e, {
|
|
184
184
|
categoryField: c.value,
|
|
185
185
|
renderer: O,
|
|
186
|
-
tooltip:
|
|
186
|
+
tooltip: W.new(e, {})
|
|
187
187
|
})
|
|
188
188
|
);
|
|
189
189
|
const H = T.uniqBy(v, c.value);
|
|
190
|
-
if (k.data.setAll(H),
|
|
191
|
-
const p =
|
|
190
|
+
if (k.data.setAll(H), t.length === 1 && a.length > 1) {
|
|
191
|
+
const p = a[1].value, C = ue.new(e, {
|
|
192
192
|
visible: !1,
|
|
193
193
|
minGridDistance: 20,
|
|
194
194
|
inversed: !0
|
|
@@ -200,16 +200,16 @@ const Ye = (X) => {
|
|
|
200
200
|
renderer: C,
|
|
201
201
|
categoryField: p
|
|
202
202
|
})
|
|
203
|
-
),
|
|
203
|
+
), I = e.interfaceColors.get("background"), F = m.bottomAxesContainer.children.push(
|
|
204
204
|
_.new(e, {
|
|
205
205
|
orientation: "horizontal",
|
|
206
|
-
startColor:
|
|
207
|
-
endColor: (
|
|
206
|
+
startColor: I,
|
|
207
|
+
endColor: (M = m.get("colors")) == null ? void 0 : M.getIndex(0),
|
|
208
208
|
startOpacity: 1,
|
|
209
209
|
endOpacity: 1
|
|
210
210
|
})
|
|
211
211
|
), g = m.series.push(
|
|
212
|
-
|
|
212
|
+
pe.new(e, {
|
|
213
213
|
calculateAggregates: !0,
|
|
214
214
|
stroke: Y(16777215),
|
|
215
215
|
clustered: !1,
|
|
@@ -217,7 +217,7 @@ const Ye = (X) => {
|
|
|
217
217
|
yAxis: w,
|
|
218
218
|
categoryXField: c.value,
|
|
219
219
|
categoryYField: p,
|
|
220
|
-
valueField:
|
|
220
|
+
valueField: t[0].dataFieldName
|
|
221
221
|
})
|
|
222
222
|
);
|
|
223
223
|
g.columns.template.setAll({
|
|
@@ -228,41 +228,41 @@ const Ye = (X) => {
|
|
|
228
228
|
height: P(100)
|
|
229
229
|
}), g.columns.template.events.on("pointerover", function(V) {
|
|
230
230
|
const A = V.target.dataItem;
|
|
231
|
-
A &&
|
|
231
|
+
A && F.showValue(A.get(p, 0));
|
|
232
232
|
}), g.events.on("datavalidated", function() {
|
|
233
|
-
|
|
233
|
+
F.set("startValue", g.getPrivate("valueLow")), F.set("endValue", g.getPrivate("valueHigh"));
|
|
234
234
|
}), g.set("heatRules", [
|
|
235
235
|
{
|
|
236
236
|
target: g.columns.template,
|
|
237
|
-
min:
|
|
238
|
-
max: (
|
|
237
|
+
min: I,
|
|
238
|
+
max: (G = m.get("colors")) == null ? void 0 : G.getIndex(0),
|
|
239
239
|
dataField: "value",
|
|
240
240
|
key: "fill"
|
|
241
241
|
}
|
|
242
242
|
]);
|
|
243
|
-
const
|
|
243
|
+
const q = T.uniqBy(v, p), N = [];
|
|
244
244
|
H.forEach((V) => {
|
|
245
|
-
|
|
246
|
-
const
|
|
245
|
+
q.forEach((A) => {
|
|
246
|
+
const z = {
|
|
247
247
|
[c.value]: V[c.value],
|
|
248
248
|
[p]: A[p]
|
|
249
|
-
},
|
|
250
|
-
|
|
251
|
-
...
|
|
252
|
-
[
|
|
253
|
-
}) :
|
|
249
|
+
}, B = T.find(v, z);
|
|
250
|
+
B === void 0 ? N.push({
|
|
251
|
+
...z,
|
|
252
|
+
[t[0].dataFieldName]: 0
|
|
253
|
+
}) : N.push(B);
|
|
254
254
|
});
|
|
255
|
-
}), w.data.setAll(
|
|
255
|
+
}), w.data.setAll(q), g.data.setAll(N);
|
|
256
256
|
}
|
|
257
257
|
m.appear(1e3, 100);
|
|
258
258
|
}, d), () => {
|
|
259
259
|
var e;
|
|
260
260
|
D && clearTimeout(D), (e = b.current) == null || e.dispose(), b.current = null;
|
|
261
261
|
};
|
|
262
|
-
}, [i,
|
|
263
|
-
const
|
|
264
|
-
return { chartId: h, ownerState:
|
|
262
|
+
}, [i, a, t, n.palette.mode, r]);
|
|
263
|
+
const $ = { ...s };
|
|
264
|
+
return { chartId: h, ownerState: $, sx: f, error: x, other: y };
|
|
265
265
|
};
|
|
266
266
|
export {
|
|
267
|
-
|
|
267
|
+
_e as useHeatmapLogic
|
|
268
268
|
};
|
|
@@ -1,143 +1,241 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
import { R as Z, a as q, A as J, T as K } from "../../../AnimatedTheme-jnasw6rT.js";
|
|
2
|
+
import { useThemeProps as Q, useTheme as ee } from "@mui/material";
|
|
3
|
+
import _ from "lodash";
|
|
4
|
+
import { useId as te, useRef as oe, useEffect as re } from "react";
|
|
5
|
+
import { humanizeLabel as ae } from "../_common/format.js";
|
|
6
|
+
import { colorSetFromPalette as se, applyValueFormat as ne } from "../_common/utils.js";
|
|
7
|
+
import { c, p as k, b as U } from "../../../ColorSet-C7vpNXhM.js";
|
|
8
|
+
import { X as ie, V as le } from "../../../AxisRenderer-DTyLLA6c.js";
|
|
9
|
+
import { D as me } from "../../../DateAxis-YX3QNIB-.js";
|
|
10
|
+
import { A as V, a as de } from "../../../AxisRendererY-C_ItLPNV.js";
|
|
11
|
+
import { C as pe } from "../../../CategoryAxis-CwnfaGc8.js";
|
|
12
|
+
import { L as ce } from "../../../LineSeries-Uiv5o56b.js";
|
|
13
|
+
import { D as ue } from "../../../DataProcessor-CHDO51q4.js";
|
|
14
|
+
import { B as ye } from "../../../Bullet-DVczI2TD.js";
|
|
15
|
+
import { C as fe } from "../../../Circle-Cy5s-pVc.js";
|
|
16
|
+
import { X as he } from "../../../XYCursor-C8WktvKM.js";
|
|
17
|
+
import { L as ge } from "../../../Legend-Dp_MKfS4.js";
|
|
18
|
+
const R = 1.1, Ae = {
|
|
19
|
+
millisecond: 1,
|
|
20
|
+
second: 1e3,
|
|
21
|
+
minute: 6e4,
|
|
22
|
+
hour: 36e5,
|
|
23
|
+
day: 864e5,
|
|
24
|
+
week: 6048e5,
|
|
25
|
+
month: 2592e6,
|
|
26
|
+
year: 31536e6
|
|
27
|
+
}, xe = {
|
|
28
|
+
millisecond: "d MMM, yyyy HH:mm:ss.SSS",
|
|
29
|
+
second: "d MMM, yyyy HH:mm:ss",
|
|
30
|
+
minute: "d MMM, yyyy HH:mm",
|
|
31
|
+
hour: "d MMM, yyyy HH:mm",
|
|
32
|
+
day: "d MMM, yyyy",
|
|
33
|
+
week: "d MMM, yyyy",
|
|
34
|
+
month: "MMM yyyy",
|
|
35
|
+
year: "yyyy"
|
|
36
|
+
}, Ue = (B) => {
|
|
37
|
+
const b = Q({ props: B, name: "HCLineChart" }), {
|
|
38
|
+
dimensions: r,
|
|
39
|
+
values: y,
|
|
40
|
+
data: w,
|
|
41
|
+
initDelay: E = 0,
|
|
42
|
+
baseInterval: l,
|
|
43
|
+
colors: X,
|
|
44
|
+
connectMissingData: T = !0,
|
|
45
|
+
sx: G,
|
|
46
|
+
...I
|
|
47
|
+
} = b, m = ee(), H = `hc-line-chart-${te().replace(/:/g, "")}`, F = oe(null);
|
|
48
|
+
let v = null;
|
|
49
|
+
r.length < 1 ? v = "Missing dimensions config!" : y.length < 1 && (v = "Missing values config!"), re(() => {
|
|
50
|
+
if (v) return;
|
|
51
|
+
let C;
|
|
52
|
+
return C = setTimeout(() => {
|
|
53
|
+
var $, O, S, Y, P;
|
|
54
|
+
const e = Z.new(H);
|
|
55
|
+
F.current = e;
|
|
56
|
+
const j = q.new(e);
|
|
57
|
+
e.setThemes([J.new(e), j]), e.interfaceColors.setAll({
|
|
58
|
+
text: c(m.palette.text.primary),
|
|
59
|
+
grid: c(m.palette.divider),
|
|
60
|
+
stroke: c(m.palette.divider)
|
|
39
61
|
});
|
|
40
|
-
const
|
|
41
|
-
|
|
62
|
+
const n = e.container.children.push(
|
|
63
|
+
ie.new(e, {
|
|
42
64
|
panX: !0,
|
|
43
65
|
panY: !0,
|
|
44
66
|
wheelX: "none",
|
|
45
67
|
wheelY: "none",
|
|
46
|
-
|
|
68
|
+
// -1 = show the tooltip from the cursor's x-position anywhere in the
|
|
69
|
+
// plot, not only when the pointer is on a data point / line.
|
|
70
|
+
maxTooltipDistance: -1,
|
|
47
71
|
pinchZoomX: !0
|
|
48
72
|
})
|
|
49
73
|
);
|
|
50
|
-
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
|
|
74
|
+
n.set("colors", se(e, X));
|
|
75
|
+
let d, f = w;
|
|
76
|
+
r[0].type === "date" ? (d = n.xAxes.push(
|
|
77
|
+
me.new(e, {
|
|
54
78
|
maxDeviation: 0.1,
|
|
55
79
|
groupData: !1,
|
|
56
|
-
baseInterval:
|
|
57
|
-
renderer:
|
|
58
|
-
tooltip: A.new(e, {})
|
|
80
|
+
baseInterval: l || { timeUnit: "day", count: 1 },
|
|
81
|
+
renderer: V.new(e, {})
|
|
59
82
|
})
|
|
60
|
-
),
|
|
61
|
-
|
|
62
|
-
categoryField:
|
|
63
|
-
renderer:
|
|
64
|
-
tooltip: A.new(e, {})
|
|
83
|
+
), f = _.orderBy(w, [r[0].value])) : (d = n.xAxes.push(
|
|
84
|
+
pe.new(e, {
|
|
85
|
+
categoryField: r[0].value,
|
|
86
|
+
renderer: V.new(e, {})
|
|
65
87
|
})
|
|
66
88
|
), e.numberFormatter.setAll({
|
|
67
89
|
numberFormat: "#",
|
|
68
90
|
numericFields: ["valueX"]
|
|
69
|
-
}),
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
renderer:
|
|
91
|
+
}), f = _.orderBy(w, [r[0].value]), d.data.setAll(f));
|
|
92
|
+
const N = n.yAxes.push(
|
|
93
|
+
le.new(e, {
|
|
94
|
+
renderer: de.new(e, {})
|
|
73
95
|
})
|
|
74
96
|
);
|
|
75
|
-
(
|
|
76
|
-
stroke:
|
|
97
|
+
($ = d.get("renderer")) == null || $.grid.template.setAll({
|
|
98
|
+
stroke: c(m.palette.divider),
|
|
77
99
|
strokeOpacity: 1
|
|
78
|
-
}), (
|
|
79
|
-
stroke:
|
|
100
|
+
}), (O = d.get("renderer")) == null || O.labels.template.setAll({ paddingTop: 12 }), (S = N.get("renderer")) == null || S.grid.template.setAll({
|
|
101
|
+
stroke: c(m.palette.divider),
|
|
80
102
|
strokeOpacity: 1
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
103
|
+
});
|
|
104
|
+
const M = K.new(e, {
|
|
105
|
+
getFillFromSprite: !1
|
|
106
|
+
});
|
|
107
|
+
(Y = M.get("background")) == null || Y.setAll({
|
|
108
|
+
fill: c(m.palette.background.paper),
|
|
109
|
+
stroke: c(m.palette.divider),
|
|
110
|
+
fillOpacity: 1
|
|
111
|
+
}), M.label.setAll({
|
|
112
|
+
fill: c(m.palette.text.primary),
|
|
113
|
+
textAlign: "left",
|
|
114
|
+
lineHeight: k(160)
|
|
115
|
+
});
|
|
116
|
+
const L = xe[(l == null ? void 0 : l.timeUnit) ?? "day"], z = c(m.palette.text.secondary).toCSSHex();
|
|
117
|
+
M.label.adapters.add("text", () => {
|
|
118
|
+
let t = "";
|
|
119
|
+
const a = [];
|
|
120
|
+
if (n.series.each((i) => {
|
|
121
|
+
const s = i.get("tooltipDataItem"), p = s == null ? void 0 : s.get("valueY");
|
|
122
|
+
if (s === void 0 || p === void 0 || p === null)
|
|
123
|
+
return;
|
|
124
|
+
if (!t)
|
|
125
|
+
if (r[0].type === "date") {
|
|
126
|
+
const o = s.get("valueX");
|
|
127
|
+
typeof o == "number" && (t = e.dateFormatter.format(
|
|
128
|
+
new Date(o),
|
|
129
|
+
L
|
|
130
|
+
));
|
|
131
|
+
} else
|
|
132
|
+
t = `${s.get("categoryX") ?? ""}`;
|
|
133
|
+
const u = i.get("stroke"), g = u ? `[${u.toCSSHex()}]●[/] ` : "";
|
|
134
|
+
a.push(
|
|
135
|
+
`${g}${i.get("name")}: ${e.numberFormatter.format(
|
|
136
|
+
p
|
|
137
|
+
)}`
|
|
138
|
+
);
|
|
139
|
+
}), a.length === 0) {
|
|
140
|
+
if (r[0].type === "date") {
|
|
141
|
+
const s = d.positionToValue(
|
|
142
|
+
d.getPrivate("tooltipPosition", 0)
|
|
143
|
+
);
|
|
144
|
+
typeof s == "number" && !Number.isNaN(s) && (t = e.dateFormatter.format(new Date(s), L));
|
|
145
|
+
}
|
|
146
|
+
const i = `[${z}]No data[/]`;
|
|
147
|
+
return t ? `[bold]${t}[/]
|
|
148
|
+
${i}` : i;
|
|
149
|
+
}
|
|
150
|
+
return t ? `[bold]${t}[/]
|
|
151
|
+
${a.join(`
|
|
152
|
+
`)}` : a.join(`
|
|
153
|
+
`);
|
|
154
|
+
}), d.set("tooltip", M), y.forEach((t) => {
|
|
155
|
+
const a = n.series.push(
|
|
156
|
+
ce.new(e, {
|
|
157
|
+
// Legend/tooltip label: explicit override, else humanize the raw
|
|
158
|
+
// backend field (snake_case / lowercase → Title Case).
|
|
159
|
+
name: t.label ?? ae(t.name),
|
|
160
|
+
xAxis: d,
|
|
161
|
+
yAxis: N,
|
|
162
|
+
valueYField: t.dataFieldName,
|
|
163
|
+
// When false, the line breaks at missing points. On a date axis the
|
|
164
|
+
// break is auto-detected when adjacent points are spaced more than
|
|
165
|
+
// `autoGapCount` (default 1.1) base intervals apart, so absent dates
|
|
166
|
+
// surface as gaps instead of being bridged by a straight segment.
|
|
167
|
+
connect: T,
|
|
168
|
+
autoGapCount: R,
|
|
169
|
+
...r[0].type === "date" ? { valueXField: r[0].value } : { categoryXField: r[0].value }
|
|
93
170
|
})
|
|
94
171
|
);
|
|
95
|
-
|
|
172
|
+
if (r[0].type === "date" && (a.data.processor = ue.new(e, {
|
|
96
173
|
dateFormat: "i",
|
|
97
|
-
dateFields: [
|
|
98
|
-
})),
|
|
99
|
-
|
|
174
|
+
dateFields: [r[0].value]
|
|
175
|
+
})), r[0].type === "date") {
|
|
176
|
+
const i = r[0].value, s = Ae[(l == null ? void 0 : l.timeUnit) ?? "day"] * ((l == null ? void 0 : l.count) ?? 1), p = T ? 1 / 0 : s * R, u = f.map((o) => ({
|
|
177
|
+
t: new Date(o[i]).getTime(),
|
|
178
|
+
hasValue: o[t.dataFieldName] !== null && o[t.dataFieldName] !== void 0
|
|
179
|
+
})).filter((o) => o.hasValue && !Number.isNaN(o.t)), g = /* @__PURE__ */ new Set();
|
|
180
|
+
u.forEach((o, A) => {
|
|
181
|
+
const D = A > 0 ? o.t - u[A - 1].t : 1 / 0, x = A < u.length - 1 ? u[A + 1].t - o.t : 1 / 0;
|
|
182
|
+
D > p && x > p && g.add(o.t);
|
|
183
|
+
}), g.size > 0 && a.bullets.push((o, A, D) => {
|
|
184
|
+
const x = D.dataContext;
|
|
185
|
+
if (g.has(new Date(x == null ? void 0 : x[i]).getTime()))
|
|
186
|
+
return ye.new(o, {
|
|
187
|
+
sprite: fe.new(o, {
|
|
188
|
+
radius: 3,
|
|
189
|
+
fill: a.get("fill"),
|
|
190
|
+
stroke: o.interfaceColors.get("background"),
|
|
191
|
+
strokeWidth: 1
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
a.data.setAll(f), a.strokes.template.setAll({ strokeWidth: 2 }), a.appear();
|
|
197
|
+
}), n.set(
|
|
100
198
|
"cursor",
|
|
101
|
-
|
|
199
|
+
he.new(e, { xAxis: d, behavior: "none" })
|
|
102
200
|
).lineY.set("visible", !1);
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
width:
|
|
201
|
+
const h = n.bottomAxesContainer.children.push(
|
|
202
|
+
ge.new(e, {
|
|
203
|
+
width: k(100),
|
|
106
204
|
paddingTop: 10,
|
|
107
|
-
centerX:
|
|
108
|
-
x:
|
|
205
|
+
centerX: k(50),
|
|
206
|
+
x: k(50),
|
|
109
207
|
layout: e.gridLayout
|
|
110
208
|
})
|
|
111
209
|
);
|
|
112
|
-
|
|
113
|
-
var
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
210
|
+
h.itemContainers.template.events.on("pointerover", function(t) {
|
|
211
|
+
var s;
|
|
212
|
+
const a = t.target, i = (s = a == null ? void 0 : a.dataItem) == null ? void 0 : s.dataContext;
|
|
213
|
+
n.series.each(function(p) {
|
|
214
|
+
p !== i ? p.strokes.template.setAll({
|
|
117
215
|
strokeOpacity: 0.15,
|
|
118
|
-
stroke:
|
|
119
|
-
}) :
|
|
216
|
+
stroke: c(0)
|
|
217
|
+
}) : p.strokes.template.setAll({ strokeWidth: 3 });
|
|
120
218
|
});
|
|
121
|
-
}),
|
|
122
|
-
|
|
123
|
-
|
|
219
|
+
}), h.itemContainers.template.events.on("pointerout", function() {
|
|
220
|
+
n.series.each(function(t) {
|
|
221
|
+
t.strokes.template.setAll({
|
|
124
222
|
strokeOpacity: 1,
|
|
125
223
|
strokeWidth: 2,
|
|
126
|
-
stroke:
|
|
224
|
+
stroke: t.get("fill")
|
|
127
225
|
});
|
|
128
226
|
});
|
|
129
|
-
}),
|
|
130
|
-
width:
|
|
227
|
+
}), h.itemContainers.template.set("width", U), h.valueLabels.template.setAll({
|
|
228
|
+
width: U,
|
|
131
229
|
textAlign: "right"
|
|
132
|
-
}),
|
|
133
|
-
},
|
|
230
|
+
}), h.data.setAll(n.series.values), ne(e, (P = y == null ? void 0 : y[0]) == null ? void 0 : P.format), n.appear(1e3, 100);
|
|
231
|
+
}, E), () => {
|
|
134
232
|
var e;
|
|
135
|
-
|
|
233
|
+
C && clearTimeout(C), (e = F.current) == null || e.dispose(), F.current = null;
|
|
136
234
|
};
|
|
137
|
-
}, [
|
|
138
|
-
const
|
|
139
|
-
return { chartId:
|
|
235
|
+
}, [w, r, y, m.palette.mode, X, T]);
|
|
236
|
+
const W = { ...b };
|
|
237
|
+
return { chartId: H, ownerState: W, sx: G, error: v, other: I };
|
|
140
238
|
};
|
|
141
239
|
export {
|
|
142
|
-
|
|
240
|
+
Ue as useLineChartLogic
|
|
143
241
|
};
|