@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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { c as o } from "./createReactComponent-C7L-DMHj.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license @tabler/icons-react v3.44.0 - MIT
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
const t = [["path", { d: "M18 6l-12 12", key: "svg-0" }], ["path", { d: "M6 6l12 12", key: "svg-1" }]], c = o("outline", "x", "X", t);
|
|
9
|
+
export {
|
|
10
|
+
c as I
|
|
11
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const s = "—", l = (n) => new Intl.NumberFormat(
|
|
2
|
+
"en-US",
|
|
3
|
+
n === void 0 ? { maximumFractionDigits: 2 } : { minimumFractionDigits: n, maximumFractionDigits: n }
|
|
4
|
+
), a = (n, e, c = s) => {
|
|
5
|
+
if (n == null || n === "") return c;
|
|
6
|
+
const i = Number(n);
|
|
7
|
+
if (Number.isNaN(i)) return String(n);
|
|
8
|
+
const r = l(e == null ? void 0 : e.decimals).format(i);
|
|
9
|
+
return `${(e == null ? void 0 : e.prefix) ?? ""}${r}${(e == null ? void 0 : e.suffix) ?? ""}`;
|
|
10
|
+
}, b = (n) => {
|
|
11
|
+
if (!n) return;
|
|
12
|
+
const { prefix: e, suffix: c, decimals: i } = n;
|
|
13
|
+
if (e === void 0 && c === void 0 && i === void 0)
|
|
14
|
+
return;
|
|
15
|
+
const r = i === void 0 ? "#,###.##" : i <= 0 ? "#,##0" : `#,##0.${"0".repeat(i)}`, u = (o) => o ? `'${o.replace(/'/g, "")}'` : "";
|
|
16
|
+
return `${u(e)}${r}${u(c)}`;
|
|
17
|
+
}, g = (n) => n && n.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), d = (n, e) => {
|
|
18
|
+
switch (e.op) {
|
|
19
|
+
case "lt":
|
|
20
|
+
return n < e.value;
|
|
21
|
+
case "lte":
|
|
22
|
+
return n <= e.value;
|
|
23
|
+
case "gt":
|
|
24
|
+
return n > e.value;
|
|
25
|
+
case "gte":
|
|
26
|
+
return n >= e.value;
|
|
27
|
+
case "eq":
|
|
28
|
+
return n === e.value;
|
|
29
|
+
case "neq":
|
|
30
|
+
return n !== e.value;
|
|
31
|
+
case "between":
|
|
32
|
+
return e.value2 !== void 0 && n >= e.value && n <= e.value2;
|
|
33
|
+
default:
|
|
34
|
+
return !1;
|
|
35
|
+
}
|
|
36
|
+
}, t = (n) => n || void 0, v = (n, e) => {
|
|
37
|
+
const c = {
|
|
38
|
+
color: t(e == null ? void 0 : e.color),
|
|
39
|
+
backgroundColor: t(e == null ? void 0 : e.backgroundColor)
|
|
40
|
+
}, i = e == null ? void 0 : e.conditionalRules;
|
|
41
|
+
if (!(i != null && i.length)) return c;
|
|
42
|
+
const r = Number(n);
|
|
43
|
+
if (Number.isNaN(r)) return c;
|
|
44
|
+
const u = i.find((o) => d(r, o));
|
|
45
|
+
return u ? {
|
|
46
|
+
color: t(u.color) ?? c.color,
|
|
47
|
+
backgroundColor: t(u.backgroundColor) ?? c.backgroundColor
|
|
48
|
+
} : c;
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
b as buildAmNumberFormat,
|
|
52
|
+
a as formatValue,
|
|
53
|
+
g as humanizeLabel,
|
|
54
|
+
v as resolveConditionalStyle
|
|
55
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { buildAmNumberFormat as t } from "./format.js";
|
|
2
|
+
import { C as m, c as F } from "../../../ColorSet-C7vpNXhM.js";
|
|
3
|
+
const a = [
|
|
3
4
|
"#294D94",
|
|
4
5
|
"#375F97",
|
|
5
6
|
"#44729C",
|
|
@@ -10,11 +11,15 @@ const c = [
|
|
|
10
11
|
"#9FCFBF",
|
|
11
12
|
"#B9E1C9",
|
|
12
13
|
"#D6F1D5"
|
|
13
|
-
],
|
|
14
|
-
colors:
|
|
14
|
+
], u = (r, e = a) => m.new(r, {
|
|
15
|
+
colors: e.map((o) => F(o)),
|
|
15
16
|
reuse: !0
|
|
16
|
-
})
|
|
17
|
+
}), c = (r, e) => {
|
|
18
|
+
const o = t(e);
|
|
19
|
+
o && (r.numberFormatter.set("numericFields", void 0), r.numberFormatter.set("numberFormat", o));
|
|
20
|
+
};
|
|
17
21
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
a as DEFAULT_VIRIDIS_COOL,
|
|
23
|
+
c as applyValueFormat,
|
|
24
|
+
u as colorSetFromPalette
|
|
20
25
|
};
|
|
@@ -1,27 +1,52 @@
|
|
|
1
|
-
import { camelCase as d, uniqBy as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { camelCase as d, uniqBy as y } from "lodash";
|
|
2
|
+
const u = 864e5, M = [
|
|
3
|
+
{ maxMs: 1.5 * 1e3, unit: "second" },
|
|
4
|
+
{ maxMs: 1.5 * 6e4, unit: "minute" },
|
|
5
|
+
{ maxMs: 1.5 * 36e5, unit: "hour" },
|
|
6
|
+
{ maxMs: 1.5 * u, unit: "day" },
|
|
7
|
+
{ maxMs: 10.5 * u, unit: "week" },
|
|
8
|
+
{ maxMs: 45 * u, unit: "month" }
|
|
9
|
+
], h = (s) => {
|
|
10
|
+
const a = [...s].filter((e) => typeof e == "number" && !Number.isNaN(e)).sort((e, t) => e - t);
|
|
11
|
+
let n = 1 / 0;
|
|
12
|
+
for (let e = 1; e < a.length; e++) {
|
|
13
|
+
const t = a[e] - a[e - 1];
|
|
14
|
+
t > 0 && t < n && (n = t);
|
|
15
|
+
}
|
|
16
|
+
if (!Number.isFinite(n)) return;
|
|
17
|
+
const o = M.find((e) => n <= e.maxMs);
|
|
18
|
+
return { timeUnit: o ? o.unit : "year", count: 1 };
|
|
19
|
+
}, v = (s) => {
|
|
20
|
+
const a = /* @__PURE__ */ new Map(), n = [], o = [];
|
|
21
|
+
s.forEach((t, r) => {
|
|
22
|
+
const l = t.label, m = (t.propertyId ?? d(t.label)) + r, p = [{ type: "date", value: "t" }];
|
|
23
|
+
n.push({
|
|
24
|
+
dataFieldName: m,
|
|
25
|
+
fieldName: m,
|
|
26
|
+
name: l,
|
|
10
27
|
operator: "count"
|
|
11
|
-
}),
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
28
|
+
}), o.push(...p), t.type === "TIMESERIES" && Array.isArray(t.points) && t.points.forEach((c) => {
|
|
29
|
+
const i = c.t;
|
|
30
|
+
a.has(i) || a.set(i, { t: i });
|
|
31
|
+
const f = a.get(i);
|
|
32
|
+
f[m] = c.v;
|
|
16
33
|
});
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
});
|
|
35
|
+
const e = Array.from(a.values()).sort(
|
|
36
|
+
(t, r) => new Date(t.t).getTime() - new Date(r.t).getTime()
|
|
37
|
+
);
|
|
38
|
+
return {
|
|
39
|
+
data: e,
|
|
40
|
+
values: n,
|
|
41
|
+
dimensions: y(o, "value"),
|
|
42
|
+
// SQL-query series carry no grain metadata, so infer it from the points'
|
|
43
|
+
// spacing — otherwise the axis falls back to a daily grain for monthly data.
|
|
44
|
+
baseInterval: h(
|
|
45
|
+
e.map((t) => new Date(t.t).getTime())
|
|
46
|
+
)
|
|
23
47
|
};
|
|
24
48
|
};
|
|
25
49
|
export {
|
|
26
|
-
|
|
50
|
+
v as adaptTemporalData,
|
|
51
|
+
h as inferBaseInterval
|
|
27
52
|
};
|
|
@@ -1,49 +1,66 @@
|
|
|
1
|
-
import { useThemeProps as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { adaptTemporalData as C } from "./helpers.js";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useThemeProps as P } from "@mui/material";
|
|
2
|
+
import { useMemo as U } from "react";
|
|
3
|
+
import { inferBaseInterval as w, adaptTemporalData as C } from "./helpers.js";
|
|
4
|
+
const m = {
|
|
5
|
+
"1M": "month",
|
|
6
|
+
"1W": "week",
|
|
7
|
+
"1D": "day",
|
|
8
|
+
"1Y": "year"
|
|
9
|
+
}, k = (c) => {
|
|
10
|
+
const p = P({ props: c, name: "HCChartWrapper" }), {
|
|
11
|
+
title: d,
|
|
12
|
+
description: f,
|
|
13
|
+
type: u,
|
|
14
|
+
interval: t,
|
|
15
|
+
data: r = [],
|
|
11
16
|
dimensions: s = [],
|
|
12
|
-
values:
|
|
13
|
-
series:
|
|
14
|
-
loading:
|
|
15
|
-
sx:
|
|
16
|
-
...
|
|
17
|
-
} =
|
|
18
|
-
...
|
|
19
|
-
let
|
|
17
|
+
values: l = [],
|
|
18
|
+
series: a = [],
|
|
19
|
+
loading: h = !1,
|
|
20
|
+
sx: v,
|
|
21
|
+
...T
|
|
22
|
+
} = p, g = {
|
|
23
|
+
...U(() => {
|
|
24
|
+
let e = { data: r, dimensions: s, values: l };
|
|
20
25
|
if (s.length > 0) {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const n = s.find((o) => o.type === "date");
|
|
27
|
+
if (n) {
|
|
28
|
+
const o = n.value.split("/")[1] || t;
|
|
29
|
+
let i;
|
|
30
|
+
if (o)
|
|
31
|
+
i = {
|
|
32
|
+
timeUnit: m[o] ?? o,
|
|
33
|
+
count: 1
|
|
34
|
+
};
|
|
35
|
+
else {
|
|
36
|
+
const I = n.value;
|
|
37
|
+
i = w(
|
|
38
|
+
r.map((D) => new Date(D[I]).getTime())
|
|
39
|
+
) ?? { timeUnit: "day", count: 1 };
|
|
40
|
+
}
|
|
41
|
+
e = { ...e, baseInterval: i };
|
|
28
42
|
}
|
|
29
|
-
} else if (
|
|
30
|
-
const
|
|
31
|
-
|
|
43
|
+
} else if (a.length > 0) {
|
|
44
|
+
const n = C(a);
|
|
45
|
+
e = { ...e, ...n }, t && (e.baseInterval = {
|
|
46
|
+
timeUnit: m[t] ?? t,
|
|
47
|
+
count: 1
|
|
48
|
+
});
|
|
32
49
|
}
|
|
33
|
-
return
|
|
34
|
-
}, [
|
|
35
|
-
...
|
|
36
|
-
},
|
|
50
|
+
return e;
|
|
51
|
+
}, [t, r, s, l, a]),
|
|
52
|
+
...T
|
|
53
|
+
}, y = { ...p };
|
|
37
54
|
return {
|
|
38
|
-
title:
|
|
39
|
-
description:
|
|
40
|
-
type:
|
|
41
|
-
chartProps:
|
|
42
|
-
loading:
|
|
43
|
-
ownerState:
|
|
44
|
-
sx:
|
|
55
|
+
title: d,
|
|
56
|
+
description: f,
|
|
57
|
+
type: u,
|
|
58
|
+
chartProps: g,
|
|
59
|
+
loading: h,
|
|
60
|
+
ownerState: y,
|
|
61
|
+
sx: v
|
|
45
62
|
};
|
|
46
63
|
};
|
|
47
64
|
export {
|
|
48
|
-
|
|
65
|
+
k as useChartWrapperLogic
|
|
49
66
|
};
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import { R, A 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 { C as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { R as B, A as I, T as d } from "../../../AnimatedTheme-jnasw6rT.js";
|
|
2
|
+
import { useThemeProps as M, useTheme as P } from "@mui/material";
|
|
3
|
+
import X from "lodash";
|
|
4
|
+
import { useId as V, useRef as E, useEffect as N } from "react";
|
|
5
|
+
import { humanizeLabel as k } from "../_common/format.js";
|
|
6
|
+
import { colorSetFromPalette as W, applyValueFormat as q } from "../_common/utils.js";
|
|
7
|
+
import { c as l, p as H, a as C } from "../../../ColorSet-C7vpNXhM.js";
|
|
8
|
+
import { X as U, V as _ } from "../../../AxisRenderer-DTyLLA6c.js";
|
|
9
|
+
import { S as $ } from "../../../Scrollbar-D86MJyr2.js";
|
|
10
|
+
import { D as j } from "../../../DateAxis-YX3QNIB-.js";
|
|
11
|
+
import { A as b, a as G } from "../../../AxisRendererY-C_ItLPNV.js";
|
|
12
|
+
import { C as J } from "../../../CategoryAxis-CwnfaGc8.js";
|
|
13
|
+
import { C as K } from "../../../ColumnSeries-CjgdJ2QL.js";
|
|
14
|
+
import { D as L } from "../../../DataProcessor-CHDO51q4.js";
|
|
15
|
+
import { L as Q } from "../../../LineSeries-Uiv5o56b.js";
|
|
16
|
+
import { B as Z } from "../../../Bullet-DVczI2TD.js";
|
|
17
|
+
import { C as ee } from "../../../Circle-Cy5s-pVc.js";
|
|
18
|
+
import { X as te } from "../../../XYCursor-C8WktvKM.js";
|
|
19
|
+
import { L as re } from "../../../Legend-Dp_MKfS4.js";
|
|
20
|
+
const ke = (T) => {
|
|
21
|
+
const h = M({ props: T, name: "HCColumnLineMix" }), {
|
|
21
22
|
dimensions: t,
|
|
22
|
-
values:
|
|
23
|
-
data:
|
|
24
|
-
initDelay:
|
|
25
|
-
baseInterval:
|
|
23
|
+
values: n,
|
|
24
|
+
data: p,
|
|
25
|
+
initDelay: Y = 0,
|
|
26
|
+
baseInterval: D,
|
|
26
27
|
colors: g,
|
|
27
|
-
sx:
|
|
28
|
-
...
|
|
29
|
-
} =
|
|
30
|
-
|
|
28
|
+
sx: S,
|
|
29
|
+
...O
|
|
30
|
+
} = h, a = P(), x = `hc-column-line-mix-${V().replace(/:/g, "")}`, c = E(null), w = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
|
|
31
|
+
N(() => {
|
|
31
32
|
if (w) return;
|
|
32
33
|
let u;
|
|
33
34
|
return u = setTimeout(() => {
|
|
34
|
-
var
|
|
35
|
-
const e =
|
|
36
|
-
|
|
37
|
-
text:
|
|
38
|
-
grid:
|
|
39
|
-
stroke:
|
|
35
|
+
var y, A, v, F;
|
|
36
|
+
const e = B.new(x);
|
|
37
|
+
c.current = e, e.setThemes([I.new(e)]), e.interfaceColors.setAll({
|
|
38
|
+
text: l(a.palette.text.primary),
|
|
39
|
+
grid: l(a.palette.divider),
|
|
40
|
+
stroke: l(a.palette.divider)
|
|
40
41
|
});
|
|
41
42
|
const r = e.container.children.push(
|
|
42
|
-
|
|
43
|
+
U.new(e, {
|
|
43
44
|
panX: !1,
|
|
44
45
|
panY: !1,
|
|
45
46
|
wheelX: "none",
|
|
@@ -48,76 +49,76 @@ const ye = (b) => {
|
|
|
48
49
|
layout: e.verticalLayout
|
|
49
50
|
})
|
|
50
51
|
);
|
|
51
|
-
r.set("colors",
|
|
52
|
+
r.set("colors", W(e, g)), r.get("colors", {}).set("step", 3), r.set(
|
|
52
53
|
"scrollbarX",
|
|
53
|
-
|
|
54
|
+
$.new(e, { orientation: "horizontal" })
|
|
54
55
|
);
|
|
55
|
-
let s,
|
|
56
|
-
t[0].type === "date" ? (
|
|
57
|
-
|
|
56
|
+
let s, m = p;
|
|
57
|
+
t[0].type === "date" ? (m = X.orderBy(p, [t[0].value]), s = r.xAxes.push(
|
|
58
|
+
j.new(e, {
|
|
58
59
|
maxDeviation: 0.1,
|
|
59
60
|
groupData: !1,
|
|
60
|
-
baseInterval:
|
|
61
|
-
renderer:
|
|
62
|
-
tooltip:
|
|
61
|
+
baseInterval: D || { timeUnit: "day", count: 1 },
|
|
62
|
+
renderer: b.new(e, {}),
|
|
63
|
+
tooltip: d.new(e, {})
|
|
63
64
|
})
|
|
64
|
-
), (
|
|
65
|
-
stroke:
|
|
65
|
+
), (y = s.get("renderer")) == null || y.grid.template.setAll({
|
|
66
|
+
stroke: l(a.palette.divider),
|
|
66
67
|
strokeOpacity: 1
|
|
67
68
|
})) : (s = r.xAxes.push(
|
|
68
|
-
|
|
69
|
+
J.new(e, {
|
|
69
70
|
categoryField: t[0].value,
|
|
70
|
-
renderer:
|
|
71
|
-
tooltip:
|
|
71
|
+
renderer: b.new(e, {}),
|
|
72
|
+
tooltip: d.new(e, {})
|
|
72
73
|
})
|
|
73
|
-
), (
|
|
74
|
-
stroke:
|
|
74
|
+
), (A = s.get("renderer")) == null || A.grid.template.setAll({
|
|
75
|
+
stroke: l(a.palette.divider),
|
|
75
76
|
strokeOpacity: 1
|
|
76
77
|
}), e.numberFormatter.setAll({
|
|
77
78
|
numberFormat: "#",
|
|
78
79
|
numericFields: ["valueX"]
|
|
79
|
-
}),
|
|
80
|
-
const
|
|
81
|
-
|
|
80
|
+
}), m = X.orderBy(p, [t[0].value]), s.data.setAll(m));
|
|
81
|
+
const f = r.yAxes.push(
|
|
82
|
+
_.new(e, {
|
|
82
83
|
min: 0,
|
|
83
84
|
extraMax: 0.1,
|
|
84
|
-
renderer:
|
|
85
|
+
renderer: G.new(e, { strokeOpacity: 0.1 })
|
|
85
86
|
})
|
|
86
87
|
);
|
|
87
|
-
(
|
|
88
|
-
stroke:
|
|
88
|
+
(v = f.get("renderer")) == null || v.grid.template.setAll({
|
|
89
|
+
stroke: l(a.palette.divider),
|
|
89
90
|
strokeOpacity: 1
|
|
90
|
-
}),
|
|
91
|
-
if (
|
|
91
|
+
}), n.forEach((i, z) => {
|
|
92
|
+
if (z === 0) {
|
|
92
93
|
const o = r.series.push(
|
|
93
|
-
|
|
94
|
-
name:
|
|
94
|
+
K.new(e, {
|
|
95
|
+
name: i.label ?? k(i.name),
|
|
95
96
|
xAxis: s,
|
|
96
|
-
yAxis:
|
|
97
|
-
valueYField:
|
|
97
|
+
yAxis: f,
|
|
98
|
+
valueYField: i.dataFieldName,
|
|
98
99
|
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value },
|
|
99
|
-
tooltip:
|
|
100
|
+
tooltip: d.new(e, {
|
|
100
101
|
pointerOrientation: "horizontal",
|
|
101
102
|
labelText: "{name} in {categoryX}: {valueY} {info}"
|
|
102
103
|
})
|
|
103
104
|
})
|
|
104
105
|
);
|
|
105
106
|
o.columns.template.setAll({
|
|
106
|
-
tooltipY:
|
|
107
|
+
tooltipY: H(10),
|
|
107
108
|
templateField: "columnSettings"
|
|
108
|
-
}), t[0].type === "date" && (o.data.processor =
|
|
109
|
+
}), t[0].type === "date" && (o.data.processor = L.new(e, {
|
|
109
110
|
dateFormat: "i",
|
|
110
111
|
dateFields: [t[0].value]
|
|
111
|
-
})), o.data.setAll(
|
|
112
|
+
})), o.data.setAll(m), o.appear();
|
|
112
113
|
} else {
|
|
113
114
|
const o = r.series.push(
|
|
114
|
-
|
|
115
|
-
name:
|
|
115
|
+
Q.new(e, {
|
|
116
|
+
name: i.label ?? k(i.name),
|
|
116
117
|
xAxis: s,
|
|
117
|
-
yAxis:
|
|
118
|
-
valueYField:
|
|
118
|
+
yAxis: f,
|
|
119
|
+
valueYField: i.dataFieldName,
|
|
119
120
|
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value },
|
|
120
|
-
tooltip:
|
|
121
|
+
tooltip: d.new(e, {
|
|
121
122
|
pointerOrientation: "horizontal",
|
|
122
123
|
labelText: "{name} in {categoryX}: {valueY} {info}"
|
|
123
124
|
})
|
|
@@ -126,12 +127,12 @@ const ye = (b) => {
|
|
|
126
127
|
o.strokes.template.setAll({
|
|
127
128
|
strokeWidth: 3,
|
|
128
129
|
templateField: "strokeSettings"
|
|
129
|
-
}), t[0].type === "date" && (o.data.processor =
|
|
130
|
+
}), t[0].type === "date" && (o.data.processor = L.new(e, {
|
|
130
131
|
dateFormat: "i",
|
|
131
132
|
dateFields: [t[0].value]
|
|
132
|
-
})), o.data.setAll(
|
|
133
|
-
return
|
|
134
|
-
sprite:
|
|
133
|
+
})), o.data.setAll(m), o.bullets.push(function() {
|
|
134
|
+
return Z.new(e, {
|
|
135
|
+
sprite: ee.new(e, {
|
|
135
136
|
strokeWidth: 3,
|
|
136
137
|
stroke: o.get("stroke"),
|
|
137
138
|
radius: 5,
|
|
@@ -140,20 +141,20 @@ const ye = (b) => {
|
|
|
140
141
|
});
|
|
141
142
|
});
|
|
142
143
|
}
|
|
143
|
-
}), r.set("cursor",
|
|
144
|
-
|
|
145
|
-
centerX:
|
|
146
|
-
x:
|
|
144
|
+
}), r.set("cursor", te.new(e, {})), r.children.push(
|
|
145
|
+
re.new(e, {
|
|
146
|
+
centerX: C,
|
|
147
|
+
x: C
|
|
147
148
|
})
|
|
148
|
-
).data.setAll(r.series.values), r.appear(1e3, 100);
|
|
149
|
-
},
|
|
149
|
+
).data.setAll(r.series.values), q(e, (F = n == null ? void 0 : n[0]) == null ? void 0 : F.format), r.appear(1e3, 100);
|
|
150
|
+
}, Y), () => {
|
|
150
151
|
var e;
|
|
151
|
-
u && clearTimeout(u), (e =
|
|
152
|
+
u && clearTimeout(u), (e = c.current) == null || e.dispose(), c.current = null;
|
|
152
153
|
};
|
|
153
|
-
}, [
|
|
154
|
-
const
|
|
155
|
-
return { chartId: x, ownerState:
|
|
154
|
+
}, [p, t, n, a.palette.mode, g]);
|
|
155
|
+
const R = { ...h };
|
|
156
|
+
return { chartId: x, ownerState: R, sx: S, error: w, other: O };
|
|
156
157
|
};
|
|
157
158
|
export {
|
|
158
|
-
|
|
159
|
+
ke as useColumnLineMixLogic
|
|
159
160
|
};
|
|
@@ -1,66 +1,67 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as P, useRef as R, useEffect as
|
|
5
|
-
import { colorSetFromPalette as
|
|
6
|
-
import { P as
|
|
1
|
+
import { R as x, A } from "../../../AnimatedTheme-jnasw6rT.js";
|
|
2
|
+
import { useThemeProps as C, useTheme as D } from "@mui/material";
|
|
3
|
+
import F from "dayjs";
|
|
4
|
+
import { useId as P, useRef as R, useEffect as L } from "react";
|
|
5
|
+
import { applyValueFormat as I, colorSetFromPalette as S } from "../_common/utils.js";
|
|
6
|
+
import { P as E, a as j } from "../../../PieSeries-B2fW3z0s.js";
|
|
7
7
|
import { p as m, c as u } from "../../../ColorSet-C7vpNXhM.js";
|
|
8
|
-
import { L as
|
|
9
|
-
const
|
|
10
|
-
const d =
|
|
8
|
+
import { L as k } from "../../../Legend-Dp_MKfS4.js";
|
|
9
|
+
const J = (v) => {
|
|
10
|
+
const d = C({ props: v, name: "HCDonutChart" }), {
|
|
11
11
|
dimensions: t,
|
|
12
|
-
values:
|
|
12
|
+
values: o,
|
|
13
13
|
data: n,
|
|
14
|
-
initDelay:
|
|
14
|
+
initDelay: y = 0,
|
|
15
15
|
colors: p,
|
|
16
|
-
sx:
|
|
17
|
-
...
|
|
18
|
-
} = d,
|
|
19
|
-
let
|
|
20
|
-
t.length < 1 ?
|
|
21
|
-
if (
|
|
16
|
+
sx: M,
|
|
17
|
+
...T
|
|
18
|
+
} = d, r = D(), f = `hc-donut-chart-${P().replace(/:/g, "")}`, i = R(null);
|
|
19
|
+
let s = null;
|
|
20
|
+
t.length < 1 ? s = "Missing dimensions config!" : o.length < 1 && (s = "Missing values config!"), L(() => {
|
|
21
|
+
if (s) return;
|
|
22
22
|
let l;
|
|
23
23
|
return l = setTimeout(() => {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
var g;
|
|
25
|
+
const e = x.new(f);
|
|
26
|
+
i.current = e, I(e, (g = o == null ? void 0 : o[0]) == null ? void 0 : g.format), e.setThemes([A.new(e)]);
|
|
26
27
|
const h = e.container.children.push(
|
|
27
|
-
|
|
28
|
+
E.new(e, {
|
|
28
29
|
layout: e.verticalLayout,
|
|
29
30
|
innerRadius: m(50)
|
|
30
31
|
})
|
|
31
32
|
);
|
|
32
33
|
e.interfaceColors.setAll({
|
|
33
|
-
text: u(
|
|
34
|
-
grid: u(
|
|
35
|
-
stroke: u(
|
|
34
|
+
text: u(r.palette.text.primary),
|
|
35
|
+
grid: u(r.palette.divider),
|
|
36
|
+
stroke: u(r.palette.divider)
|
|
36
37
|
});
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
valueField:
|
|
38
|
+
const a = h.series.push(
|
|
39
|
+
j.new(e, {
|
|
40
|
+
valueField: o[0].dataFieldName,
|
|
40
41
|
categoryField: t[0].value
|
|
41
42
|
})
|
|
42
43
|
);
|
|
43
|
-
|
|
44
|
+
a.set("colors", S(e, p)), t[0].type === "date" && n.forEach((Y) => {
|
|
44
45
|
let c = "YYYY";
|
|
45
|
-
t[0].value.includes("month") ? c = "MMM YYYY" : t[0].value.includes("day") && (c = "DD MMM YYYY"),
|
|
46
|
+
t[0].value.includes("month") ? c = "MMM YYYY" : t[0].value.includes("day") && (c = "DD MMM YYYY"), Y[t[0].value] = F(Y[t[0].value]).format(
|
|
46
47
|
c
|
|
47
48
|
);
|
|
48
|
-
}),
|
|
49
|
-
|
|
49
|
+
}), a.data.setAll(n), h.children.push(
|
|
50
|
+
k.new(e, {
|
|
50
51
|
centerX: m(50),
|
|
51
52
|
x: m(50),
|
|
52
53
|
marginTop: 15,
|
|
53
54
|
marginBottom: 15
|
|
54
55
|
})
|
|
55
|
-
).data.setAll(
|
|
56
|
-
},
|
|
56
|
+
).data.setAll(a.dataItems), a.appear(1e3, 100);
|
|
57
|
+
}, y), () => {
|
|
57
58
|
var e;
|
|
58
59
|
l && clearTimeout(l), (e = i.current) == null || e.dispose(), i.current = null;
|
|
59
60
|
};
|
|
60
|
-
}, [n, t,
|
|
61
|
-
const
|
|
62
|
-
return { chartId: f, ownerState:
|
|
61
|
+
}, [n, t, o, r.palette.mode, p]);
|
|
62
|
+
const w = { ...d };
|
|
63
|
+
return { chartId: f, ownerState: w, sx: M, error: s, other: T };
|
|
63
64
|
};
|
|
64
65
|
export {
|
|
65
|
-
|
|
66
|
+
J as useDonutChartLogic
|
|
66
67
|
};
|