@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
|
@@ -2,44 +2,40 @@ import { R as M, A as O } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
|
2
2
|
import { useThemeProps as B, useTheme as E } from "@mui/material";
|
|
3
3
|
import P from "lodash";
|
|
4
4
|
import { useId as V, useRef as G, useEffect as N } from "react";
|
|
5
|
-
import { humanizeLabel as
|
|
5
|
+
import { humanizeLabel as k } from "../_common/format.js";
|
|
6
6
|
import { attachCombinedAxisTooltip as W } from "../_common/tooltip.js";
|
|
7
|
-
import {
|
|
8
|
-
import { c as l, p as U, a as D } from "../../../Entity-BJCuhdq_.js";
|
|
7
|
+
import { applyInterfaceColors as q, colorSetFromPalette as z, applyDateAxisLabelFormat as H, applyValueFormat as U } from "../_common/utils.js";
|
|
9
8
|
import { X as _, V as $ } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
10
|
-
import { A as
|
|
11
|
-
import {
|
|
12
|
-
import { C as K } from "../../../
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
9
|
+
import { A as D, a as j } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
10
|
+
import { c as u, p as J, a as b } from "../../../Entity-BJCuhdq_.js";
|
|
11
|
+
import { C as K } from "../../../CategoryAxis-B6NqW8qd.js";
|
|
12
|
+
import { C as Q } from "../../../ColumnSeries-CtRTsn-E.js";
|
|
13
|
+
import { D as X, G as Z } from "../../../GaplessDateAxis-B2g2jgSG.js";
|
|
14
|
+
import { L as ee } from "../../../LineSeries-D_IL2qGF.js";
|
|
15
|
+
import { B as te } from "../../../Bullet-Djj7Vs9T.js";
|
|
16
|
+
import { C as re } from "../../../Circle-BnfBNKBD.js";
|
|
17
|
+
import { X as ae } from "../../../XYCursor-CVUSpqb9.js";
|
|
18
|
+
import { L as se } from "../../../Legend-CFvQiIfn.js";
|
|
19
|
+
import { D as oe } from "../../../DateAxis-DEXKps1S.js";
|
|
20
|
+
const Le = (L) => {
|
|
21
21
|
const f = B({ props: L, name: "HCColumnLineMix" }), {
|
|
22
22
|
dimensions: t,
|
|
23
|
-
values:
|
|
24
|
-
data:
|
|
23
|
+
values: l,
|
|
24
|
+
data: m,
|
|
25
25
|
initDelay: Y = 0,
|
|
26
|
-
baseInterval:
|
|
27
|
-
colors:
|
|
26
|
+
baseInterval: h,
|
|
27
|
+
colors: x,
|
|
28
28
|
skipEmptyDates: A = !1,
|
|
29
29
|
sx: T,
|
|
30
30
|
...R
|
|
31
|
-
} = f,
|
|
31
|
+
} = f, i = E(), y = `hc-column-line-mix-${V().replace(/:/g, "")}`, p = G(null), g = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
|
|
32
32
|
N(() => {
|
|
33
|
-
if (
|
|
34
|
-
let
|
|
35
|
-
return
|
|
36
|
-
var w, F, v,
|
|
37
|
-
const e = M.new(
|
|
38
|
-
|
|
39
|
-
text: l(o.palette.text.primary),
|
|
40
|
-
grid: l(o.palette.divider),
|
|
41
|
-
stroke: l(o.palette.divider)
|
|
42
|
-
});
|
|
33
|
+
if (g) return;
|
|
34
|
+
let d;
|
|
35
|
+
return d = setTimeout(() => {
|
|
36
|
+
var w, F, v, C;
|
|
37
|
+
const e = M.new(y);
|
|
38
|
+
p.current = e, e.setThemes([O.new(e)]), q(e, i);
|
|
43
39
|
const r = e.container.children.push(
|
|
44
40
|
_.new(e, {
|
|
45
41
|
panX: !1,
|
|
@@ -51,70 +47,70 @@ const Xe = (L) => {
|
|
|
51
47
|
layout: e.verticalLayout
|
|
52
48
|
})
|
|
53
49
|
);
|
|
54
|
-
r.set("colors",
|
|
55
|
-
let a,
|
|
50
|
+
r.set("colors", z(e, x)), r.get("colors", {}).set("step", 3);
|
|
51
|
+
let a, n = m;
|
|
56
52
|
if (t[0].type === "date") {
|
|
57
|
-
|
|
58
|
-
const
|
|
53
|
+
n = P.orderBy(m, [t[0].value]);
|
|
54
|
+
const o = A ? Z : oe;
|
|
59
55
|
a = r.xAxes.push(
|
|
60
|
-
|
|
56
|
+
o.new(e, {
|
|
61
57
|
maxDeviation: 0.1,
|
|
62
58
|
groupData: !1,
|
|
63
|
-
baseInterval:
|
|
64
|
-
renderer:
|
|
59
|
+
baseInterval: h || { timeUnit: "day", count: 1 },
|
|
60
|
+
renderer: D.new(e, {})
|
|
65
61
|
})
|
|
66
62
|
), (w = a.get("renderer")) == null || w.grid.template.setAll({
|
|
67
|
-
stroke:
|
|
63
|
+
stroke: u(i.palette.divider),
|
|
68
64
|
strokeOpacity: 1
|
|
69
|
-
}),
|
|
65
|
+
}), H(a, t[0]);
|
|
70
66
|
} else
|
|
71
67
|
a = r.xAxes.push(
|
|
72
|
-
|
|
68
|
+
K.new(e, {
|
|
73
69
|
categoryField: t[0].value,
|
|
74
|
-
renderer:
|
|
70
|
+
renderer: D.new(e, {})
|
|
75
71
|
})
|
|
76
72
|
), (F = a.get("renderer")) == null || F.grid.template.setAll({
|
|
77
|
-
stroke:
|
|
73
|
+
stroke: u(i.palette.divider),
|
|
78
74
|
strokeOpacity: 1
|
|
79
75
|
}), e.numberFormatter.setAll({
|
|
80
76
|
numberFormat: "#",
|
|
81
77
|
numericFields: ["valueX"]
|
|
82
|
-
}), a.data.setAll(
|
|
83
|
-
const
|
|
78
|
+
}), a.data.setAll(n);
|
|
79
|
+
const c = r.yAxes.push(
|
|
84
80
|
$.new(e, {
|
|
85
81
|
min: 0,
|
|
86
82
|
extraMax: 0.1,
|
|
87
83
|
renderer: j.new(e, { strokeOpacity: 0.1 })
|
|
88
84
|
})
|
|
89
85
|
);
|
|
90
|
-
(v =
|
|
91
|
-
stroke:
|
|
86
|
+
(v = c.get("renderer")) == null || v.grid.template.setAll({
|
|
87
|
+
stroke: u(i.palette.divider),
|
|
92
88
|
strokeOpacity: 1
|
|
93
|
-
}),
|
|
89
|
+
}), l.forEach((o, I) => {
|
|
94
90
|
if (I === 0) {
|
|
95
91
|
const s = r.series.push(
|
|
96
|
-
|
|
97
|
-
name:
|
|
92
|
+
Q.new(e, {
|
|
93
|
+
name: o.label ?? k(o.name),
|
|
98
94
|
xAxis: a,
|
|
99
|
-
yAxis:
|
|
100
|
-
valueYField:
|
|
95
|
+
yAxis: c,
|
|
96
|
+
valueYField: o.dataFieldName,
|
|
101
97
|
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
|
|
102
98
|
})
|
|
103
99
|
);
|
|
104
100
|
s.columns.template.setAll({
|
|
105
|
-
tooltipY:
|
|
101
|
+
tooltipY: J(10),
|
|
106
102
|
templateField: "columnSettings"
|
|
107
103
|
}), t[0].type === "date" && (s.data.processor = X.new(e, {
|
|
108
104
|
dateFormat: "i",
|
|
109
105
|
dateFields: [t[0].value]
|
|
110
|
-
})), s.data.setAll(
|
|
106
|
+
})), s.data.setAll(n), s.appear();
|
|
111
107
|
} else {
|
|
112
108
|
const s = r.series.push(
|
|
113
|
-
|
|
114
|
-
name:
|
|
109
|
+
ee.new(e, {
|
|
110
|
+
name: o.label ?? k(o.name),
|
|
115
111
|
xAxis: a,
|
|
116
|
-
yAxis:
|
|
117
|
-
valueYField:
|
|
112
|
+
yAxis: c,
|
|
113
|
+
valueYField: o.dataFieldName,
|
|
118
114
|
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
|
|
119
115
|
})
|
|
120
116
|
);
|
|
@@ -124,9 +120,9 @@ const Xe = (L) => {
|
|
|
124
120
|
}), t[0].type === "date" && (s.data.processor = X.new(e, {
|
|
125
121
|
dateFormat: "i",
|
|
126
122
|
dateFields: [t[0].value]
|
|
127
|
-
})), s.data.setAll(
|
|
128
|
-
return
|
|
129
|
-
sprite:
|
|
123
|
+
})), s.data.setAll(n), s.bullets.push(function() {
|
|
124
|
+
return te.new(e, {
|
|
125
|
+
sprite: re.new(e, {
|
|
130
126
|
strokeWidth: 3,
|
|
131
127
|
stroke: s.get("stroke"),
|
|
132
128
|
radius: 5,
|
|
@@ -137,29 +133,29 @@ const Xe = (L) => {
|
|
|
137
133
|
}
|
|
138
134
|
}), r.set(
|
|
139
135
|
"cursor",
|
|
140
|
-
|
|
136
|
+
ae.new(e, { xAxis: a, behavior: "none" })
|
|
141
137
|
).lineY.set("visible", !1), W({
|
|
142
138
|
root: e,
|
|
143
139
|
chart: r,
|
|
144
140
|
xAxis: a,
|
|
145
|
-
theme:
|
|
141
|
+
theme: i,
|
|
146
142
|
isDateAxis: t[0].type === "date",
|
|
147
|
-
baseInterval:
|
|
143
|
+
baseInterval: h,
|
|
148
144
|
follow: !0
|
|
149
145
|
}), r.children.push(
|
|
150
|
-
|
|
151
|
-
centerX:
|
|
152
|
-
x:
|
|
146
|
+
se.new(e, {
|
|
147
|
+
centerX: b,
|
|
148
|
+
x: b
|
|
153
149
|
})
|
|
154
|
-
).data.setAll(r.series.values),
|
|
150
|
+
).data.setAll(r.series.values), U(e, (C = l == null ? void 0 : l[0]) == null ? void 0 : C.format), r.appear(1e3, 100);
|
|
155
151
|
}, Y), () => {
|
|
156
152
|
var e;
|
|
157
|
-
|
|
153
|
+
d && clearTimeout(d), (e = p.current) == null || e.dispose(), p.current = null;
|
|
158
154
|
};
|
|
159
|
-
}, [
|
|
155
|
+
}, [m, t, l, i.palette.mode, x, A]);
|
|
160
156
|
const S = { ...f };
|
|
161
|
-
return { chartId:
|
|
157
|
+
return { chartId: y, ownerState: S, sx: T, error: g, other: R };
|
|
162
158
|
};
|
|
163
159
|
export {
|
|
164
|
-
|
|
160
|
+
Le as useColumnLineMixLogic
|
|
165
161
|
};
|
|
@@ -3,118 +3,115 @@ import { useThemeProps as z, useTheme as E } from "@mui/material";
|
|
|
3
3
|
import W from "dayjs";
|
|
4
4
|
import { useId as X, useRef as j, useEffect as H } from "react";
|
|
5
5
|
import { formatDateValue as O } from "../_common/format.js";
|
|
6
|
-
import { applyValueFormat as $,
|
|
7
|
-
import { P as
|
|
8
|
-
import { p as
|
|
9
|
-
import { L as
|
|
10
|
-
import { L as
|
|
11
|
-
const
|
|
12
|
-
const
|
|
6
|
+
import { applyValueFormat as $, applyInterfaceColors as q, colorSetFromPalette as G, buildSliceText as P, applyLegendPercentFormat as J, readSharePercent as K } from "../_common/utils.js";
|
|
7
|
+
import { P as Q, a as U } from "../../../PieSeries-CMH0Z7pz.js";
|
|
8
|
+
import { p as i, c as v } from "../../../Entity-BJCuhdq_.js";
|
|
9
|
+
import { L as Z } from "../../../Legend-CFvQiIfn.js";
|
|
10
|
+
import { L as _ } from "../../../Tooltip-vyZRZWih.js";
|
|
11
|
+
const pe = (k) => {
|
|
12
|
+
const x = z({ props: k, name: "HCDonutChart" }), {
|
|
13
13
|
dimensions: a,
|
|
14
|
-
values:
|
|
15
|
-
data:
|
|
16
|
-
initDelay:
|
|
14
|
+
values: r,
|
|
15
|
+
data: c,
|
|
16
|
+
initDelay: A = 0,
|
|
17
17
|
colors: T,
|
|
18
18
|
showDimensionLabel: Y = !1,
|
|
19
|
-
showValueText:
|
|
19
|
+
showValueText: h = !0,
|
|
20
20
|
percentDecimals: p = 2,
|
|
21
21
|
sx: R,
|
|
22
22
|
...C
|
|
23
|
-
} =
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
let
|
|
28
|
-
return
|
|
23
|
+
} = x, m = E(), w = `hc-donut-chart-${X().replace(/:/g, "")}`, f = j(null), n = r.length > 1;
|
|
24
|
+
let d = null;
|
|
25
|
+
r.length < 1 ? d = "Missing values config!" : !n && a.length < 1 && (d = "Missing dimensions config!"), H(() => {
|
|
26
|
+
if (d) return;
|
|
27
|
+
let g;
|
|
28
|
+
return g = setTimeout(() => {
|
|
29
29
|
var M, F;
|
|
30
30
|
const e = N.new(w);
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
31
|
+
f.current = e, $(e, (M = r == null ? void 0 : r[0]) == null ? void 0 : M.format), e.setThemes([V.new(e)]);
|
|
32
|
+
const y = e.container.children.push(
|
|
33
|
+
Q.new(e, {
|
|
34
34
|
layout: e.verticalLayout,
|
|
35
|
-
innerRadius:
|
|
35
|
+
innerRadius: i(50)
|
|
36
36
|
})
|
|
37
37
|
);
|
|
38
|
-
e
|
|
39
|
-
text: d(i.palette.text.primary),
|
|
40
|
-
grid: d(i.palette.divider),
|
|
41
|
-
stroke: d(i.palette.divider),
|
|
38
|
+
q(e, m, {
|
|
42
39
|
// Drives the gap color between slices; tie it to the surface so the
|
|
43
40
|
// beveled edges read correctly in both light and dark mode.
|
|
44
|
-
background:
|
|
41
|
+
background: v(m.palette.background.paper)
|
|
45
42
|
});
|
|
46
|
-
const
|
|
43
|
+
const B = n ? r.map((o) => {
|
|
47
44
|
var s;
|
|
48
45
|
return {
|
|
49
|
-
category:
|
|
50
|
-
value: (s =
|
|
46
|
+
category: o.label || o.name || o.fieldName,
|
|
47
|
+
value: (s = c[0]) == null ? void 0 : s[o.dataFieldName]
|
|
51
48
|
};
|
|
52
|
-
}) :
|
|
53
|
-
|
|
54
|
-
valueField:
|
|
55
|
-
categoryField:
|
|
49
|
+
}) : c, t = y.series.push(
|
|
50
|
+
U.new(e, {
|
|
51
|
+
valueField: n ? "value" : r[0].dataFieldName,
|
|
52
|
+
categoryField: n ? "category" : a[0].value
|
|
56
53
|
})
|
|
57
54
|
);
|
|
58
|
-
t.set("colors",
|
|
59
|
-
const b =
|
|
55
|
+
t.set("colors", G(e, T));
|
|
56
|
+
const b = P({ percentDecimals: p, showValueText: h });
|
|
60
57
|
t.slices.template.setAll({
|
|
61
58
|
tooltipText: b,
|
|
62
|
-
stroke:
|
|
59
|
+
stroke: v(m.palette.background.paper),
|
|
63
60
|
strokeWidth: 2,
|
|
64
61
|
strokeOpacity: 1,
|
|
65
62
|
cornerRadius: 4
|
|
66
|
-
}), t.slices.template.states.create("hover", { scale: 1.04 }), t.set("radius",
|
|
63
|
+
}), t.slices.template.states.create("hover", { scale: 1.04 }), t.set("radius", i(80)), t.labels.template.setAll({
|
|
67
64
|
text: b,
|
|
68
65
|
maxWidth: 140,
|
|
69
66
|
oversizedBehavior: "wrap"
|
|
70
67
|
});
|
|
71
|
-
const D = (
|
|
72
|
-
const S =
|
|
73
|
-
return S === void 0 ?
|
|
68
|
+
const D = (o, s) => {
|
|
69
|
+
const S = K(s);
|
|
70
|
+
return S === void 0 ? o : P({ percentDecimals: p, showValueText: h, percent: S });
|
|
74
71
|
};
|
|
75
|
-
t.slices.template.adapters.add("tooltipText", D), t.labels.template.adapters.add("text", D), !
|
|
72
|
+
t.slices.template.adapters.add("tooltipText", D), t.labels.template.adapters.add("text", D), !n && a[0].type === "date" && c.forEach((o) => {
|
|
76
73
|
let s = "YYYY";
|
|
77
|
-
a[0].value.includes("month") ? s = "MMM YYYY" : a[0].value.includes("day") && (s = "DD MMM YYYY"),
|
|
74
|
+
a[0].value.includes("month") ? s = "MMM YYYY" : a[0].value.includes("day") && (s = "DD MMM YYYY"), o[a[0].value] = W(o[a[0].value]).format(
|
|
78
75
|
s
|
|
79
76
|
);
|
|
80
|
-
}), t.data.setAll(
|
|
81
|
-
const L =
|
|
82
|
-
|
|
83
|
-
centerX:
|
|
84
|
-
x:
|
|
77
|
+
}), t.data.setAll(B);
|
|
78
|
+
const L = y.children.push(
|
|
79
|
+
Z.new(e, {
|
|
80
|
+
centerX: i(50),
|
|
81
|
+
x: i(50),
|
|
85
82
|
marginTop: 15,
|
|
86
83
|
marginBottom: 15
|
|
87
84
|
})
|
|
88
85
|
);
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
Y &&
|
|
92
|
-
|
|
93
|
-
text:
|
|
94
|
-
centerX:
|
|
95
|
-
x:
|
|
96
|
-
fill:
|
|
86
|
+
J(L, p), L.data.setAll(t.dataItems);
|
|
87
|
+
const l = a[0], u = l ? (F = c[0]) == null ? void 0 : F[l.value] : void 0;
|
|
88
|
+
Y && n && l && u != null && u !== "" && y.children.push(
|
|
89
|
+
_.new(e, {
|
|
90
|
+
text: l.type === "date" ? O(u, l.dateFormat, l.value) : String(u),
|
|
91
|
+
centerX: i(50),
|
|
92
|
+
x: i(50),
|
|
93
|
+
fill: v(m.palette.text.secondary),
|
|
97
94
|
fontSize: 12,
|
|
98
95
|
paddingBottom: 8
|
|
99
96
|
})
|
|
100
97
|
), t.appear(1e3, 100);
|
|
101
|
-
},
|
|
98
|
+
}, A), () => {
|
|
102
99
|
var e;
|
|
103
|
-
|
|
100
|
+
g && clearTimeout(g), (e = f.current) == null || e.dispose(), f.current = null;
|
|
104
101
|
};
|
|
105
102
|
}, [
|
|
106
|
-
|
|
103
|
+
c,
|
|
107
104
|
a,
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
r,
|
|
106
|
+
m.palette.mode,
|
|
110
107
|
T,
|
|
111
108
|
Y,
|
|
112
|
-
|
|
109
|
+
h,
|
|
113
110
|
p
|
|
114
111
|
]);
|
|
115
|
-
const
|
|
116
|
-
return { chartId: w, ownerState:
|
|
112
|
+
const I = { ...x };
|
|
113
|
+
return { chartId: w, ownerState: I, sx: R, error: d, other: C };
|
|
117
114
|
};
|
|
118
115
|
export {
|
|
119
|
-
|
|
116
|
+
pe as useDonutChartLogic
|
|
120
117
|
};
|