@carbon/charts 1.27.14 → 1.27.15

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.
@@ -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 A } from "../color-scale-utils-C4KU2jNr.mjs";
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--mwppOF8.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-D6ni_TQq.mjs";
4
- function ht(u, t, e, s) {
5
- for (var a = -1, n = u == null ? 0 : u.length; ++a < n; ) {
6
- var o = u[a];
7
- t(s, o, e(o), u);
3
+ import { b as ut, c as I, a as pt } from "../array-DpdUWKrC.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(u, t, e, s) {
12
- return ut(u, function(a, n, o) {
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(u, t) {
16
+ function ft(c, t) {
17
17
  return function(e, s) {
18
18
  var a = st(e) ? ht : gt, n = {};
19
- return a(e, u, et(s), n);
19
+ return a(e, c, et(s), n);
20
20
  };
21
21
  }
22
- function dt(u) {
23
- for (var t = -1, e = u == null ? 0 : u.length, s = {}; ++t < e; ) {
24
- var a = u[t];
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 mt = Object.prototype, Dt = mt.hasOwnProperty, yt = ft(function(u, t, e) {
30
- Dt.call(u, e) ? u[e].push(t) : H(u, e, [t]);
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(u, t) {
32
+ function bt(c, t) {
33
33
  let e = 0;
34
- for (let s of u)
34
+ for (let s of c)
35
35
  s != null && (s = +s) >= s && ++e;
36
36
  return e;
37
37
  }
38
- function vt(u) {
39
- return u;
38
+ function vt(c) {
39
+ return c;
40
40
  }
41
- function xt(u = w) {
42
- if (u === w) return J;
43
- if (typeof u != "function") throw new TypeError("compare is not a function");
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 = u(t, e);
46
- return s || s === 0 ? s : (u(e, e) === 0) - (u(t, t) === 0);
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(u, t) {
50
- return (u == null || !(u >= u)) - (t == null || !(t >= t)) || (u < t ? -1 : u > t ? 1 : 0);
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(u) {
54
- return () => u;
53
+ function V(c) {
54
+ return () => c;
55
55
  }
56
- function At(u, t, e) {
56
+ function Ot(c, t, e) {
57
57
  let s;
58
58
  for (; ; ) {
59
- const a = $(u, t, e);
59
+ const a = $(c, t, e);
60
60
  if (a === s || a === 0 || !isFinite(a))
61
- return [u, t];
62
- a > 0 ? (u = Math.floor(u / a) * a, t = Math.ceil(t / a) * a) : a < 0 && (u = Math.ceil(u * a) / a, t = Math.floor(t * a) / a), s = a;
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 Ot(u) {
66
- return Math.max(1, Math.ceil(Math.log(bt(u)) / Math.LN2) + 1);
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 u = vt, t = N, e = Ot;
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] = u(a[n], n, a);
75
- var c = t(l), h = c[0], g = c[1], f = e(l, h, g);
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] = At(h, g, S)), f = at(h, g, S), f[0] <= h && (i = $(h, g, S)), f[f.length - 1] >= 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 d = f.length, m = 0, D = d; f[m] <= h; ) ++m;
85
+ for (var m = f.length, d = 0, D = m; f[d] <= h; ) ++d;
86
86
  for (; f[D - 1] > g; ) --D;
87
- (m || D < d) && (f = f.slice(m, D), d = D - m);
88
- var x = new Array(d + 1), O;
89
- for (n = 0; n <= d; ++n)
90
- O = x[n] = [], O.x0 = n > 0 ? f[n - 1] : h, O.x1 = n < d ? f[n] : g;
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(d, Math.floor((r - h) / i))].push(a[n]);
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(d, y + (f[y] <= r))].push(a[n]);
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, d)].push(a[n]);
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 ? (u = typeof a == "function" ? a : V(a), s) : u;
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(u, 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(u.length - 1, s)), !(e <= t && t <= s)) return u;
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, c = Math.log(i), h = 0.5 * Math.exp(2 * c / 3), g = 0.5 * Math.sqrt(c * h * (i - h) / i) * (l - i / 2 < 0 ? -1 : 1), f = Math.max(e, Math.floor(t - l * h / i + g)), d = Math.min(s, Math.floor(t + (i - l) * h / i + g));
120
- tt(u, t, f, d, a);
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 = u[t];
122
+ const n = c[t];
123
123
  let o = e, r = s;
124
- for (G(u, e, t), a(u[s], n) > 0 && G(u, e, s); o < r; ) {
125
- for (G(u, o, r), ++o, --r; a(u[o], n) < 0; ) ++o;
126
- for (; a(u[r], n) > 0; ) --r;
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(u[e], n) === 0 ? G(u, e, r) : (++r, G(u, r, s)), r <= t && (e = r + 1), t <= r && (s = r - 1);
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 u;
130
+ return c;
131
131
  }
132
- function G(u, t, e) {
133
- const s = u[t];
134
- u[t] = u[e], u[e] = s;
132
+ function G(c, t, e) {
133
+ const s = c[t];
134
+ c[t] = c[e], c[e] = s;
135
135
  }
136
- function B(u, t, e) {
137
- if (u = Float64Array.from(ot(u)), !(!(s = u.length) || isNaN(t = +t))) {
138
- if (t <= 0 || s < 2) return P(u);
139
- if (t >= 1) return k(u);
140
- var s, a = (s - 1) * t, n = Math.floor(a), o = k(tt(u, n).subarray(0, n + 1)), r = P(u.subarray(n + 1));
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(u, t) {
145
- if ((o = u.length) > 1)
146
- for (var e = 1, s, a, n = u[t[0]], o, r = n.length; e < o; ++e)
147
- for (a = n, n = u[t[e]], s = 0; s < r; ++s)
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(u) {
151
- for (var t = u.length, e = new Array(t); --t >= 0; ) e[t] = 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(u, t) {
155
- return u[t];
154
+ function Gt(c, t) {
155
+ return c[t];
156
156
  }
157
- function St(u) {
157
+ function St(c) {
158
158
  const t = [];
159
- return t.key = u, t;
159
+ return t.key = c, t;
160
160
  }
161
161
  function _() {
162
- var u = I([]), t = j, e = K, s = Gt;
162
+ var c = I([]), t = j, e = K, s = Gt;
163
163
  function a(n) {
164
- var o = Array.from(u.apply(this, arguments), St), r, i = o.length, l = -1, c;
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, c = pt(t(o)); r < i; ++r)
169
- o[c[r]].index = r;
170
- return e(o, c), 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 ? (u = typeof n == "function" ? n : I(Array.from(n)), a) : u;
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(u, t) {
183
- if ((i = u.length) > 0)
184
- for (var e, s = 0, a, n, o, r, i, l = u[t[0]].length; s < l; ++s)
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 = u[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);
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(u) {
189
- const t = u.trim();
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, c = l?.getDomainAxisScaleType();
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 c === b.TIME && (h = (f) => n(f, a, { month: "short", day: "numeric", year: "numeric" })), [
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 d in f) {
210
- const m = f[d];
211
- typeof m == "number" && (f[d] = o(m, a));
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((c) => ({
226
- ...c,
227
- [i]: c[i] === null ? c[i] : Number(c[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
- (c) => o[r].domain.includes(c[i])
231
+ (u) => o[r].domain.includes(u[i])
232
232
  );
233
233
  else {
234
- const [c, h] = o[r].domain;
234
+ const [u, h] = o[r].domain;
235
235
  s = s.filter(
236
- (g) => !(i in g) || g[i] >= c && g[i] <= h
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 c = 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 = [];
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 d = `${f.x0}-${f.x1}`, m = this.aggregateBinDataByGroup(f);
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: d,
306
- value: m[D] || 0,
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: c
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 c = new Date(i), h = new Date(l);
346
- return c - h;
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, c] = i.split(":"), h = { x0: l, x1: c }, g = t.find((f) => f.x0.toString() === l.toString());
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
- (d) => d[a] === f
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((c) => {
360
+ return o.forEach((u) => {
361
361
  const h = n.find((f) => {
362
- const d = this.services.cartesianScales.getDomainIdentifier(f);
363
- return f[a] === c && Object.prototype.hasOwnProperty.call(f, d) && (f[d] instanceof Date ? z(f[d]) === i : f[d].toString() === i);
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[c] = h ? h[g] : null;
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 = dt(r.map((c) => [c.sharedStackKey, 0]));
375
- r.forEach((c) => {
374
+ const l = mt(r.map((u) => [u.sharedStackKey, 0]));
375
+ r.forEach((u) => {
376
376
  o.forEach((h) => {
377
- l[c.sharedStackKey] += c[h];
377
+ l[u.sharedStackKey] += u[h];
378
378
  });
379
- }), r.forEach((c) => {
379
+ }), r.forEach((u) => {
380
380
  o.forEach((h) => {
381
- const g = l[c.sharedStackKey];
382
- l[c.sharedStackKey] ? c[h] = c[h] / g * 100 : c[h] = 0;
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, c) => Object.keys(l).filter((h) => !isNaN(h)).map((h) => {
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[c], g;
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((c) => c.status === s), o = a.filter((c) => c.status === e);
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((c, h) => {
441
+ a.forEach((u, h) => {
442
442
  a[h].status = e;
443
443
  });
444
444
  else {
445
- const c = a.findIndex((h) => h.name === t);
446
- a[c].status = a[c].status === s ? e : s;
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((c, h) => {
450
- a[h].status = c.name === t ? e : s;
449
+ a.forEach((u, h) => {
450
+ a[h].status = u.name === t ? e : s;
451
451
  });
452
- const r = a.filter((c) => c.status === e), i = this.getOptions();
453
- a.some((c) => c.status === s) ? i.data.selectedGroups = r.map((c) => c.name) : i.data.selectedGroups = [], this.services.events.dispatchEvent(U.Legend.ITEMS_UPDATE, {
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 c = {
518
+ const u = {
519
519
  group: i,
520
520
  key: a[r]
521
521
  };
522
- isNaN(o) ? (c.value = o.value, c.date = o.date) : c.value = o, e.push(c);
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 === "&ndash;" ? "–" : r).split(/[,;'"`]/).map((c) => qt(c)).join("")}"`)
531
+ (o) => o.map((r) => `"${(r === "&ndash;" ? "–" : 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"), c = [
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]) ? "&ndash;" : g[r.identifier]
633
633
  ] : []
634
634
  ]);
635
- return super.formatTable({ headers: c, cells: h });
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 c = {};
668
+ const u = {};
669
669
  return e.forEach((h) => {
670
670
  h[n].getTime() === i && (l += h[o]);
671
- }), c[n] = new Date(i), c[o] = l, c;
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
- }, c = l.quartiles.q_25, h = l.quartiles.q_75, g = (h - c) * 1.5, f = c - g, d = h + g, m = [], D = [];
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 > d ? m.push(y) : D.push(y);
740
- l.outliers = m;
741
- const x = P(D), O = k(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: O || k([l.quartiles.q_25, l.quartiles.q_50, l.quartiles.q_75])
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) : "&ndash;",
763
- l.map((c) => a(c, n)).join(",")
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((c) => [
799
- c.title,
800
- c[s],
801
- c.value === null ? "&ndash;" : n(c.value, o),
802
- p(c, "marker") === null ? "&ndash;" : n(c.marker, o),
803
- p(c, "marker") === null ? "&ndash;" : `${n(Math.floor(c[a] / c.marker * 100), o)}%`,
804
- r[this.getMatchingRangeIndexForDatapoint(c)]
798
+ ...t.map((u) => [
799
+ u.title,
800
+ u[s],
801
+ u.value === null ? "&ndash;" : n(u.value, o),
802
+ p(u, "marker") === null ? "&ndash;" : n(u.marker, o),
803
+ p(u, "marker") === null ? "&ndash;" : `${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 c = 0;
948
+ let u = 0;
949
949
  if (i.children)
950
- i.children.length > 0 && (typeof i.value == "number" && (a += i.value), c += this.getChildrenDatums(i.children, l, s, c), s.push([l, n, o(c, r)]), a += c);
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 data
1015
+ * @returns Array consisting of smallest and largest values in data
1008
1016
  */
1009
1017
  getValueDomain() {
1010
- const t = N(this.getDisplayData(), (s) => s.value), e = it().domain(t).nice().domain();
1011
- if (e[0] > 0)
1012
- e[0] = 0;
1013
- else if (e[0] === 0 && e[1] === 0)
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 l = o === "diverge" ? 17 : 11;
1142
- for (let c = 1; c < l + 1; c++)
1143
- r.push(`fill-${o}-${a}-${c}`);
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
- A(t, "bins.rangeLabel") || "Range",
1154
- ...n.map((i) => A(i, `0.${e}`))
1159
+ O(t, "bins.rangeLabel") || "Range",
1160
+ ...n.map((i) => O(i, `0.${e}`))
1155
1161
  ], r = [
1156
- ...A(n, 0).map((i, l) => [
1157
- `${s(Number(A(i, "data.x0")), a)} – ${s(
1158
- Number(A(i, "data.x1")),
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
- (c) => s(A(c[l], `data.${A(c[l], e)}`), a)
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 = [], c;
1207
+ let i = [], l = [], u;
1202
1208
  if (n === null) {
1203
- c = 100;
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
- c = h || this.getMaximumDomain(t), i = ["Group", "Value", "Percentage of total"], l = [
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 d = Number((g.value / c * 100).toFixed(2));
1224
+ const m = Number((g.value / u * 100).toFixed(2));
1219
1225
  return [
1220
1226
  g[s],
1221
1227
  g.value === null ? "&ndash;" : o(f, r),
1222
- o(d, r) + " %"
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((c) => c[s]), i = ["Group", ...r], l = [
1236
- ...e.map((c) => [
1237
- c.name,
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(c, "data", g, a) !== null ? n(p(c, "data", g, a), o) : "&ndash;"
1245
+ (h, g) => p(u, "data", g, a) !== null ? n(p(u, "data", g, a), o) : "&ndash;"
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((c) => [
1298
- c[a],
1299
- c[n],
1300
- r(c[s], o)
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 });