@hybridcore/ui 1.6.27 → 1.6.29
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/format.js +64 -54
- package/dist/components/charts/_common/utils.js +39 -20
- package/dist/components/charts/donut-chart/logic.js +96 -58
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +4 -1
- package/dist/components/charts/highlighting-line-data/logic.js +12 -10
- package/dist/components/charts/packed-circles/logic.js +4 -1
- package/dist/components/charts/pie-chart/logic.js +88 -50
- package/dist/components/data-map/index.js +5 -1
- package/dist/components/data-map/logic.js +93 -82
- package/dist/components/heat-map/index.js +16 -12
- package/dist/main.d.ts +50 -2
- package/package.json +1 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import S from "dayjs";
|
|
2
2
|
import { c as k, g as q } from "../../../_commonjsHelpers-BkfeUUK-.js";
|
|
3
|
-
var
|
|
3
|
+
var E = { exports: {} };
|
|
4
4
|
(function(t, e) {
|
|
5
5
|
(function(r, n) {
|
|
6
6
|
t.exports = n();
|
|
7
7
|
})(k, function() {
|
|
8
8
|
return function(r, n, s) {
|
|
9
9
|
r = r || {};
|
|
10
|
-
var i = n.prototype,
|
|
10
|
+
var i = n.prototype, h = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
|
|
11
11
|
function d(o, c, m, f) {
|
|
12
12
|
return i.fromToBase(o, c, m, f);
|
|
13
13
|
}
|
|
14
|
-
s.en.relativeTime =
|
|
15
|
-
for (var N,
|
|
16
|
-
var u = D[
|
|
14
|
+
s.en.relativeTime = h, i.fromToBase = function(o, c, m, f, $) {
|
|
15
|
+
for (var N, p, M, y = m.$locale().relativeTime || h, D = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], L = D.length, b = 0; b < L; b += 1) {
|
|
16
|
+
var u = D[b];
|
|
17
17
|
u.d && (N = f ? s(o).diff(m, u.d, !0) : m.diff(o, u.d, !0));
|
|
18
18
|
var a = (r.rounding || Math.round)(Math.abs(N));
|
|
19
|
-
if (
|
|
20
|
-
a <= 1 &&
|
|
21
|
-
var
|
|
22
|
-
$ && (a = $("" + a)),
|
|
19
|
+
if (M = N > 0, a <= u.r || !u.r) {
|
|
20
|
+
a <= 1 && b > 0 && (u = D[b - 1]);
|
|
21
|
+
var x = y[u.l];
|
|
22
|
+
$ && (a = $("" + a)), p = typeof x == "string" ? x.replace("%d", a) : x(a, c, u.l, M);
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
if (c) return
|
|
27
|
-
var
|
|
28
|
-
return typeof
|
|
26
|
+
if (c) return p;
|
|
27
|
+
var w = M ? y.future : y.past;
|
|
28
|
+
return typeof w == "function" ? w(p) : w.replace("%s", p);
|
|
29
29
|
}, i.to = function(o, c) {
|
|
30
30
|
return d(o, c, this, !0);
|
|
31
31
|
}, i.from = function(o, c) {
|
|
@@ -41,10 +41,10 @@ var S = { exports: {} };
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
});
|
|
44
|
-
})(
|
|
45
|
-
var
|
|
46
|
-
const B = /* @__PURE__ */ q(
|
|
47
|
-
|
|
44
|
+
})(E);
|
|
45
|
+
var A = E.exports;
|
|
46
|
+
const B = /* @__PURE__ */ q(A);
|
|
47
|
+
S.extend(B);
|
|
48
48
|
const W = "—", j = (t) => {
|
|
49
49
|
const { decimals: e, notation: r } = t ?? {};
|
|
50
50
|
return r === "compact" ? new Intl.NumberFormat("en-US", {
|
|
@@ -56,7 +56,7 @@ const W = "—", j = (t) => {
|
|
|
56
56
|
"en-US",
|
|
57
57
|
e === void 0 ? { maximumFractionDigits: 2 } : { minimumFractionDigits: e, maximumFractionDigits: e }
|
|
58
58
|
);
|
|
59
|
-
},
|
|
59
|
+
}, C = (t) => {
|
|
60
60
|
if (typeof t == "boolean") return t;
|
|
61
61
|
if (typeof t == "number") return t === 1;
|
|
62
62
|
if (typeof t == "string") {
|
|
@@ -64,38 +64,47 @@ const W = "—", j = (t) => {
|
|
|
64
64
|
return e === "true" || e === "1";
|
|
65
65
|
}
|
|
66
66
|
return !1;
|
|
67
|
-
},
|
|
67
|
+
}, I = (t) => {
|
|
68
68
|
const e = t.toLowerCase();
|
|
69
69
|
return e.includes("year") ? "YYYY" : e.includes("month") ? "MMM YYYY" : e.includes("hour") || e.includes("minute") || e.includes("time") ? "DD MMM YYYY HH:mm" : "DD MMM YYYY";
|
|
70
|
-
},
|
|
71
|
-
const n =
|
|
72
|
-
return n.isValid() ? e === "relative" ? n.fromNow() : n.format(e ||
|
|
73
|
-
},
|
|
70
|
+
}, P = (t, e, r = "") => {
|
|
71
|
+
const n = S(t);
|
|
72
|
+
return n.isValid() ? e === "relative" ? n.fromNow() : n.format(e || I(r)) : String(t);
|
|
73
|
+
}, F = (t, e) => `${(t == null ? void 0 : t.prefix) ?? ""}${e}${(t == null ? void 0 : t.suffix) ?? ""}`, X = (t, e, r = W, n = "") => {
|
|
74
74
|
if (t == null || t === "") return r;
|
|
75
75
|
switch ((e == null ? void 0 : e.valueType) ?? (e != null && e.dateFormat ? "date" : "number")) {
|
|
76
76
|
case "date":
|
|
77
|
-
return
|
|
77
|
+
return P(t, e == null ? void 0 : e.dateFormat, n);
|
|
78
78
|
case "boolean":
|
|
79
|
-
return
|
|
79
|
+
return C(t) ? (e == null ? void 0 : e.trueLabel) ?? "true" : (e == null ? void 0 : e.falseLabel) ?? "false";
|
|
80
80
|
case "text":
|
|
81
|
-
return
|
|
81
|
+
return F(e, String(t));
|
|
82
82
|
case "number":
|
|
83
83
|
default: {
|
|
84
84
|
const i = Number(t);
|
|
85
|
-
return Number.isNaN(i) ?
|
|
85
|
+
return Number.isNaN(i) ? F(e, String(t)) : F(e, j(e).format(i));
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
},
|
|
88
|
+
}, Z = (t) => {
|
|
89
89
|
if (!t) return;
|
|
90
90
|
const { prefix: e, suffix: r, decimals: n, notation: s } = t, i = s === "compact";
|
|
91
91
|
if (e === void 0 && r === void 0 && n === void 0 && !i)
|
|
92
92
|
return;
|
|
93
|
-
const
|
|
94
|
-
return `${d(e)}${
|
|
95
|
-
},
|
|
93
|
+
const h = i ? n === void 0 ? "#,###.#a" : n <= 0 ? "#,##0a" : `#,##0.${"0".repeat(n)}a` : n === void 0 ? "#,###.##" : n <= 0 ? "#,##0" : `#,##0.${"0".repeat(n)}`, d = (l) => l ? `'${l.replace(/'/g, "")}'` : "";
|
|
94
|
+
return `${d(e)}${h}${d(r)}`;
|
|
95
|
+
}, Y = 4, J = (t, e = 2) => {
|
|
96
|
+
if (!Number.isFinite(t)) return "";
|
|
97
|
+
const r = Math.max(0, Math.trunc(e)), n = t.toFixed(r);
|
|
98
|
+
if (Number(n) !== 0 || t === 0) return n;
|
|
99
|
+
for (let s = r + 1; s <= Y; s++) {
|
|
100
|
+
const i = t.toFixed(s);
|
|
101
|
+
if (Number(i) !== 0) return i;
|
|
102
|
+
}
|
|
103
|
+
return `<${(10 ** -Y).toFixed(Y)}`;
|
|
104
|
+
}, K = (t) => t && t.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), T = (t) => t instanceof Date ? t.getTime() : typeof t == "number" ? t : typeof t == "string" && t !== "" ? Date.parse(t) : NaN, v = (t, e) => {
|
|
96
105
|
const r = new Date(t), n = new Date(e);
|
|
97
106
|
return r.getFullYear() === n.getFullYear() && r.getMonth() === n.getMonth() && r.getDate() === n.getDate();
|
|
98
|
-
},
|
|
107
|
+
}, U = (t, e) => {
|
|
99
108
|
const r = Number(t);
|
|
100
109
|
if (Number.isNaN(r)) return !1;
|
|
101
110
|
const n = Number(e.value);
|
|
@@ -119,8 +128,8 @@ const W = "—", j = (t) => {
|
|
|
119
128
|
default:
|
|
120
129
|
return !1;
|
|
121
130
|
}
|
|
122
|
-
},
|
|
123
|
-
const r =
|
|
131
|
+
}, V = (t, e) => {
|
|
132
|
+
const r = T(t), n = T(e.value);
|
|
124
133
|
if (Number.isNaN(r) || Number.isNaN(n)) return !1;
|
|
125
134
|
switch (e.op) {
|
|
126
135
|
case "lt":
|
|
@@ -132,17 +141,17 @@ const W = "—", j = (t) => {
|
|
|
132
141
|
case "gte":
|
|
133
142
|
return r >= n;
|
|
134
143
|
case "eq":
|
|
135
|
-
return
|
|
144
|
+
return v(r, n);
|
|
136
145
|
case "neq":
|
|
137
|
-
return !
|
|
146
|
+
return !v(r, n);
|
|
138
147
|
case "between": {
|
|
139
|
-
const s =
|
|
148
|
+
const s = T(e.value2);
|
|
140
149
|
return !Number.isNaN(s) && r >= n && r <= s;
|
|
141
150
|
}
|
|
142
151
|
default:
|
|
143
152
|
return !1;
|
|
144
153
|
}
|
|
145
|
-
},
|
|
154
|
+
}, _ = (t, e) => {
|
|
146
155
|
const r = String(t ?? "").toLowerCase(), n = String(e.value ?? "").toLowerCase();
|
|
147
156
|
switch (e.op) {
|
|
148
157
|
case "eq":
|
|
@@ -164,44 +173,45 @@ const W = "—", j = (t) => {
|
|
|
164
173
|
default:
|
|
165
174
|
return !1;
|
|
166
175
|
}
|
|
167
|
-
},
|
|
176
|
+
}, z = (t, e) => {
|
|
168
177
|
switch (e.op) {
|
|
169
178
|
case "isTrue":
|
|
170
|
-
return
|
|
179
|
+
return C(t);
|
|
171
180
|
case "isFalse":
|
|
172
|
-
return !
|
|
181
|
+
return !C(t);
|
|
173
182
|
default:
|
|
174
183
|
return !1;
|
|
175
184
|
}
|
|
176
|
-
},
|
|
185
|
+
}, H = (t, e) => {
|
|
177
186
|
switch (e.type ?? "number") {
|
|
178
187
|
case "date":
|
|
179
|
-
return
|
|
188
|
+
return V(t, e);
|
|
180
189
|
case "text":
|
|
181
|
-
return
|
|
190
|
+
return _(t, e);
|
|
182
191
|
case "boolean":
|
|
183
|
-
return
|
|
192
|
+
return z(t, e);
|
|
184
193
|
case "number":
|
|
185
194
|
default:
|
|
186
|
-
return
|
|
195
|
+
return U(t, e);
|
|
187
196
|
}
|
|
188
|
-
}, g = (t) => t || void 0,
|
|
197
|
+
}, g = (t) => t || void 0, O = (t, e) => {
|
|
189
198
|
const r = {
|
|
190
199
|
color: g(e == null ? void 0 : e.color),
|
|
191
200
|
backgroundColor: g(e == null ? void 0 : e.backgroundColor)
|
|
192
201
|
}, n = e == null ? void 0 : e.conditionalRules;
|
|
193
202
|
if (!(n != null && n.length)) return r;
|
|
194
|
-
const s = n.find((i) =>
|
|
203
|
+
const s = n.find((i) => H(t, i));
|
|
195
204
|
return s ? {
|
|
196
205
|
color: g(s.color) ?? r.color,
|
|
197
206
|
backgroundColor: g(s.backgroundColor) ?? r.backgroundColor
|
|
198
207
|
} : r;
|
|
199
208
|
};
|
|
200
209
|
export {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
K as
|
|
210
|
+
Z as buildAmNumberFormat,
|
|
211
|
+
I as defaultDateFormat,
|
|
212
|
+
P as formatDateValue,
|
|
213
|
+
J as formatPercent,
|
|
214
|
+
X as formatValue,
|
|
215
|
+
K as humanizeLabel,
|
|
216
|
+
O as resolveConditionalStyle
|
|
207
217
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { buildAmNumberFormat as
|
|
2
|
-
import { C as
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
1
|
+
import { buildAmNumberFormat as c, formatDateValue as m, formatPercent as s } from "./format.js";
|
|
2
|
+
import { C as l } from "../../../ColorSet-cyPmWGwh.js";
|
|
3
|
+
import { c as p } from "../../../Entity-BJCuhdq_.js";
|
|
4
|
+
const b = [
|
|
5
5
|
"#294D94",
|
|
6
6
|
"#375F97",
|
|
7
7
|
"#44729C",
|
|
@@ -12,30 +12,49 @@ const n = [
|
|
|
12
12
|
"#9FCFBF",
|
|
13
13
|
"#B9E1C9",
|
|
14
14
|
"#D6F1D5"
|
|
15
|
-
],
|
|
16
|
-
colors: e.map((
|
|
15
|
+
], v = (t, e = b) => l.new(t, {
|
|
16
|
+
colors: e.map((r) => p(r)),
|
|
17
17
|
reuse: !0
|
|
18
|
-
}),
|
|
18
|
+
}), F = [
|
|
19
19
|
{ number: 1e3, suffix: "K" },
|
|
20
20
|
{ number: 1e6, suffix: "M" },
|
|
21
21
|
{ number: 1e9, suffix: "B" },
|
|
22
22
|
{ number: 1e12, suffix: "T" }
|
|
23
|
-
],
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
e.type !== "date" || !e.dateFormat ||
|
|
23
|
+
], P = (t, e) => {
|
|
24
|
+
const r = c(e) ?? "#,###.##";
|
|
25
|
+
t.numberFormatter.set("numericFields", void 0), t.numberFormatter.set("numberFormat", r), (e == null ? void 0 : e.notation) === "compact" && t.numberFormatter.set("bigNumberPrefixes", F);
|
|
26
|
+
}, D = (t, e) => {
|
|
27
|
+
e.type !== "date" || !e.dateFormat || t.get("renderer").labels.template.adapters.add(
|
|
28
28
|
"text",
|
|
29
|
-
(
|
|
30
|
-
var
|
|
31
|
-
const
|
|
32
|
-
return typeof
|
|
29
|
+
(r, a) => {
|
|
30
|
+
var u;
|
|
31
|
+
const o = (u = a == null ? void 0 : a.dataItem) == null ? void 0 : u.get("value");
|
|
32
|
+
return typeof o == "number" ? m(o, e.dateFormat, e.value) : r;
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
|
+
}, n = (t) => {
|
|
36
|
+
const { percentDecimals: e, percent: r } = t, a = e <= 0 ? "0" : `0.${"0".repeat(e)}`;
|
|
37
|
+
return r === void 0 ? `{valuePercentTotal.formatNumber('${a}')}%` : `${s(r, e)}%`;
|
|
38
|
+
}, y = (t) => {
|
|
39
|
+
const { percentDecimals: e, showValueText: r, percent: a } = t, o = n({ percentDecimals: e, percent: a });
|
|
40
|
+
return r ? `{category}: ${o} ({value})` : `{category}: ${o}`;
|
|
41
|
+
}, d = (t) => {
|
|
42
|
+
var r;
|
|
43
|
+
const e = (r = t == null ? void 0 : t.dataItem) == null ? void 0 : r.get("valuePercentTotal");
|
|
44
|
+
return typeof e == "number" ? e : void 0;
|
|
45
|
+
}, A = (t, e) => {
|
|
46
|
+
t.valueLabels.template.set("text", n({ percentDecimals: e })), t.valueLabels.template.adapters.add("text", (r, a) => {
|
|
47
|
+
const o = d(a);
|
|
48
|
+
return o === void 0 ? r : n({ percentDecimals: e, percent: o });
|
|
49
|
+
});
|
|
35
50
|
};
|
|
36
51
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
b as DEFAULT_VIRIDIS_COOL,
|
|
53
|
+
D as applyDateAxisLabelFormat,
|
|
54
|
+
A as applyLegendPercentFormat,
|
|
55
|
+
P as applyValueFormat,
|
|
56
|
+
n as buildPercentText,
|
|
57
|
+
y as buildSliceText,
|
|
58
|
+
v as colorSetFromPalette,
|
|
59
|
+
d as readSharePercent
|
|
41
60
|
};
|
|
@@ -1,82 +1,120 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { R as N, A as V } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as z, useTheme as E } from "@mui/material";
|
|
3
|
+
import W from "dayjs";
|
|
4
|
+
import { useId as X, useRef as j, useEffect as H } from "react";
|
|
5
|
+
import { formatDateValue as O } from "../_common/format.js";
|
|
6
|
+
import { applyValueFormat as $, colorSetFromPalette as q, buildSliceText as k, applyLegendPercentFormat as G, readSharePercent as J } from "../_common/utils.js";
|
|
7
|
+
import { P as K, a as Q } from "../../../PieSeries-CMH0Z7pz.js";
|
|
8
|
+
import { p as c, c as d } from "../../../Entity-BJCuhdq_.js";
|
|
9
|
+
import { L as U } from "../../../Legend-CFvQiIfn.js";
|
|
10
|
+
import { L as Z } from "../../../Tooltip-vyZRZWih.js";
|
|
11
|
+
const de = (A) => {
|
|
12
|
+
const y = z({ props: A, name: "HCDonutChart" }), {
|
|
13
|
+
dimensions: a,
|
|
12
14
|
values: o,
|
|
13
|
-
data:
|
|
14
|
-
initDelay:
|
|
15
|
-
colors:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
data: m,
|
|
16
|
+
initDelay: P = 0,
|
|
17
|
+
colors: T,
|
|
18
|
+
showDimensionLabel: Y = !1,
|
|
19
|
+
showValueText: f = !0,
|
|
20
|
+
percentDecimals: p = 2,
|
|
21
|
+
sx: R,
|
|
22
|
+
...C
|
|
23
|
+
} = y, i = E(), w = `hc-donut-chart-${X().replace(/:/g, "")}`, g = j(null), l = o.length > 1;
|
|
24
|
+
let u = null;
|
|
25
|
+
o.length < 1 ? u = "Missing values config!" : !l && a.length < 1 && (u = "Missing dimensions config!"), H(() => {
|
|
26
|
+
if (u) return;
|
|
27
|
+
let v;
|
|
28
|
+
return v = setTimeout(() => {
|
|
29
|
+
var M, F;
|
|
30
|
+
const e = N.new(w);
|
|
31
|
+
g.current = e, $(e, (M = o == null ? void 0 : o[0]) == null ? void 0 : M.format), e.setThemes([V.new(e)]);
|
|
32
|
+
const x = e.container.children.push(
|
|
33
|
+
K.new(e, {
|
|
29
34
|
layout: e.verticalLayout,
|
|
30
|
-
innerRadius:
|
|
35
|
+
innerRadius: c(50)
|
|
31
36
|
})
|
|
32
37
|
);
|
|
33
38
|
e.interfaceColors.setAll({
|
|
34
|
-
text:
|
|
35
|
-
grid:
|
|
36
|
-
stroke:
|
|
39
|
+
text: d(i.palette.text.primary),
|
|
40
|
+
grid: d(i.palette.divider),
|
|
41
|
+
stroke: d(i.palette.divider),
|
|
37
42
|
// Drives the gap color between slices; tie it to the surface so the
|
|
38
43
|
// beveled edges read correctly in both light and dark mode.
|
|
39
|
-
background:
|
|
44
|
+
background: d(i.palette.background.paper)
|
|
40
45
|
});
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
const I = l ? o.map((r) => {
|
|
47
|
+
var s;
|
|
48
|
+
return {
|
|
49
|
+
category: r.label || r.name || r.fieldName,
|
|
50
|
+
value: (s = m[0]) == null ? void 0 : s[r.dataFieldName]
|
|
51
|
+
};
|
|
52
|
+
}) : m, t = x.series.push(
|
|
53
|
+
Q.new(e, {
|
|
54
|
+
valueField: l ? "value" : o[0].dataFieldName,
|
|
55
|
+
categoryField: l ? "category" : a[0].value
|
|
45
56
|
})
|
|
46
57
|
);
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
tooltipText:
|
|
51
|
-
stroke:
|
|
58
|
+
t.set("colors", q(e, T));
|
|
59
|
+
const b = k({ percentDecimals: p, showValueText: f });
|
|
60
|
+
t.slices.template.setAll({
|
|
61
|
+
tooltipText: b,
|
|
62
|
+
stroke: d(i.palette.background.paper),
|
|
52
63
|
strokeWidth: 2,
|
|
53
64
|
strokeOpacity: 1,
|
|
54
65
|
cornerRadius: 4
|
|
55
|
-
}),
|
|
56
|
-
text:
|
|
66
|
+
}), t.slices.template.states.create("hover", { scale: 1.04 }), t.set("radius", c(80)), t.labels.template.setAll({
|
|
67
|
+
text: b,
|
|
57
68
|
maxWidth: 140,
|
|
58
69
|
oversizedBehavior: "wrap"
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
});
|
|
71
|
+
const D = (r, s) => {
|
|
72
|
+
const S = J(s);
|
|
73
|
+
return S === void 0 ? r : k({ percentDecimals: p, showValueText: f, percent: S });
|
|
74
|
+
};
|
|
75
|
+
t.slices.template.adapters.add("tooltipText", D), t.labels.template.adapters.add("text", D), !l && a[0].type === "date" && m.forEach((r) => {
|
|
76
|
+
let s = "YYYY";
|
|
77
|
+
a[0].value.includes("month") ? s = "MMM YYYY" : a[0].value.includes("day") && (s = "DD MMM YYYY"), r[a[0].value] = W(r[a[0].value]).format(
|
|
78
|
+
s
|
|
63
79
|
);
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
80
|
+
}), t.data.setAll(I);
|
|
81
|
+
const L = x.children.push(
|
|
82
|
+
U.new(e, {
|
|
83
|
+
centerX: c(50),
|
|
84
|
+
x: c(50),
|
|
68
85
|
marginTop: 15,
|
|
69
86
|
marginBottom: 15
|
|
70
87
|
})
|
|
71
|
-
)
|
|
72
|
-
|
|
88
|
+
);
|
|
89
|
+
G(L, p), L.data.setAll(t.dataItems);
|
|
90
|
+
const n = a[0], h = n ? (F = m[0]) == null ? void 0 : F[n.value] : void 0;
|
|
91
|
+
Y && l && n && h != null && h !== "" && x.children.push(
|
|
92
|
+
Z.new(e, {
|
|
93
|
+
text: n.type === "date" ? O(h, n.dateFormat, n.value) : String(h),
|
|
94
|
+
centerX: c(50),
|
|
95
|
+
x: c(50),
|
|
96
|
+
fill: d(i.palette.text.secondary),
|
|
97
|
+
fontSize: 12,
|
|
98
|
+
paddingBottom: 8
|
|
99
|
+
})
|
|
100
|
+
), t.appear(1e3, 100);
|
|
101
|
+
}, P), () => {
|
|
73
102
|
var e;
|
|
74
|
-
|
|
103
|
+
v && clearTimeout(v), (e = g.current) == null || e.dispose(), g.current = null;
|
|
75
104
|
};
|
|
76
|
-
}, [
|
|
77
|
-
|
|
78
|
-
|
|
105
|
+
}, [
|
|
106
|
+
m,
|
|
107
|
+
a,
|
|
108
|
+
o,
|
|
109
|
+
i.palette.mode,
|
|
110
|
+
T,
|
|
111
|
+
Y,
|
|
112
|
+
f,
|
|
113
|
+
p
|
|
114
|
+
]);
|
|
115
|
+
const B = { ...y };
|
|
116
|
+
return { chartId: w, ownerState: B, sx: R, error: u, other: C };
|
|
79
117
|
};
|
|
80
118
|
export {
|
|
81
|
-
|
|
119
|
+
de as useDonutChartLogic
|
|
82
120
|
};
|
|
@@ -1451,7 +1451,10 @@ const kn = (t) => {
|
|
|
1451
1451
|
Ee.new(m, {
|
|
1452
1452
|
width: Vt,
|
|
1453
1453
|
height: Vt,
|
|
1454
|
-
|
|
1454
|
+
// Off by default for the same reason the XY charts set `wheelX`/`wheelY`
|
|
1455
|
+
// to "none": the widget lives in a scrollable dashboard, and capturing the
|
|
1456
|
+
// wheel traps the page scroll. Drill-down is click-driven; pinch still zooms.
|
|
1457
|
+
wheelable: !1,
|
|
1455
1458
|
pinchZoom: !0
|
|
1456
1459
|
})
|
|
1457
1460
|
).contents.children.push(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { R as I, A as W } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import { useRef as d, useLayoutEffect as
|
|
2
|
+
import { useThemeProps as S } from "@mui/material";
|
|
3
|
+
import { useRef as d, useLayoutEffect as z } from "react";
|
|
4
4
|
import { X as F, V } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
5
5
|
import { X as G } from "../../../XYCursor-CVUSpqb9.js";
|
|
6
6
|
import { D as M } from "../../../DateAxis-DEXKps1S.js";
|
|
@@ -11,7 +11,7 @@ import { L as j } from "../../../LineSeries-D_IL2qGF.js";
|
|
|
11
11
|
import { T as q } from "../../../Tooltip-vyZRZWih.js";
|
|
12
12
|
import { L as B } from "../../../Legend-CFvQiIfn.js";
|
|
13
13
|
const ie = (v) => {
|
|
14
|
-
const u =
|
|
14
|
+
const u = S({
|
|
15
15
|
props: v,
|
|
16
16
|
name: "HCHighlightLineChart"
|
|
17
17
|
}), {
|
|
@@ -24,7 +24,7 @@ const ie = (v) => {
|
|
|
24
24
|
emptyMessage: x = "No data available",
|
|
25
25
|
sx: A,
|
|
26
26
|
...L
|
|
27
|
-
} = u,
|
|
27
|
+
} = u, y = {
|
|
28
28
|
...u,
|
|
29
29
|
height: f,
|
|
30
30
|
width: k,
|
|
@@ -32,8 +32,8 @@ const ie = (v) => {
|
|
|
32
32
|
showLegend: l,
|
|
33
33
|
loading: g,
|
|
34
34
|
emptyMessage: x
|
|
35
|
-
},
|
|
36
|
-
return
|
|
35
|
+
}, X = d(null), C = d(null), h = d(null);
|
|
36
|
+
return z(() => {
|
|
37
37
|
if (!h.current) return;
|
|
38
38
|
const e = I.new(h.current);
|
|
39
39
|
C.current = e, e.setThemes([W.new(e)]);
|
|
@@ -41,12 +41,14 @@ const ie = (v) => {
|
|
|
41
41
|
F.new(e, {
|
|
42
42
|
panX: !0,
|
|
43
43
|
panY: !0,
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
// The widget lives in a scrollable dashboard, so the wheel must reach the
|
|
45
|
+
// page instead of panning/zooming the plot. Drag-pan and pinch still zoom.
|
|
46
|
+
wheelX: "none",
|
|
47
|
+
wheelY: "none",
|
|
46
48
|
pinchZoomX: !0
|
|
47
49
|
})
|
|
48
50
|
);
|
|
49
|
-
|
|
51
|
+
X.current = o, o.set(
|
|
50
52
|
"cursor",
|
|
51
53
|
G.new(e, {
|
|
52
54
|
behavior: "zoomX"
|
|
@@ -120,7 +122,7 @@ const ie = (v) => {
|
|
|
120
122
|
emptyMessage: x,
|
|
121
123
|
sx: A,
|
|
122
124
|
other: L,
|
|
123
|
-
ownerState:
|
|
125
|
+
ownerState: y
|
|
124
126
|
};
|
|
125
127
|
};
|
|
126
128
|
export {
|
|
@@ -383,7 +383,10 @@ const ze = (t) => {
|
|
|
383
383
|
U.new(f, {
|
|
384
384
|
width: q,
|
|
385
385
|
height: q,
|
|
386
|
-
|
|
386
|
+
// Off by default for the same reason the XY charts set `wheelX`/`wheelY`
|
|
387
|
+
// to "none": the widget lives in a scrollable dashboard, and capturing the
|
|
388
|
+
// wheel traps the page scroll. `ZoomTools` and pinch still zoom.
|
|
389
|
+
wheelable: !1,
|
|
387
390
|
pinchZoom: !0
|
|
388
391
|
})
|
|
389
392
|
);
|
|
@@ -1,68 +1,106 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { R as B, A as E } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as X, useTheme as j } from "@mui/material";
|
|
3
|
+
import k from "dayjs";
|
|
4
|
+
import { useId as z, useRef as H, useEffect as $ } from "react";
|
|
5
|
+
import { formatDateValue as q } from "../_common/format.js";
|
|
6
|
+
import { applyValueFormat as G, colorSetFromPalette as J, buildSliceText as b, applyLegendPercentFormat as K, readSharePercent as O } from "../_common/utils.js";
|
|
7
|
+
import { P as Q, a as U } from "../../../PieSeries-CMH0Z7pz.js";
|
|
8
|
+
import { c as u, p as f } from "../../../Entity-BJCuhdq_.js";
|
|
9
|
+
import { L as W } from "../../../Legend-CFvQiIfn.js";
|
|
10
|
+
import { L as Z } from "../../../Tooltip-vyZRZWih.js";
|
|
11
|
+
const me = (A) => {
|
|
12
|
+
const v = X({ props: A, name: "HCPieChart" }), {
|
|
11
13
|
dimensions: t,
|
|
12
14
|
values: o,
|
|
13
|
-
data:
|
|
14
|
-
initDelay:
|
|
15
|
-
colors:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
data: n,
|
|
16
|
+
initDelay: C = 0,
|
|
17
|
+
colors: T,
|
|
18
|
+
showDimensionLabel: Y = !1,
|
|
19
|
+
showValueText: h = !0,
|
|
20
|
+
percentDecimals: m = 2,
|
|
21
|
+
sx: R,
|
|
22
|
+
...I
|
|
23
|
+
} = v, c = j(), w = `hc-pie-chart-${z().replace(/:/g, "")}`, g = H(null), i = o.length > 1;
|
|
24
|
+
let d = null;
|
|
25
|
+
o.length < 1 ? d = "Missing values config!" : !i && t.length < 1 && (d = "Missing dimensions config!"), $(() => {
|
|
26
|
+
if (d) return;
|
|
27
|
+
let x;
|
|
28
|
+
return x = setTimeout(() => {
|
|
29
|
+
var F, S;
|
|
30
|
+
const e = B.new(w);
|
|
31
|
+
g.current = e, G(e, (F = o == null ? void 0 : o[0]) == null ? void 0 : F.format), e.setThemes([E.new(e)]);
|
|
32
|
+
const y = e.container.children.push(
|
|
33
|
+
Q.new(e, {
|
|
29
34
|
layout: e.verticalLayout
|
|
30
35
|
})
|
|
31
36
|
);
|
|
32
37
|
e.interfaceColors.setAll({
|
|
33
|
-
text:
|
|
34
|
-
grid:
|
|
35
|
-
stroke:
|
|
38
|
+
text: u(c.palette.text.primary),
|
|
39
|
+
grid: u(c.palette.divider),
|
|
40
|
+
stroke: u(c.palette.divider)
|
|
36
41
|
});
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
const V = i ? o.map((a) => {
|
|
43
|
+
var s;
|
|
44
|
+
return {
|
|
45
|
+
category: a.label || a.name || a.fieldName,
|
|
46
|
+
value: (s = n[0]) == null ? void 0 : s[a.dataFieldName]
|
|
47
|
+
};
|
|
48
|
+
}) : n, r = y.series.push(
|
|
49
|
+
U.new(e, {
|
|
50
|
+
valueField: i ? "value" : o[0].dataFieldName,
|
|
51
|
+
categoryField: i ? "category" : t[0].value
|
|
41
52
|
})
|
|
42
53
|
);
|
|
43
|
-
r.set("colors",
|
|
44
|
-
const
|
|
45
|
-
r.slices.template.set("tooltipText",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
r.set("colors", J(e, T));
|
|
55
|
+
const L = b({ percentDecimals: m, showValueText: h });
|
|
56
|
+
r.slices.template.set("tooltipText", L), r.labels.template.set("text", L);
|
|
57
|
+
const M = (a, s) => {
|
|
58
|
+
const D = O(s);
|
|
59
|
+
return D === void 0 ? a : b({ percentDecimals: m, showValueText: h, percent: D });
|
|
60
|
+
};
|
|
61
|
+
r.slices.template.adapters.add("tooltipText", M), r.labels.template.adapters.add("text", M), !i && t[0].type === "date" && n.forEach((a) => {
|
|
62
|
+
let s = "YYYY";
|
|
63
|
+
t[0].value.includes("month") ? s = "MMM YYYY" : t[0].value.includes("day") && (s = "DD MMM YYYY"), a[t[0].value] = k(a[t[0].value]).format(
|
|
64
|
+
s
|
|
49
65
|
);
|
|
50
|
-
}), r.data.setAll(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
}), r.data.setAll(V);
|
|
67
|
+
const P = y.children.push(
|
|
68
|
+
W.new(e, {
|
|
69
|
+
centerX: f(50),
|
|
70
|
+
x: f(50),
|
|
54
71
|
marginTop: 15,
|
|
55
72
|
marginBottom: 15
|
|
56
73
|
})
|
|
57
|
-
)
|
|
58
|
-
|
|
74
|
+
);
|
|
75
|
+
K(P, m), P.data.setAll(r.dataItems);
|
|
76
|
+
const l = t[0], p = l ? (S = n[0]) == null ? void 0 : S[l.value] : void 0;
|
|
77
|
+
Y && i && l && p != null && p !== "" && y.children.push(
|
|
78
|
+
Z.new(e, {
|
|
79
|
+
text: l.type === "date" ? q(p, l.dateFormat, l.value) : String(p),
|
|
80
|
+
centerX: f(50),
|
|
81
|
+
x: f(50),
|
|
82
|
+
fill: u(c.palette.text.secondary),
|
|
83
|
+
fontSize: 12,
|
|
84
|
+
paddingBottom: 8
|
|
85
|
+
})
|
|
86
|
+
), r.appear(1e3, 100);
|
|
87
|
+
}, C), () => {
|
|
59
88
|
var e;
|
|
60
|
-
|
|
89
|
+
x && clearTimeout(x), (e = g.current) == null || e.dispose(), g.current = null;
|
|
61
90
|
};
|
|
62
|
-
}, [
|
|
63
|
-
|
|
64
|
-
|
|
91
|
+
}, [
|
|
92
|
+
n,
|
|
93
|
+
t,
|
|
94
|
+
o,
|
|
95
|
+
c.palette.mode,
|
|
96
|
+
T,
|
|
97
|
+
Y,
|
|
98
|
+
h,
|
|
99
|
+
m
|
|
100
|
+
]);
|
|
101
|
+
const N = { ...v };
|
|
102
|
+
return { chartId: w, ownerState: N, sx: R, error: d, other: I };
|
|
65
103
|
};
|
|
66
104
|
export {
|
|
67
|
-
|
|
105
|
+
me as usePieChartLogic
|
|
68
106
|
};
|
|
@@ -21,7 +21,11 @@ const H = (i) => {
|
|
|
21
21
|
zoom: 3,
|
|
22
22
|
options: {
|
|
23
23
|
cssPosition: "absolute",
|
|
24
|
-
controls: { zoom: !1 }
|
|
24
|
+
controls: { zoom: !1 },
|
|
25
|
+
// The widget sits in a scrollable dashboard: swallowing the wheel would
|
|
26
|
+
// trap the page scroll on the map. Zoom stays available through
|
|
27
|
+
// `Controls` and double-click.
|
|
28
|
+
interactions: { mouseWheelZoom: !1 }
|
|
25
29
|
},
|
|
26
30
|
onInit: a.onInit
|
|
27
31
|
}
|
|
@@ -1,108 +1,119 @@
|
|
|
1
|
-
import { useThemeProps as
|
|
2
|
-
import { V as
|
|
3
|
-
import { t as
|
|
4
|
-
import { V as
|
|
5
|
-
import { uniqueId as
|
|
6
|
-
import { useRef as
|
|
7
|
-
import { createMapboxLayer as
|
|
8
|
-
import { parse as
|
|
9
|
-
import { W as
|
|
10
|
-
import { S as
|
|
11
|
-
const
|
|
12
|
-
const q =
|
|
13
|
-
|
|
1
|
+
import { useThemeProps as C, useTheme as O } from "@mui/material";
|
|
2
|
+
import { V as U } from "../../Vector-BmuhQO4p.js";
|
|
3
|
+
import { t as Y } from "../../Source-BSZST_GH.js";
|
|
4
|
+
import { V as K } from "../../Vector-DfTqQEln.js";
|
|
5
|
+
import { uniqueId as j, isEmpty as _, values as L, isEqual as $ } from "lodash";
|
|
6
|
+
import { useRef as n, useEffect as b, useState as w } from "react";
|
|
7
|
+
import { createMapboxLayer as ee } from "../map/helpers/mapbox.js";
|
|
8
|
+
import { parse as te } from "../map/helpers/wkt.js";
|
|
9
|
+
import { W as re } from "../../WKT-2wsDT-nq.js";
|
|
10
|
+
import { S as oe, I as ae } from "../../Text-ChJRuaD8.js";
|
|
11
|
+
const ne = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAADNCAMAAAAmPqoJAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAohQTFRFAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Ro2BGQAAANh0Uk5TABA4XICDn6e/y9/Pq4dkPBgoWHyjx+v/8zQEGkx/seTntIJPHSxwr++3eAqO1JJQDgFDhYlHBQhAkeHmlkVOnvRTAgtbrPxgSD6dRCDeJmHAxmebu9zjdwwumaBWwchdE37q8DuuQmLbam7odnv7CQ0VkyHDj2niJK2G8sw5pRJxomyLP0uqswZXqb4w97V5NRxo1yeMxA91+C1a5f3KjXLSvbzO7h8lUS8X2Zea/qHCsMVv2tDpPdFUhJzJc5VSuKQbbbLsdGM2Ht1Z1SM37RQDqPFmZYEzh2hhYQAAC0NJREFUeJzNnQ1UFNcVx+cKKOAHu0BslSY1ftRDbSs0p0I4Ao1gbBRpNaaLVpEYCIqkGjXERKM2iTZHaSqpVoNGiYpVjtFgYo/aqE1NY6icVmrUnGiSNtWEtEZEQBABu7O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yWzqMmYSbewMoeakJl4szAzqEmZyXc4M56amJliLzmjqcmZaXbtM5aagplqq0EjqWmY6TZ1NI6aiplyJ0qjqOmYaff8NIaakpkW2hBqWmZqaAOoqZnpoblT0zMzQHOmZmBmgeZKzcLMBM2RmomZDZobNRszIzQnakZmVmgu1KzMzNAcqJmZ2aHR1OzMCGgkNYIZA42ixjCjoBHUKGYcNDM1jhkJzUiNZMZCM1FjmdHQDNRoZjw0NTWemQM0JTUHZh7QVNQ8mLlAC3lvkobmt0agMi94xGe/u8FXydL1tOWobl1MI16b9J0box+cPyyJ0/Z63HYWzHlH7xKBb/CK1uG3HeJg22NawbWOjEIel7NLPPdwLJ94Wm1datTK1ER+jvhuPAmJN5WWe5ZVNvLYP8HvhmdlTqVcrPxSnjrAfjUhkirpur54Q4uy9Sqo7Cp13ilKqpqjoC9lzhIC/R8ayIzTAQpU0QAAAABJRU5ErkJggg==", ce = [-170, -65, 170, 65], qe = (S) => {
|
|
12
|
+
const q = C({ props: S, name: "HCDataMap" }), { data: l, payload: g, onPayloadUpdate: y, accessToken: P, sx: W, ...v } = q, m = O(), M = n(j("map-")), o = n(null), u = n(null), i = n(null), c = n(null), d = n(), A = n(!1), x = n(!1), h = n(null), p = n({ payload: g, onPayloadUpdate: y });
|
|
13
|
+
b(() => {
|
|
14
|
+
p.current = { payload: g, onPayloadUpdate: y };
|
|
15
|
+
});
|
|
16
|
+
const [z, I] = w(!1), [k, J] = w(null), X = () => {
|
|
17
|
+
if (!z || !o.current || !l || _(l) || !i.current)
|
|
14
18
|
return;
|
|
15
|
-
const
|
|
16
|
-
const a =
|
|
19
|
+
const e = new re(), t = l.filter((r) => {
|
|
20
|
+
const a = L(r.variables.geometry)[0];
|
|
17
21
|
try {
|
|
18
|
-
return
|
|
22
|
+
return te(a), !0;
|
|
19
23
|
} catch {
|
|
20
24
|
return !1;
|
|
21
25
|
}
|
|
22
|
-
}).map((
|
|
23
|
-
const a =
|
|
26
|
+
}).map((r) => {
|
|
27
|
+
const a = L(r.variables.geometry)[0], s = e.readFeature(a, {
|
|
24
28
|
dataProjection: "EPSG:4326",
|
|
25
29
|
featureProjection: "EPSG:3857"
|
|
26
30
|
});
|
|
27
|
-
return
|
|
31
|
+
return s.set("title", r.title), s;
|
|
28
32
|
});
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
i.current.clear(), i.current.addFeatures(t);
|
|
34
|
+
}, N = () => {
|
|
35
|
+
if (!A.current || !o.current) return !1;
|
|
36
|
+
const e = o.current.getSize();
|
|
37
|
+
return !!(e && e[0] > 0 && e[1] > 0);
|
|
38
|
+
}, R = () => {
|
|
39
|
+
if (!o.current || !N()) return;
|
|
40
|
+
const e = o.current.getBoundingBox(), t = {
|
|
41
|
+
...p.current.payload,
|
|
42
|
+
boundingBox: e
|
|
36
43
|
};
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
$(t, h.current) || (h.current = t, p.current.onPayloadUpdate(t));
|
|
45
|
+
}, D = () => {
|
|
46
|
+
var r, a;
|
|
47
|
+
if (x.current || !N()) return;
|
|
48
|
+
const e = (r = p.current.payload) == null ? void 0 : r.boundingBox, t = e ? [
|
|
49
|
+
e.bottomLeft.longitude,
|
|
50
|
+
e.bottomLeft.latitude,
|
|
51
|
+
e.topRight.longitude,
|
|
52
|
+
e.topRight.latitude
|
|
53
|
+
] : ce;
|
|
54
|
+
(a = o.current) == null || a.centerToExtent(
|
|
55
|
+
Y(t, "EPSG:4326", "EPSG:3857")
|
|
56
|
+
), x.current = !0, R();
|
|
57
|
+
}, F = () => {
|
|
58
|
+
d.current && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
59
|
+
var e;
|
|
60
|
+
A.current && ((e = o.current) == null || e.updateSize(), u.current && u.current.map.resize(), D());
|
|
42
61
|
}, 100);
|
|
43
|
-
},
|
|
44
|
-
var
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
}), (
|
|
48
|
-
|
|
62
|
+
}, Q = () => {
|
|
63
|
+
var e, t;
|
|
64
|
+
(e = o.current) == null || e.on("movestart", () => {
|
|
65
|
+
c.current && (clearTimeout(c.current), c.current = null);
|
|
66
|
+
}), (t = o.current) == null || t.on("moveend", () => {
|
|
67
|
+
c.current && (clearTimeout(c.current), c.current = null), c.current = setTimeout(R, 500);
|
|
49
68
|
});
|
|
50
|
-
},
|
|
51
|
-
var
|
|
52
|
-
const
|
|
53
|
-
id:
|
|
69
|
+
}, B = () => {
|
|
70
|
+
var s, G, Z;
|
|
71
|
+
const e = m.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", t = ee({
|
|
72
|
+
id: M.current,
|
|
54
73
|
center: [0, 0],
|
|
55
|
-
style:
|
|
56
|
-
accessToken:
|
|
74
|
+
style: e,
|
|
75
|
+
accessToken: P
|
|
57
76
|
});
|
|
58
|
-
(
|
|
59
|
-
const
|
|
60
|
-
source:
|
|
61
|
-
style: new
|
|
62
|
-
image: new
|
|
77
|
+
(s = o.current) == null || s.addLayer(t.layer), u.current = t;
|
|
78
|
+
const r = new K(), a = new U({
|
|
79
|
+
source: r,
|
|
80
|
+
style: new oe({
|
|
81
|
+
image: new ae({
|
|
63
82
|
anchor: [0.5, 1],
|
|
64
|
-
src:
|
|
83
|
+
src: ne,
|
|
65
84
|
scale: 0.1,
|
|
66
|
-
color:
|
|
85
|
+
color: m.palette.primary.main
|
|
67
86
|
})
|
|
68
87
|
})
|
|
69
88
|
});
|
|
70
|
-
|
|
71
|
-
var
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
text:
|
|
75
|
-
x:
|
|
76
|
-
y:
|
|
89
|
+
(G = o.current) == null || G.addLayer(a), i.current = r, A.current = !0, I(!0), Q(), (Z = o.current) == null || Z.on("pointermove", (f) => {
|
|
90
|
+
var E;
|
|
91
|
+
const H = (E = o.current) == null ? void 0 : E.forEachFeatureAtPixel(f.pixel, 4);
|
|
92
|
+
J(H ? {
|
|
93
|
+
text: H.get("title"),
|
|
94
|
+
x: f.pixel[0],
|
|
95
|
+
y: f.pixel[1]
|
|
77
96
|
} : null);
|
|
78
|
-
}),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
], F = V(b, "EPSG:4326", "EPSG:3857");
|
|
85
|
-
t.current.centerToExtent(F);
|
|
86
|
-
}
|
|
87
|
-
}, v = () => {
|
|
88
|
-
var e, a;
|
|
89
|
-
if (!c.current) return;
|
|
90
|
-
const r = p.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", o = ((a = (e = c.current.layer.getSource()) == null ? void 0 : e.getMapboxMap) == null ? void 0 : a.call(e)) || c.current.map;
|
|
91
|
-
o && o.setStyle(r);
|
|
97
|
+
}), D();
|
|
98
|
+
}, V = () => {
|
|
99
|
+
var r, a;
|
|
100
|
+
if (!u.current) return;
|
|
101
|
+
const e = m.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", t = ((a = (r = u.current.layer.getSource()) == null ? void 0 : r.getMapboxMap) == null ? void 0 : a.call(r)) || u.current.map;
|
|
102
|
+
t && t.setStyle(e);
|
|
92
103
|
};
|
|
93
|
-
|
|
94
|
-
}), [
|
|
95
|
-
}), [
|
|
96
|
-
const
|
|
104
|
+
b(() => (X(), () => {
|
|
105
|
+
}), [l, z]), b(() => (V(), () => {
|
|
106
|
+
}), [m.palette.mode]);
|
|
107
|
+
const T = { ...q };
|
|
97
108
|
return {
|
|
98
|
-
refs: { mapRef:
|
|
99
|
-
state: { tooltip:
|
|
100
|
-
actions: { onInit:
|
|
101
|
-
ownerState:
|
|
102
|
-
sx:
|
|
103
|
-
other:
|
|
109
|
+
refs: { mapRef: o, mapId: M },
|
|
110
|
+
state: { tooltip: k },
|
|
111
|
+
actions: { onInit: B, onMapResize: F },
|
|
112
|
+
ownerState: T,
|
|
113
|
+
sx: W,
|
|
114
|
+
other: v
|
|
104
115
|
};
|
|
105
116
|
};
|
|
106
117
|
export {
|
|
107
|
-
|
|
118
|
+
qe as useDataMapLogic
|
|
108
119
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { useEffect as
|
|
2
|
+
import { Typography as l } from "@mui/material";
|
|
3
|
+
import { useEffect as d } from "react";
|
|
4
4
|
import { u } from "../../index.esm-DAf19hyR.js";
|
|
5
5
|
import { Map as h } from "../map/index.js";
|
|
6
6
|
import { Controls as M } from "./components/controls/index.js";
|
|
@@ -8,27 +8,31 @@ import { Legend as R } from "./components/legend/index.js";
|
|
|
8
8
|
import { useHeatMapLogic as g } from "./logic.js";
|
|
9
9
|
import { HeatMapRoot as H, HeatMapHeader as z, HeatMapContent as x } from "./styled.js";
|
|
10
10
|
const E = (r) => {
|
|
11
|
-
const { refs:
|
|
12
|
-
return
|
|
13
|
-
}), [n, a]), /* @__PURE__ */ m(H, { ownerState:
|
|
14
|
-
/* @__PURE__ */ e(z, { ownerState:
|
|
15
|
-
/* @__PURE__ */ m(x, { ownerState:
|
|
11
|
+
const { refs: o, actions: i, gradient: s, ownerState: t, sx: p, other: f } = g(r), { width: n, height: a, ref: c } = u();
|
|
12
|
+
return d(() => (n && a && i.onMapResize(), () => {
|
|
13
|
+
}), [n, a]), /* @__PURE__ */ m(H, { ownerState: t, sx: p, ref: c, ...f, children: [
|
|
14
|
+
/* @__PURE__ */ e(z, { ownerState: t, children: /* @__PURE__ */ e(l, { variant: "h3", children: r.title }) }),
|
|
15
|
+
/* @__PURE__ */ m(x, { ownerState: t, children: [
|
|
16
16
|
/* @__PURE__ */ e(
|
|
17
17
|
h,
|
|
18
18
|
{
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: o.mapId.current,
|
|
20
|
+
ref: o.mapRef,
|
|
21
21
|
center: { latitude: 0, longitude: 0 },
|
|
22
22
|
zoom: 3,
|
|
23
23
|
options: {
|
|
24
24
|
cssPosition: "absolute",
|
|
25
|
-
controls: { zoom: !1 }
|
|
25
|
+
controls: { zoom: !1 },
|
|
26
|
+
// The widget sits in a scrollable dashboard: swallowing the wheel would
|
|
27
|
+
// trap the page scroll on the map. Zoom stays available through
|
|
28
|
+
// `Controls` and double-click.
|
|
29
|
+
interactions: { mouseWheelZoom: !1 }
|
|
26
30
|
},
|
|
27
31
|
onInit: i.onInit
|
|
28
32
|
}
|
|
29
33
|
),
|
|
30
|
-
/* @__PURE__ */ e(R, { gradient:
|
|
31
|
-
/* @__PURE__ */ e(M, { mapRef:
|
|
34
|
+
/* @__PURE__ */ e(R, { gradient: s }),
|
|
35
|
+
/* @__PURE__ */ e(M, { mapRef: o.mapRef.current })
|
|
32
36
|
] })
|
|
33
37
|
] });
|
|
34
38
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -837,7 +837,31 @@ export declare type DonutChartComponentOverride<Theme = unknown> = {
|
|
|
837
837
|
styleOverrides?: ComponentsOverrides_2<Theme>["HCDonutChart"];
|
|
838
838
|
};
|
|
839
839
|
|
|
840
|
-
export declare
|
|
840
|
+
export declare interface DonutChartProps extends ChartProps {
|
|
841
|
+
/**
|
|
842
|
+
* Show the row's dimension value (e.g. which record the breakdown belongs to)
|
|
843
|
+
* as a caption under the legend. Only takes effect when more than one value is
|
|
844
|
+
* configured — each value then becomes a slice and the dimension labels
|
|
845
|
+
* nothing on the chart. Defaults to `false`.
|
|
846
|
+
*/
|
|
847
|
+
showDimensionLabel?: boolean;
|
|
848
|
+
/**
|
|
849
|
+
* Append the raw value to each slice's label and tooltip, after the
|
|
850
|
+
* percentage — "Up: 62.00% (0.62)". Turn it off for a percentage-only
|
|
851
|
+
* "Up: 62.00%", e.g. when the value and the percentage say the same thing.
|
|
852
|
+
* Defaults to `true`.
|
|
853
|
+
*/
|
|
854
|
+
showValueText?: boolean;
|
|
855
|
+
/**
|
|
856
|
+
* Decimal places for the percentage on slice labels and tooltips. Independent
|
|
857
|
+
* of a value's own `format.decimals`, which describes the measure's scale
|
|
858
|
+
* rather than its share of the total. Defaults to `2`.
|
|
859
|
+
*
|
|
860
|
+
* A share too small to survive this rounding is not reported as "0" — it
|
|
861
|
+
* escalates precision until a digit shows (see `formatPercent`).
|
|
862
|
+
*/
|
|
863
|
+
percentDecimals?: number;
|
|
864
|
+
}
|
|
841
865
|
|
|
842
866
|
export declare const DrillDownTreemap: (inProps: DrillDownTreemapProps) => JSX_2.Element;
|
|
843
867
|
|
|
@@ -1813,7 +1837,31 @@ export declare type PieChartComponentOverride<Theme = unknown> = {
|
|
|
1813
1837
|
styleOverrides?: ComponentsOverrides_2<Theme>["HCPieChart"];
|
|
1814
1838
|
};
|
|
1815
1839
|
|
|
1816
|
-
export declare
|
|
1840
|
+
export declare interface PieChartProps extends ChartProps {
|
|
1841
|
+
/**
|
|
1842
|
+
* Show the row's dimension value (e.g. which record the breakdown belongs to)
|
|
1843
|
+
* as a caption under the legend. Only takes effect when more than one value is
|
|
1844
|
+
* configured — each value then becomes a slice and the dimension labels
|
|
1845
|
+
* nothing on the chart. Defaults to `false`.
|
|
1846
|
+
*/
|
|
1847
|
+
showDimensionLabel?: boolean;
|
|
1848
|
+
/**
|
|
1849
|
+
* Append the raw value to each slice's label and tooltip, after the
|
|
1850
|
+
* percentage — "Up: 62.00% (0.62)". Turn it off for a percentage-only
|
|
1851
|
+
* "Up: 62.00%", e.g. when the value and the percentage say the same thing.
|
|
1852
|
+
* Defaults to `true`.
|
|
1853
|
+
*/
|
|
1854
|
+
showValueText?: boolean;
|
|
1855
|
+
/**
|
|
1856
|
+
* Decimal places for the percentage on slice labels and tooltips. Independent
|
|
1857
|
+
* of a value's own `format.decimals`, which describes the measure's scale
|
|
1858
|
+
* rather than its share of the total. Defaults to `2`.
|
|
1859
|
+
*
|
|
1860
|
+
* A share too small to survive this rounding is not reported as "0" — it
|
|
1861
|
+
* escalates precision until a digit shows (see `formatPercent`).
|
|
1862
|
+
*/
|
|
1863
|
+
percentDecimals?: number;
|
|
1864
|
+
}
|
|
1817
1865
|
|
|
1818
1866
|
export declare const Placeholder: (props: PlaceholderProps) => JSX_2.Element;
|
|
1819
1867
|
|