@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,143 +1,155 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
1
|
+
import { R as V, A as q } from "../../../AnimatedTheme-BOKdw2Oy.js";
|
|
2
|
+
import { useThemeProps as I, useTheme as N } from "@mui/material";
|
|
3
|
+
import P from "dayjs";
|
|
4
4
|
import v from "lodash";
|
|
5
|
-
import { useId as
|
|
6
|
-
import { humanizeLabel as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
import { useId as z, useRef as H, useEffect as _ } from "react";
|
|
6
|
+
import { humanizeLabel as $ } from "../_common/format.js";
|
|
7
|
+
import { attachCombinedAxisTooltip as G } from "../_common/tooltip.js";
|
|
8
|
+
import { applyValueFormat as J, colorSetFromPalette as K } from "../_common/utils.js";
|
|
9
|
+
import { c as p, a as h, p as Q } from "../../../Entity-CCUIdRAr.js";
|
|
10
|
+
import { X as W, V as Z } from "../../../AxisRenderer-lUbezuh7.js";
|
|
11
|
+
import { A as ee, a as te } from "../../../AxisRendererY-DbSiyb45.js";
|
|
12
|
+
import { C as D } from "../../../CategoryAxis-B8KQp1pE.js";
|
|
13
|
+
import { L as re } from "../../../Legend-kbCFjJAW.js";
|
|
14
|
+
import { X as oe } from "../../../XYCursor-gHAo40xC.js";
|
|
15
|
+
import { C as ae } from "../../../ColumnSeries-rgnGm-Bg.js";
|
|
16
|
+
import { B as se } from "../../../Bullet-PgoNb3Jv.js";
|
|
17
|
+
import { L as ne } from "../../../Tooltip-A_HlttXp.js";
|
|
18
|
+
const Xe = (L) => {
|
|
19
|
+
const C = I({
|
|
20
|
+
props: L,
|
|
18
21
|
name: "HCStackedColumnChart"
|
|
19
22
|
}), {
|
|
20
|
-
dimensions:
|
|
23
|
+
dimensions: u,
|
|
21
24
|
values: n,
|
|
22
|
-
data:
|
|
23
|
-
initDelay:
|
|
24
|
-
baseInterval:
|
|
25
|
+
data: w,
|
|
26
|
+
initDelay: R = 0,
|
|
27
|
+
baseInterval: d,
|
|
25
28
|
colors: k,
|
|
26
|
-
sx:
|
|
27
|
-
...
|
|
28
|
-
} =
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
if (
|
|
32
|
-
let
|
|
33
|
-
return
|
|
34
|
-
var
|
|
35
|
-
const e =
|
|
36
|
-
x.current = e,
|
|
37
|
-
text: p(
|
|
38
|
-
grid: p(
|
|
39
|
-
stroke: p(
|
|
29
|
+
sx: O,
|
|
30
|
+
...B
|
|
31
|
+
} = C, i = N(), T = `hc-stacked-column-chart-${z().replace(/:/g, "")}`, x = H(null);
|
|
32
|
+
let f = null;
|
|
33
|
+
u.length < 2 ? f = "StackedColumnChart requires at least 2 dimensions" : n.length < 1 && (f = "StackedColumnChart requires at least 1 value"), _(() => {
|
|
34
|
+
if (f) return;
|
|
35
|
+
let A;
|
|
36
|
+
return A = setTimeout(() => {
|
|
37
|
+
var F, S, b;
|
|
38
|
+
const e = V.new(T);
|
|
39
|
+
x.current = e, J(e, (F = n == null ? void 0 : n[0]) == null ? void 0 : F.format), e.setThemes([q.new(e)]), e.interfaceColors.setAll({
|
|
40
|
+
text: p(i.palette.text.primary),
|
|
41
|
+
grid: p(i.palette.divider),
|
|
42
|
+
stroke: p(i.palette.divider)
|
|
40
43
|
});
|
|
41
|
-
const
|
|
42
|
-
|
|
44
|
+
const o = e.container.children.push(
|
|
45
|
+
W.new(e, {
|
|
43
46
|
panX: !1,
|
|
44
47
|
panY: !1,
|
|
45
48
|
wheelX: "none",
|
|
46
49
|
wheelY: "none",
|
|
50
|
+
maxTooltipDistance: -1,
|
|
47
51
|
layout: e.verticalLayout
|
|
48
52
|
})
|
|
49
53
|
);
|
|
50
|
-
|
|
51
|
-
const Y =
|
|
54
|
+
o.set("colors", K(e, k)), o.get("colors", {}).set("step", 2);
|
|
55
|
+
const Y = ee.new(e, {});
|
|
52
56
|
Y.grid.template.setAll({ location: 1 });
|
|
53
|
-
const
|
|
54
|
-
let
|
|
55
|
-
if (
|
|
56
|
-
const t = (
|
|
57
|
-
let
|
|
58
|
-
t === "month" ?
|
|
57
|
+
const a = u[0], M = u[1];
|
|
58
|
+
let l, c = w;
|
|
59
|
+
if (a.type === "date") {
|
|
60
|
+
const t = (d == null ? void 0 : d.timeUnit) || "day";
|
|
61
|
+
let s = "DD/MM/YYYY";
|
|
62
|
+
t === "month" ? s = "MM YYYY" : t === "year" && (s = "YYYY"), l = o.xAxes.push(
|
|
59
63
|
D.new(e, {
|
|
60
|
-
categoryField:
|
|
61
|
-
renderer: Y
|
|
62
|
-
tooltip: R.new(e, {})
|
|
64
|
+
categoryField: a.value,
|
|
65
|
+
renderer: Y
|
|
63
66
|
})
|
|
64
|
-
),
|
|
67
|
+
), c = v.orderBy(c, [a.value]), c = c.map((r) => ({
|
|
65
68
|
...r,
|
|
66
|
-
[
|
|
69
|
+
[a.value]: P(r[a.value]).format(s)
|
|
67
70
|
}));
|
|
68
71
|
} else
|
|
69
|
-
|
|
72
|
+
l = o.xAxes.push(
|
|
70
73
|
D.new(e, {
|
|
71
|
-
categoryField:
|
|
72
|
-
renderer: Y
|
|
73
|
-
tooltip: R.new(e, {})
|
|
74
|
+
categoryField: a.value,
|
|
75
|
+
renderer: Y
|
|
74
76
|
})
|
|
75
77
|
);
|
|
76
|
-
const
|
|
77
|
-
Object.keys(
|
|
78
|
-
|
|
79
|
-
const r = a
|
|
80
|
-
|
|
81
|
-
[
|
|
82
|
-
[t]:
|
|
83
|
-
}) :
|
|
84
|
-
...
|
|
85
|
-
[t]:
|
|
78
|
+
const m = [], y = v.groupBy(c, M.value);
|
|
79
|
+
Object.keys(y).forEach((t) => {
|
|
80
|
+
y[t].forEach((s) => {
|
|
81
|
+
const r = s[a.value], g = v.findIndex(m, { [a.value]: r });
|
|
82
|
+
g === -1 ? m.push({
|
|
83
|
+
[a.value]: r,
|
|
84
|
+
[t]: s[n[0].dataFieldName]
|
|
85
|
+
}) : m[g] = {
|
|
86
|
+
...m[g],
|
|
87
|
+
[t]: s[n[0].dataFieldName]
|
|
86
88
|
};
|
|
87
89
|
});
|
|
88
|
-
}),
|
|
89
|
-
const
|
|
90
|
-
|
|
90
|
+
}), l.data.setAll(m);
|
|
91
|
+
const X = o.yAxes.push(
|
|
92
|
+
Z.new(e, {
|
|
91
93
|
min: 0,
|
|
92
|
-
renderer:
|
|
94
|
+
renderer: te.new(e, { strokeOpacity: 0.1 })
|
|
93
95
|
})
|
|
94
|
-
),
|
|
95
|
-
|
|
96
|
-
centerX:
|
|
97
|
-
x:
|
|
96
|
+
), j = o.children.push(
|
|
97
|
+
re.new(e, {
|
|
98
|
+
centerX: h,
|
|
99
|
+
x: h
|
|
98
100
|
})
|
|
99
101
|
);
|
|
100
|
-
(S =
|
|
101
|
-
stroke: p(
|
|
102
|
+
(S = l.get("renderer")) == null || S.grid.template.setAll({
|
|
103
|
+
stroke: p(i.palette.divider),
|
|
102
104
|
strokeOpacity: 1
|
|
103
|
-
}), (
|
|
104
|
-
stroke: p(
|
|
105
|
+
}), (b = X.get("renderer")) == null || b.grid.template.setAll({
|
|
106
|
+
stroke: p(i.palette.divider),
|
|
105
107
|
strokeOpacity: 1
|
|
106
108
|
});
|
|
107
|
-
function
|
|
108
|
-
const r =
|
|
109
|
+
function U(t, s) {
|
|
110
|
+
const r = o.series.push(
|
|
109
111
|
ae.new(e, {
|
|
110
112
|
name: t,
|
|
111
113
|
stacked: !0,
|
|
112
|
-
xAxis:
|
|
113
|
-
yAxis:
|
|
114
|
-
valueYField:
|
|
115
|
-
categoryXField:
|
|
114
|
+
xAxis: l,
|
|
115
|
+
yAxis: X,
|
|
116
|
+
valueYField: s,
|
|
117
|
+
categoryXField: a.value
|
|
116
118
|
})
|
|
117
119
|
);
|
|
118
120
|
r.columns.template.setAll({
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}), r.data.setAll(i), r.appear(), r.bullets.push(function() {
|
|
121
|
+
tooltipY: Q(10)
|
|
122
|
+
}), r.data.setAll(m), r.appear(), r.bullets.push(function() {
|
|
122
123
|
return se.new(e, {
|
|
123
|
-
sprite:
|
|
124
|
+
sprite: ne.new(e, {
|
|
124
125
|
fill: e.interfaceColors.get("alternativeText"),
|
|
125
|
-
centerY:
|
|
126
|
-
centerX:
|
|
126
|
+
centerY: h,
|
|
127
|
+
centerX: h,
|
|
127
128
|
populateText: !0
|
|
128
129
|
})
|
|
129
130
|
});
|
|
130
|
-
}),
|
|
131
|
+
}), j.data.push(r);
|
|
131
132
|
}
|
|
132
|
-
Object.keys(
|
|
133
|
-
|
|
133
|
+
Object.keys(y).forEach((t) => U($(t), t)), o.set(
|
|
134
|
+
"cursor",
|
|
135
|
+
oe.new(e, { xAxis: l, behavior: "none" })
|
|
136
|
+
).lineY.set("visible", !1), G({
|
|
137
|
+
root: e,
|
|
138
|
+
chart: o,
|
|
139
|
+
xAxis: l,
|
|
140
|
+
theme: i,
|
|
141
|
+
isDateAxis: !1,
|
|
142
|
+
baseInterval: d,
|
|
143
|
+
follow: !0
|
|
144
|
+
}), o.appear(1e3, 100);
|
|
145
|
+
}, R), () => {
|
|
134
146
|
var e;
|
|
135
|
-
|
|
147
|
+
A && clearTimeout(A), (e = x.current) == null || e.dispose(), x.current = null;
|
|
136
148
|
};
|
|
137
|
-
}, [
|
|
138
|
-
const
|
|
139
|
-
return { chartId: T, ownerState:
|
|
149
|
+
}, [w, u, n, i.palette.mode, k]);
|
|
150
|
+
const E = { ...C };
|
|
151
|
+
return { chartId: T, ownerState: E, sx: O, error: f, other: B };
|
|
140
152
|
};
|
|
141
153
|
export {
|
|
142
|
-
|
|
154
|
+
Xe as useStackedColumnChartLogic
|
|
143
155
|
};
|
|
@@ -1,172 +1,184 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
1
|
+
import { R as P, A as V } from "../../../AnimatedTheme-BOKdw2Oy.js";
|
|
2
|
+
import { useThemeProps as W, useTheme as z } from "@mui/material";
|
|
3
|
+
import Y from "lodash";
|
|
4
|
+
import { useId as G, useRef as N, useEffect as j } from "react";
|
|
5
5
|
import { humanizeLabel as k } from "../_common/format.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { C as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
import { attachCombinedAxisTooltip as H } from "../_common/tooltip.js";
|
|
7
|
+
import { colorSetFromPalette as M, applyValueFormat as U } from "../_common/utils.js";
|
|
8
|
+
import { c, a as x, p as _ } from "../../../Entity-CCUIdRAr.js";
|
|
9
|
+
import { X as $, V as q } from "../../../AxisRenderer-lUbezuh7.js";
|
|
10
|
+
import { L as J } from "../../../Legend-kbCFjJAW.js";
|
|
11
|
+
import { D as K } from "../../../DateAxis-zNtbSVjW.js";
|
|
12
|
+
import { A as F, a as Q } from "../../../AxisRendererY-DbSiyb45.js";
|
|
13
|
+
import { C as Z } from "../../../CategoryAxis-B8KQp1pE.js";
|
|
14
|
+
import { T as ee, R as te, L as re } from "../../../Tooltip-A_HlttXp.js";
|
|
15
|
+
import { X as oe } from "../../../XYCursor-gHAo40xC.js";
|
|
16
|
+
import { C as ae } from "../../../ColumnSeries-rgnGm-Bg.js";
|
|
17
|
+
import { D as se } from "../../../DataProcessor-CvIe9BVn.js";
|
|
18
|
+
import { B as ie } from "../../../Bullet-PgoNb3Jv.js";
|
|
19
|
+
const Ye = (L) => {
|
|
20
|
+
const y = W({ props: L, name: "HCXYChart" }), {
|
|
21
|
+
dimensions: m,
|
|
19
22
|
values: n,
|
|
20
23
|
data: d,
|
|
21
24
|
initDelay: R = 0,
|
|
22
|
-
baseInterval:
|
|
23
|
-
colors:
|
|
24
|
-
sx:
|
|
25
|
-
...
|
|
26
|
-
} = y, i =
|
|
27
|
-
|
|
25
|
+
baseInterval: A,
|
|
26
|
+
colors: g,
|
|
27
|
+
sx: O,
|
|
28
|
+
...B
|
|
29
|
+
} = y, i = z(), w = `hc-xy-chart-${G().replace(/:/g, "")}`, u = N(null), b = m.length < 1 ? "Missing dimensions config!" : null;
|
|
30
|
+
j(() => {
|
|
28
31
|
if (b) return;
|
|
29
32
|
let f;
|
|
30
33
|
return f = setTimeout(() => {
|
|
31
|
-
var
|
|
32
|
-
const e =
|
|
33
|
-
u.current = e, e.setThemes([
|
|
34
|
-
text:
|
|
35
|
-
grid:
|
|
36
|
-
stroke:
|
|
34
|
+
var T, D, X;
|
|
35
|
+
const e = P.new(w);
|
|
36
|
+
u.current = e, e.setThemes([V.new(e)]), e.interfaceColors.setAll({
|
|
37
|
+
text: c(i.palette.text.primary),
|
|
38
|
+
grid: c(i.palette.divider),
|
|
39
|
+
stroke: c(i.palette.divider)
|
|
37
40
|
});
|
|
38
|
-
const
|
|
39
|
-
|
|
41
|
+
const r = e.container.children.push(
|
|
42
|
+
$.new(e, {
|
|
40
43
|
panX: !1,
|
|
41
44
|
panY: !1,
|
|
42
45
|
wheelX: "none",
|
|
43
46
|
wheelY: "none",
|
|
47
|
+
// Let the cursor surface the combined tooltip anywhere in the plot.
|
|
48
|
+
maxTooltipDistance: -1,
|
|
44
49
|
layout: e.verticalLayout
|
|
45
50
|
})
|
|
46
51
|
);
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
centerX:
|
|
51
|
-
x
|
|
52
|
+
r.set("colors", M(e, g));
|
|
53
|
+
const E = r.children.push(
|
|
54
|
+
J.new(e, {
|
|
55
|
+
centerX: x,
|
|
56
|
+
x
|
|
52
57
|
})
|
|
53
|
-
), a =
|
|
54
|
-
let
|
|
58
|
+
), a = m[0];
|
|
59
|
+
let o, p = d;
|
|
55
60
|
if (a.type === "date")
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
o = r.xAxes.push(
|
|
62
|
+
K.new(e, {
|
|
58
63
|
maxDeviation: 0,
|
|
59
|
-
baseInterval:
|
|
60
|
-
renderer: F.new(e, { minGridDistance: 60 })
|
|
61
|
-
tooltip: x.new(e, {})
|
|
64
|
+
baseInterval: A || { timeUnit: "day", count: 1 },
|
|
65
|
+
renderer: F.new(e, { minGridDistance: 60 })
|
|
62
66
|
})
|
|
63
|
-
),
|
|
67
|
+
), p = Y.orderBy(d, [a.value]);
|
|
64
68
|
else {
|
|
65
69
|
const t = F.new(e, {
|
|
66
70
|
cellStartLocation: 0.1,
|
|
67
71
|
cellEndLocation: 0.9,
|
|
68
72
|
minGridDistance: 30
|
|
69
73
|
});
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
o = r.xAxes.push(
|
|
75
|
+
Z.new(e, {
|
|
72
76
|
categoryField: a.value,
|
|
73
|
-
renderer: t
|
|
74
|
-
tooltip: x.new(e, {})
|
|
77
|
+
renderer: t
|
|
75
78
|
})
|
|
76
|
-
), t.grid.template.setAll({ location: 1 }),
|
|
79
|
+
), t.grid.template.setAll({ location: 1 }), o.labelsContainer.set(
|
|
77
80
|
"tooltip",
|
|
78
|
-
|
|
81
|
+
ee.new(e, { pointerOrientation: "down" })
|
|
79
82
|
), t.labels.template.setAll({
|
|
80
83
|
oversizedBehavior: "truncate",
|
|
81
84
|
maxWidth: 150,
|
|
82
85
|
tooltipText: "{category}"
|
|
83
|
-
}), t.labels.template.setup = function(
|
|
84
|
-
|
|
86
|
+
}), t.labels.template.setup = function(s) {
|
|
87
|
+
s.set(
|
|
85
88
|
"background",
|
|
86
|
-
|
|
87
|
-
fill:
|
|
89
|
+
te.new(e, {
|
|
90
|
+
fill: c(0),
|
|
88
91
|
fillOpacity: 0
|
|
89
92
|
})
|
|
90
93
|
);
|
|
91
|
-
},
|
|
92
|
-
t.labels.template.set("maxWidth",
|
|
94
|
+
}, o.onPrivate("cellWidth", function(s) {
|
|
95
|
+
t.labels.template.set("maxWidth", s);
|
|
93
96
|
}), e.numberFormatter.setAll({
|
|
94
97
|
numberFormat: "#",
|
|
95
98
|
numericFields: ["valueX"]
|
|
96
|
-
}),
|
|
99
|
+
}), o.data.setAll(p);
|
|
97
100
|
}
|
|
98
|
-
const v =
|
|
99
|
-
|
|
100
|
-
renderer:
|
|
101
|
+
const v = r.yAxes.push(
|
|
102
|
+
q.new(e, {
|
|
103
|
+
renderer: Q.new(e, { strokeOpacity: 0.1 })
|
|
101
104
|
})
|
|
102
105
|
);
|
|
103
|
-
(
|
|
104
|
-
stroke:
|
|
106
|
+
(T = o.get("renderer")) == null || T.grid.template.setAll({
|
|
107
|
+
stroke: c(i.palette.divider),
|
|
105
108
|
strokeOpacity: 1
|
|
106
|
-
}), (
|
|
107
|
-
stroke:
|
|
109
|
+
}), (D = v.get("renderer")) == null || D.grid.template.setAll({
|
|
110
|
+
stroke: c(i.palette.divider),
|
|
108
111
|
strokeOpacity: 1
|
|
109
112
|
});
|
|
110
|
-
function
|
|
111
|
-
const l =
|
|
112
|
-
|
|
113
|
+
function C(t, s, h, I) {
|
|
114
|
+
const l = r.series.push(
|
|
115
|
+
ae.new(e, {
|
|
113
116
|
name: t,
|
|
114
|
-
xAxis:
|
|
117
|
+
xAxis: o,
|
|
115
118
|
yAxis: v,
|
|
116
|
-
valueYField:
|
|
119
|
+
valueYField: I,
|
|
117
120
|
...a.type === "date" ? { valueXField: h } : { categoryXField: h }
|
|
118
121
|
})
|
|
119
122
|
);
|
|
120
123
|
l.columns.template.setAll({
|
|
121
|
-
|
|
122
|
-
width: q(90),
|
|
123
|
-
tooltipY: 0,
|
|
124
|
+
width: _(90),
|
|
124
125
|
strokeOpacity: 0
|
|
125
|
-
}), a.type === "date" && (l.data.processor =
|
|
126
|
+
}), a.type === "date" && (l.data.processor = se.new(e, {
|
|
126
127
|
dateFormat: "i",
|
|
127
128
|
dateFields: [h]
|
|
128
|
-
})), l.data.setAll(
|
|
129
|
-
return
|
|
129
|
+
})), l.data.setAll(s), l.appear(), l.bullets.push(function() {
|
|
130
|
+
return ie.new(e, {
|
|
130
131
|
locationY: 0,
|
|
131
|
-
sprite:
|
|
132
|
+
sprite: re.new(e, {
|
|
132
133
|
text: "{valueY}",
|
|
133
134
|
fill: e.interfaceColors.get("alternativeText"),
|
|
134
135
|
centerY: 0,
|
|
135
|
-
centerX:
|
|
136
|
+
centerX: x,
|
|
136
137
|
populateText: !0
|
|
137
138
|
})
|
|
138
139
|
});
|
|
139
|
-
}),
|
|
140
|
+
}), E.data.push(l);
|
|
140
141
|
}
|
|
141
|
-
if (
|
|
142
|
+
if (m.length === 1)
|
|
142
143
|
n.forEach((t) => {
|
|
143
|
-
|
|
144
|
+
C(
|
|
144
145
|
t.label ?? k(t.name),
|
|
145
|
-
|
|
146
|
+
p,
|
|
146
147
|
a.value,
|
|
147
148
|
t.dataFieldName
|
|
148
149
|
);
|
|
149
150
|
});
|
|
150
151
|
else {
|
|
151
|
-
const t =
|
|
152
|
-
Object.keys(t).forEach((
|
|
153
|
-
|
|
154
|
-
k(
|
|
155
|
-
t[
|
|
152
|
+
const t = Y.groupBy(p, m[1].value);
|
|
153
|
+
Object.keys(t).forEach((s) => {
|
|
154
|
+
C(
|
|
155
|
+
k(s),
|
|
156
|
+
t[s],
|
|
156
157
|
a.value,
|
|
157
158
|
n[0].dataFieldName
|
|
158
159
|
);
|
|
159
160
|
});
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
+
r.set(
|
|
163
|
+
"cursor",
|
|
164
|
+
oe.new(e, { xAxis: o, behavior: "none" })
|
|
165
|
+
).lineY.set("visible", !1), H({
|
|
166
|
+
root: e,
|
|
167
|
+
chart: r,
|
|
168
|
+
xAxis: o,
|
|
169
|
+
theme: i,
|
|
170
|
+
isDateAxis: a.type === "date",
|
|
171
|
+
baseInterval: A,
|
|
172
|
+
follow: !0
|
|
173
|
+
}), U(e, (X = n == null ? void 0 : n[0]) == null ? void 0 : X.format), r.appear(1e3, 100);
|
|
162
174
|
}, R), () => {
|
|
163
175
|
var e;
|
|
164
176
|
f && clearTimeout(f), (e = u.current) == null || e.dispose(), u.current = null;
|
|
165
177
|
};
|
|
166
|
-
}, [d,
|
|
167
|
-
const
|
|
168
|
-
return { chartId:
|
|
178
|
+
}, [d, m, n, i.palette.mode, g]);
|
|
179
|
+
const S = { ...y };
|
|
180
|
+
return { chartId: w, ownerState: S, sx: O, error: b, other: B };
|
|
169
181
|
};
|
|
170
182
|
export {
|
|
171
|
-
|
|
183
|
+
Ye as useXYChartLogic
|
|
172
184
|
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
-
import { R as u, A
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { X as
|
|
6
|
-
import { C as
|
|
7
|
-
import { A as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { L as
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import { R as u, A } from "../../AnimatedTheme-BOKdw2Oy.js";
|
|
3
|
+
import { useTheme as g, alpha as v } from "@mui/material";
|
|
4
|
+
import { useRef as w, useLayoutEffect as x } from "react";
|
|
5
|
+
import { X as y, V as R } from "../../AxisRenderer-lUbezuh7.js";
|
|
6
|
+
import { C as L } from "../../CategoryAxis-B8KQp1pE.js";
|
|
7
|
+
import { A as T, a as b } from "../../AxisRendererY-DbSiyb45.js";
|
|
8
|
+
import { T as X } from "../../Tooltip-A_HlttXp.js";
|
|
9
|
+
import { C } from "../../ColumnSeries-rgnGm-Bg.js";
|
|
10
|
+
import { c as a } from "../../Entity-CCUIdRAr.js";
|
|
11
|
+
import { L as Y } from "../../LineSeries-BLFvwrLT.js";
|
|
12
|
+
import { L as F } from "../../LinearGradient-C7rnipF7.js";
|
|
13
|
+
const z = ({
|
|
14
|
+
data: o,
|
|
14
15
|
type: p,
|
|
15
16
|
inset: d = !1,
|
|
16
17
|
gradient: m = !1
|
|
17
18
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
if (!
|
|
21
|
-
const e = u.new(
|
|
19
|
+
const l = w(null), t = g();
|
|
20
|
+
return x(() => {
|
|
21
|
+
if (!l.current) return;
|
|
22
|
+
const e = u.new(l.current);
|
|
22
23
|
e.setThemes([A.new(e)]);
|
|
23
24
|
const i = e.container.children.push(
|
|
24
|
-
|
|
25
|
+
y.new(e, {
|
|
25
26
|
panX: !1,
|
|
26
27
|
panY: !1,
|
|
27
28
|
wheelX: "none",
|
|
@@ -32,21 +33,21 @@ const q = ({
|
|
|
32
33
|
paddingBottom: 0
|
|
33
34
|
})
|
|
34
35
|
), s = i.xAxes.push(
|
|
35
|
-
|
|
36
|
+
L.new(e, {
|
|
36
37
|
categoryField: "t",
|
|
37
|
-
renderer:
|
|
38
|
+
renderer: T.new(e, {
|
|
38
39
|
minGridDistance: 10
|
|
39
40
|
}),
|
|
40
|
-
tooltip:
|
|
41
|
+
tooltip: X.new(e, {})
|
|
41
42
|
})
|
|
42
43
|
), c = s.get("renderer");
|
|
43
44
|
c.grid.template.set("visible", !1), c.labels.template.set("visible", !1), s.setAll({
|
|
44
45
|
startLocation: 0.5,
|
|
45
46
|
endLocation: 0.5
|
|
46
|
-
}), s.data.setAll(
|
|
47
|
+
}), s.data.setAll(o);
|
|
47
48
|
const n = i.yAxes.push(
|
|
48
|
-
|
|
49
|
-
renderer:
|
|
49
|
+
R.new(e, {
|
|
50
|
+
renderer: b.new(e, {})
|
|
50
51
|
})
|
|
51
52
|
), f = n.get("renderer");
|
|
52
53
|
f.grid.template.set("visible", !1), f.labels.template.set("visible", !1);
|
|
@@ -72,7 +73,7 @@ const q = ({
|
|
|
72
73
|
valueYField: "v",
|
|
73
74
|
categoryXField: "t",
|
|
74
75
|
// @ts-expect-error amcharts5 typing accepts string/Color; alpha returns rgba string
|
|
75
|
-
fill:
|
|
76
|
+
fill: v(t.palette.divider, 0.25),
|
|
76
77
|
stroke: a(t.palette.divider)
|
|
77
78
|
})
|
|
78
79
|
), r.strokes.template.setAll({
|
|
@@ -89,13 +90,13 @@ const q = ({
|
|
|
89
90
|
]
|
|
90
91
|
})
|
|
91
92
|
}
|
|
92
|
-
})), r.data.setAll(
|
|
93
|
+
})), r.data.setAll(o), r.appear(1e3), i.appear(1e3, 100), () => {
|
|
93
94
|
e.dispose();
|
|
94
95
|
};
|
|
95
|
-
}, [
|
|
96
|
+
}, [o, p, d, m, t.palette.mode, t.palette.divider]), /* @__PURE__ */ h(
|
|
96
97
|
"div",
|
|
97
98
|
{
|
|
98
|
-
ref:
|
|
99
|
+
ref: l,
|
|
99
100
|
style: d ? { width: "100%", height: "100%" } : {
|
|
100
101
|
width: "calc(100% + 10px)",
|
|
101
102
|
height: "100%",
|
|
@@ -106,5 +107,5 @@ const q = ({
|
|
|
106
107
|
);
|
|
107
108
|
};
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
+
z as MetricChart
|
|
110
111
|
};
|
|
@@ -42,7 +42,7 @@ const G = (t) => {
|
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ n(r, { direction: "row", alignItems: "baseline", spacing: 0.5, children: [
|
|
44
44
|
/* @__PURE__ */ e(z, { variant: "h4", ownerState: i, children: y }),
|
|
45
|
-
l && /* @__PURE__ */ e(V, { variant: "h5", children: l })
|
|
45
|
+
l && /* @__PURE__ */ e(V, { variant: "h5", ownerState: i, children: l })
|
|
46
46
|
] }),
|
|
47
47
|
T && /* @__PURE__ */ n(k, { ownerState: i, children: [
|
|
48
48
|
d === "overlay" && t.showTrend && /* @__PURE__ */ e(S, { size: 16 }),
|