@hybridcore/ui 1.6.7 → 1.6.9
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/AnimatedTheme-BOKdw2Oy.js +7708 -0
- package/dist/{AxisRenderer-DTyLLA6c.js → AxisRenderer-lUbezuh7.js} +51 -49
- package/dist/{AxisRendererY-C_ItLPNV.js → AxisRendererY-DbSiyb45.js} +3 -3
- package/dist/{Bullet-DVczI2TD.js → Bullet-PgoNb3Jv.js} +1 -1
- package/dist/{Button-CcsPEIDh.js → Button-XBf4Mwz-.js} +3 -3
- package/dist/{CategoryAxis-CwnfaGc8.js → CategoryAxis-B8KQp1pE.js} +3 -3
- package/dist/{Circle-Cy5s-pVc.js → Circle-BWRdiMpG.js} +1 -1
- package/dist/ColorSet-DDmFoKtZ.js +77 -0
- package/dist/{ColumnSeries-CjgdJ2QL.js → ColumnSeries-rgnGm-Bg.js} +4 -4
- package/dist/{DataProcessor-CHDO51q4.js → DataProcessor-CvIe9BVn.js} +1 -1
- package/dist/{DateAxis-YX3QNIB-.js → DateAxis-zNtbSVjW.js} +8 -7
- package/dist/{ColorSet-C7vpNXhM.js → Entity-CCUIdRAr.js} +638 -712
- package/dist/{Hierarchy-Bihj0S61.js → Hierarchy-CCvGsF1A.js} +25 -23
- package/dist/{Legend-Dp_MKfS4.js → Legend-kbCFjJAW.js} +11 -10
- package/dist/{LineSeries-Uiv5o56b.js → LineSeries-BLFvwrLT.js} +13 -12
- package/dist/{LinearGradient-DiRq5YcI.js → LinearGradient-C7rnipF7.js} +11 -11
- package/dist/{PieSeries-B2fW3z0s.js → PieSeries-3iLRbqFv.js} +34 -32
- package/dist/{RoundedRectangle-CWLi2PXn.js → RoundedRectangle-CqMMmPM0.js} +4 -4
- package/dist/{Scrollbar-D86MJyr2.js → Scrollbar-BzSBcIUt.js} +4 -4
- package/dist/{Slice-B19rbYDZ.js → Slice-CS23iLiS.js} +2 -2
- package/dist/{Tick-2bcLyHpF.js → Tick-BADQ8QeT.js} +15 -15
- package/dist/Tooltip-A_HlttXp.js +3606 -0
- package/dist/{XYCursor-C8WktvKM.js → XYCursor-gHAo40xC.js} +3 -3
- package/dist/{ZoomableContainer-DYyqwaMb.js → ZoomableContainer-Brs1wHM1.js} +9 -9
- package/dist/components/charts/_common/tooltip.js +73 -0
- package/dist/components/charts/_common/utils.js +10 -9
- package/dist/components/charts/candlestick/logic.js +181 -156
- package/dist/components/charts/column-line-mix/logic.js +80 -77
- package/dist/components/charts/donut-chart/logic.js +36 -34
- package/dist/components/charts/drill-down-treemap/logic.js +49 -48
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +102 -101
- package/dist/components/charts/heatmap/logic.js +33 -32
- package/dist/components/charts/highlighting-line-data/logic.js +26 -24
- package/dist/components/charts/line/logic.js +123 -174
- package/dist/components/charts/logaritmic-scale/logic.js +69 -60
- package/dist/components/charts/multiple-value-axes/logic.js +93 -88
- package/dist/components/charts/nested-pie/logic.js +3 -3
- package/dist/components/charts/packed-circles/logic.js +28 -27
- package/dist/components/charts/pie-chart/logic.js +43 -41
- package/dist/components/charts/stacked-area-radar/logic.js +124 -121
- package/dist/components/charts/stacked-column-chart/logic.js +107 -95
- package/dist/components/charts/xy-chart/logic.js +103 -91
- package/dist/components/metric-card/MetricChart.js +29 -28
- package/dist/components/metric-card/index.js +1 -1
- package/dist/components/metric-card/logic.js +74 -67
- package/dist/components/metric-card/styled.js +55 -46
- package/package.json +1 -1
- package/dist/AnimatedTheme-jnasw6rT.js +0 -11305
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { R as I, A as W
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import { useRef as d, useLayoutEffect as
|
|
4
|
-
import { X as
|
|
5
|
-
import { X as
|
|
6
|
-
import { D as
|
|
7
|
-
import { A as
|
|
8
|
-
import { C as
|
|
9
|
-
import {
|
|
10
|
-
import { L as
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { R as I, A as W } from "../../../AnimatedTheme-BOKdw2Oy.js";
|
|
2
|
+
import { useThemeProps as z } from "@mui/material";
|
|
3
|
+
import { useRef as d, useLayoutEffect as S } from "react";
|
|
4
|
+
import { X as F, V } from "../../../AxisRenderer-lUbezuh7.js";
|
|
5
|
+
import { X as G } from "../../../XYCursor-gHAo40xC.js";
|
|
6
|
+
import { D as M } from "../../../DateAxis-zNtbSVjW.js";
|
|
7
|
+
import { A as N, a as P } from "../../../AxisRendererY-DbSiyb45.js";
|
|
8
|
+
import { C as U } from "../../../ColorSet-DDmFoKtZ.js";
|
|
9
|
+
import { c as Z, p as w } from "../../../Entity-CCUIdRAr.js";
|
|
10
|
+
import { L as j } from "../../../LineSeries-BLFvwrLT.js";
|
|
11
|
+
import { T as q } from "../../../Tooltip-A_HlttXp.js";
|
|
12
|
+
import { L as B } from "../../../Legend-kbCFjJAW.js";
|
|
13
|
+
const ie = (v) => {
|
|
14
|
+
const u = z({
|
|
13
15
|
props: v,
|
|
14
16
|
name: "HCHighlightLineChart"
|
|
15
17
|
}), {
|
|
@@ -31,12 +33,12 @@ const ae = (v) => {
|
|
|
31
33
|
loading: g,
|
|
32
34
|
emptyMessage: x
|
|
33
35
|
}, y = d(null), C = d(null), h = d(null);
|
|
34
|
-
return
|
|
36
|
+
return S(() => {
|
|
35
37
|
if (!h.current) return;
|
|
36
38
|
const e = I.new(h.current);
|
|
37
39
|
C.current = e, e.setThemes([W.new(e)]);
|
|
38
40
|
const o = e.container.children.push(
|
|
39
|
-
|
|
41
|
+
F.new(e, {
|
|
40
42
|
panX: !0,
|
|
41
43
|
panY: !0,
|
|
42
44
|
wheelX: "panX",
|
|
@@ -46,26 +48,26 @@ const ae = (v) => {
|
|
|
46
48
|
);
|
|
47
49
|
y.current = o, o.set(
|
|
48
50
|
"cursor",
|
|
49
|
-
|
|
51
|
+
G.new(e, {
|
|
50
52
|
behavior: "zoomX"
|
|
51
53
|
})
|
|
52
54
|
).lineY.set("visible", !1);
|
|
53
55
|
const R = o.xAxes.push(
|
|
54
|
-
|
|
56
|
+
M.new(e, {
|
|
55
57
|
maxDeviation: 0.3,
|
|
56
58
|
baseInterval: { timeUnit: "day", count: 1 },
|
|
57
|
-
renderer:
|
|
59
|
+
renderer: N.new(e, {
|
|
58
60
|
minorGridEnabled: !0
|
|
59
61
|
})
|
|
60
62
|
})
|
|
61
63
|
), Y = o.yAxes.push(
|
|
62
|
-
|
|
63
|
-
renderer:
|
|
64
|
+
V.new(e, {
|
|
65
|
+
renderer: P.new(e, {})
|
|
64
66
|
})
|
|
65
|
-
), c = [], b =
|
|
67
|
+
), c = [], b = U.new(e, {});
|
|
66
68
|
m.forEach((t, i) => {
|
|
67
|
-
const s = t.color ?
|
|
68
|
-
|
|
69
|
+
const s = t.color ? Z(t.color) : b.getIndex(i), r = o.series.push(
|
|
70
|
+
j.new(e, {
|
|
69
71
|
name: t.name,
|
|
70
72
|
xAxis: R,
|
|
71
73
|
yAxis: Y,
|
|
@@ -73,7 +75,7 @@ const ae = (v) => {
|
|
|
73
75
|
valueXField: "date",
|
|
74
76
|
stroke: s,
|
|
75
77
|
fill: s,
|
|
76
|
-
tooltip:
|
|
78
|
+
tooltip: q.new(e, {
|
|
77
79
|
labelText: "{name}: {valueY}"
|
|
78
80
|
})
|
|
79
81
|
})
|
|
@@ -122,5 +124,5 @@ const ae = (v) => {
|
|
|
122
124
|
};
|
|
123
125
|
};
|
|
124
126
|
export {
|
|
125
|
-
|
|
127
|
+
ie as useHighlightLineChartLogic
|
|
126
128
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import { humanizeLabel as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
1
|
+
import { R as z, T as H, A as Z } from "../../../AnimatedTheme-BOKdw2Oy.js";
|
|
2
|
+
import { useThemeProps as $, useTheme as j } from "@mui/material";
|
|
3
|
+
import U from "lodash";
|
|
4
|
+
import { useId as q, useRef as J, useEffect as K } from "react";
|
|
5
|
+
import { humanizeLabel as Q } from "../_common/format.js";
|
|
6
|
+
import { attachCombinedAxisTooltip as ee } from "../_common/tooltip.js";
|
|
7
|
+
import { colorSetFromPalette as te, applyValueFormat as re } from "../_common/utils.js";
|
|
8
|
+
import { c as p, p as D, b as V } from "../../../Entity-CCUIdRAr.js";
|
|
9
|
+
import { X as oe, V as se } from "../../../AxisRenderer-lUbezuh7.js";
|
|
10
|
+
import { D as ae } from "../../../DateAxis-zNtbSVjW.js";
|
|
11
|
+
import { A as _, a as ie } from "../../../AxisRendererY-DbSiyb45.js";
|
|
12
|
+
import { C as ne } from "../../../CategoryAxis-B8KQp1pE.js";
|
|
13
|
+
import { L as le } from "../../../LineSeries-BLFvwrLT.js";
|
|
14
|
+
import { D as me } from "../../../DataProcessor-CvIe9BVn.js";
|
|
15
|
+
import { B as de } from "../../../Bullet-PgoNb3Jv.js";
|
|
16
|
+
import { C as pe } from "../../../Circle-BWRdiMpG.js";
|
|
17
|
+
import { X as ce } from "../../../XYCursor-gHAo40xC.js";
|
|
18
|
+
import { L as ue } from "../../../Legend-kbCFjJAW.js";
|
|
19
|
+
const B = 1.1, fe = {
|
|
19
20
|
millisecond: 1,
|
|
20
21
|
second: 1e3,
|
|
21
22
|
minute: 6e4,
|
|
@@ -24,43 +25,34 @@ const R = 1.1, Ae = {
|
|
|
24
25
|
week: 6048e5,
|
|
25
26
|
month: 2592e6,
|
|
26
27
|
year: 31536e6
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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;
|
|
28
|
+
}, Ue = (G) => {
|
|
29
|
+
const X = $({ props: G, name: "HCLineChart" }), {
|
|
30
|
+
dimensions: t,
|
|
31
|
+
values: m,
|
|
32
|
+
data: g,
|
|
33
|
+
initDelay: P = 0,
|
|
34
|
+
baseInterval: i,
|
|
35
|
+
colors: b,
|
|
36
|
+
connectMissingData: k = !0,
|
|
37
|
+
sx: R,
|
|
38
|
+
...W
|
|
39
|
+
} = X, l = j(), L = `hc-line-chart-${q().replace(/:/g, "")}`, v = J(null);
|
|
40
|
+
let A = null;
|
|
41
|
+
t.length < 1 ? A = "Missing dimensions config!" : m.length < 1 && (A = "Missing values config!"), K(() => {
|
|
42
|
+
if (A) return;
|
|
51
43
|
let C;
|
|
52
44
|
return C = setTimeout(() => {
|
|
53
|
-
var
|
|
54
|
-
const e =
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
e.setThemes([
|
|
58
|
-
text:
|
|
59
|
-
grid:
|
|
60
|
-
stroke:
|
|
45
|
+
var Y, O, I, M;
|
|
46
|
+
const e = z.new(L);
|
|
47
|
+
v.current = e;
|
|
48
|
+
const S = H.new(e);
|
|
49
|
+
e.setThemes([Z.new(e), S]), e.interfaceColors.setAll({
|
|
50
|
+
text: p(l.palette.text.primary),
|
|
51
|
+
grid: p(l.palette.divider),
|
|
52
|
+
stroke: p(l.palette.divider)
|
|
61
53
|
});
|
|
62
|
-
const
|
|
63
|
-
|
|
54
|
+
const o = e.container.children.push(
|
|
55
|
+
oe.new(e, {
|
|
64
56
|
panX: !0,
|
|
65
57
|
panY: !0,
|
|
66
58
|
wheelX: "none",
|
|
@@ -71,170 +63,127 @@ const R = 1.1, Ae = {
|
|
|
71
63
|
pinchZoomX: !0
|
|
72
64
|
})
|
|
73
65
|
);
|
|
74
|
-
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
o.set("colors", te(e, b));
|
|
67
|
+
let n, c = g;
|
|
68
|
+
t[0].type === "date" ? (n = o.xAxes.push(
|
|
69
|
+
ae.new(e, {
|
|
78
70
|
maxDeviation: 0.1,
|
|
79
71
|
groupData: !1,
|
|
80
|
-
baseInterval:
|
|
81
|
-
renderer:
|
|
72
|
+
baseInterval: i || { timeUnit: "day", count: 1 },
|
|
73
|
+
renderer: _.new(e, {})
|
|
82
74
|
})
|
|
83
|
-
),
|
|
84
|
-
|
|
85
|
-
categoryField:
|
|
86
|
-
renderer:
|
|
75
|
+
), c = U.orderBy(g, [t[0].value])) : (n = o.xAxes.push(
|
|
76
|
+
ne.new(e, {
|
|
77
|
+
categoryField: t[0].value,
|
|
78
|
+
renderer: _.new(e, {})
|
|
87
79
|
})
|
|
88
80
|
), e.numberFormatter.setAll({
|
|
89
81
|
numberFormat: "#",
|
|
90
82
|
numericFields: ["valueX"]
|
|
91
|
-
}),
|
|
92
|
-
const N =
|
|
93
|
-
|
|
94
|
-
renderer:
|
|
83
|
+
}), c = U.orderBy(g, [t[0].value]), n.data.setAll(c));
|
|
84
|
+
const N = o.yAxes.push(
|
|
85
|
+
se.new(e, {
|
|
86
|
+
renderer: ie.new(e, {})
|
|
95
87
|
})
|
|
96
88
|
);
|
|
97
|
-
(
|
|
98
|
-
stroke:
|
|
89
|
+
(Y = n.get("renderer")) == null || Y.grid.template.setAll({
|
|
90
|
+
stroke: p(l.palette.divider),
|
|
99
91
|
strokeOpacity: 1
|
|
100
|
-
}), (O =
|
|
101
|
-
stroke:
|
|
92
|
+
}), (O = n.get("renderer")) == null || O.labels.template.setAll({ paddingTop: 12 }), (I = N.get("renderer")) == null || I.grid.template.setAll({
|
|
93
|
+
stroke: p(l.palette.divider),
|
|
102
94
|
strokeOpacity: 1
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
|
|
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, {
|
|
95
|
+
}), m.forEach((s) => {
|
|
96
|
+
const a = o.series.push(
|
|
97
|
+
le.new(e, {
|
|
157
98
|
// Legend/tooltip label: explicit override, else humanize the raw
|
|
158
99
|
// backend field (snake_case / lowercase → Title Case).
|
|
159
|
-
name:
|
|
160
|
-
xAxis:
|
|
100
|
+
name: s.label ?? Q(s.name),
|
|
101
|
+
xAxis: n,
|
|
161
102
|
yAxis: N,
|
|
162
|
-
valueYField:
|
|
103
|
+
valueYField: s.dataFieldName,
|
|
163
104
|
// When false, the line breaks at missing points. On a date axis the
|
|
164
105
|
// break is auto-detected when adjacent points are spaced more than
|
|
165
106
|
// `autoGapCount` (default 1.1) base intervals apart, so absent dates
|
|
166
107
|
// surface as gaps instead of being bridged by a straight segment.
|
|
167
|
-
connect:
|
|
168
|
-
autoGapCount:
|
|
169
|
-
...
|
|
108
|
+
connect: k,
|
|
109
|
+
autoGapCount: B,
|
|
110
|
+
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
|
|
170
111
|
})
|
|
171
112
|
);
|
|
172
|
-
if (
|
|
113
|
+
if (t[0].type === "date" && (a.data.processor = me.new(e, {
|
|
173
114
|
dateFormat: "i",
|
|
174
|
-
dateFields: [
|
|
175
|
-
})),
|
|
176
|
-
const
|
|
177
|
-
t: new Date(
|
|
178
|
-
hasValue:
|
|
179
|
-
})).filter((
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
}),
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
186
|
-
return
|
|
187
|
-
sprite:
|
|
115
|
+
dateFields: [t[0].value]
|
|
116
|
+
})), t[0].type === "date") {
|
|
117
|
+
const y = t[0].value, x = fe[(i == null ? void 0 : i.timeUnit) ?? "day"] * ((i == null ? void 0 : i.count) ?? 1), d = k ? 1 / 0 : x * B, w = c.map((r) => ({
|
|
118
|
+
t: new Date(r[y]).getTime(),
|
|
119
|
+
hasValue: r[s.dataFieldName] !== null && r[s.dataFieldName] !== void 0
|
|
120
|
+
})).filter((r) => r.hasValue && !Number.isNaN(r.t)), T = /* @__PURE__ */ new Set();
|
|
121
|
+
w.forEach((r, f) => {
|
|
122
|
+
const F = f > 0 ? r.t - w[f - 1].t : 1 / 0, h = f < w.length - 1 ? w[f + 1].t - r.t : 1 / 0;
|
|
123
|
+
F > d && h > d && T.add(r.t);
|
|
124
|
+
}), T.size > 0 && a.bullets.push((r, f, F) => {
|
|
125
|
+
const h = F.dataContext;
|
|
126
|
+
if (T.has(new Date(h == null ? void 0 : h[y]).getTime()))
|
|
127
|
+
return de.new(r, {
|
|
128
|
+
sprite: pe.new(r, {
|
|
188
129
|
radius: 3,
|
|
189
130
|
fill: a.get("fill"),
|
|
190
|
-
stroke:
|
|
131
|
+
stroke: r.interfaceColors.get("background"),
|
|
191
132
|
strokeWidth: 1
|
|
192
133
|
})
|
|
193
134
|
});
|
|
194
135
|
});
|
|
195
136
|
}
|
|
196
|
-
a.data.setAll(
|
|
197
|
-
}),
|
|
137
|
+
a.data.setAll(c), a.strokes.template.setAll({ strokeWidth: 2 }), a.appear();
|
|
138
|
+
}), o.set(
|
|
198
139
|
"cursor",
|
|
199
|
-
|
|
200
|
-
).lineY.set("visible", !1)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
140
|
+
ce.new(e, { xAxis: n, behavior: "none" })
|
|
141
|
+
).lineY.set("visible", !1), ee({
|
|
142
|
+
root: e,
|
|
143
|
+
chart: o,
|
|
144
|
+
xAxis: n,
|
|
145
|
+
theme: l,
|
|
146
|
+
isDateAxis: t[0].type === "date",
|
|
147
|
+
baseInterval: i,
|
|
148
|
+
follow: !0
|
|
149
|
+
});
|
|
150
|
+
const u = o.bottomAxesContainer.children.push(
|
|
151
|
+
ue.new(e, {
|
|
152
|
+
width: D(100),
|
|
204
153
|
paddingTop: 10,
|
|
205
|
-
centerX:
|
|
206
|
-
x:
|
|
154
|
+
centerX: D(50),
|
|
155
|
+
x: D(50),
|
|
207
156
|
layout: e.gridLayout
|
|
208
157
|
})
|
|
209
158
|
);
|
|
210
|
-
|
|
211
|
-
var
|
|
212
|
-
const a =
|
|
213
|
-
|
|
214
|
-
|
|
159
|
+
u.itemContainers.template.events.on("pointerover", function(s) {
|
|
160
|
+
var x;
|
|
161
|
+
const a = s.target, y = (x = a == null ? void 0 : a.dataItem) == null ? void 0 : x.dataContext;
|
|
162
|
+
o.series.each(function(d) {
|
|
163
|
+
d !== y ? d.strokes.template.setAll({
|
|
215
164
|
strokeOpacity: 0.15,
|
|
216
|
-
stroke:
|
|
217
|
-
}) :
|
|
165
|
+
stroke: p(0)
|
|
166
|
+
}) : d.strokes.template.setAll({ strokeWidth: 3 });
|
|
218
167
|
});
|
|
219
|
-
}),
|
|
220
|
-
|
|
221
|
-
|
|
168
|
+
}), u.itemContainers.template.events.on("pointerout", function() {
|
|
169
|
+
o.series.each(function(s) {
|
|
170
|
+
s.strokes.template.setAll({
|
|
222
171
|
strokeOpacity: 1,
|
|
223
172
|
strokeWidth: 2,
|
|
224
|
-
stroke:
|
|
173
|
+
stroke: s.get("fill")
|
|
225
174
|
});
|
|
226
175
|
});
|
|
227
|
-
}),
|
|
228
|
-
width:
|
|
176
|
+
}), u.itemContainers.template.set("width", V), u.valueLabels.template.setAll({
|
|
177
|
+
width: V,
|
|
229
178
|
textAlign: "right"
|
|
230
|
-
}),
|
|
231
|
-
},
|
|
179
|
+
}), u.data.setAll(o.series.values), re(e, (M = m == null ? void 0 : m[0]) == null ? void 0 : M.format), o.appear(1e3, 100);
|
|
180
|
+
}, P), () => {
|
|
232
181
|
var e;
|
|
233
|
-
C && clearTimeout(C), (e =
|
|
182
|
+
C && clearTimeout(C), (e = v.current) == null || e.dispose(), v.current = null;
|
|
234
183
|
};
|
|
235
|
-
}, [
|
|
236
|
-
const
|
|
237
|
-
return { chartId:
|
|
184
|
+
}, [g, t, m, l.palette.mode, b, k]);
|
|
185
|
+
const E = { ...X };
|
|
186
|
+
return { chartId: L, ownerState: E, sx: R, error: A, other: W };
|
|
238
187
|
};
|
|
239
188
|
export {
|
|
240
189
|
Ue as useLineChartLogic
|
|
@@ -1,113 +1,122 @@
|
|
|
1
|
-
import { R as C, A as
|
|
2
|
-
import { useThemeProps as
|
|
1
|
+
import { R as C, A as Y } from "../../../AnimatedTheme-BOKdw2Oy.js";
|
|
2
|
+
import { useThemeProps as R, useTheme as I } from "@mui/material";
|
|
3
3
|
import F from "lodash";
|
|
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
|
-
|
|
4
|
+
import { useId as E, useRef as O, useEffect as P } from "react";
|
|
5
|
+
import { humanizeLabel as V } from "../_common/format.js";
|
|
6
|
+
import { attachCombinedAxisTooltip as q } from "../_common/tooltip.js";
|
|
7
|
+
import { colorSetFromPalette as z, applyValueFormat as B } from "../_common/utils.js";
|
|
8
|
+
import { c as i } from "../../../Entity-CCUIdRAr.js";
|
|
9
|
+
import { X as G, V as H } from "../../../AxisRenderer-lUbezuh7.js";
|
|
10
|
+
import { X as N } from "../../../XYCursor-gHAo40xC.js";
|
|
11
|
+
import { D as U } from "../../../DateAxis-zNtbSVjW.js";
|
|
12
|
+
import { A as X, a as W } from "../../../AxisRendererY-DbSiyb45.js";
|
|
13
|
+
import { C as Z } from "../../../CategoryAxis-B8KQp1pE.js";
|
|
14
|
+
import { L as _ } from "../../../LineSeries-BLFvwrLT.js";
|
|
15
|
+
import { D as $ } from "../../../DataProcessor-CvIe9BVn.js";
|
|
16
|
+
import { S as j } from "../../../Scrollbar-BzSBcIUt.js";
|
|
17
|
+
const fe = (D) => {
|
|
18
|
+
const f = R({ props: D, name: "HCLogaritmicScale" }), {
|
|
17
19
|
dimensions: t,
|
|
18
|
-
values:
|
|
20
|
+
values: s,
|
|
19
21
|
data: l,
|
|
20
22
|
initDelay: k = 0,
|
|
21
|
-
baseInterval:
|
|
22
|
-
colors:
|
|
23
|
-
sx:
|
|
24
|
-
...
|
|
25
|
-
} = f, o =
|
|
23
|
+
baseInterval: h,
|
|
24
|
+
colors: A,
|
|
25
|
+
sx: S,
|
|
26
|
+
...L
|
|
27
|
+
} = f, o = I(), g = `hc-logaritmic-scale-${E().replace(/:/g, "")}`, p = O(null);
|
|
26
28
|
let n = null;
|
|
27
|
-
t.length < 1 ? n = "LogaritmicScale requires at least 1 dimension" :
|
|
29
|
+
t.length < 1 ? n = "LogaritmicScale requires at least 1 dimension" : s.length < 1 && (n = "LogaritmicScale requires at least 1 value"), P(() => {
|
|
28
30
|
if (n) return;
|
|
29
31
|
let d;
|
|
30
32
|
return d = setTimeout(() => {
|
|
31
|
-
var v, w,
|
|
33
|
+
var y, v, w, b;
|
|
32
34
|
const e = C.new(g);
|
|
33
|
-
|
|
35
|
+
p.current = e, e.setThemes([Y.new(e)]), e.interfaceColors.setAll({
|
|
34
36
|
text: i(o.palette.text.primary),
|
|
35
37
|
grid: i(o.palette.divider),
|
|
36
38
|
stroke: i(o.palette.divider)
|
|
37
39
|
});
|
|
38
40
|
const r = e.container.children.push(
|
|
39
|
-
|
|
41
|
+
G.new(e, {
|
|
40
42
|
panX: !0,
|
|
41
43
|
panY: !0,
|
|
42
44
|
wheelX: "none",
|
|
43
45
|
wheelY: "none",
|
|
46
|
+
maxTooltipDistance: -1,
|
|
44
47
|
pinchZoomX: !0
|
|
45
48
|
})
|
|
46
49
|
);
|
|
47
|
-
r.set("colors",
|
|
50
|
+
r.set("colors", z(e, A)), r.set(
|
|
48
51
|
"cursor",
|
|
49
|
-
|
|
52
|
+
N.new(e, { behavior: "none" })
|
|
50
53
|
).lineY.set("visible", !1);
|
|
51
|
-
let
|
|
52
|
-
t[0].type === "date" ? (m = F.orderBy(l, [t[0].value]),
|
|
53
|
-
|
|
54
|
+
let a, m = l;
|
|
55
|
+
t[0].type === "date" ? (m = F.orderBy(l, [t[0].value]), a = r.xAxes.push(
|
|
56
|
+
U.new(e, {
|
|
54
57
|
maxDeviation: 0.1,
|
|
55
58
|
groupData: !1,
|
|
56
|
-
baseInterval:
|
|
57
|
-
renderer: X.new(e, {})
|
|
58
|
-
tooltip: u.new(e, {})
|
|
59
|
+
baseInterval: h || { timeUnit: "day", count: 1 },
|
|
60
|
+
renderer: X.new(e, {})
|
|
59
61
|
})
|
|
60
|
-
), (
|
|
62
|
+
), (y = a.get("renderer")) == null || y.grid.template.setAll({
|
|
61
63
|
stroke: i(o.palette.divider),
|
|
62
64
|
strokeOpacity: 1
|
|
63
|
-
})) : (
|
|
64
|
-
|
|
65
|
+
})) : (a = r.xAxes.push(
|
|
66
|
+
Z.new(e, {
|
|
65
67
|
categoryField: t[0].value,
|
|
66
|
-
renderer: X.new(e, {})
|
|
67
|
-
tooltip: u.new(e, {})
|
|
68
|
+
renderer: X.new(e, {})
|
|
68
69
|
})
|
|
69
70
|
), e.numberFormatter.setAll({
|
|
70
71
|
numberFormat: "#",
|
|
71
72
|
numericFields: ["valueX"]
|
|
72
|
-
}), m = F.orderBy(l, [t[0].value]),
|
|
73
|
+
}), m = F.orderBy(l, [t[0].value]), a.data.setAll(m), (v = a.get("renderer")) == null || v.grid.template.setAll({
|
|
73
74
|
stroke: i(o.palette.divider),
|
|
74
75
|
strokeOpacity: 1
|
|
75
76
|
}));
|
|
76
|
-
const
|
|
77
|
-
|
|
77
|
+
const x = r.yAxes.push(
|
|
78
|
+
H.new(e, {
|
|
78
79
|
logarithmic: !0,
|
|
79
|
-
renderer:
|
|
80
|
+
renderer: W.new(e, { minorGridEnabled: !0 })
|
|
80
81
|
})
|
|
81
82
|
);
|
|
82
|
-
(
|
|
83
|
+
(w = x.get("renderer")) == null || w.grid.template.setAll({
|
|
83
84
|
stroke: i(o.palette.divider),
|
|
84
85
|
strokeOpacity: 1
|
|
85
|
-
}),
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
}), s.forEach((u) => {
|
|
87
|
+
const c = r.series.push(
|
|
88
|
+
_.new(e, {
|
|
89
|
+
name: u.label ?? V(u.name),
|
|
90
|
+
xAxis: a,
|
|
91
|
+
yAxis: x,
|
|
92
|
+
valueYField: u.dataFieldName,
|
|
93
|
+
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
|
|
93
94
|
})
|
|
94
95
|
);
|
|
95
|
-
|
|
96
|
+
c.strokes.template.setAll({ strokeWidth: 3 }), t[0].type === "date" && (c.data.processor = $.new(e, {
|
|
96
97
|
dateFormat: "i",
|
|
97
98
|
dateFields: [t[0].value]
|
|
98
|
-
})),
|
|
99
|
+
})), c.data.setAll(m), c.appear(1e3);
|
|
100
|
+
}), q({
|
|
101
|
+
root: e,
|
|
102
|
+
chart: r,
|
|
103
|
+
xAxis: a,
|
|
104
|
+
theme: o,
|
|
105
|
+
isDateAxis: t[0].type === "date",
|
|
106
|
+
baseInterval: h,
|
|
107
|
+
follow: !0
|
|
99
108
|
}), r.set(
|
|
100
109
|
"scrollbarX",
|
|
101
|
-
|
|
102
|
-
), B(e, (
|
|
110
|
+
j.new(e, { orientation: "horizontal" })
|
|
111
|
+
), B(e, (b = s == null ? void 0 : s[0]) == null ? void 0 : b.format), r.appear(1e3, 100);
|
|
103
112
|
}, k), () => {
|
|
104
113
|
var e;
|
|
105
|
-
d && clearTimeout(d), (e =
|
|
114
|
+
d && clearTimeout(d), (e = p.current) == null || e.dispose(), p.current = null;
|
|
106
115
|
};
|
|
107
|
-
}, [l, t,
|
|
108
|
-
const
|
|
109
|
-
return { chartId: g, ownerState:
|
|
116
|
+
}, [l, t, s, o.palette.mode, A]);
|
|
117
|
+
const T = { ...f };
|
|
118
|
+
return { chartId: g, ownerState: T, sx: S, error: n, other: L };
|
|
110
119
|
};
|
|
111
120
|
export {
|
|
112
|
-
|
|
121
|
+
fe as useLogaritmicScaleLogic
|
|
113
122
|
};
|