@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,21 +1,21 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as x, k as F, l as I, L as W, R as E, a as Z, A as $ } from "../../../AnimatedTheme-jnasw6rT.js";
|
|
2
2
|
import { useThemeProps as G, useTheme as J } from "@mui/material";
|
|
3
3
|
import K from "dayjs";
|
|
4
4
|
import Q from "lodash";
|
|
5
5
|
import { useId as U, useRef as ee, useEffect as te } from "react";
|
|
6
|
-
import {
|
|
7
|
-
import { m as
|
|
8
|
-
import { a as
|
|
6
|
+
import { applyValueFormat as ie, colorSetFromPalette as ae } from "../_common/utils.js";
|
|
7
|
+
import { m as M, f as O, e as j, p as C } from "../../../ColorSet-C7vpNXhM.js";
|
|
8
|
+
import { a as ne, H as X } from "../../../Hierarchy-Bihj0S61.js";
|
|
9
9
|
import { R as z } from "../../../RoundedRectangle-CWLi2PXn.js";
|
|
10
|
-
import { r as
|
|
11
|
-
class
|
|
10
|
+
import { r as se, c as R, a as L } from "../../../constant-BiOGvlZc.js";
|
|
11
|
+
class Y extends x {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), Object.defineProperty(this, "labels", {
|
|
14
14
|
enumerable: !0,
|
|
15
15
|
configurable: !0,
|
|
16
16
|
writable: !0,
|
|
17
|
-
value: this.addDisposer(new
|
|
18
|
-
themeTags:
|
|
17
|
+
value: this.addDisposer(new F(I.new({}), () => W._new(this._root, {
|
|
18
|
+
themeTags: M(this.labels.template.get("themeTags", []), ["label"]),
|
|
19
19
|
background: z.new(this._root, {
|
|
20
20
|
themeTags: ["background"]
|
|
21
21
|
})
|
|
@@ -38,7 +38,7 @@ class L extends V {
|
|
|
38
38
|
}), this.labels.push(i), i;
|
|
39
39
|
}
|
|
40
40
|
_afterNew() {
|
|
41
|
-
this._defaultThemes.push(
|
|
41
|
+
this._defaultThemes.push(ne.new(this._root)), this._settings.themeTags = M(this._settings.themeTags, ["breadcrumb"]), super._afterNew();
|
|
42
42
|
}
|
|
43
43
|
_changed() {
|
|
44
44
|
if (super._changed(), this.isDirty("series")) {
|
|
@@ -58,116 +58,116 @@ class L extends V {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
Object.defineProperty(
|
|
61
|
+
Object.defineProperty(Y, "className", {
|
|
62
62
|
enumerable: !0,
|
|
63
63
|
configurable: !0,
|
|
64
64
|
writable: !0,
|
|
65
65
|
value: "BreadcrumbBar"
|
|
66
66
|
});
|
|
67
|
-
Object.defineProperty(
|
|
67
|
+
Object.defineProperty(Y, "classNames", {
|
|
68
68
|
enumerable: !0,
|
|
69
69
|
configurable: !0,
|
|
70
70
|
writable: !0,
|
|
71
|
-
value:
|
|
71
|
+
value: x.classNames.concat([Y.className])
|
|
72
72
|
});
|
|
73
|
-
function
|
|
73
|
+
function re(u) {
|
|
74
74
|
u.x0 = Math.round(u.x0), u.y0 = Math.round(u.y0), u.x1 = Math.round(u.x1), u.y1 = Math.round(u.y1);
|
|
75
75
|
}
|
|
76
|
-
function x(u, t, i, a, r) {
|
|
77
|
-
for (var l = u.children, n, h = -1, b = l.length, c = u.value && (a - t) / u.value; ++h < b; )
|
|
78
|
-
n = l[h], n.y0 = i, n.y1 = r, n.x0 = t, n.x1 = t += n.value * c;
|
|
79
|
-
}
|
|
80
76
|
function A(u, t, i, a, r) {
|
|
81
|
-
for (var l = u.children,
|
|
82
|
-
|
|
77
|
+
for (var l = u.children, s, h = -1, y = l.length, c = u.value && (a - t) / u.value; ++h < y; )
|
|
78
|
+
s = l[h], s.y0 = i, s.y1 = r, s.x0 = t, s.x1 = t += s.value * c;
|
|
83
79
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
function H(u, t, i, a, r) {
|
|
81
|
+
for (var l = u.children, s, h = -1, y = l.length, c = u.value && (r - i) / u.value; ++h < y; )
|
|
82
|
+
s = l[h], s.x0 = t, s.x1 = a, s.y0 = i, s.y1 = i += s.value * c;
|
|
83
|
+
}
|
|
84
|
+
var oe = (1 + Math.sqrt(5)) / 2;
|
|
85
|
+
function le(u, t, i, a, r, l) {
|
|
86
|
+
for (var s = [], h = t.children, y, c, o = 0, m = 0, e = h.length, d, g, p = t.value, n, f, w, v, P, b, _; o < e; ) {
|
|
87
87
|
d = r - i, g = l - a;
|
|
88
88
|
do
|
|
89
|
-
|
|
90
|
-
while (!
|
|
91
|
-
for (
|
|
92
|
-
if (
|
|
93
|
-
|
|
89
|
+
n = h[m++].value;
|
|
90
|
+
while (!n && m < e);
|
|
91
|
+
for (f = w = n, b = Math.max(g / d, d / g) / (p * u), _ = n * n * b, P = Math.max(w / _, _ / f); m < e; ++m) {
|
|
92
|
+
if (n += c = h[m].value, c < f && (f = c), c > w && (w = c), _ = n * n * b, v = Math.max(w / _, _ / f), v > P) {
|
|
93
|
+
n -= c;
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
P = v;
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
s.push(y = { value: n, dice: d < g, children: h.slice(o, m) }), y.dice ? A(y, i, a, r, p ? a += g * n / p : l) : H(y, i, a, p ? i += d * n / p : r, l), p -= n, o = m;
|
|
99
99
|
}
|
|
100
|
-
return
|
|
100
|
+
return s;
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
function i(a, r, l,
|
|
104
|
-
|
|
102
|
+
const V = function u(t) {
|
|
103
|
+
function i(a, r, l, s, h) {
|
|
104
|
+
le(t, a, r, l, s, h);
|
|
105
105
|
}
|
|
106
106
|
return i.ratio = function(a) {
|
|
107
107
|
return u((a = +a) > 1 ? a : 1);
|
|
108
108
|
}, i;
|
|
109
|
-
}(
|
|
109
|
+
}(oe);
|
|
110
110
|
function q() {
|
|
111
|
-
var u =
|
|
111
|
+
var u = V, t = !1, i = 1, a = 1, r = [0], l = R, s = R, h = R, y = R, c = R;
|
|
112
112
|
function o(e) {
|
|
113
|
-
return e.x0 = e.y0 = 0, e.x1 = i, e.y1 = a, e.eachBefore(m), r = [0], t && e.eachBefore(
|
|
113
|
+
return e.x0 = e.y0 = 0, e.x1 = i, e.y1 = a, e.eachBefore(m), r = [0], t && e.eachBefore(re), e;
|
|
114
114
|
}
|
|
115
115
|
function m(e) {
|
|
116
|
-
var d = r[e.depth], g = e.x0 + d,
|
|
117
|
-
|
|
116
|
+
var d = r[e.depth], g = e.x0 + d, p = e.y0 + d, n = e.x1 - d, f = e.y1 - d;
|
|
117
|
+
n < g && (g = n = (g + n) / 2), f < p && (p = f = (p + f) / 2), e.x0 = g, e.y0 = p, e.x1 = n, e.y1 = f, e.children && (d = r[e.depth + 1] = l(e) / 2, g += c(e) - d, p += s(e) - d, n -= h(e) - d, f -= y(e) - d, n < g && (g = n = (g + n) / 2), f < p && (p = f = (p + f) / 2), u(e, g, p, n, f));
|
|
118
118
|
}
|
|
119
119
|
return o.round = function(e) {
|
|
120
120
|
return arguments.length ? (t = !!e, o) : t;
|
|
121
121
|
}, o.size = function(e) {
|
|
122
122
|
return arguments.length ? (i = +e[0], a = +e[1], o) : [i, a];
|
|
123
123
|
}, o.tile = function(e) {
|
|
124
|
-
return arguments.length ? (u =
|
|
124
|
+
return arguments.length ? (u = se(e), o) : u;
|
|
125
125
|
}, o.padding = function(e) {
|
|
126
126
|
return arguments.length ? o.paddingInner(e).paddingOuter(e) : o.paddingInner();
|
|
127
127
|
}, o.paddingInner = function(e) {
|
|
128
|
-
return arguments.length ? (l = typeof e == "function" ? e :
|
|
128
|
+
return arguments.length ? (l = typeof e == "function" ? e : L(+e), o) : l;
|
|
129
129
|
}, o.paddingOuter = function(e) {
|
|
130
130
|
return arguments.length ? o.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e) : o.paddingTop();
|
|
131
131
|
}, o.paddingTop = function(e) {
|
|
132
|
-
return arguments.length ? (
|
|
132
|
+
return arguments.length ? (s = typeof e == "function" ? e : L(+e), o) : s;
|
|
133
133
|
}, o.paddingRight = function(e) {
|
|
134
|
-
return arguments.length ? (h = typeof e == "function" ? e :
|
|
134
|
+
return arguments.length ? (h = typeof e == "function" ? e : L(+e), o) : h;
|
|
135
135
|
}, o.paddingBottom = function(e) {
|
|
136
|
-
return arguments.length ? (
|
|
136
|
+
return arguments.length ? (y = typeof e == "function" ? e : L(+e), o) : y;
|
|
137
137
|
}, o.paddingLeft = function(e) {
|
|
138
|
-
return arguments.length ? (c = typeof e == "function" ? e :
|
|
138
|
+
return arguments.length ? (c = typeof e == "function" ? e : L(+e), o) : c;
|
|
139
139
|
}, o;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
var l = u.children,
|
|
143
|
-
for (c[0] =
|
|
144
|
-
c[
|
|
141
|
+
function de(u, t, i, a, r) {
|
|
142
|
+
var l = u.children, s, h = l.length, y, c = new Array(h + 1);
|
|
143
|
+
for (c[0] = y = s = 0; s < h; ++s)
|
|
144
|
+
c[s + 1] = y += l[s].value;
|
|
145
145
|
o(0, h, u.value, t, i, a, r);
|
|
146
|
-
function o(m, e, d, g,
|
|
146
|
+
function o(m, e, d, g, p, n, f) {
|
|
147
147
|
if (m >= e - 1) {
|
|
148
|
-
var
|
|
149
|
-
|
|
148
|
+
var w = l[m];
|
|
149
|
+
w.x0 = g, w.y0 = p, w.x1 = n, w.y1 = f;
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
for (var
|
|
153
|
-
var
|
|
154
|
-
c[
|
|
152
|
+
for (var v = c[m], P = d / 2 + v, b = m + 1, _ = e - 1; b < _; ) {
|
|
153
|
+
var k = b + _ >>> 1;
|
|
154
|
+
c[k] < P ? b = k + 1 : _ = k;
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
var D = c[
|
|
158
|
-
if (
|
|
159
|
-
var
|
|
160
|
-
o(m,
|
|
156
|
+
P - c[b - 1] < c[b] - P && m + 1 < b && --b;
|
|
157
|
+
var D = c[b] - v, T = d - D;
|
|
158
|
+
if (n - g > f - p) {
|
|
159
|
+
var N = d ? (g * T + n * D) / d : n;
|
|
160
|
+
o(m, b, D, g, p, N, f), o(b, e, T, N, p, n, f);
|
|
161
161
|
} else {
|
|
162
|
-
var S = d ? (
|
|
163
|
-
o(m,
|
|
162
|
+
var S = d ? (p * T + f * D) / d : f;
|
|
163
|
+
o(m, b, D, g, p, n, S), o(b, e, T, g, S, n, f);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
(u.depth & 1 ?
|
|
167
|
+
function ue(u, t, i, a, r) {
|
|
168
|
+
(u.depth & 1 ? H : A)(u, t, i, a, r);
|
|
169
169
|
}
|
|
170
|
-
class
|
|
170
|
+
class B extends X {
|
|
171
171
|
constructor() {
|
|
172
172
|
super(...arguments), Object.defineProperty(this, "_tag", {
|
|
173
173
|
enumerable: !0,
|
|
@@ -178,18 +178,18 @@ class Y extends F {
|
|
|
178
178
|
enumerable: !0,
|
|
179
179
|
configurable: !0,
|
|
180
180
|
writable: !0,
|
|
181
|
-
value:
|
|
181
|
+
value: I.new({})
|
|
182
182
|
}), Object.defineProperty(this, "_treemapLayout", {
|
|
183
183
|
enumerable: !0,
|
|
184
184
|
configurable: !0,
|
|
185
185
|
writable: !0,
|
|
186
|
-
value: q().tile(
|
|
186
|
+
value: q().tile(V)
|
|
187
187
|
}), Object.defineProperty(this, "rectangles", {
|
|
188
188
|
enumerable: !0,
|
|
189
189
|
configurable: !0,
|
|
190
190
|
writable: !0,
|
|
191
|
-
value: this.addDisposer(new
|
|
192
|
-
themeTags:
|
|
191
|
+
value: this.addDisposer(new F(I.new({}), () => z._new(this._root, {
|
|
192
|
+
themeTags: M(this.rectangles.template.get("themeTags", []), [this._tag, "shape"])
|
|
193
193
|
}, [this.rectangles.template])))
|
|
194
194
|
});
|
|
195
195
|
}
|
|
@@ -201,19 +201,19 @@ class Y extends F {
|
|
|
201
201
|
let t;
|
|
202
202
|
switch (this.get("layoutAlgorithm")) {
|
|
203
203
|
case "squarify":
|
|
204
|
-
t =
|
|
204
|
+
t = V;
|
|
205
205
|
break;
|
|
206
206
|
case "binary":
|
|
207
|
-
t =
|
|
207
|
+
t = de;
|
|
208
208
|
break;
|
|
209
209
|
case "slice":
|
|
210
|
-
t =
|
|
210
|
+
t = H;
|
|
211
211
|
break;
|
|
212
212
|
case "dice":
|
|
213
|
-
t =
|
|
213
|
+
t = A;
|
|
214
214
|
break;
|
|
215
215
|
case "sliceDice":
|
|
216
|
-
t =
|
|
216
|
+
t = ue;
|
|
217
217
|
break;
|
|
218
218
|
}
|
|
219
219
|
if (t) {
|
|
@@ -228,22 +228,22 @@ class Y extends F {
|
|
|
228
228
|
if (this._rootNode) {
|
|
229
229
|
const t = this._treemapLayout;
|
|
230
230
|
t.size([this.innerWidth(), this.innerHeight()]);
|
|
231
|
-
const i = this.get("nodePaddingLeft"), a = this.get("nodePaddingRight"), r = this.get("nodePaddingTop"), l = this.get("nodePaddingBottom"),
|
|
232
|
-
|
|
231
|
+
const i = this.get("nodePaddingLeft"), a = this.get("nodePaddingRight"), r = this.get("nodePaddingTop"), l = this.get("nodePaddingBottom"), s = this.get("nodePaddingInner"), h = this.get("nodePaddingOuter");
|
|
232
|
+
O(i) && t.paddingLeft(i), O(a) && t.paddingRight(a), O(r) && t.paddingTop(r), O(l) && t.paddingBottom(l), O(s) && t.paddingInner(s), O(h) && t.paddingOuter(h), t(this._rootNode), this._updateNodes(this._rootNode);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
_updateNode(t) {
|
|
236
236
|
super._updateNode(t);
|
|
237
|
-
const i = t.get("node"), a = t.get("rectangle"), r = t.get("d3HierarchyNode"), l = this.getPrivate("scaleX", 1),
|
|
237
|
+
const i = t.get("node"), a = t.get("rectangle"), r = t.get("d3HierarchyNode"), l = this.getPrivate("scaleX", 1), s = this.getPrivate("scaleY", 1), h = r.x0 * l, y = r.x1 * l, c = r.y0 * s, o = r.y1 * s, m = y - h, e = o - c, d = this.get("animationDuration", 0), g = this.get("animationEasing");
|
|
238
238
|
if (i.animate({ key: "x", to: h, duration: d, easing: g }), i.animate({ key: "y", to: c, duration: d, easing: g }), i.animate({ key: "width", to: m, duration: d, easing: g }), i.animate({ key: "height", to: e, duration: d, easing: g }), a) {
|
|
239
|
-
const
|
|
240
|
-
a.animate({ key: "width", to: m, duration: d, easing: g }), a.animate({ key: "height", to: e, duration: d, easing: g }), a._setDefault("fill",
|
|
239
|
+
const p = t.get("fill"), n = t.get("fillPattern");
|
|
240
|
+
a.animate({ key: "width", to: m, duration: d, easing: g }), a.animate({ key: "height", to: e, duration: d, easing: g }), a._setDefault("fill", p), a._setDefault("fillPattern", n), a._setDefault("stroke", p);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
_updateNodesScale(t) {
|
|
244
244
|
const i = t.data.dataItem;
|
|
245
245
|
if (i) {
|
|
246
|
-
const a = i.get("node"), r = i.get("rectangle"), l = this.getPrivate("scaleX", 1),
|
|
246
|
+
const a = i.get("node"), r = i.get("rectangle"), l = this.getPrivate("scaleX", 1), s = this.getPrivate("scaleY", 1), h = t.x0 * l, y = t.x1 * l, c = t.y0 * s, o = t.y1 * s, m = y - h, e = o - c;
|
|
247
247
|
a.setAll({ x: h, y: c, width: m, height: e }), r.setAll({ width: m, height: e });
|
|
248
248
|
const d = t.children;
|
|
249
249
|
d && j(d, (g) => {
|
|
@@ -267,10 +267,10 @@ class Y extends F {
|
|
|
267
267
|
_zoom(t) {
|
|
268
268
|
if (this.width() > 0 && this.height() > 0) {
|
|
269
269
|
const i = t.get("d3HierarchyNode"), a = this.get("nodePaddingOuter", 0);
|
|
270
|
-
let r = i.x0 + a, l = i.x1 - a,
|
|
270
|
+
let r = i.x0 + a, l = i.x1 - a, s = i.y0 + a, h = i.y1 - a, y = (this.innerWidth() - a * 2) / (l - r), c = (this.innerHeight() - a * 2) / (h - s);
|
|
271
271
|
const o = this.get("animationEasing");
|
|
272
272
|
let m = this.get("animationDuration", 0);
|
|
273
|
-
this.inited || (m = 0), this.animatePrivate({ key: "scaleX", to:
|
|
273
|
+
this.inited || (m = 0), this.animatePrivate({ key: "scaleX", to: y, duration: m, easing: o }), this.animatePrivate({ key: "scaleY", to: c, duration: m, easing: o }), this.nodesContainer.animate({ key: "x", to: a - r * y, duration: m, easing: o }), this.nodesContainer.animate({ key: "y", to: a - s * c, duration: m, easing: o });
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
_selectDataItem(t, i, a) {
|
|
@@ -278,8 +278,8 @@ class Y extends F {
|
|
|
278
278
|
let r = this.get("downDepth", 1) + t.get("depth");
|
|
279
279
|
this.inited || (r = this.get("initialDepth", 1));
|
|
280
280
|
const l = this._getVisibleNodes(t, r);
|
|
281
|
-
this.nodes.each((
|
|
282
|
-
l.indexOf(
|
|
281
|
+
this.nodes.each((s) => {
|
|
282
|
+
l.indexOf(s.dataItem) == -1 ? s.setPrivate("focusable", !1) : s.removePrivate("focusable");
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
285
|
this._root._invalidateTabindexes();
|
|
@@ -292,46 +292,46 @@ class Y extends F {
|
|
|
292
292
|
}), r;
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
Object.defineProperty(
|
|
295
|
+
Object.defineProperty(B, "className", {
|
|
296
296
|
enumerable: !0,
|
|
297
297
|
configurable: !0,
|
|
298
298
|
writable: !0,
|
|
299
299
|
value: "Treemap"
|
|
300
300
|
});
|
|
301
|
-
Object.defineProperty(
|
|
301
|
+
Object.defineProperty(B, "classNames", {
|
|
302
302
|
enumerable: !0,
|
|
303
303
|
configurable: !0,
|
|
304
304
|
writable: !0,
|
|
305
|
-
value:
|
|
305
|
+
value: X.classNames.concat([B.className])
|
|
306
306
|
});
|
|
307
|
-
const
|
|
307
|
+
const _e = (u) => {
|
|
308
308
|
const t = G({ props: u, name: "HCDrillDownTreemap" }), {
|
|
309
309
|
dimensions: i,
|
|
310
310
|
values: a,
|
|
311
311
|
data: r,
|
|
312
312
|
initDelay: l = 0,
|
|
313
|
-
colors:
|
|
313
|
+
colors: s,
|
|
314
314
|
sx: h,
|
|
315
|
-
...
|
|
315
|
+
...y
|
|
316
316
|
} = t, c = J(), m = `hc-drill-down-treemap-${U().replace(/:/g, "")}`, e = ee(null);
|
|
317
317
|
let d = null;
|
|
318
318
|
i.length < 2 ? d = "DrillDownTreemap requires at least 2 dimensions" : a.length < 1 && (d = "DrillDownTreemap requires at least 1 value"), te(() => {
|
|
319
319
|
if (d) return;
|
|
320
|
-
let
|
|
321
|
-
return
|
|
322
|
-
var
|
|
323
|
-
const
|
|
324
|
-
e.current =
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
const
|
|
328
|
-
|
|
320
|
+
let p;
|
|
321
|
+
return p = setTimeout(() => {
|
|
322
|
+
var b, _;
|
|
323
|
+
const n = E.new(m);
|
|
324
|
+
e.current = n, ie(n, (b = a == null ? void 0 : a[0]) == null ? void 0 : b.format);
|
|
325
|
+
const f = Z.new(n);
|
|
326
|
+
f.rule("RoundedRectangle", ["hierarchy", "node", "shape", "depth1"]).setAll({ strokeWidth: 2 }), f.rule("RoundedRectangle", ["hierarchy", "node", "shape", "depth2"]).setAll({ strokeWidth: 1, strokeOpacity: 0.2 }), f.rule("Label", ["node", "depth1"]).setAll({ fontSize: 10 }), f.rule("Label", ["node", "depth2"]).setAll({ fontSize: 10 }), n.setThemes([$.new(n), f]);
|
|
327
|
+
const w = n.container.children.push(
|
|
328
|
+
x.new(n, {
|
|
329
329
|
width: C(100),
|
|
330
330
|
height: C(100),
|
|
331
|
-
layout:
|
|
331
|
+
layout: n.verticalLayout
|
|
332
332
|
})
|
|
333
|
-
),
|
|
334
|
-
|
|
333
|
+
), v = w.children.push(
|
|
334
|
+
B.new(n, {
|
|
335
335
|
sort: "descending",
|
|
336
336
|
singleBranchOnly: !1,
|
|
337
337
|
downDepth: 1,
|
|
@@ -344,42 +344,42 @@ const we = (u) => {
|
|
|
344
344
|
nodePaddingInner: 0
|
|
345
345
|
})
|
|
346
346
|
);
|
|
347
|
-
|
|
348
|
-
|
|
347
|
+
v.nodes.template.setPrivate("trustBounds", !0), v.set("colors", ae(n, s)), (_ = v.get("colors")) == null || _.set("step", 1), w.children.moveValue(
|
|
348
|
+
Y.new(n, { series: v }),
|
|
349
349
|
0
|
|
350
350
|
);
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
let
|
|
354
|
-
return
|
|
351
|
+
const P = (k, D, T) => {
|
|
352
|
+
if (k === "date") {
|
|
353
|
+
let N = "YYYY";
|
|
354
|
+
return D.includes("month") ? N = "MMM YYYY" : D.includes("day") && (N = "DD MMM YYYY"), K(T).format(N);
|
|
355
355
|
}
|
|
356
|
-
return
|
|
356
|
+
return T;
|
|
357
357
|
};
|
|
358
358
|
if (i.length > 1) {
|
|
359
|
-
const
|
|
360
|
-
Object.keys(
|
|
361
|
-
|
|
362
|
-
name:
|
|
363
|
-
children:
|
|
364
|
-
name:
|
|
359
|
+
const k = Q.groupBy(r, i[0].value), D = [];
|
|
360
|
+
Object.keys(k).forEach((T) => {
|
|
361
|
+
D.push({
|
|
362
|
+
name: P(i[0].type, i[0].value, T),
|
|
363
|
+
children: k[T].map((N) => ({
|
|
364
|
+
name: P(
|
|
365
365
|
i[1].type,
|
|
366
366
|
i[1].value,
|
|
367
|
-
|
|
367
|
+
N[i[1].value]
|
|
368
368
|
),
|
|
369
|
-
[a[0].dataFieldName]:
|
|
369
|
+
[a[0].dataFieldName]: N[a[0].dataFieldName]
|
|
370
370
|
}))
|
|
371
371
|
});
|
|
372
|
-
}),
|
|
372
|
+
}), v.data.setAll([{ name: "Home", children: D }]);
|
|
373
373
|
}
|
|
374
|
-
|
|
374
|
+
v.set("selectedDataItem", v.dataItems[0]);
|
|
375
375
|
}, l), () => {
|
|
376
|
-
var
|
|
377
|
-
|
|
376
|
+
var n;
|
|
377
|
+
p && clearTimeout(p), (n = e.current) == null || n.dispose(), e.current = null;
|
|
378
378
|
};
|
|
379
|
-
}, [r, i, a, c.palette.mode,
|
|
379
|
+
}, [r, i, a, c.palette.mode, s]);
|
|
380
380
|
const g = { ...t };
|
|
381
|
-
return { chartId: m, ownerState: g, sx: h, error: d, other:
|
|
381
|
+
return { chartId: m, ownerState: g, sx: h, error: d, other: y };
|
|
382
382
|
};
|
|
383
383
|
export {
|
|
384
|
-
|
|
384
|
+
_e as useDrillDownTreemapLogic
|
|
385
385
|
};
|