@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,15 +1,15 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as U, G as A, k as X, l as I, R as ee, A as te } from "../../../AnimatedTheme-jnasw6rT.js";
|
|
2
2
|
import { useThemeProps as re } from "@mui/material";
|
|
3
3
|
import ne from "dayjs";
|
|
4
|
-
import { useId as
|
|
5
|
-
import {
|
|
4
|
+
import { useId as ie, useRef as se, useEffect as oe } from "react";
|
|
5
|
+
import { applyValueFormat as ae, colorSetFromPalette as ue } from "../_common/utils.js";
|
|
6
6
|
import { Z as $ } from "../../../ZoomableContainer-DYyqwaMb.js";
|
|
7
|
-
import { M as
|
|
7
|
+
import { M as le, m as ce, e as he, b as q } from "../../../ColorSet-C7vpNXhM.js";
|
|
8
8
|
import { B as O } from "../../../Button-CcsPEIDh.js";
|
|
9
9
|
import { H as J } from "../../../Hierarchy-Bihj0S61.js";
|
|
10
|
-
import { C as
|
|
11
|
-
import { o as
|
|
12
|
-
class j extends
|
|
10
|
+
import { C as fe } from "../../../Circle-Cy5s-pVc.js";
|
|
11
|
+
import { o as de, c as z, a as me } from "../../../constant-BiOGvlZc.js";
|
|
12
|
+
class j extends U {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments), Object.defineProperty(this, "homeButton", {
|
|
15
15
|
enumerable: !0,
|
|
@@ -57,7 +57,7 @@ class j extends V {
|
|
|
57
57
|
n == r.get("minZoomLevel") ? this.minusButton.set("disabled", !0) : this.minusButton.set("disabled", !1), n == r.get("maxZoomLevel") ? this.plusButton.set("disabled", !0) : this.plusButton.set("disabled", !1);
|
|
58
58
|
})), this.root.events.once("frameended", () => {
|
|
59
59
|
r.get("scale") == r.get("minZoomLevel") && this.minusButton.set("disabled", !0);
|
|
60
|
-
})), this._disposer = new
|
|
60
|
+
})), this._disposer = new le([
|
|
61
61
|
this.plusButton.events.on("click", () => {
|
|
62
62
|
r.zoomIn();
|
|
63
63
|
}),
|
|
@@ -81,46 +81,46 @@ Object.defineProperty(j, "classNames", {
|
|
|
81
81
|
enumerable: !0,
|
|
82
82
|
configurable: !0,
|
|
83
83
|
writable: !0,
|
|
84
|
-
value:
|
|
84
|
+
value: U.classNames.concat([j.className])
|
|
85
85
|
});
|
|
86
|
-
const
|
|
87
|
-
function
|
|
86
|
+
const pe = 1664525, ge = 1013904223, E = 4294967296;
|
|
87
|
+
function ye() {
|
|
88
88
|
let t = 1;
|
|
89
|
-
return () => (t = (
|
|
89
|
+
return () => (t = (pe * t + ge) % E) / E;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function xe(t) {
|
|
92
92
|
return typeof t == "object" && "length" in t ? t : Array.from(t);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
let e = t.length, n,
|
|
94
|
+
function be(t, r) {
|
|
95
|
+
let e = t.length, n, i;
|
|
96
96
|
for (; e; )
|
|
97
|
-
|
|
97
|
+
i = r() * e-- | 0, n = t[e], t[e] = t[i], t[i] = n;
|
|
98
98
|
return t;
|
|
99
99
|
}
|
|
100
100
|
function ve(t, r) {
|
|
101
|
-
for (var e = 0, n = (t =
|
|
102
|
-
|
|
101
|
+
for (var e = 0, n = (t = be(Array.from(t), r)).length, i = [], s, a; e < n; )
|
|
102
|
+
s = t[e], a && K(a, s) ? ++e : (a = we(i = _e(i, s)), e = 0);
|
|
103
103
|
return a;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function _e(t, r) {
|
|
106
106
|
var e, n;
|
|
107
107
|
if (L(r, t)) return [r];
|
|
108
108
|
for (e = 0; e < t.length; ++e)
|
|
109
|
-
if (D(r, t[e]) && L(
|
|
109
|
+
if (D(r, t[e]) && L(_(t[e], r), t))
|
|
110
110
|
return [t[e], r];
|
|
111
111
|
for (e = 0; e < t.length - 1; ++e)
|
|
112
112
|
for (n = e + 1; n < t.length; ++n)
|
|
113
|
-
if (D(
|
|
113
|
+
if (D(_(t[e], t[n]), r) && D(_(t[e], r), t[n]) && D(_(t[n], r), t[e]) && L(Q(t[e], t[n], r), t))
|
|
114
114
|
return [t[e], t[n], r];
|
|
115
115
|
throw new Error();
|
|
116
116
|
}
|
|
117
117
|
function D(t, r) {
|
|
118
|
-
var e = t.r - r.r, n = r.x - t.x,
|
|
119
|
-
return e < 0 || e * e < n * n +
|
|
118
|
+
var e = t.r - r.r, n = r.x - t.x, i = r.y - t.y;
|
|
119
|
+
return e < 0 || e * e < n * n + i * i;
|
|
120
120
|
}
|
|
121
121
|
function K(t, r) {
|
|
122
|
-
var e = t.r - r.r + Math.max(t.r, r.r, 1) * 1e-9, n = r.x - t.x,
|
|
123
|
-
return e > 0 && e * e > n * n +
|
|
122
|
+
var e = t.r - r.r + Math.max(t.r, r.r, 1) * 1e-9, n = r.x - t.x, i = r.y - t.y;
|
|
123
|
+
return e > 0 && e * e > n * n + i * i;
|
|
124
124
|
}
|
|
125
125
|
function L(t, r) {
|
|
126
126
|
for (var e = 0; e < r.length; ++e)
|
|
@@ -128,118 +128,118 @@ function L(t, r) {
|
|
|
128
128
|
return !1;
|
|
129
129
|
return !0;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function we(t) {
|
|
132
132
|
switch (t.length) {
|
|
133
133
|
case 1:
|
|
134
|
-
return
|
|
134
|
+
return ke(t[0]);
|
|
135
135
|
case 2:
|
|
136
|
-
return
|
|
136
|
+
return _(t[0], t[1]);
|
|
137
137
|
case 3:
|
|
138
138
|
return Q(t[0], t[1], t[2]);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function ke(t) {
|
|
142
142
|
return {
|
|
143
143
|
x: t.x,
|
|
144
144
|
y: t.y,
|
|
145
145
|
r: t.r
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
var e = t.x, n = t.y,
|
|
148
|
+
function _(t, r) {
|
|
149
|
+
var e = t.x, n = t.y, i = t.r, s = r.x, a = r.y, l = r.r, o = s - e, u = a - n, c = l - i, h = Math.sqrt(o * o + u * u);
|
|
150
150
|
return {
|
|
151
|
-
x: (e +
|
|
151
|
+
x: (e + s + o / h * c) / 2,
|
|
152
152
|
y: (n + a + u / h * c) / 2,
|
|
153
|
-
r: (h +
|
|
153
|
+
r: (h + i + l) / 2
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
156
|
function Q(t, r, e) {
|
|
157
|
-
var n = t.x,
|
|
157
|
+
var n = t.x, i = t.y, s = t.r, a = r.x, l = r.y, o = r.r, u = e.x, c = e.y, h = e.r, d = n - a, m = n - u, b = i - l, p = i - c, f = o - s, y = h - s, x = n * n + i * i - s * s, w = x - a * a - l * l + o * o, v = x - u * u - c * c + h * h, g = m * b - d * p, k = (b * v - p * w) / (g * 2) - n, P = (p * f - b * y) / g, N = (m * w - d * v) / (g * 2) - i, M = (d * y - m * f) / g, H = P * P + M * M - 1, C = 2 * (s + k * P + N * M), Z = k * k + N * N - s * s, Y = -(Math.abs(H) > 1e-6 ? (C + Math.sqrt(C * C - 4 * H * Z)) / (2 * H) : Z / C);
|
|
158
158
|
return {
|
|
159
159
|
x: n + k + P * Y,
|
|
160
|
-
y:
|
|
160
|
+
y: i + N + M * Y,
|
|
161
161
|
r: Y
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
var n = t.x - r.x,
|
|
166
|
-
u ? (
|
|
164
|
+
function F(t, r, e) {
|
|
165
|
+
var n = t.x - r.x, i, s, a = t.y - r.y, l, o, u = n * n + a * a;
|
|
166
|
+
u ? (s = r.r + e.r, s *= s, o = t.r + e.r, o *= o, s > o ? (i = (u + o - s) / (2 * u), l = Math.sqrt(Math.max(0, o / u - i * i)), e.x = t.x - i * n - l * a, e.y = t.y - i * a + l * n) : (i = (u + s - o) / (2 * u), l = Math.sqrt(Math.max(0, s / u - i * i)), e.x = r.x + i * n - l * a, e.y = r.y + i * a + l * n)) : (e.x = r.x + e.r, e.y = r.y);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
var e = t.r + r.r - 1e-6, n = r.x - t.x,
|
|
170
|
-
return e > 0 && e * e > n * n +
|
|
168
|
+
function W(t, r) {
|
|
169
|
+
var e = t.r + r.r - 1e-6, n = r.x - t.x, i = r.y - t.y;
|
|
170
|
+
return e > 0 && e * e > n * n + i * i;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
var r = t._, e = t.next._, n = r.r + e.r,
|
|
174
|
-
return
|
|
172
|
+
function V(t) {
|
|
173
|
+
var r = t._, e = t.next._, n = r.r + e.r, i = (r.x * e.r + e.x * r.r) / n, s = (r.y * e.r + e.y * r.r) / n;
|
|
174
|
+
return i * i + s * s;
|
|
175
175
|
}
|
|
176
176
|
function T(t) {
|
|
177
177
|
this._ = t, this.next = null, this.previous = null;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
if (!(
|
|
181
|
-
var e, n,
|
|
182
|
-
if (e = t[0], e.x = 0, e.y = 0, !(
|
|
183
|
-
if (n = t[1], e.x = -n.r, n.x = e.r, n.y = 0, !(
|
|
184
|
-
|
|
185
|
-
e: for (o = 3; o <
|
|
186
|
-
|
|
179
|
+
function Pe(t, r) {
|
|
180
|
+
if (!(s = (t = xe(t)).length)) return 0;
|
|
181
|
+
var e, n, i, s, a, l, o, u, c, h, d;
|
|
182
|
+
if (e = t[0], e.x = 0, e.y = 0, !(s > 1)) return e.r;
|
|
183
|
+
if (n = t[1], e.x = -n.r, n.x = e.r, n.y = 0, !(s > 2)) return e.r + n.r;
|
|
184
|
+
F(n, e, i = t[2]), e = new T(e), n = new T(n), i = new T(i), e.next = i.previous = n, n.next = e.previous = i, i.next = n.previous = e;
|
|
185
|
+
e: for (o = 3; o < s; ++o) {
|
|
186
|
+
F(e._, n._, i = t[o]), i = new T(i), u = n.next, c = e.previous, h = n._.r, d = e._.r;
|
|
187
187
|
do
|
|
188
188
|
if (h <= d) {
|
|
189
|
-
if (
|
|
189
|
+
if (W(u._, i._)) {
|
|
190
190
|
n = u, e.next = n, n.previous = e, --o;
|
|
191
191
|
continue e;
|
|
192
192
|
}
|
|
193
193
|
h += u._.r, u = u.next;
|
|
194
194
|
} else {
|
|
195
|
-
if (
|
|
195
|
+
if (W(c._, i._)) {
|
|
196
196
|
e = c, e.next = n, n.previous = e, --o;
|
|
197
197
|
continue e;
|
|
198
198
|
}
|
|
199
199
|
d += c._.r, c = c.previous;
|
|
200
200
|
}
|
|
201
201
|
while (u !== c.next);
|
|
202
|
-
for (
|
|
203
|
-
(l =
|
|
202
|
+
for (i.previous = e, i.next = n, e.next = n.previous = n = i, a = V(e); (i = i.next) !== n; )
|
|
203
|
+
(l = V(i)) < a && (e = i, a = l);
|
|
204
204
|
n = e.next;
|
|
205
205
|
}
|
|
206
|
-
for (e = [n._],
|
|
207
|
-
for (
|
|
208
|
-
return
|
|
206
|
+
for (e = [n._], i = n; (i = i.next) !== n; ) e.push(i._);
|
|
207
|
+
for (i = ve(e, r), o = 0; o < s; ++o) e = t[o], e.x -= i.x, e.y -= i.y;
|
|
208
|
+
return i.r;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Ne(t) {
|
|
211
211
|
return Math.sqrt(t.value);
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Me() {
|
|
214
214
|
var t = null, r = 1, e = 1, n = z;
|
|
215
|
-
function s
|
|
216
|
-
const a =
|
|
217
|
-
return
|
|
215
|
+
function i(s) {
|
|
216
|
+
const a = ye();
|
|
217
|
+
return s.x = r / 2, s.y = e / 2, t ? s.eachBefore(B(t)).eachAfter(S(n, 0.5, a)).eachBefore(G(1)) : s.eachBefore(B(Ne)).eachAfter(S(z, 1, a)).eachAfter(S(n, s.r / Math.min(r, e), a)).eachBefore(G(Math.min(r, e) / (2 * s.r))), s;
|
|
218
218
|
}
|
|
219
|
-
return
|
|
220
|
-
return arguments.length ? (t =
|
|
221
|
-
},
|
|
222
|
-
return arguments.length ? (r = +
|
|
223
|
-
},
|
|
224
|
-
return arguments.length ? (n = typeof
|
|
225
|
-
},
|
|
219
|
+
return i.radius = function(s) {
|
|
220
|
+
return arguments.length ? (t = de(s), i) : t;
|
|
221
|
+
}, i.size = function(s) {
|
|
222
|
+
return arguments.length ? (r = +s[0], e = +s[1], i) : [r, e];
|
|
223
|
+
}, i.padding = function(s) {
|
|
224
|
+
return arguments.length ? (n = typeof s == "function" ? s : me(+s), i) : n;
|
|
225
|
+
}, i;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function B(t) {
|
|
228
228
|
return function(r) {
|
|
229
229
|
r.children || (r.r = Math.max(0, +t(r) || 0));
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
232
|
function S(t, r, e) {
|
|
233
233
|
return function(n) {
|
|
234
|
-
if (
|
|
235
|
-
var
|
|
236
|
-
if (l) for (
|
|
237
|
-
if (o =
|
|
234
|
+
if (i = n.children) {
|
|
235
|
+
var i, s, a = i.length, l = t(n) * r || 0, o;
|
|
236
|
+
if (l) for (s = 0; s < a; ++s) i[s].r += l;
|
|
237
|
+
if (o = Pe(i, e), l) for (s = 0; s < a; ++s) i[s].r -= l;
|
|
238
238
|
n.r = o + l;
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function G(t) {
|
|
243
243
|
return function(r) {
|
|
244
244
|
var e = r.parent;
|
|
245
245
|
r.r *= t, e && (r.x = e.x + t * r.x, r.y = e.y + t * r.y);
|
|
@@ -256,7 +256,7 @@ class R extends J {
|
|
|
256
256
|
enumerable: !0,
|
|
257
257
|
configurable: !0,
|
|
258
258
|
writable: !0,
|
|
259
|
-
value:
|
|
259
|
+
value: Me()
|
|
260
260
|
}), Object.defineProperty(this, "_packData", {
|
|
261
261
|
enumerable: !0,
|
|
262
262
|
configurable: !0,
|
|
@@ -266,8 +266,8 @@ class R extends J {
|
|
|
266
266
|
enumerable: !0,
|
|
267
267
|
configurable: !0,
|
|
268
268
|
writable: !0,
|
|
269
|
-
value: this.addDisposer(new X(I.new({}), () =>
|
|
270
|
-
themeTags:
|
|
269
|
+
value: this.addDisposer(new X(I.new({}), () => fe._new(this._root, {
|
|
270
|
+
themeTags: ce(this.circles.template.get("themeTags", []), [this._tag, "shape"])
|
|
271
271
|
}, [this.circles.template])))
|
|
272
272
|
});
|
|
273
273
|
}
|
|
@@ -285,7 +285,7 @@ class R extends J {
|
|
|
285
285
|
}
|
|
286
286
|
_updateNode(r) {
|
|
287
287
|
super._updateNode(r);
|
|
288
|
-
const e = r.get("node"), n = r.get("circle"),
|
|
288
|
+
const e = r.get("node"), n = r.get("circle"), i = r.get("d3HierarchyNode"), s = this.getPrivate("scaleR", 1), a = i.x * s, l = i.y * s, o = i.r * s, u = this.get("animationDuration", 0), c = this.get("animationEasing");
|
|
289
289
|
if (e.animate({ key: "x", to: a, duration: u, easing: c }), e.animate({ key: "y", to: l, duration: u, easing: c }), n) {
|
|
290
290
|
const h = r.get("fill"), d = r.get("fillPattern");
|
|
291
291
|
n.animate({ key: "radius", to: o, duration: u, easing: c }), n._setDefault("fill", h), n._setDefault("fillPattern", d), n._setDefault("stroke", h);
|
|
@@ -294,10 +294,10 @@ class R extends J {
|
|
|
294
294
|
_updateNodesScale(r) {
|
|
295
295
|
const e = r.data.dataItem;
|
|
296
296
|
if (e) {
|
|
297
|
-
const n = e.get("node"),
|
|
298
|
-
n.setAll({ x: a, y: l }),
|
|
297
|
+
const n = e.get("node"), i = e.get("circle"), s = this.getPrivate("scaleR", 1), a = r.x * s, l = r.y * s, o = r.r * s;
|
|
298
|
+
n.setAll({ x: a, y: l }), i.set("radius", o);
|
|
299
299
|
const u = r.children;
|
|
300
|
-
u &&
|
|
300
|
+
u && he(u, (c) => {
|
|
301
301
|
this._updateNodesScale(c);
|
|
302
302
|
});
|
|
303
303
|
}
|
|
@@ -308,20 +308,20 @@ class R extends J {
|
|
|
308
308
|
makeNode(r) {
|
|
309
309
|
const e = super.makeNode(r), n = e.children.moveValue(this.circles.make(), 0);
|
|
310
310
|
e.setPrivate("tooltipTarget", n), this.circles.push(n), r.setRaw("circle", n);
|
|
311
|
-
const
|
|
311
|
+
const i = r.get("label");
|
|
312
312
|
return n.on("radius", () => {
|
|
313
|
-
const
|
|
314
|
-
|
|
313
|
+
const s = n.get("radius", this.width()) * 2;
|
|
314
|
+
i.setAll({ maxWidth: s, maxHeight: s });
|
|
315
315
|
}), e;
|
|
316
316
|
}
|
|
317
317
|
_zoom(r) {
|
|
318
318
|
const e = r.get("d3HierarchyNode");
|
|
319
|
-
let n = e.x,
|
|
319
|
+
let n = e.x, i = e.y, s = e.r, a = Math.min(this.innerWidth(), this.innerHeight()) / (s * 2);
|
|
320
320
|
const l = this.get("animationEasing");
|
|
321
321
|
let o = this.get("animationDuration", 0);
|
|
322
322
|
this.inited || (o = 0), this.animatePrivate({ key: "scaleR", to: a, duration: o, easing: l });
|
|
323
323
|
const u = this.nodesContainer;
|
|
324
|
-
u.animate({ key: "x", from: u.x(), to: this.width() / 2 - n * a, duration: o, easing: l }), u.animate({ key: "y", from: u.y(), to: this.height() / 2 -
|
|
324
|
+
u.animate({ key: "x", from: u.x(), to: this.width() / 2 - n * a, duration: o, easing: l }), u.animate({ key: "y", from: u.y(), to: this.height() / 2 - i * a, duration: o, easing: l });
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
Object.defineProperty(R, "className", {
|
|
@@ -336,7 +336,7 @@ Object.defineProperty(R, "classNames", {
|
|
|
336
336
|
writable: !0,
|
|
337
337
|
value: J.classNames.concat([R.className])
|
|
338
338
|
});
|
|
339
|
-
function
|
|
339
|
+
function Ce(t, r) {
|
|
340
340
|
const e = ne(t);
|
|
341
341
|
switch (r) {
|
|
342
342
|
case "millisecond":
|
|
@@ -359,25 +359,26 @@ function Me(t, r) {
|
|
|
359
359
|
return e.format();
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
const
|
|
362
|
+
const qe = (t) => {
|
|
363
363
|
const r = re({ props: t, name: "HCPackedCircles" }), {
|
|
364
364
|
dimensions: e,
|
|
365
365
|
values: n,
|
|
366
|
-
data:
|
|
367
|
-
initDelay:
|
|
366
|
+
data: i,
|
|
367
|
+
initDelay: s = 0,
|
|
368
368
|
baseInterval: a = { timeUnit: "year", count: 1 },
|
|
369
369
|
colors: l,
|
|
370
370
|
sx: o,
|
|
371
371
|
...u
|
|
372
|
-
} = r, h = `hc-packed-circles-${
|
|
372
|
+
} = r, h = `hc-packed-circles-${ie().replace(/:/g, "")}`, d = se(null);
|
|
373
373
|
let m = null;
|
|
374
374
|
e.length < 1 ? m = "PackedCircles requires at least 1 dimension" : n.length < 1 && (m = "PackedCircles requires at least 1 value"), oe(() => {
|
|
375
375
|
if (m) return;
|
|
376
376
|
let p;
|
|
377
377
|
return p = setTimeout(() => {
|
|
378
|
+
var v;
|
|
378
379
|
const f = ee.new(h);
|
|
379
|
-
d.current = f, f.setThemes([te.new(f)]);
|
|
380
|
-
const
|
|
380
|
+
d.current = f, ae(f, (v = n == null ? void 0 : n[0]) == null ? void 0 : v.format), f.setThemes([te.new(f)]);
|
|
381
|
+
const y = f.container.children.push(
|
|
381
382
|
$.new(f, {
|
|
382
383
|
width: q,
|
|
383
384
|
height: q,
|
|
@@ -385,10 +386,10 @@ const Ze = (t) => {
|
|
|
385
386
|
pinchZoom: !0
|
|
386
387
|
})
|
|
387
388
|
);
|
|
388
|
-
|
|
389
|
-
j.new(f, { target:
|
|
389
|
+
y.children.push(
|
|
390
|
+
j.new(f, { target: y })
|
|
390
391
|
);
|
|
391
|
-
const
|
|
392
|
+
const x = y.contents.children.push(
|
|
392
393
|
R.new(f, {
|
|
393
394
|
maskContent: !1,
|
|
394
395
|
topDepth: 1,
|
|
@@ -396,22 +397,22 @@ const Ze = (t) => {
|
|
|
396
397
|
categoryField: e[0].value,
|
|
397
398
|
childDataField: "children"
|
|
398
399
|
})
|
|
399
|
-
),
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
400
|
+
), w = ue(f, l);
|
|
401
|
+
x.set("colors", w), e[0].type === "date" && i.forEach((g) => {
|
|
402
|
+
g[e[0].value] = Ce(
|
|
403
|
+
g[e[0].value],
|
|
403
404
|
a.timeUnit
|
|
404
405
|
);
|
|
405
|
-
}),
|
|
406
|
-
},
|
|
406
|
+
}), x.data.setAll([{ name: "Root", children: i }]), x.appear(1e3, 100);
|
|
407
|
+
}, s), () => {
|
|
407
408
|
var f;
|
|
408
409
|
p && clearTimeout(p), (f = d.current) == null || f.dispose(), d.current = null;
|
|
409
410
|
};
|
|
410
|
-
}, [
|
|
411
|
-
const
|
|
412
|
-
return { chartId: h, ownerState:
|
|
411
|
+
}, [i, e, n, l]);
|
|
412
|
+
const b = { ...r };
|
|
413
|
+
return { chartId: h, ownerState: b, sx: o, error: m, other: u };
|
|
413
414
|
};
|
|
414
415
|
export {
|
|
415
|
-
|
|
416
|
-
|
|
416
|
+
Ce as formatTimeLabel,
|
|
417
|
+
qe as usePackedCirclesLogic
|
|
417
418
|
};
|
|
@@ -1,65 +1,66 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import { colorSetFromPalette as
|
|
6
|
-
import { P as
|
|
7
|
-
import { c as m, p as
|
|
8
|
-
import { L as
|
|
9
|
-
const
|
|
10
|
-
const
|
|
1
|
+
import { R as w, A as x } from "../../../AnimatedTheme-jnasw6rT.js";
|
|
2
|
+
import { useThemeProps as A, useTheme as C } from "@mui/material";
|
|
3
|
+
import F from "dayjs";
|
|
4
|
+
import { useId as L, useRef as R, useEffect as D } 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
|
+
import { c as m, p as Y } from "../../../ColorSet-C7vpNXhM.js";
|
|
8
|
+
import { L as k } from "../../../Legend-Dp_MKfS4.js";
|
|
9
|
+
const J = (v) => {
|
|
10
|
+
const p = A({ props: v, name: "HCPieChart" }), {
|
|
11
11
|
dimensions: t,
|
|
12
|
-
values:
|
|
12
|
+
values: r,
|
|
13
13
|
data: i,
|
|
14
|
-
initDelay:
|
|
14
|
+
initDelay: y = 0,
|
|
15
15
|
colors: d,
|
|
16
|
-
sx:
|
|
17
|
-
...
|
|
18
|
-
} =
|
|
19
|
-
let
|
|
20
|
-
t.length < 1 ?
|
|
21
|
-
if (
|
|
16
|
+
sx: M,
|
|
17
|
+
...P
|
|
18
|
+
} = p, o = C(), u = `hc-pie-chart-${L().replace(/:/g, "")}`, n = R(null);
|
|
19
|
+
let s = null;
|
|
20
|
+
t.length < 1 ? s = "Missing dimensions config!" : r.length < 1 && (s = "Missing values config!"), D(() => {
|
|
21
|
+
if (s) return;
|
|
22
22
|
let l;
|
|
23
23
|
return l = setTimeout(() => {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
var h;
|
|
25
|
+
const e = w.new(u);
|
|
26
|
+
n.current = e, I(e, (h = r == null ? void 0 : r[0]) == null ? void 0 : h.format), e.setThemes([x.new(e)]);
|
|
26
27
|
const f = e.container.children.push(
|
|
27
|
-
|
|
28
|
+
E.new(e, {
|
|
28
29
|
layout: e.verticalLayout
|
|
29
30
|
})
|
|
30
31
|
);
|
|
31
32
|
e.interfaceColors.setAll({
|
|
32
|
-
text: m(
|
|
33
|
-
grid: m(
|
|
34
|
-
stroke: m(
|
|
33
|
+
text: m(o.palette.text.primary),
|
|
34
|
+
grid: m(o.palette.divider),
|
|
35
|
+
stroke: m(o.palette.divider)
|
|
35
36
|
});
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
valueField:
|
|
37
|
+
const a = f.series.push(
|
|
38
|
+
j.new(e, {
|
|
39
|
+
valueField: r[0].dataFieldName,
|
|
39
40
|
categoryField: t[0].value
|
|
40
41
|
})
|
|
41
42
|
);
|
|
42
|
-
|
|
43
|
+
a.set("colors", S(e, d)), t[0].type === "date" && i.forEach((g) => {
|
|
43
44
|
let c = "YYYY";
|
|
44
|
-
t[0].value.includes("month") ? c = "MMM YYYY" : t[0].value.includes("day") && (c = "DD MMM YYYY"),
|
|
45
|
+
t[0].value.includes("month") ? c = "MMM YYYY" : t[0].value.includes("day") && (c = "DD MMM YYYY"), g[t[0].value] = F(g[t[0].value]).format(
|
|
45
46
|
c
|
|
46
47
|
);
|
|
47
|
-
}),
|
|
48
|
-
|
|
49
|
-
centerX:
|
|
50
|
-
x:
|
|
48
|
+
}), a.data.setAll(i), f.children.push(
|
|
49
|
+
k.new(e, {
|
|
50
|
+
centerX: Y(50),
|
|
51
|
+
x: Y(50),
|
|
51
52
|
marginTop: 15,
|
|
52
53
|
marginBottom: 15
|
|
53
54
|
})
|
|
54
|
-
).data.setAll(
|
|
55
|
-
},
|
|
55
|
+
).data.setAll(a.dataItems), a.appear(1e3, 100);
|
|
56
|
+
}, y), () => {
|
|
56
57
|
var e;
|
|
57
58
|
l && clearTimeout(l), (e = n.current) == null || e.dispose(), n.current = null;
|
|
58
59
|
};
|
|
59
|
-
}, [i, t,
|
|
60
|
-
const
|
|
61
|
-
return { chartId:
|
|
60
|
+
}, [i, t, r, o.palette.mode, d]);
|
|
61
|
+
const T = { ...p };
|
|
62
|
+
return { chartId: u, ownerState: T, sx: M, error: s, other: P };
|
|
62
63
|
};
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
+
J as usePieChartLogic
|
|
65
66
|
};
|