@carbon/charts 1.27.14 → 1.27.16
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/CHANGELOG.md +18 -0
- package/dist/{angle-utils-Dy0Gf7Eb.mjs → angle-utils-DQX11pHz.mjs} +2 -2
- package/dist/{angle-utils-Dy0Gf7Eb.mjs.map → angle-utils-DQX11pHz.mjs.map} +1 -1
- package/dist/{array-D6ni_TQq.mjs → array-CtuAxDOt.mjs} +2 -2
- package/dist/{array-D6ni_TQq.mjs.map → array-CtuAxDOt.mjs.map} +1 -1
- package/dist/{choropleth-Bn8eKXA6.mjs → choropleth-oyaTm15Q.mjs} +1746 -1740
- package/dist/{choropleth-Bn8eKXA6.mjs.map → choropleth-oyaTm15Q.mjs.map} +1 -1
- package/dist/{color-scale-utils-C4KU2jNr.mjs → color-scale-utils-C1aV7-HR.mjs} +20 -22
- package/dist/{color-scale-utils-C4KU2jNr.mjs.map → color-scale-utils-C1aV7-HR.mjs.map} +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/{index-CHbrPDmO.mjs → index-ZmGceN3D.mjs} +3 -3
- package/dist/{index-CHbrPDmO.mjs.map → index-ZmGceN3D.mjs.map} +1 -1
- package/dist/index.mjs +7 -7
- package/dist/interfaces/charts.d.ts +24 -0
- package/dist/model/heatmap.d.ts +7 -1
- package/dist/model/index.mjs +186 -180
- package/dist/model/index.mjs.map +1 -1
- package/dist/services/color-scale-utils.d.ts +15 -2
- package/dist/services/index.mjs +3 -3
- package/dist/umd/bundle.umd.cjs +14 -14
- package/dist/umd/bundle.umd.cjs.map +1 -1
- package/dist/umd/bundle.umd.js +14 -14
- package/package.json +2 -2
package/dist/model/index.mjs
CHANGED
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
import { ah as et, ai as st, aD as H, aE as w, aF as $, as as N, aG as at, aH as nt, aI as ot, ay as P, aA as k, g as p, w as E, c as F, v as rt, ax as L, J as z, Y as Z, a as R, r as Q, a9 as W, ar as C, L as X, au as it, aJ as lt, aq as
|
|
1
|
+
import { ah as et, ai as st, aD as H, aE as w, aF as $, as as N, aG as at, aH as nt, aI as ot, ay as P, aA as k, g as p, w as E, c as F, v as rt, ax as L, J as z, Y as Z, a as R, r as Q, a9 as W, ar as C, L as X, au as it, aJ as lt, aq as O } from "../color-scale-utils-C1aV7-HR.mjs";
|
|
2
2
|
import { S as b, a0 as U, d as Y, e as q, t as ct } from "../axis-scales-CFRGPXH8.mjs";
|
|
3
|
-
import { b as ut, c as I, a as pt } from "../array-
|
|
4
|
-
function ht(
|
|
5
|
-
for (var a = -1, n =
|
|
6
|
-
var o =
|
|
7
|
-
t(s, o, e(o),
|
|
3
|
+
import { b as ut, c as I, a as pt } from "../array-CtuAxDOt.mjs";
|
|
4
|
+
function ht(c, t, e, s) {
|
|
5
|
+
for (var a = -1, n = c == null ? 0 : c.length; ++a < n; ) {
|
|
6
|
+
var o = c[a];
|
|
7
|
+
t(s, o, e(o), c);
|
|
8
8
|
}
|
|
9
9
|
return s;
|
|
10
10
|
}
|
|
11
|
-
function gt(
|
|
12
|
-
return ut(
|
|
11
|
+
function gt(c, t, e, s) {
|
|
12
|
+
return ut(c, function(a, n, o) {
|
|
13
13
|
t(s, a, e(a), o);
|
|
14
14
|
}), s;
|
|
15
15
|
}
|
|
16
|
-
function ft(
|
|
16
|
+
function ft(c, t) {
|
|
17
17
|
return function(e, s) {
|
|
18
18
|
var a = st(e) ? ht : gt, n = {};
|
|
19
|
-
return a(e,
|
|
19
|
+
return a(e, c, et(s), n);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
for (var t = -1, e =
|
|
24
|
-
var a =
|
|
22
|
+
function mt(c) {
|
|
23
|
+
for (var t = -1, e = c == null ? 0 : c.length, s = {}; ++t < e; ) {
|
|
24
|
+
var a = c[t];
|
|
25
25
|
H(s, a[0], a[1]);
|
|
26
26
|
}
|
|
27
27
|
return s;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
30
|
-
Dt.call(
|
|
29
|
+
var dt = Object.prototype, Dt = dt.hasOwnProperty, yt = ft(function(c, t, e) {
|
|
30
|
+
Dt.call(c, e) ? c[e].push(t) : H(c, e, [t]);
|
|
31
31
|
});
|
|
32
|
-
function bt(
|
|
32
|
+
function bt(c, t) {
|
|
33
33
|
let e = 0;
|
|
34
|
-
for (let s of
|
|
34
|
+
for (let s of c)
|
|
35
35
|
s != null && (s = +s) >= s && ++e;
|
|
36
36
|
return e;
|
|
37
37
|
}
|
|
38
|
-
function vt(
|
|
39
|
-
return
|
|
38
|
+
function vt(c) {
|
|
39
|
+
return c;
|
|
40
40
|
}
|
|
41
|
-
function xt(
|
|
42
|
-
if (
|
|
43
|
-
if (typeof
|
|
41
|
+
function xt(c = w) {
|
|
42
|
+
if (c === w) return J;
|
|
43
|
+
if (typeof c != "function") throw new TypeError("compare is not a function");
|
|
44
44
|
return (t, e) => {
|
|
45
|
-
const s =
|
|
46
|
-
return s || s === 0 ? s : (
|
|
45
|
+
const s = c(t, e);
|
|
46
|
+
return s || s === 0 ? s : (c(e, e) === 0) - (c(t, t) === 0);
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function J(
|
|
50
|
-
return (
|
|
49
|
+
function J(c, t) {
|
|
50
|
+
return (c == null || !(c >= c)) - (t == null || !(t >= t)) || (c < t ? -1 : c > t ? 1 : 0);
|
|
51
51
|
}
|
|
52
52
|
var Ct = Array.prototype, Tt = Ct.slice;
|
|
53
|
-
function V(
|
|
54
|
-
return () =>
|
|
53
|
+
function V(c) {
|
|
54
|
+
return () => c;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Ot(c, t, e) {
|
|
57
57
|
let s;
|
|
58
58
|
for (; ; ) {
|
|
59
|
-
const a = $(
|
|
59
|
+
const a = $(c, t, e);
|
|
60
60
|
if (a === s || a === 0 || !isFinite(a))
|
|
61
|
-
return [
|
|
62
|
-
a > 0 ? (
|
|
61
|
+
return [c, t];
|
|
62
|
+
a > 0 ? (c = Math.floor(c / a) * a, t = Math.ceil(t / a) * a) : a < 0 && (c = Math.ceil(c * a) / a, t = Math.floor(t * a) / a), s = a;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return Math.max(1, Math.ceil(Math.log(bt(
|
|
65
|
+
function At(c) {
|
|
66
|
+
return Math.max(1, Math.ceil(Math.log(bt(c)) / Math.LN2) + 1);
|
|
67
67
|
}
|
|
68
68
|
function Mt() {
|
|
69
|
-
var
|
|
69
|
+
var c = vt, t = N, e = At;
|
|
70
70
|
function s(a) {
|
|
71
71
|
Array.isArray(a) || (a = Array.from(a));
|
|
72
72
|
var n, o = a.length, r, i, l = new Array(o);
|
|
73
73
|
for (n = 0; n < o; ++n)
|
|
74
|
-
l[n] =
|
|
75
|
-
var
|
|
74
|
+
l[n] = c(a[n], n, a);
|
|
75
|
+
var u = t(l), h = u[0], g = u[1], f = e(l, h, g);
|
|
76
76
|
if (!Array.isArray(f)) {
|
|
77
77
|
const y = g, S = +f;
|
|
78
|
-
if (t === N && ([h, g] =
|
|
78
|
+
if (t === N && ([h, g] = Ot(h, g, S)), f = at(h, g, S), f[0] <= h && (i = $(h, g, S)), f[f.length - 1] >= g)
|
|
79
79
|
if (y >= g && t === N) {
|
|
80
80
|
const T = $(h, g, S);
|
|
81
81
|
isFinite(T) && (T > 0 ? g = (Math.floor(g / T) + 1) * T : T < 0 && (g = (Math.ceil(g * -T) + 1) / -T));
|
|
82
82
|
} else
|
|
83
83
|
f.pop();
|
|
84
84
|
}
|
|
85
|
-
for (var
|
|
85
|
+
for (var m = f.length, d = 0, D = m; f[d] <= h; ) ++d;
|
|
86
86
|
for (; f[D - 1] > g; ) --D;
|
|
87
|
-
(
|
|
88
|
-
var x = new Array(
|
|
89
|
-
for (n = 0; n <=
|
|
90
|
-
|
|
87
|
+
(d || D < m) && (f = f.slice(d, D), m = D - d);
|
|
88
|
+
var x = new Array(m + 1), A;
|
|
89
|
+
for (n = 0; n <= m; ++n)
|
|
90
|
+
A = x[n] = [], A.x0 = n > 0 ? f[n - 1] : h, A.x1 = n < m ? f[n] : g;
|
|
91
91
|
if (isFinite(i)) {
|
|
92
92
|
if (i > 0)
|
|
93
93
|
for (n = 0; n < o; ++n)
|
|
94
|
-
(r = l[n]) != null && h <= r && r <= g && x[Math.min(
|
|
94
|
+
(r = l[n]) != null && h <= r && r <= g && x[Math.min(m, Math.floor((r - h) / i))].push(a[n]);
|
|
95
95
|
else if (i < 0) {
|
|
96
96
|
for (n = 0; n < o; ++n)
|
|
97
97
|
if ((r = l[n]) != null && h <= r && r <= g) {
|
|
98
98
|
const y = Math.floor((h - r) * i);
|
|
99
|
-
x[Math.min(
|
|
99
|
+
x[Math.min(m, y + (f[y] <= r))].push(a[n]);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
} else
|
|
103
103
|
for (n = 0; n < o; ++n)
|
|
104
|
-
(r = l[n]) != null && h <= r && r <= g && x[nt(f, r, 0,
|
|
104
|
+
(r = l[n]) != null && h <= r && r <= g && x[nt(f, r, 0, m)].push(a[n]);
|
|
105
105
|
return x;
|
|
106
106
|
}
|
|
107
107
|
return s.value = function(a) {
|
|
108
|
-
return arguments.length ? (
|
|
108
|
+
return arguments.length ? (c = typeof a == "function" ? a : V(a), s) : c;
|
|
109
109
|
}, s.domain = function(a) {
|
|
110
110
|
return arguments.length ? (t = typeof a == "function" ? a : V([a[0], a[1]]), s) : t;
|
|
111
111
|
}, s.thresholds = function(a) {
|
|
112
112
|
return arguments.length ? (e = typeof a == "function" ? a : V(Array.isArray(a) ? Tt.call(a) : a), s) : e;
|
|
113
113
|
}, s;
|
|
114
114
|
}
|
|
115
|
-
function tt(
|
|
116
|
-
if (t = Math.floor(t), e = Math.floor(Math.max(0, e)), s = Math.floor(Math.min(
|
|
115
|
+
function tt(c, t, e = 0, s = 1 / 0, a) {
|
|
116
|
+
if (t = Math.floor(t), e = Math.floor(Math.max(0, e)), s = Math.floor(Math.min(c.length - 1, s)), !(e <= t && t <= s)) return c;
|
|
117
117
|
for (a = a === void 0 ? J : xt(a); s > e; ) {
|
|
118
118
|
if (s - e > 600) {
|
|
119
|
-
const i = s - e + 1, l = t - e + 1,
|
|
120
|
-
tt(
|
|
119
|
+
const i = s - e + 1, l = t - e + 1, u = Math.log(i), h = 0.5 * Math.exp(2 * u / 3), g = 0.5 * Math.sqrt(u * h * (i - h) / i) * (l - i / 2 < 0 ? -1 : 1), f = Math.max(e, Math.floor(t - l * h / i + g)), m = Math.min(s, Math.floor(t + (i - l) * h / i + g));
|
|
120
|
+
tt(c, t, f, m, a);
|
|
121
121
|
}
|
|
122
|
-
const n =
|
|
122
|
+
const n = c[t];
|
|
123
123
|
let o = e, r = s;
|
|
124
|
-
for (G(
|
|
125
|
-
for (G(
|
|
126
|
-
for (; a(
|
|
124
|
+
for (G(c, e, t), a(c[s], n) > 0 && G(c, e, s); o < r; ) {
|
|
125
|
+
for (G(c, o, r), ++o, --r; a(c[o], n) < 0; ) ++o;
|
|
126
|
+
for (; a(c[r], n) > 0; ) --r;
|
|
127
127
|
}
|
|
128
|
-
a(
|
|
128
|
+
a(c[e], n) === 0 ? G(c, e, r) : (++r, G(c, r, s)), r <= t && (e = r + 1), t <= r && (s = r - 1);
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return c;
|
|
131
131
|
}
|
|
132
|
-
function G(
|
|
133
|
-
const s =
|
|
134
|
-
|
|
132
|
+
function G(c, t, e) {
|
|
133
|
+
const s = c[t];
|
|
134
|
+
c[t] = c[e], c[e] = s;
|
|
135
135
|
}
|
|
136
|
-
function B(
|
|
137
|
-
if (
|
|
138
|
-
if (t <= 0 || s < 2) return P(
|
|
139
|
-
if (t >= 1) return k(
|
|
140
|
-
var s, a = (s - 1) * t, n = Math.floor(a), o = k(tt(
|
|
136
|
+
function B(c, t, e) {
|
|
137
|
+
if (c = Float64Array.from(ot(c)), !(!(s = c.length) || isNaN(t = +t))) {
|
|
138
|
+
if (t <= 0 || s < 2) return P(c);
|
|
139
|
+
if (t >= 1) return k(c);
|
|
140
|
+
var s, a = (s - 1) * t, n = Math.floor(a), o = k(tt(c, n).subarray(0, n + 1)), r = P(c.subarray(n + 1));
|
|
141
141
|
return o + (r - o) * (a - n);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
function K(
|
|
145
|
-
if ((o =
|
|
146
|
-
for (var e = 1, s, a, n =
|
|
147
|
-
for (a = n, n =
|
|
144
|
+
function K(c, t) {
|
|
145
|
+
if ((o = c.length) > 1)
|
|
146
|
+
for (var e = 1, s, a, n = c[t[0]], o, r = n.length; e < o; ++e)
|
|
147
|
+
for (a = n, n = c[t[e]], s = 0; s < r; ++s)
|
|
148
148
|
n[s][1] += n[s][0] = isNaN(a[s][1]) ? a[s][0] : a[s][1];
|
|
149
149
|
}
|
|
150
|
-
function j(
|
|
151
|
-
for (var t =
|
|
150
|
+
function j(c) {
|
|
151
|
+
for (var t = c.length, e = new Array(t); --t >= 0; ) e[t] = t;
|
|
152
152
|
return e;
|
|
153
153
|
}
|
|
154
|
-
function Gt(
|
|
155
|
-
return
|
|
154
|
+
function Gt(c, t) {
|
|
155
|
+
return c[t];
|
|
156
156
|
}
|
|
157
|
-
function St(
|
|
157
|
+
function St(c) {
|
|
158
158
|
const t = [];
|
|
159
|
-
return t.key =
|
|
159
|
+
return t.key = c, t;
|
|
160
160
|
}
|
|
161
161
|
function _() {
|
|
162
|
-
var
|
|
162
|
+
var c = I([]), t = j, e = K, s = Gt;
|
|
163
163
|
function a(n) {
|
|
164
|
-
var o = Array.from(
|
|
164
|
+
var o = Array.from(c.apply(this, arguments), St), r, i = o.length, l = -1, u;
|
|
165
165
|
for (const h of n)
|
|
166
166
|
for (r = 0, ++l; r < i; ++r)
|
|
167
167
|
(o[r][l] = [0, +s(h, o[r].key, l, n)]).data = h;
|
|
168
|
-
for (r = 0,
|
|
169
|
-
o[
|
|
170
|
-
return e(o,
|
|
168
|
+
for (r = 0, u = pt(t(o)); r < i; ++r)
|
|
169
|
+
o[u[r]].index = r;
|
|
170
|
+
return e(o, u), o;
|
|
171
171
|
}
|
|
172
172
|
return a.keys = function(n) {
|
|
173
|
-
return arguments.length ? (
|
|
173
|
+
return arguments.length ? (c = typeof n == "function" ? n : I(Array.from(n)), a) : c;
|
|
174
174
|
}, a.value = function(n) {
|
|
175
175
|
return arguments.length ? (s = typeof n == "function" ? n : I(+n), a) : s;
|
|
176
176
|
}, a.order = function(n) {
|
|
@@ -179,14 +179,14 @@ function _() {
|
|
|
179
179
|
return arguments.length ? (e = n ?? K, a) : e;
|
|
180
180
|
}, a;
|
|
181
181
|
}
|
|
182
|
-
function Et(
|
|
183
|
-
if ((i =
|
|
184
|
-
for (var e, s = 0, a, n, o, r, i, l =
|
|
182
|
+
function Et(c, t) {
|
|
183
|
+
if ((i = c.length) > 0)
|
|
184
|
+
for (var e, s = 0, a, n, o, r, i, l = c[t[0]].length; s < l; ++s)
|
|
185
185
|
for (o = r = 0, e = 0; e < i; ++e)
|
|
186
|
-
(n = (a =
|
|
186
|
+
(n = (a = c[t[e]][s])[1] - a[0]) > 0 ? (a[0] = o, a[1] = o += n) : n < 0 ? (a[1] = r, a[0] = r += n) : (a[0] = 0, a[1] = n);
|
|
187
187
|
}
|
|
188
|
-
function qt(
|
|
189
|
-
const t =
|
|
188
|
+
function qt(c) {
|
|
189
|
+
const t = c.trim();
|
|
190
190
|
return ["=", "+", "-", "@", " ", "\r"].includes(t.charAt(0)) ? ` ${t}` : /[,\"\n]/.test(t) ? `"${t}"` : t;
|
|
191
191
|
}
|
|
192
192
|
class v {
|
|
@@ -200,15 +200,15 @@ class v {
|
|
|
200
200
|
code: a,
|
|
201
201
|
date: n,
|
|
202
202
|
number: o
|
|
203
|
-
} = p(s, "locale"), r = p(s, "tabularRepModal", "tableHeadingFormatter"), i = p(s, "tabularRepModal", "tableCellFormatter"), { cartesianScales: l } = this.services,
|
|
203
|
+
} = p(s, "locale"), r = p(s, "tabularRepModal", "tableHeadingFormatter"), i = p(s, "tabularRepModal", "tableCellFormatter"), { cartesianScales: l } = this.services, u = l?.getDomainAxisScaleType();
|
|
204
204
|
let h;
|
|
205
|
-
return
|
|
205
|
+
return u === b.TIME && (h = (f) => n(f, a, { month: "short", day: "numeric", year: "numeric" })), [
|
|
206
206
|
typeof r == "function" ? r(t) : t,
|
|
207
207
|
...typeof i == "function" ? i(e) : e.map((f) => {
|
|
208
208
|
h && (f[1] = h(f[1]));
|
|
209
|
-
for (const
|
|
210
|
-
const
|
|
211
|
-
typeof
|
|
209
|
+
for (const m in f) {
|
|
210
|
+
const d = f[m];
|
|
211
|
+
typeof d == "number" && (f[m] = o(d, a));
|
|
212
212
|
}
|
|
213
213
|
return f;
|
|
214
214
|
})
|
|
@@ -222,18 +222,18 @@ class v {
|
|
|
222
222
|
const a = this.getDataGroups(), { groupMapsTo: n } = p(e, "data"), o = p(e, "axes");
|
|
223
223
|
return t && (s = s.filter((r) => t.includes(r[n]))), o && Object.keys(o).forEach((r) => {
|
|
224
224
|
const i = o[r].mapsTo, l = o[r].scaleType;
|
|
225
|
-
if ((l === b.LINEAR || l === b.LOG) && (s = s.map((
|
|
226
|
-
...
|
|
227
|
-
[i]:
|
|
225
|
+
if ((l === b.LINEAR || l === b.LOG) && (s = s.map((u) => ({
|
|
226
|
+
...u,
|
|
227
|
+
[i]: u[i] === null ? u[i] : Number(u[i])
|
|
228
228
|
}))), i && o[r].domain)
|
|
229
229
|
if (l === b.LABELS)
|
|
230
230
|
s = s.filter(
|
|
231
|
-
(
|
|
231
|
+
(u) => o[r].domain.includes(u[i])
|
|
232
232
|
);
|
|
233
233
|
else {
|
|
234
|
-
const [
|
|
234
|
+
const [u, h] = o[r].domain;
|
|
235
235
|
s = s.filter(
|
|
236
|
-
(g) => !(i in g) || g[i] >=
|
|
236
|
+
(g) => !(i in g) || g[i] >= u && g[i] <= h
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
239
|
}), s.filter((r) => a.find((i) => i.name === r[n]));
|
|
@@ -296,20 +296,20 @@ class v {
|
|
|
296
296
|
const f = l[0].x1 - l[0].x0;
|
|
297
297
|
l[l.length - 1].x1 = +l[l.length - 1].x0 + f;
|
|
298
298
|
}
|
|
299
|
-
const
|
|
299
|
+
const u = i ? [r[0], r[r.length - 1]] : [l[0].x0, l[l.length - 1].x1], h = Array.from(new Set(t.map((f) => f[o]))), g = [];
|
|
300
300
|
return l.forEach((f) => {
|
|
301
|
-
const
|
|
301
|
+
const m = `${f.x0}-${f.x1}`, d = this.aggregateBinDataByGroup(f);
|
|
302
302
|
h.forEach((D) => {
|
|
303
303
|
g.push({
|
|
304
304
|
group: D,
|
|
305
|
-
key:
|
|
306
|
-
value:
|
|
305
|
+
key: m,
|
|
306
|
+
value: d[D] || 0,
|
|
307
307
|
bin: f.x0
|
|
308
308
|
});
|
|
309
309
|
});
|
|
310
310
|
}), {
|
|
311
311
|
bins: l,
|
|
312
|
-
binsDomain:
|
|
312
|
+
binsDomain: u
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
315
|
getBinnedStackedData() {
|
|
@@ -342,27 +342,27 @@ class v {
|
|
|
342
342
|
);
|
|
343
343
|
const o = this.services.cartesianScales.domainAxisPosition, r = s.axes[o].scaleType;
|
|
344
344
|
return r === b.TIME ? n.sort((i, l) => {
|
|
345
|
-
const
|
|
346
|
-
return
|
|
345
|
+
const u = new Date(i), h = new Date(l);
|
|
346
|
+
return u - h;
|
|
347
347
|
}) : (r === b.LOG || r === b.LINEAR) && n.sort((i, l) => i - l), n;
|
|
348
348
|
}
|
|
349
349
|
getDataValuesGroupedByKeys({ bins: t = null, groups: e = null }) {
|
|
350
350
|
const s = this.getOptions(), { groupMapsTo: a } = s.data, n = this.getDisplayData(e), o = this.getDataGroupNames(), r = this.getStackKeys({ bins: t, groups: e });
|
|
351
351
|
return t ? r.map((i) => {
|
|
352
|
-
const [l,
|
|
352
|
+
const [l, u] = i.split(":"), h = { x0: l, x1: u }, g = t.find((f) => f.x0.toString() === l.toString());
|
|
353
353
|
return o.forEach((f) => {
|
|
354
354
|
h[f] = g.filter(
|
|
355
|
-
(
|
|
355
|
+
(m) => m[a] === f
|
|
356
356
|
).length;
|
|
357
357
|
}), h;
|
|
358
358
|
}) : r.map((i) => {
|
|
359
359
|
const l = { sharedStackKey: i };
|
|
360
|
-
return o.forEach((
|
|
360
|
+
return o.forEach((u) => {
|
|
361
361
|
const h = n.find((f) => {
|
|
362
|
-
const
|
|
363
|
-
return f[a] ===
|
|
362
|
+
const m = this.services.cartesianScales.getDomainIdentifier(f);
|
|
363
|
+
return f[a] === u && Object.prototype.hasOwnProperty.call(f, m) && (f[m] instanceof Date ? z(f[m]) === i : f[m].toString() === i);
|
|
364
364
|
}), g = this.services.cartesianScales.getRangeIdentifier(l);
|
|
365
|
-
l[
|
|
365
|
+
l[u] = h ? h[g] : null;
|
|
366
366
|
}), l;
|
|
367
367
|
});
|
|
368
368
|
}
|
|
@@ -371,21 +371,21 @@ class v {
|
|
|
371
371
|
groups: e
|
|
372
372
|
});
|
|
373
373
|
if (t) {
|
|
374
|
-
const l =
|
|
375
|
-
r.forEach((
|
|
374
|
+
const l = mt(r.map((u) => [u.sharedStackKey, 0]));
|
|
375
|
+
r.forEach((u) => {
|
|
376
376
|
o.forEach((h) => {
|
|
377
|
-
l[
|
|
377
|
+
l[u.sharedStackKey] += u[h];
|
|
378
378
|
});
|
|
379
|
-
}), r.forEach((
|
|
379
|
+
}), r.forEach((u) => {
|
|
380
380
|
o.forEach((h) => {
|
|
381
|
-
const g = l[
|
|
382
|
-
l[
|
|
381
|
+
const g = l[u.sharedStackKey];
|
|
382
|
+
l[u.sharedStackKey] ? u[h] = u[h] / g * 100 : u[h] = 0;
|
|
383
383
|
});
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
return (s ? _().offset(Et) : _()).keys(o)(r).map((l,
|
|
386
|
+
return (s ? _().offset(Et) : _()).keys(o)(r).map((l, u) => Object.keys(l).filter((h) => !isNaN(h)).map((h) => {
|
|
387
387
|
const g = l[h];
|
|
388
|
-
return g[n] = o[
|
|
388
|
+
return g[n] = o[u], g;
|
|
389
389
|
}));
|
|
390
390
|
}
|
|
391
391
|
/**
|
|
@@ -435,22 +435,22 @@ class v {
|
|
|
435
435
|
* Data labels
|
|
436
436
|
*/
|
|
437
437
|
toggleDataLabel(t) {
|
|
438
|
-
const { ACTIVE: e, DISABLED: s } = E.items.status, a = this.getDataGroups(), n = a.some((
|
|
438
|
+
const { ACTIVE: e, DISABLED: s } = E.items.status, a = this.getDataGroups(), n = a.some((u) => u.status === s), o = a.filter((u) => u.status === e);
|
|
439
439
|
if (n)
|
|
440
440
|
if (o.length === 1 && o[0].name === t)
|
|
441
|
-
a.forEach((
|
|
441
|
+
a.forEach((u, h) => {
|
|
442
442
|
a[h].status = e;
|
|
443
443
|
});
|
|
444
444
|
else {
|
|
445
|
-
const
|
|
446
|
-
a[
|
|
445
|
+
const u = a.findIndex((h) => h.name === t);
|
|
446
|
+
a[u].status = a[u].status === s ? e : s;
|
|
447
447
|
}
|
|
448
448
|
else
|
|
449
|
-
a.forEach((
|
|
450
|
-
a[h].status =
|
|
449
|
+
a.forEach((u, h) => {
|
|
450
|
+
a[h].status = u.name === t ? e : s;
|
|
451
451
|
});
|
|
452
|
-
const r = a.filter((
|
|
453
|
-
a.some((
|
|
452
|
+
const r = a.filter((u) => u.status === e), i = this.getOptions();
|
|
453
|
+
a.some((u) => u.status === s) ? i.data.selectedGroups = r.map((u) => u.name) : i.data.selectedGroups = [], this.services.events.dispatchEvent(U.Legend.ITEMS_UPDATE, {
|
|
454
454
|
dataGroups: a
|
|
455
455
|
}), this.set({
|
|
456
456
|
dataGroups: a
|
|
@@ -515,11 +515,11 @@ class v {
|
|
|
515
515
|
h ? i = h : i = "Ungrouped";
|
|
516
516
|
} else
|
|
517
517
|
i = l;
|
|
518
|
-
const
|
|
518
|
+
const u = {
|
|
519
519
|
group: i,
|
|
520
520
|
key: a[r]
|
|
521
521
|
};
|
|
522
|
-
isNaN(o) ? (
|
|
522
|
+
isNaN(o) ? (u.value = o.value, u.date = o.date) : u.value = o, e.push(u);
|
|
523
523
|
});
|
|
524
524
|
}), e;
|
|
525
525
|
}
|
|
@@ -528,7 +528,7 @@ class v {
|
|
|
528
528
|
}
|
|
529
529
|
exportToCSV() {
|
|
530
530
|
const e = this.getTabularDataArray().map(
|
|
531
|
-
(o) => o.map((r) => `"${(r === "–" ? "–" : r).split(/[,;'"`]/).map((
|
|
531
|
+
(o) => o.map((r) => `"${(r === "–" ? "–" : r).split(/[,;'"`]/).map((u) => qt(u)).join("")}"`)
|
|
532
532
|
).map((o) => o.join(",")).join(`
|
|
533
533
|
`), s = this.getOptions();
|
|
534
534
|
let a = "myChart";
|
|
@@ -615,7 +615,7 @@ class M extends v {
|
|
|
615
615
|
), a;
|
|
616
616
|
}
|
|
617
617
|
getTabularDataArray() {
|
|
618
|
-
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { primaryDomain: a, primaryRange: n, secondaryDomain: o, secondaryRange: r } = this.assignRangeAndDomains(), { number: i, code: l } = p(this.getOptions(), "locale"),
|
|
618
|
+
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { primaryDomain: a, primaryRange: n, secondaryDomain: o, secondaryRange: r } = this.assignRangeAndDomains(), { number: i, code: l } = p(this.getOptions(), "locale"), u = [
|
|
619
619
|
"Group",
|
|
620
620
|
a.label,
|
|
621
621
|
n.label,
|
|
@@ -632,7 +632,7 @@ class M extends v {
|
|
|
632
632
|
g[r.identifier] === null || isNaN(g[r.identifier]) ? "–" : g[r.identifier]
|
|
633
633
|
] : []
|
|
634
634
|
]);
|
|
635
|
-
return super.formatTable({ headers:
|
|
635
|
+
return super.formatTable({ headers: u, cells: h });
|
|
636
636
|
}
|
|
637
637
|
setData(t) {
|
|
638
638
|
let e;
|
|
@@ -665,10 +665,10 @@ class M extends v {
|
|
|
665
665
|
let r = e.map((i) => i[n].getTime());
|
|
666
666
|
r = L(r).sort(), s = r.map((i) => {
|
|
667
667
|
let l = 0;
|
|
668
|
-
const
|
|
668
|
+
const u = {};
|
|
669
669
|
return e.forEach((h) => {
|
|
670
670
|
h[n].getTime() === i && (l += h[o]);
|
|
671
|
-
}),
|
|
671
|
+
}), u[n] = new Date(i), u[o] = l, u;
|
|
672
672
|
});
|
|
673
673
|
}
|
|
674
674
|
this.set({ zoomBarData: s });
|
|
@@ -734,14 +734,14 @@ class Ft extends M {
|
|
|
734
734
|
quartiles: this.getBoxQuartiles(i),
|
|
735
735
|
outliers: null,
|
|
736
736
|
whiskers: null
|
|
737
|
-
},
|
|
737
|
+
}, u = l.quartiles.q_25, h = l.quartiles.q_75, g = (h - u) * 1.5, f = u - g, m = h + g, d = [], D = [];
|
|
738
738
|
for (const y of i)
|
|
739
|
-
y < f || y >
|
|
740
|
-
l.outliers =
|
|
741
|
-
const x = P(D),
|
|
739
|
+
y < f || y > m ? d.push(y) : D.push(y);
|
|
740
|
+
l.outliers = d;
|
|
741
|
+
const x = P(D), A = k(D);
|
|
742
742
|
l.whiskers = {
|
|
743
743
|
min: x || P([l.quartiles.q_25, l.quartiles.q_50, l.quartiles.q_75]),
|
|
744
|
-
max:
|
|
744
|
+
max: A || k([l.quartiles.q_25, l.quartiles.q_50, l.quartiles.q_75])
|
|
745
745
|
}, a.push(l);
|
|
746
746
|
}
|
|
747
747
|
return a;
|
|
@@ -760,7 +760,7 @@ class Ft extends M {
|
|
|
760
760
|
p(i, "quartiles", "q_75") !== null && p(i, "quartiles", "q_25") !== null ? (a(
|
|
761
761
|
p(i, "quartiles", "q_75") - p(i, "quartiles", "q_25")
|
|
762
762
|
), n) : "–",
|
|
763
|
-
l.map((
|
|
763
|
+
l.map((u) => a(u, n)).join(",")
|
|
764
764
|
];
|
|
765
765
|
})
|
|
766
766
|
];
|
|
@@ -795,13 +795,13 @@ class Vt extends M {
|
|
|
795
795
|
}
|
|
796
796
|
getTabularDataArray() {
|
|
797
797
|
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.services.cartesianScales.getRangeIdentifier(), { number: n, code: o } = p(e, "locale"), r = p(e, "bullet", "performanceAreaTitles"), i = ["Title", "Group", "Value", "Target", "Percentage", "Performance"], l = [
|
|
798
|
-
...t.map((
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
p(
|
|
803
|
-
p(
|
|
804
|
-
r[this.getMatchingRangeIndexForDatapoint(
|
|
798
|
+
...t.map((u) => [
|
|
799
|
+
u.title,
|
|
800
|
+
u[s],
|
|
801
|
+
u.value === null ? "–" : n(u.value, o),
|
|
802
|
+
p(u, "marker") === null ? "–" : n(u.marker, o),
|
|
803
|
+
p(u, "marker") === null ? "–" : `${n(Math.floor(u[a] / u.marker * 100), o)}%`,
|
|
804
|
+
r[this.getMatchingRangeIndexForDatapoint(u)]
|
|
805
805
|
])
|
|
806
806
|
];
|
|
807
807
|
return super.formatTable({ headers: i, cells: l });
|
|
@@ -945,9 +945,9 @@ class _t extends v {
|
|
|
945
945
|
const n = e, { number: o, code: r } = p(this.getOptions(), "locale");
|
|
946
946
|
return t.forEach((i) => {
|
|
947
947
|
const l = i.name;
|
|
948
|
-
let
|
|
948
|
+
let u = 0;
|
|
949
949
|
if (i.children)
|
|
950
|
-
i.children.length > 0 && (typeof i.value == "number" && (a += i.value),
|
|
950
|
+
i.children.length > 0 && (typeof i.value == "number" && (a += i.value), u += this.getChildrenDatums(i.children, l, s, u), s.push([l, n, o(u, r)]), a += u);
|
|
951
951
|
else {
|
|
952
952
|
let h = 0;
|
|
953
953
|
typeof i.value == "number" && (h = i.value, a += i.value), s.push([i.name, n, o(h, r)]);
|
|
@@ -1002,17 +1002,23 @@ class Lt extends M {
|
|
|
1002
1002
|
if (p(e, "left", "scaleType") && p(e, "left", "scaleType") !== b.LABELS || p(e, "right", "scaleType") && p(e, "right", "scaleType") !== b.LABELS || p(e, "top", "scaleType") && p(e, "top", "scaleType") !== b.LABELS || p(e, "bottom", "scaleType") && p(e, "bottom", "scaleType") !== b.LABELS)
|
|
1003
1003
|
throw Error("Heatmap only supports label scaletypes.");
|
|
1004
1004
|
}
|
|
1005
|
+
/**
|
|
1006
|
+
* Get the custom color domain options from chart configuration
|
|
1007
|
+
* @returns ColorDomainOptions or undefined
|
|
1008
|
+
*/
|
|
1009
|
+
getColorDomainOptions() {
|
|
1010
|
+
const t = this.getOptions();
|
|
1011
|
+
return p(t, "heatmap", "colorDomain");
|
|
1012
|
+
}
|
|
1005
1013
|
/**
|
|
1006
1014
|
* Get min and maximum value of the display data
|
|
1007
|
-
* @returns Array consisting of smallest and largest values in
|
|
1015
|
+
* @returns Array consisting of smallest and largest values in data
|
|
1008
1016
|
*/
|
|
1009
1017
|
getValueDomain() {
|
|
1010
|
-
const t = N(this.getDisplayData(), (
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
return [0, 1];
|
|
1015
|
-
return e[0] < 0 && e[1] > 0 && (Math.abs(e[0]) > e[1] ? e[1] = Math.abs(e[0]) : e[0] = -e[1]), e;
|
|
1018
|
+
const t = N(this.getDisplayData(), (a) => a.value), e = it().domain(t).nice().domain();
|
|
1019
|
+
e[0] > 0 ? e[0] = 0 : e[0] === 0 && e[1] === 0 && (e[0] = 0, e[1] = 1), e[0] < 0 && e[1] > 0 && (Math.abs(e[0]) > e[1] ? e[1] = Math.abs(e[0]) : e[0] = -e[1]);
|
|
1020
|
+
const s = this.getColorDomainOptions();
|
|
1021
|
+
return s && (typeof s.min == "number" && (e[0] = s.min), typeof s.max == "number" && (e[1] = s.max)), e;
|
|
1016
1022
|
}
|
|
1017
1023
|
/**
|
|
1018
1024
|
* @override
|
|
@@ -1138,28 +1144,28 @@ class Lt extends M {
|
|
|
1138
1144
|
(a < 1 && a > 4 && o === "mono" || a < 1 && a > 2 && o === "diverge") && (a = 1);
|
|
1139
1145
|
const r = s ? e : [];
|
|
1140
1146
|
if (!s) {
|
|
1141
|
-
const
|
|
1142
|
-
for (let
|
|
1143
|
-
r.push(`fill-${o}-${a}-${
|
|
1147
|
+
const u = o === "diverge" ? 17 : 11;
|
|
1148
|
+
for (let h = 1; h < u + 1; h++)
|
|
1149
|
+
r.push(`fill-${o}-${a}-${h}`);
|
|
1144
1150
|
}
|
|
1145
1151
|
this._colorScale = lt().domain(n).range(r);
|
|
1146
|
-
const i = p(this.getOptions(), "color");
|
|
1147
|
-
this._colorScale = X(this.getDisplayData(), i);
|
|
1152
|
+
const i = p(this.getOptions(), "color"), l = this.getColorDomainOptions();
|
|
1153
|
+
this._colorScale = X(this.getDisplayData(), i, l);
|
|
1148
1154
|
}
|
|
1149
1155
|
}
|
|
1150
1156
|
class Rt extends M {
|
|
1151
1157
|
getTabularDataArray() {
|
|
1152
1158
|
const t = this.getOptions(), { groupMapsTo: e } = t.data, { number: s, code: a } = p(this.getOptions(), "locale"), n = this.getBinnedStackedData(), o = [
|
|
1153
|
-
|
|
1154
|
-
...n.map((i) =>
|
|
1159
|
+
O(t, "bins.rangeLabel") || "Range",
|
|
1160
|
+
...n.map((i) => O(i, `0.${e}`))
|
|
1155
1161
|
], r = [
|
|
1156
|
-
...
|
|
1157
|
-
`${s(Number(
|
|
1158
|
-
Number(
|
|
1162
|
+
...O(n, 0).map((i, l) => [
|
|
1163
|
+
`${s(Number(O(i, "data.x0")), a)} – ${s(
|
|
1164
|
+
Number(O(i, "data.x1")),
|
|
1159
1165
|
a
|
|
1160
1166
|
)}`,
|
|
1161
1167
|
...n.map(
|
|
1162
|
-
(
|
|
1168
|
+
(u) => s(O(u[l], `data.${O(u[l], e)}`), a)
|
|
1163
1169
|
)
|
|
1164
1170
|
])
|
|
1165
1171
|
];
|
|
@@ -1198,9 +1204,9 @@ class zt extends v {
|
|
|
1198
1204
|
}
|
|
1199
1205
|
getTabularDataArray() {
|
|
1200
1206
|
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.getStatus(), n = p(e, "meter", "proportional"), { number: o, code: r } = p(this.getOptions(), "locale");
|
|
1201
|
-
let i = [], l = [],
|
|
1207
|
+
let i = [], l = [], u;
|
|
1202
1208
|
if (n === null) {
|
|
1203
|
-
|
|
1209
|
+
u = 100;
|
|
1204
1210
|
const h = t[0];
|
|
1205
1211
|
i = ["Group", "Value", ...a ? ["Status"] : []], l = [
|
|
1206
1212
|
[
|
|
@@ -1211,15 +1217,15 @@ class zt extends v {
|
|
|
1211
1217
|
];
|
|
1212
1218
|
} else {
|
|
1213
1219
|
const h = p(n, "total");
|
|
1214
|
-
|
|
1220
|
+
u = h || this.getMaximumDomain(t), i = ["Group", "Value", "Percentage of total"], l = [
|
|
1215
1221
|
...t.map((g) => {
|
|
1216
1222
|
let f;
|
|
1217
1223
|
g.value !== null && g.value !== void 0 ? f = Number(g.value) : f = 0;
|
|
1218
|
-
const
|
|
1224
|
+
const m = Number((g.value / u * 100).toFixed(2));
|
|
1219
1225
|
return [
|
|
1220
1226
|
g[s],
|
|
1221
1227
|
g.value === null ? "–" : o(f, r),
|
|
1222
|
-
o(
|
|
1228
|
+
o(m, r) + " %"
|
|
1223
1229
|
];
|
|
1224
1230
|
})
|
|
1225
1231
|
];
|
|
@@ -1232,11 +1238,11 @@ class Ut extends M {
|
|
|
1232
1238
|
super(t);
|
|
1233
1239
|
}
|
|
1234
1240
|
getTabularDataArray() {
|
|
1235
|
-
const t = this.getOptions(), e = this.getGroupedData(), { angle: s, value: a } = p(t, "radar", "axes"), { number: n, code: o } = p(t, "locale"), r = p(e, "0", "data").map((
|
|
1236
|
-
...e.map((
|
|
1237
|
-
|
|
1241
|
+
const t = this.getOptions(), e = this.getGroupedData(), { angle: s, value: a } = p(t, "radar", "axes"), { number: n, code: o } = p(t, "locale"), r = p(e, "0", "data").map((u) => u[s]), i = ["Group", ...r], l = [
|
|
1242
|
+
...e.map((u) => [
|
|
1243
|
+
u.name,
|
|
1238
1244
|
...r.map(
|
|
1239
|
-
(h, g) => p(
|
|
1245
|
+
(h, g) => p(u, "data", g, a) !== null ? n(p(u, "data", g, a), o) : "–"
|
|
1240
1246
|
)
|
|
1241
1247
|
])
|
|
1242
1248
|
];
|
|
@@ -1294,10 +1300,10 @@ class Ht extends v {
|
|
|
1294
1300
|
}
|
|
1295
1301
|
getTabularDataArray() {
|
|
1296
1302
|
const t = this.getDisplayData(), e = this.getOptions(), { fontSizeMapsTo: s, wordMapsTo: a } = e.wordCloud, { groupMapsTo: n } = e.data, { code: o, number: r } = p(e, "locale"), i = [e.tooltip.wordLabel, "Group", e.tooltip.valueLabel], l = [
|
|
1297
|
-
...t.map((
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
r(
|
|
1303
|
+
...t.map((u) => [
|
|
1304
|
+
u[a],
|
|
1305
|
+
u[n],
|
|
1306
|
+
r(u[s], o)
|
|
1301
1307
|
])
|
|
1302
1308
|
];
|
|
1303
1309
|
return super.formatTable({ headers: i, cells: l });
|