@carbon/charts 1.13.34 → 1.14.0

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{_baseEach-fBb6x0bv.mjs → _baseEach-1x0l4fXu.mjs} +2 -2
  3. package/dist/{_baseEach-fBb6x0bv.mjs.map → _baseEach-1x0l4fXu.mjs.map} +1 -1
  4. package/dist/{angle-utils-uYSg57eT.mjs → angle-utils-Ss5LscUK.mjs} +2 -2
  5. package/dist/{angle-utils-uYSg57eT.mjs.map → angle-utils-Ss5LscUK.mjs.map} +1 -1
  6. package/dist/{choropleth-QJfTyxqo.mjs → choropleth-bo0SVD2j.mjs} +1843 -1818
  7. package/dist/choropleth-bo0SVD2j.mjs.map +1 -0
  8. package/dist/{color-scale-utils-k_4IkKRj.mjs → color-scale-utils-eeC25Jjh.mjs} +1263 -1078
  9. package/dist/color-scale-utils-eeC25Jjh.mjs.map +1 -0
  10. package/dist/components/index.mjs +1 -1
  11. package/dist/demo/charts/bar.d.ts +75 -0
  12. package/dist/demo/index.mjs +1394 -1294
  13. package/dist/demo/index.mjs.map +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.mjs +8 -8
  16. package/dist/interfaces/charts.d.ts +5 -1
  17. package/dist/interfaces/components.d.ts +65 -0
  18. package/dist/interfaces/index.d.ts +1 -1
  19. package/dist/model/index.mjs +1 -1
  20. package/dist/services/index.mjs +3 -3
  21. package/dist/services/time-series.d.ts +2 -1
  22. package/dist/umd/bundle.umd.js +25 -24
  23. package/dist/umd/bundle.umd.js.map +1 -1
  24. package/dist/{wordcloud-a6lxyv6s.mjs → wordcloud-UWOp6fZX.mjs} +381 -350
  25. package/dist/wordcloud-UWOp6fZX.mjs.map +1 -0
  26. package/dist/{zoom-PYRfEo-q.mjs → zoom-LcHlmSqj.mjs} +135 -135
  27. package/dist/zoom-LcHlmSqj.mjs.map +1 -0
  28. package/package.json +2 -2
  29. package/dist/choropleth-QJfTyxqo.mjs.map +0 -1
  30. package/dist/color-scale-utils-k_4IkKRj.mjs.map +0 -1
  31. package/dist/wordcloud-a6lxyv6s.mjs.map +0 -1
  32. package/dist/zoom-PYRfEo-q.mjs.map +0 -1
@@ -1,38 +1,38 @@
1
- import { bin as w, stack as G, stackOffsetDiverging as z, scaleOrdinal as L, quantile as M, ascending as j, min as P, max as k, extent as U, scaleLinear as K, scaleQuantize as H } from "d3";
2
- import { o as Z, p as Q, q as W, m as u, s as O, t as A, u as X, v as E, f as N, w as V, x as _, y as R, z as Y, A as y, g as $, B as b } from "./color-scale-utils-k_4IkKRj.mjs";
3
- import { S as f, _ as B, d as F, e as S, s as J } from "./enums-lWSDG4ik.mjs";
4
- import { b as tt } from "./_baseEach-fBb6x0bv.mjs";
5
- function et(h, t, e, s) {
6
- for (var a = -1, n = h == null ? 0 : h.length; ++a < n; ) {
7
- var o = h[a];
8
- t(s, o, e(o), h);
1
+ import { o as w, p as z, q as j, m as u, s as O, t as G, u as U, v as M, f as N, w as F, x as _, y as V, z as b, g as L, A as C } from "./color-scale-utils-eeC25Jjh.mjs";
2
+ import { bin as K, stack as S, stackOffsetDiverging as H, scaleOrdinal as R, quantile as E, ascending as Z, min as P, max as k, extent as Q, scaleLinear as W, scaleQuantize as X } from "d3";
3
+ import { S as f, _ as B, d as $, e as A, s as Y } from "./enums-lWSDG4ik.mjs";
4
+ import { b as J } from "./_baseEach-1x0l4fXu.mjs";
5
+ function tt(d, t, e, s) {
6
+ for (var a = -1, o = d == null ? 0 : d.length; ++a < o; ) {
7
+ var r = d[a];
8
+ t(s, r, e(r), d);
9
9
  }
10
10
  return s;
11
11
  }
12
- function st(h, t, e, s) {
13
- return tt(h, function(a, n, o) {
14
- t(s, a, e(a), o);
12
+ function et(d, t, e, s) {
13
+ return J(d, function(a, o, r) {
14
+ t(s, a, e(a), r);
15
15
  }), s;
16
16
  }
17
- function at(h, t) {
17
+ function st(d, t) {
18
18
  return function(e, s) {
19
- var a = Z(e) ? et : st, n = t ? t() : {};
20
- return a(e, h, Q(s), n);
19
+ var a = w(e) ? tt : et, o = t ? t() : {};
20
+ return a(e, d, z(s), o);
21
21
  };
22
22
  }
23
- function ot(h) {
24
- for (var t = -1, e = h == null ? 0 : h.length, s = {}; ++t < e; ) {
25
- var a = h[t];
23
+ function at(d) {
24
+ for (var t = -1, e = d == null ? 0 : d.length, s = {}; ++t < e; ) {
25
+ var a = d[t];
26
26
  s[a[0]] = a[1];
27
27
  }
28
28
  return s;
29
29
  }
30
- var nt = Object.prototype, rt = nt.hasOwnProperty, it = at(function(h, t, e) {
31
- rt.call(h, e) ? h[e].push(t) : W(h, e, [t]);
30
+ var ot = Object.prototype, rt = ot.hasOwnProperty, nt = st(function(d, t, e) {
31
+ rt.call(d, e) ? d[e].push(t) : j(d, e, [t]);
32
32
  });
33
- const lt = it;
34
- function ct(h) {
35
- const t = h.trim();
33
+ const it = nt;
34
+ function lt(d) {
35
+ const t = d.trim();
36
36
  return ["=", "+", "-", "@", " ", "\r"].includes(t.charAt(0)) ? ` ${t}` : /[,\"\n]/.test(t) ? `"${t}"` : t;
37
37
  }
38
38
  class D {
@@ -42,11 +42,22 @@ class D {
42
42
  }, this.colorScale = {}, this.colorClassNames = {}, this.services = t;
43
43
  }
44
44
  formatTable({ headers: t, cells: e }) {
45
- const s = this.getOptions(), a = u(s, "tabularRepModal", "tableHeadingFormatter"), n = u(s, "tabularRepModal", "tableCellFormatter"), { cartesianScales: o } = this.services, i = o == null ? void 0 : o.getDomainAxisScaleType();
46
- let r;
47
- return i === f.TIME && (r = (l) => Y(l, "MMM d, yyyy")), [
48
- typeof a == "function" ? a(t) : t,
49
- ...typeof n == "function" ? n(e) : e.map((l) => (r && (l[1] = r(l[1])), l))
45
+ const s = this.getOptions(), {
46
+ code: a,
47
+ date: o,
48
+ number: r
49
+ } = u(s, "locale"), i = u(s, "tabularRepModal", "tableHeadingFormatter"), n = u(s, "tabularRepModal", "tableCellFormatter"), { cartesianScales: c } = this.services, l = c == null ? void 0 : c.getDomainAxisScaleType();
50
+ let p;
51
+ return l === f.TIME && (p = (g) => o(g, a, { month: "short", day: "numeric", year: "numeric" })), [
52
+ typeof i == "function" ? i(t) : t,
53
+ ...typeof n == "function" ? n(e) : e.map((g) => {
54
+ p && (g[1] = p(g[1]));
55
+ for (let m in g) {
56
+ let y = g[m];
57
+ typeof y == "number" && (g[m] = r(y, a));
58
+ }
59
+ return g;
60
+ })
50
61
  ];
51
62
  }
52
63
  getAllDataFromDomain(t) {
@@ -54,24 +65,24 @@ class D {
54
65
  return null;
55
66
  const e = this.getOptions();
56
67
  let s = this.getData();
57
- const a = this.getDataGroups(), { groupMapsTo: n } = u(e, "data"), o = u(e, "axes");
58
- return t && (s = s.filter((i) => t.includes(i[n]))), o && Object.keys(o).forEach((i) => {
59
- const r = o[i].mapsTo, c = o[i].scaleType;
68
+ const a = this.getDataGroups(), { groupMapsTo: o } = u(e, "data"), r = u(e, "axes");
69
+ return t && (s = s.filter((i) => t.includes(i[o]))), r && Object.keys(r).forEach((i) => {
70
+ const n = r[i].mapsTo, c = r[i].scaleType;
60
71
  if ((c === f.LINEAR || c === f.LOG) && (s = s.map((l) => ({
61
72
  ...l,
62
- [r]: l[r] === null ? l[r] : Number(l[r])
63
- }))), r && o[i].domain)
73
+ [n]: l[n] === null ? l[n] : Number(l[n])
74
+ }))), n && r[i].domain)
64
75
  if (c === f.LABELS)
65
76
  s = s.filter(
66
- (l) => o[i].domain.includes(l[r])
77
+ (l) => r[i].domain.includes(l[n])
67
78
  );
68
79
  else {
69
- const [l, p] = o[i].domain;
80
+ const [l, p] = r[i].domain;
70
81
  s = s.filter(
71
- (d) => !(r in d) || d[r] >= l && d[r] <= p
82
+ (h) => !(n in h) || h[n] >= l && h[n] <= p
72
83
  );
73
84
  }
74
- }), s.filter((i) => a.find((r) => r.name === i[n]));
85
+ }), s.filter((i) => a.find((n) => n.name === i[o]));
75
86
  }
76
87
  /**
77
88
  * Charts that have group configs passed into them, only want to retrieve the display data relevant to that chart
@@ -81,8 +92,8 @@ class D {
81
92
  if (!this.get("data"))
82
93
  return null;
83
94
  const { ACTIVE: e } = O.items.status, s = this.getDataGroups(t), { groupMapsTo: a } = this.getOptions().data;
84
- return this.getAllDataFromDomain(t).filter((o) => s.find(
85
- (i) => i.name === o[a] && i.status === e
95
+ return this.getAllDataFromDomain(t).filter((r) => s.find(
96
+ (i) => i.name === r[a] && i.status === e
86
97
  ));
87
98
  }
88
99
  getData() {
@@ -96,7 +107,7 @@ class D {
96
107
  * @param newData The new raw data to be set
97
108
  */
98
109
  setData(t) {
99
- const e = this.sanitize(A(t)), s = this.generateDataGroups(e);
110
+ const e = this.sanitize(G(t)), s = this.generateDataGroups(e);
100
111
  return this.set({
101
112
  data: e,
102
113
  dataGroups: s
@@ -116,24 +127,24 @@ class D {
116
127
  return this.getActiveDataGroups(t).map((s) => s.name);
117
128
  }
118
129
  aggregateBinDataByGroup(t) {
119
- return lt(t, "group");
130
+ return it(t, "group");
120
131
  }
121
132
  getBinConfigurations() {
122
- const t = this.getDisplayData(), e = this.getOptions(), s = this.services.cartesianScales.getMainXAxisPosition(), a = this.services.cartesianScales.getDomainIdentifier(), n = e.axes[s], { groupMapsTo: o } = e.data, { bins: i = X.defaultBins } = n, r = Array.isArray(i), c = w().value((g) => g[a]).thresholds(i)(t);
123
- if (r)
133
+ const t = this.getDisplayData(), e = this.getOptions(), s = this.services.cartesianScales.getMainXAxisPosition(), a = this.services.cartesianScales.getDomainIdentifier(), o = e.axes[s], { groupMapsTo: r } = e.data, { bins: i = U.defaultBins } = o, n = Array.isArray(i), c = K().value((g) => g[a]).thresholds(i)(t);
134
+ if (n)
124
135
  c[c.length - 1].x1 = i[i.length - 1];
125
136
  else {
126
137
  const g = c[0].x1 - c[0].x0;
127
138
  c[c.length - 1].x1 = +c[c.length - 1].x0 + g;
128
139
  }
129
- const l = r ? [i[0], i[i.length - 1]] : [c[0].x0, c[c.length - 1].x1], p = Array.from(new Set(t.map((g) => g[o]))), d = [];
140
+ const l = n ? [i[0], i[i.length - 1]] : [c[0].x0, c[c.length - 1].x1], p = Array.from(new Set(t.map((g) => g[r]))), h = [];
130
141
  return c.forEach((g) => {
131
- const m = `${g.x0}-${g.x1}`, C = this.aggregateBinDataByGroup(g);
142
+ const m = `${g.x0}-${g.x1}`, y = this.aggregateBinDataByGroup(g);
132
143
  p.forEach((x) => {
133
- d.push({
144
+ h.push({
134
145
  group: x,
135
146
  key: m,
136
- value: C[x] || 0,
147
+ value: y[x] || 0,
137
148
  bin: g.x0
138
149
  });
139
150
  });
@@ -143,79 +154,79 @@ class D {
143
154
  };
144
155
  }
145
156
  getBinnedStackedData() {
146
- const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getActiveDataGroupNames(), { bins: a } = this.getBinConfigurations(), n = this.getDataValuesGroupedByKeys({
157
+ const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getActiveDataGroupNames(), { bins: a } = this.getBinConfigurations(), o = this.getDataValuesGroupedByKeys({
147
158
  bins: a
148
159
  });
149
- return G().keys(s)(n).map((o, i) => Object.keys(o).filter((r) => !isNaN(r)).map((r) => {
150
- const c = o[r];
160
+ return S().keys(s)(o).map((r, i) => Object.keys(r).filter((n) => !isNaN(n)).map((n) => {
161
+ const c = r[n];
151
162
  return c[e] = s[i], c;
152
163
  }));
153
164
  }
154
165
  getGroupedData(t) {
155
166
  const e = this.getDisplayData(t), s = {}, { groupMapsTo: a } = this.getOptions().data;
156
- return e.map((n) => {
157
- const o = n[a];
158
- s[o] !== null && s[o] !== void 0 ? s[o].push(n) : s[o] = [n];
159
- }), Object.keys(s).map((n) => ({
160
- name: n,
161
- data: s[n]
167
+ return e.map((o) => {
168
+ const r = o[a];
169
+ s[r] !== null && s[r] !== void 0 ? s[r].push(o) : s[r] = [o];
170
+ }), Object.keys(s).map((o) => ({
171
+ name: o,
172
+ data: s[o]
162
173
  }));
163
174
  }
164
175
  getStackKeys({ bins: t = null, groups: e = null } = { bins: null, groups: null }) {
165
176
  const s = this.getOptions(), a = this.getDisplayData(e);
166
- let n;
167
- t ? n = t.map((r) => `${r.x0}:${r.x1}`) : n = E(
168
- a.map((r) => {
169
- const c = this.services.cartesianScales.getDomainIdentifier(r);
170
- return r[c] instanceof Date ? N(r[c]) : r[c] && typeof r[c].toString == "function" ? r[c].toString() : r[c];
177
+ let o;
178
+ t ? o = t.map((n) => `${n.x0}:${n.x1}`) : o = M(
179
+ a.map((n) => {
180
+ const c = this.services.cartesianScales.getDomainIdentifier(n);
181
+ return n[c] instanceof Date ? N(n[c]) : n[c] && typeof n[c].toString == "function" ? n[c].toString() : n[c];
171
182
  })
172
183
  );
173
- const o = this.services.cartesianScales.domainAxisPosition, i = s.axes[o].scaleType;
174
- return i === f.TIME ? n.sort((r, c) => {
175
- const l = new Date(r), p = new Date(c);
184
+ const r = this.services.cartesianScales.domainAxisPosition, i = s.axes[r].scaleType;
185
+ return i === f.TIME ? o.sort((n, c) => {
186
+ const l = new Date(n), p = new Date(c);
176
187
  return l - p;
177
- }) : (i === f.LOG || i === f.LINEAR) && n.sort((r, c) => r - c), n;
188
+ }) : (i === f.LOG || i === f.LINEAR) && o.sort((n, c) => n - c), o;
178
189
  }
179
190
  getDataValuesGroupedByKeys({ bins: t = null, groups: e = null }) {
180
- const s = this.getOptions(), { groupMapsTo: a } = s.data, n = this.getDisplayData(e), o = this.getDataGroupNames(), i = this.getStackKeys({ bins: t, groups: e });
181
- return t ? i.map((r) => {
182
- const [c, l] = r.split(":"), p = { x0: c, x1: l }, d = t.find((g) => g.x0.toString() === c.toString());
183
- return o.forEach((g) => {
184
- p[g] = d.filter(
191
+ const s = this.getOptions(), { groupMapsTo: a } = s.data, o = this.getDisplayData(e), r = this.getDataGroupNames(), i = this.getStackKeys({ bins: t, groups: e });
192
+ return t ? i.map((n) => {
193
+ const [c, l] = n.split(":"), p = { x0: c, x1: l }, h = t.find((g) => g.x0.toString() === c.toString());
194
+ return r.forEach((g) => {
195
+ p[g] = h.filter(
185
196
  (m) => m[a] === g
186
197
  ).length;
187
198
  }), p;
188
- }) : i.map((r) => {
189
- const c = { sharedStackKey: r };
190
- return o.forEach((l) => {
191
- const p = n.find((g) => {
199
+ }) : i.map((n) => {
200
+ const c = { sharedStackKey: n };
201
+ return r.forEach((l) => {
202
+ const p = o.find((g) => {
192
203
  const m = this.services.cartesianScales.getDomainIdentifier(g);
193
- return g[a] === l && Object.prototype.hasOwnProperty.call(g, m) && (g[m] instanceof Date ? N(g[m]) === r : g[m].toString() === r);
194
- }), d = this.services.cartesianScales.getRangeIdentifier(c);
195
- c[l] = p ? p[d] : null;
204
+ return g[a] === l && Object.prototype.hasOwnProperty.call(g, m) && (g[m] instanceof Date ? N(g[m]) === n : g[m].toString() === n);
205
+ }), h = this.services.cartesianScales.getRangeIdentifier(c);
206
+ c[l] = p ? p[h] : null;
196
207
  }), c;
197
208
  });
198
209
  }
199
210
  getStackedData({ percentage: t = !1, groups: e = null, divergent: s = !1 }) {
200
- const a = this.getOptions(), { groupMapsTo: n } = a.data, o = this.getActiveDataGroupNames(e), i = this.getDataValuesGroupedByKeys({
211
+ const a = this.getOptions(), { groupMapsTo: o } = a.data, r = this.getActiveDataGroupNames(e), i = this.getDataValuesGroupedByKeys({
201
212
  groups: e
202
213
  });
203
214
  if (t) {
204
- const c = ot(i.map((l) => [l.sharedStackKey, 0]));
215
+ const c = at(i.map((l) => [l.sharedStackKey, 0]));
205
216
  i.forEach((l) => {
206
- o.forEach((p) => {
217
+ r.forEach((p) => {
207
218
  c[l.sharedStackKey] += l[p];
208
219
  });
209
220
  }), i.forEach((l) => {
210
- o.forEach((p) => {
211
- const d = c[l.sharedStackKey];
212
- c[l.sharedStackKey] ? l[p] = l[p] / d * 100 : l[p] = 0;
221
+ r.forEach((p) => {
222
+ const h = c[l.sharedStackKey];
223
+ c[l.sharedStackKey] ? l[p] = l[p] / h * 100 : l[p] = 0;
213
224
  });
214
225
  });
215
226
  }
216
- return (s ? G().offset(z) : G()).keys(o)(i).map((c, l) => Object.keys(c).filter((p) => !isNaN(p)).map((p) => {
217
- const d = c[p];
218
- return d[n] = o[l], d;
227
+ return (s ? S().offset(H) : S()).keys(r)(i).map((c, l) => Object.keys(c).filter((p) => !isNaN(p)).map((p) => {
228
+ const h = c[p];
229
+ return h[o] = r[l], h;
219
230
  }));
220
231
  }
221
232
  /**
@@ -242,7 +253,7 @@ class D {
242
253
  */
243
254
  setOptions(t) {
244
255
  const e = this.getOptions();
245
- V(e, t), this.set({
256
+ F(e, t), this.set({
246
257
  options: _(e, t)
247
258
  });
248
259
  }
@@ -258,9 +269,9 @@ class D {
258
269
  * Data labels
259
270
  */
260
271
  toggleDataLabel(t) {
261
- const { ACTIVE: e, DISABLED: s } = O.items.status, a = this.getDataGroups(), n = a.some((l) => l.status === s), o = a.filter((l) => l.status === e);
262
- if (n)
263
- if (o.length === 1 && o[0].name === t)
272
+ const { ACTIVE: e, DISABLED: s } = O.items.status, a = this.getDataGroups(), o = a.some((l) => l.status === s), r = a.filter((l) => l.status === e);
273
+ if (o)
274
+ if (r.length === 1 && r[0].name === t)
264
275
  a.forEach((l, p) => {
265
276
  a[p].status = e;
266
277
  });
@@ -272,8 +283,8 @@ class D {
272
283
  a.forEach((l, p) => {
273
284
  a[p].status = l.name === t ? e : s;
274
285
  });
275
- const i = a.filter((l) => l.status === e), r = this.getOptions();
276
- a.some((l) => l.status === s) ? r.data.selectedGroups = i.map((l) => l.name) : r.data.selectedGroups = [], this.services.events.dispatchEvent(B.Legend.ITEMS_UPDATE, {
286
+ const i = a.filter((l) => l.status === e), n = this.getOptions();
287
+ a.some((l) => l.status === s) ? n.data.selectedGroups = i.map((l) => l.name) : n.data.selectedGroups = [], this.services.events.dispatchEvent(B.Legend.ITEMS_UPDATE, {
277
288
  dataGroups: a
278
289
  }), this.set({
279
290
  dataGroups: a
@@ -287,16 +298,16 @@ class D {
287
298
  * @param defaultFilled the default for this chart
288
299
  */
289
300
  getIsFilled(t, e, s, a) {
290
- const n = this.getOptions();
291
- return n.getIsFilled ? n.getIsFilled(t, e, s, a) : a;
301
+ const o = this.getOptions();
302
+ return o.getIsFilled ? o.getIsFilled(t, e, s, a) : a;
292
303
  }
293
304
  getFillColor(t, e, s) {
294
- const a = this.getOptions(), n = u(this.colorScale, t);
295
- return a.getFillColor ? a.getFillColor(t, e, s, n) : n;
305
+ const a = this.getOptions(), o = u(this.colorScale, t);
306
+ return a.getFillColor ? a.getFillColor(t, e, s, o) : o;
296
307
  }
297
308
  getStrokeColor(t, e, s) {
298
- const a = this.getOptions(), n = u(this.colorScale, t);
299
- return a.getStrokeColor ? a.getStrokeColor(t, e, s, n) : n;
309
+ const a = this.getOptions(), o = u(this.colorScale, t);
310
+ return a.getStrokeColor ? a.getStrokeColor(t, e, s, o) : o;
300
311
  }
301
312
  isUserProvidedColorScaleValid() {
302
313
  const t = u(this.getOptions(), "color", "scale"), e = this.getDataGroups();
@@ -329,20 +340,20 @@ class D {
329
340
  "We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/?path=/story/docs-tutorials--tabular-data-format"
330
341
  );
331
342
  const e = [], { datasets: s, labels: a } = t;
332
- return s.forEach((n) => {
333
- n.data.forEach((o, i) => {
334
- let r;
335
- const c = u(n, "label");
343
+ return s.forEach((o) => {
344
+ o.data.forEach((r, i) => {
345
+ let n;
346
+ const c = u(o, "label");
336
347
  if (c === null) {
337
348
  const p = u(a, i);
338
- p ? r = p : r = "Ungrouped";
349
+ p ? n = p : n = "Ungrouped";
339
350
  } else
340
- r = c;
351
+ n = c;
341
352
  const l = {
342
- group: r,
353
+ group: n,
343
354
  key: a[i]
344
355
  };
345
- isNaN(o) ? (l.value = o.value, l.date = o.date) : l.value = o, e.push(l);
356
+ isNaN(r) ? (l.value = r.value, l.date = r.date) : l.value = r, e.push(l);
346
357
  });
347
358
  }), e;
348
359
  }
@@ -351,12 +362,12 @@ class D {
351
362
  }
352
363
  exportToCSV() {
353
364
  const e = this.getTabularDataArray().map(
354
- (o) => o.map((i) => `"${(i === "&ndash;" ? "–" : i).split(/[,;'"`]/).map((l) => ct(l)).join("")}"`)
355
- ).map((o) => o.join(",")).join(`
365
+ (r) => r.map((i) => `"${(i === "&ndash;" ? "–" : i).split(/[,;'"`]/).map((l) => lt(l)).join("")}"`)
366
+ ).map((r) => r.join(",")).join(`
356
367
  `), s = this.getOptions();
357
368
  let a = "myChart";
358
- const n = u(s, "fileDownload", "fileName");
359
- typeof n == "function" ? a = n("csv") : typeof n == "string" && (a = n), this.services.files.downloadCSV(e, `${a}.csv`);
369
+ const o = u(s, "fileDownload", "fileName");
370
+ typeof o == "function" ? a = o("csv") : typeof o == "string" && (a = o), this.services.files.downloadCSV(e, `${a}.csv`);
360
371
  }
361
372
  getTabularData(t) {
362
373
  return Array.isArray(t) ? t : this.transformToTabularData(t);
@@ -373,14 +384,14 @@ class D {
373
384
  }) : this.allDataGroups = this.getDataGroupNames();
374
385
  }
375
386
  generateDataGroups(t) {
376
- const { groupMapsTo: e } = this.getOptions().data, { ACTIVE: s, DISABLED: a } = O.items.status, n = this.getOptions(), o = E(t.map((r) => r[e]));
377
- n.data.selectedGroups.length && (n.data.selectedGroups.every(
378
- (c) => o.includes(c)
379
- ) || (n.data.selectedGroups = []));
380
- const i = (r) => !n.data.selectedGroups.length || n.data.selectedGroups.includes(r) ? s : a;
381
- return o.map((r) => ({
382
- name: r,
383
- status: i(r)
387
+ const { groupMapsTo: e } = this.getOptions().data, { ACTIVE: s, DISABLED: a } = O.items.status, o = this.getOptions(), r = M(t.map((n) => n[e]));
388
+ o.data.selectedGroups.length && (o.data.selectedGroups.every(
389
+ (c) => r.includes(c)
390
+ ) || (o.data.selectedGroups = []));
391
+ const i = (n) => !o.data.selectedGroups.length || o.data.selectedGroups.includes(n) ? s : a;
392
+ return r.map((n) => ({
393
+ name: n,
394
+ status: i(n)
384
395
  }));
385
396
  }
386
397
  /*
@@ -404,18 +415,18 @@ class D {
404
415
  let e = u(t, "numberOfVariants");
405
416
  (!e || e < this.allDataGroups.length) && (e = this.allDataGroups.length);
406
417
  let s = u(t, "option");
407
- const a = R.pairingOptions, n = e > 5 ? 14 : e, o = `${n}-color`;
408
- s = s <= a[o] ? s : 1;
418
+ const a = V.pairingOptions, o = e > 5 ? 14 : e, r = `${o}-color`;
419
+ s = s <= a[r] ? s : 1;
409
420
  const i = this.allDataGroups.map(
410
- (r, c) => `${n}-${s}-${c % 14 + 1}`
421
+ (n, c) => `${o}-${s}-${c % 14 + 1}`
411
422
  );
412
- this.colorClassNames = L().range(i).domain(this.allDataGroups);
423
+ this.colorClassNames = R().range(i).domain(this.allDataGroups);
413
424
  }
414
425
  }
415
426
  class T extends D {
416
427
  // can't be protected as it's used by two-dimensional-axes.ts
417
428
  constructor(t) {
418
- super(t), this.axisFlavor = F.DEFAULT;
429
+ super(t), this.axisFlavor = $.DEFAULT;
419
430
  }
420
431
  // get the scales information
421
432
  // needed for getTabularArray()
@@ -427,43 +438,43 @@ class T extends D {
427
438
  secondaryRange: null
428
439
  };
429
440
  return s && (a.secondaryDomain = t.secondaryDomainAxisPosition, a.secondaryRange = t.secondaryRangeAxisPosition), Object.keys(a).forEach(
430
- (n) => {
431
- const o = a[n];
432
- t.scales[o] ? a[n] = {
433
- position: o,
434
- label: t.getScaleLabel(o),
435
- identifier: u(e, "axes", o, "mapsTo")
436
- } : a[n] = null;
441
+ (o) => {
442
+ const r = a[o];
443
+ t.scales[r] ? a[o] = {
444
+ position: r,
445
+ label: t.getScaleLabel(r),
446
+ identifier: u(e, "axes", r, "mapsTo")
447
+ } : a[o] = null;
437
448
  }
438
449
  ), a;
439
450
  }
440
451
  getTabularDataArray() {
441
- const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { primaryDomain: a, primaryRange: n, secondaryDomain: o, secondaryRange: i } = this.assignRangeAndDomains(), r = [
452
+ const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { primaryDomain: a, primaryRange: o, secondaryDomain: r, secondaryRange: i } = this.assignRangeAndDomains(), { number: n, code: c } = u(this.getOptions(), "locale"), l = [
442
453
  "Group",
443
454
  a.label,
444
- n.label,
445
- ...o ? [o.label] : [],
455
+ o.label,
456
+ ...r ? [r.label] : [],
446
457
  ...i ? [i.label] : []
447
- ], c = t.map((l) => [
448
- l[s],
449
- l[a.identifier] === null ? "&ndash;" : l[a.identifier],
450
- l[n.identifier] === null || isNaN(l[n.identifier]) ? "&ndash;" : l[n.identifier].toLocaleString(),
451
- ...o ? [
452
- l[o.identifier] === null ? "&ndash;" : l[o.identifier]
458
+ ], p = t.map((h) => [
459
+ h[s],
460
+ h[a.identifier] === null ? "&ndash;" : h[a.identifier],
461
+ h[o.identifier] === null || isNaN(h[o.identifier]) ? "&ndash;" : n(h[o.identifier], c),
462
+ ...r ? [
463
+ h[r.identifier] === null ? "&ndash;" : h[r.identifier]
453
464
  ] : [],
454
465
  ...i ? [
455
- l[i.identifier] === null || isNaN(l[i.identifier]) ? "&ndash;" : l[i.identifier]
466
+ h[i.identifier] === null || isNaN(h[i.identifier]) ? "&ndash;" : h[i.identifier]
456
467
  ] : []
457
468
  ]);
458
- return super.formatTable({ headers: r, cells: c });
469
+ return super.formatTable({ headers: l, cells: p });
459
470
  }
460
471
  setData(t) {
461
472
  let e;
462
- if (t && (e = super.setData(t), u(this.getOptions(), "zoomBar", S.TOP, "enabled"))) {
473
+ if (t && (e = super.setData(t), u(this.getOptions(), "zoomBar", A.TOP, "enabled"))) {
463
474
  const s = u(
464
475
  this.getOptions(),
465
476
  "zoomBar",
466
- S.TOP,
477
+ A.TOP,
467
478
  "data"
468
479
  );
469
480
  this.setZoomBarData(s);
@@ -474,18 +485,18 @@ class T extends D {
474
485
  * @param zoomBarData any special zoom bar data to use instead of the model data
475
486
  */
476
487
  setZoomBarData(t) {
477
- const e = t ? this.sanitize(A(t)) : this.getDisplayData();
488
+ const e = t ? this.sanitize(G(t)) : this.getDisplayData();
478
489
  let s = e;
479
490
  const { cartesianScales: a } = this.services;
480
491
  if (e && a.domainAxisPosition && a.rangeAxisPosition) {
481
- const n = a.getDomainIdentifier(), o = a.getRangeIdentifier();
482
- let i = e.map((r) => r[n].getTime());
483
- i = E(i).sort(), s = i.map((r) => {
492
+ const o = a.getDomainIdentifier(), r = a.getRangeIdentifier();
493
+ let i = e.map((n) => n[o].getTime());
494
+ i = M(i).sort(), s = i.map((n) => {
484
495
  let c = 0;
485
496
  const l = {};
486
497
  return e.forEach((p) => {
487
- p[n].getTime() === r && (c += p[o]);
488
- }), l[n] = new Date(r), l[o] = c, l;
498
+ p[o].getTime() === n && (c += p[r]);
499
+ }), l[o] = new Date(n), l[r] = c, l;
489
500
  });
490
501
  }
491
502
  this.set({ zoomBarData: s });
@@ -498,15 +509,15 @@ class T extends D {
498
509
  if (!e.axes)
499
510
  return t;
500
511
  const s = [];
501
- return Object.keys(S).forEach((a) => {
502
- const n = S[a], o = e.axes[n];
503
- if (o && o.scaleType === f.TIME) {
504
- const i = o.mapsTo;
512
+ return Object.keys(A).forEach((a) => {
513
+ const o = A[a], r = e.axes[o];
514
+ if (r && r.scaleType === f.TIME) {
515
+ const i = r.mapsTo;
505
516
  (i !== null || i !== void 0) && s.push(i);
506
517
  }
507
518
  }), s.length > 0 && t.forEach((a) => {
508
- s.forEach((n) => {
509
- u(a, n, "getTime") === null && (a[n] = new Date(a[n]));
519
+ s.forEach((o) => {
520
+ u(a, o, "getTime") === null && (a[o] = new Date(a[o]));
510
521
  });
511
522
  }), t;
512
523
  }
@@ -514,43 +525,47 @@ class T extends D {
514
525
  return t = super.sanitize(t), t = this.sanitizeDateValues(t), t;
515
526
  }
516
527
  }
517
- class dt extends T {
528
+ class gt extends T {
518
529
  constructor(t) {
519
530
  super(t);
520
531
  }
521
532
  getTabularDataArray() {
522
- const t = this.getDisplayData();
523
- t.sort((a, n) => a.source.localeCompare(n.source));
524
- const e = ["Source", "Target", "Value"], s = [
525
- ...t.map((a) => [a.source, a.target, a.value])
533
+ const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale");
534
+ t.sort((r, i) => r.source.localeCompare(i.source));
535
+ const a = ["Source", "Target", "Value"], o = [
536
+ ...t.map((r) => [
537
+ r.source,
538
+ r.target,
539
+ e(r.value, s)
540
+ ])
526
541
  ];
527
- return super.formatTable({ headers: e, cells: s });
542
+ return super.formatTable({ headers: a, cells: o });
528
543
  }
529
544
  }
530
- class ft extends T {
545
+ class dt extends T {
531
546
  constructor(t) {
532
547
  super(t);
533
548
  }
534
549
  getBoxQuartiles(t) {
535
550
  return {
536
- q_25: M(t, 0.25),
537
- q_50: M(t, 0.5),
538
- q_75: M(t, 0.75)
551
+ q_25: E(t, 0.25),
552
+ q_50: E(t, 0.5),
553
+ q_75: E(t, 0.75)
539
554
  };
540
555
  }
541
556
  getBoxplotData() {
542
557
  const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getGroupedData(), a = [];
543
- for (const { name: n, data: o } of s) {
544
- const i = this.services.cartesianScales.getRangeIdentifier(), r = o.map((v) => v[i]).sort(j), c = {
545
- [e]: n,
546
- counts: r,
547
- quartiles: this.getBoxQuartiles(r),
558
+ for (const { name: o, data: r } of s) {
559
+ const i = this.services.cartesianScales.getRangeIdentifier(), n = r.map((v) => v[i]).sort(Z), c = {
560
+ [e]: o,
561
+ counts: n,
562
+ quartiles: this.getBoxQuartiles(n),
548
563
  outliers: null,
549
564
  whiskers: null
550
- }, l = c.quartiles.q_25, p = c.quartiles.q_75, d = (p - l) * 1.5, g = l - d, m = p + d, C = [], x = [];
551
- for (const v of r)
552
- v < g || v > m ? C.push(v) : x.push(v);
553
- c.outliers = C;
565
+ }, l = c.quartiles.q_25, p = c.quartiles.q_75, h = (p - l) * 1.5, g = l - h, m = p + h, y = [], x = [];
566
+ for (const v of n)
567
+ v < g || v > m ? y.push(v) : x.push(v);
568
+ c.outliers = y;
554
569
  const q = P(x), I = k(x);
555
570
  c.whiskers = {
556
571
  min: q || P([c.quartiles.q_25, c.quartiles.q_50, c.quartiles.q_75]),
@@ -560,30 +575,32 @@ class ft extends T {
560
575
  return a;
561
576
  }
562
577
  getTabularDataArray() {
563
- const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getBoxplotData(), a = ["Group", "Minimum", "Q1", "Median", "Q3", "Maximum", "IQR", "Outlier(s)"], n = [
564
- ...s.map((o) => {
565
- let i = u(o, "outliers");
566
- return (i === null || i.length === 0) && (i = ["&ndash;"]), [
567
- o[e],
568
- u(o, "whiskers", "min") !== null ? u(o, "whiskers", "min").toLocaleString() : "&ndash;",
569
- u(o, "quartiles", "q_25") !== null ? u(o, "quartiles", "q_25").toLocaleString() : "&ndash;",
570
- u(o, "quartiles", "q_50") !== null ? u(o, "quartiles", "q_50").toLocaleString() : "&ndash;",
571
- u(o, "quartiles", "q_75") !== null ? u(o, "quartiles", "q_75").toLocaleString() : "&ndash;",
572
- u(o, "whiskers", "max") !== null ? u(o, "whiskers", "max").toLocaleString() : "&ndash;",
573
- u(o, "quartiles", "q_75") !== null && u(o, "quartiles", "q_25") !== null ? (u(o, "quartiles", "q_75") - u(o, "quartiles", "q_25")).toLocaleString() : "&ndash;",
574
- i.map((r) => r.toLocaleString()).join(",")
578
+ const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getBoxplotData(), { number: a, code: o } = u(t, "locale"), r = ["Group", "Minimum", "Q1", "Median", "Q3", "Maximum", "IQR", "Outlier(s)"], i = [
579
+ ...s.map((n) => {
580
+ let c = u(n, "outliers");
581
+ return (c === null || c.length === 0) && (c = ["&ndash;"]), [
582
+ n[e],
583
+ u(n, "whiskers", "min") !== null ? a(u(n, "whiskers", "min"), o) : "&ndash;",
584
+ u(n, "quartiles", "q_25") !== null ? a(u(n, "quartiles", "q_25"), o) : "&ndash;",
585
+ u(n, "quartiles", "q_50") !== null ? a(u(n, "quartiles", "q_50"), o) : "&ndash;",
586
+ u(n, "quartiles", "q_75") !== null ? a(u(n, "quartiles", "q_75"), o) : "&ndash;",
587
+ u(n, "whiskers", "max") !== null ? a(u(n, "whiskers", "max"), o) : "&ndash;",
588
+ u(n, "quartiles", "q_75") !== null && u(n, "quartiles", "q_25") !== null ? (a(
589
+ u(n, "quartiles", "q_75") - u(n, "quartiles", "q_25")
590
+ ), o) : "&ndash;",
591
+ c.map((l) => a(l, o)).join(",")
575
592
  ];
576
593
  })
577
594
  ];
578
- return super.formatTable({ headers: a, cells: n });
595
+ return super.formatTable({ headers: r, cells: i });
579
596
  }
580
597
  setColorClassNames() {
581
598
  const e = u(this.getOptions(), "color", "pairing");
582
599
  let s = u(e, "option");
583
- const a = R.pairingOptions;
600
+ const a = V.pairingOptions;
584
601
  s = s <= a["1-color"] ? s : 1;
585
- const n = this.allDataGroups.map(() => `1-${s}-1`);
586
- this.colorClassNames = L().range(n).domain(this.allDataGroups);
602
+ const o = this.allDataGroups.map(() => `1-${s}-1`);
603
+ this.colorClassNames = R().range(o).domain(this.allDataGroups);
587
604
  }
588
605
  }
589
606
  class mt extends T {
@@ -605,20 +622,20 @@ class mt extends T {
605
622
  return 0;
606
623
  }
607
624
  getTabularDataArray() {
608
- const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.services.cartesianScales.getRangeIdentifier(), n = u(e, "bullet", "performanceAreaTitles"), o = ["Title", "Group", "Value", "Target", "Percentage", "Performance"], i = [
609
- ...t.map((r) => [
610
- r.title,
611
- r[s],
612
- r.value === null ? "&ndash;" : r.value,
613
- u(r, "marker") === null ? "&ndash;" : r.marker,
614
- u(r, "marker") === null ? "&ndash;" : `${Math.floor(r[a] / r.marker * 100)}%`,
615
- n[this.getMatchingRangeIndexForDatapoint(r)]
625
+ const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.services.cartesianScales.getRangeIdentifier(), { number: o, code: r } = u(e, "locale"), i = u(e, "bullet", "performanceAreaTitles"), n = ["Title", "Group", "Value", "Target", "Percentage", "Performance"], c = [
626
+ ...t.map((l) => [
627
+ l.title,
628
+ l[s],
629
+ l.value === null ? "&ndash;" : o(l.value, r),
630
+ u(l, "marker") === null ? "&ndash;" : o(l.marker, r),
631
+ u(l, "marker") === null ? "&ndash;" : `${o(Math.floor(l[a] / l.marker * 100), r)}%`,
632
+ i[this.getMatchingRangeIndexForDatapoint(l)]
616
633
  ])
617
634
  ];
618
- return super.formatTable({ headers: o, cells: i });
635
+ return super.formatTable({ headers: n, cells: c });
619
636
  }
620
637
  }
621
- class Dt extends D {
638
+ class ft extends D {
622
639
  constructor(t) {
623
640
  super(t), this._colorScale = void 0, this._matrix = {};
624
641
  }
@@ -634,9 +651,9 @@ class Dt extends D {
634
651
  * Helper function that will generate a dictionary
635
652
  */
636
653
  getCombinedData() {
637
- if (y(this._matrix)) {
654
+ if (b(this._matrix)) {
638
655
  const t = this.getOptions(), e = this.getDisplayData();
639
- !y(e) && !y(t.geoData.objects.countries) && (t.geoData.objects.countries.geometries.forEach((s) => {
656
+ !b(e) && !b(t.geoData.objects.countries) && (t.geoData.objects.countries.geometries.forEach((s) => {
640
657
  this._matrix[s.properties.NAME] = s;
641
658
  }), e.forEach((s) => {
642
659
  this._matrix[s.name] ? this._matrix[s.name].value = s.value || null : console.warn(`Data point ${s} is missing geographical data.`);
@@ -649,14 +666,14 @@ class Dt extends D {
649
666
  * @returns Array<Object>
650
667
  */
651
668
  getTabularDataArray() {
652
- const t = this.getDisplayData(), e = ["Country ID", "Country Name", "Value"], s = [
653
- ...t.map((a) => [
654
- a.id === null ? "&ndash;" : a.id,
655
- a.name,
656
- a.value
669
+ const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale"), a = ["Country ID", "Country Name", "Value"], o = [
670
+ ...t.map((r) => [
671
+ r.id === null ? "&ndash;" : r.id,
672
+ r.name,
673
+ e(r.value, s)
657
674
  ])
658
675
  ];
659
- return super.formatTable({ headers: e, cells: s });
676
+ return super.formatTable({ headers: a, cells: o });
660
677
  }
661
678
  // Uses quantize scale to return class names
662
679
  getColorClassName(t) {
@@ -664,10 +681,10 @@ class Dt extends D {
664
681
  }
665
682
  setColorClassNames() {
666
683
  const t = u(this.getOptions(), "color");
667
- this._colorScale = $(this.getDisplayData(), t);
684
+ this._colorScale = L(this.getDisplayData(), t);
668
685
  }
669
686
  }
670
- class yt extends D {
687
+ class Dt extends D {
671
688
  constructor(t) {
672
689
  super(t), this.parentNode = !1, this.set({ depth: 2 }, { skipUpdate: !0 });
673
690
  }
@@ -676,26 +693,26 @@ class yt extends D {
676
693
  }
677
694
  setOptions(t) {
678
695
  const e = this.getOptions(), s = _({}, t, this.getZoomOptions(t));
679
- V(e, s);
680
- const a = this.getHierarchyLevel(), n = u(e, "circlePack", "hierarchyLevel");
696
+ F(e, s);
697
+ const a = this.getHierarchyLevel(), o = u(e, "circlePack", "hierarchyLevel");
681
698
  this.set({
682
699
  options: _(e, s),
683
- depth: n && n < 4 ? n : a
700
+ depth: o && o < 4 ? o : a
684
701
  });
685
702
  }
686
703
  getZoomOptions(t) {
687
704
  if (!this.getDisplayData())
688
705
  return {};
689
706
  const e = this.getDisplayData(), s = t || this.getOptions(), a = e.length === 1 && u(e, 0, "children") ? u(e, 0, "children") : e;
690
- let n = this.getHierarchyLevel();
691
- return a.some((o) => {
692
- if (o.children && o.children.some((i) => i.children))
693
- return n = 3, !1;
694
- }), u(s, "canvasZoom", "enabled") === !0 && n > 2 ? {
707
+ let o = this.getHierarchyLevel();
708
+ return a.some((r) => {
709
+ if (r.children && r.children.some((i) => i.children))
710
+ return o = 3, !1;
711
+ }), u(s, "canvasZoom", "enabled") === !0 && o > 2 ? {
695
712
  legend: {
696
713
  additionalItems: [
697
714
  {
698
- type: J.ZOOM,
715
+ type: Y.ZOOM,
699
716
  name: "Click to zoom"
700
717
  }
701
718
  ]
@@ -717,9 +734,9 @@ class yt extends D {
717
734
  }
718
735
  // set the datagroup name on the items that are it's children
719
736
  setDataGroups() {
720
- const t = this.getData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = t.map((n) => {
721
- const o = n[s];
722
- return this.setChildrenDataGroup(n, o);
737
+ const t = this.getData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = t.map((o) => {
738
+ const r = o[s];
739
+ return this.setChildrenDataGroup(o, r);
723
740
  });
724
741
  this.set(
725
742
  {
@@ -737,11 +754,11 @@ class yt extends D {
737
754
  } : { ...t, dataGroupName: e };
738
755
  }
739
756
  getTabularDataArray() {
740
- const t = this.getDisplayData(), e = ["Child", "Parent", "Value"], s = [];
741
- return t.forEach((a) => {
742
- let n = a.value ? a.value : 0;
743
- a.children && (n += this.getChildrenDatums(a.children, a.name, s, 0)), s.push(["&ndash;", a.name, n]);
744
- }), super.formatTable({ headers: e, cells: s });
757
+ const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale"), a = ["Child", "Parent", "Value"], o = [];
758
+ return t.forEach((r) => {
759
+ let i = r.value ? r.value : 0;
760
+ r.children && (i += this.getChildrenDatums(r.children, r.name, o, 0)), o.push(["&ndash;", r.name, e(i, s)]);
761
+ }), super.formatTable({ headers: a, cells: o });
745
762
  }
746
763
  /**
747
764
  * Recursively determine the relationship between all the nested elements in the child
@@ -752,20 +769,20 @@ class yt extends D {
752
769
  * @returns: number
753
770
  */
754
771
  getChildrenDatums(t, e, s = [], a = 0) {
755
- const n = e;
756
- return t.forEach((o) => {
757
- const i = o.name;
758
- let r = 0;
759
- if (o.children)
760
- o.children.length > 0 && (typeof o.value == "number" && (a += o.value), r += this.getChildrenDatums(o.children, i, s, r), s.push([i, n, r]), a += r);
772
+ const o = e, { number: r, code: i } = u(this.getOptions(), "locale");
773
+ return t.forEach((n) => {
774
+ const c = n.name;
775
+ let l = 0;
776
+ if (n.children)
777
+ n.children.length > 0 && (typeof n.value == "number" && (a += n.value), l += this.getChildrenDatums(n.children, c, s, l), s.push([c, o, r(l, i)]), a += l);
761
778
  else {
762
- let c = 0;
763
- typeof o.value == "number" && (c = o.value, a += o.value), s.push([o.name, n, c]);
779
+ let p = 0;
780
+ typeof n.value == "number" && (p = n.value, a += n.value), s.push([n.name, o, r(p, i)]);
764
781
  }
765
782
  }), a;
766
783
  }
767
784
  }
768
- class vt extends D {
785
+ class yt extends D {
769
786
  constructor(t) {
770
787
  super(t);
771
788
  }
@@ -776,13 +793,13 @@ class vt extends D {
776
793
  }), e;
777
794
  }
778
795
  getTabularDataArray() {
779
- const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { valueMapsTo: a } = e.pie, n = ["Group", "Value"], o = [
780
- ...t.map((i) => [
781
- i[s],
782
- i[a] === null ? "&ndash;" : i[a].toLocaleString()
796
+ const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { valueMapsTo: a } = e.pie, { number: o, code: r } = u(e, "locale"), i = ["Group", "Value"], n = [
797
+ ...t.map((c) => [
798
+ c[s],
799
+ c[a] === null ? "&ndash;" : o(c[a], r)
783
800
  ])
784
801
  ];
785
- return super.formatTable({ headers: n, cells: o });
802
+ return super.formatTable({ headers: i, cells: n });
786
803
  }
787
804
  sanitize(t) {
788
805
  return this.getTabularData(t).sort((s, a) => a.value - s.value);
@@ -796,18 +813,18 @@ class bt extends D {
796
813
  return super.getDataGroups().filter((t) => t.name !== "delta");
797
814
  }
798
815
  getTabularDataArray() {
799
- const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = ["Group", "Value"], n = [
800
- ...t.map((o) => [
801
- o[s],
802
- o.value === null ? "&ndash;" : o.value.toLocaleString()
816
+ const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { number: a, code: o } = u(this.getOptions(), "locale"), r = ["Group", "Value"], i = [
817
+ ...t.map((n) => [
818
+ n[s],
819
+ n.value === null ? "&ndash;" : a(n.value, o)
803
820
  ])
804
821
  ];
805
- return super.formatTable({ headers: a, cells: n });
822
+ return super.formatTable({ headers: r, cells: i });
806
823
  }
807
824
  }
808
- class xt extends T {
825
+ class vt extends T {
809
826
  constructor(t) {
810
- super(t), this.axisFlavor = F.HOVERABLE, this._colorScale = void 0, this._domains = [], this._ranges = [], this._matrix = {};
827
+ super(t), this.axisFlavor = $.HOVERABLE, this._colorScale = void 0, this._domains = [], this._ranges = [], this._matrix = {};
811
828
  const e = u(this.getOptions(), "axes");
812
829
  if (u(e, "left", "scaleType") && u(e, "left", "scaleType") !== f.LABELS || u(e, "right", "scaleType") && u(e, "right", "scaleType") !== f.LABELS || u(e, "top", "scaleType") && u(e, "top", "scaleType") !== f.LABELS || u(e, "bottom", "scaleType") && u(e, "bottom", "scaleType") !== f.LABELS)
813
830
  throw Error("Heatmap only supports label scaletypes.");
@@ -817,7 +834,7 @@ class xt extends T {
817
834
  * @returns Array consisting of smallest and largest values in data
818
835
  */
819
836
  getValueDomain() {
820
- const t = U(this.getDisplayData(), (s) => s.value), e = K().domain(t).nice().domain();
837
+ const t = Q(this.getDisplayData(), (s) => s.value), e = W().domain(t).nice().domain();
821
838
  if (e[0] > 0)
822
839
  e[0] = 0;
823
840
  else if (e[0] === 0 && e[1] === 0)
@@ -837,13 +854,13 @@ class xt extends T {
837
854
  * @returns String[]
838
855
  */
839
856
  getUniqueDomain() {
840
- if (y(this._domains)) {
841
- const t = this.getDisplayData(), { cartesianScales: e } = this.services, s = e.getDomainIdentifier(), a = e.getMainXAxisPosition(), n = e.getCustomDomainValuesByposition(a);
842
- if (n)
843
- return n;
857
+ if (b(this._domains)) {
858
+ const t = this.getDisplayData(), { cartesianScales: e } = this.services, s = e.getDomainIdentifier(), a = e.getMainXAxisPosition(), o = e.getCustomDomainValuesByposition(a);
859
+ if (o)
860
+ return o;
844
861
  this._domains = Array.from(
845
862
  new Set(
846
- t.map((o) => o[s])
863
+ t.map((r) => r[s])
847
864
  )
848
865
  );
849
866
  }
@@ -854,13 +871,13 @@ class xt extends T {
854
871
  * @returns String[]
855
872
  */
856
873
  getUniqueRanges() {
857
- if (y(this._ranges)) {
858
- const t = this.getDisplayData(), { cartesianScales: e } = this.services, s = e.getRangeIdentifier(), a = e.getMainYAxisPosition(), n = e.getCustomDomainValuesByposition(a);
859
- if (n)
860
- return n;
874
+ if (b(this._ranges)) {
875
+ const t = this.getDisplayData(), { cartesianScales: e } = this.services, s = e.getRangeIdentifier(), a = e.getMainYAxisPosition(), o = e.getCustomDomainValuesByposition(a);
876
+ if (o)
877
+ return o;
861
878
  this._ranges = Array.from(
862
879
  new Set(
863
- t.map((o) => o[s])
880
+ t.map((r) => r[s])
864
881
  )
865
882
  );
866
883
  }
@@ -871,18 +888,18 @@ class xt extends T {
871
888
  * @returns Object
872
889
  */
873
890
  getMatrix() {
874
- if (y(this._matrix)) {
875
- const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(), n = {};
876
- e.forEach((o) => {
877
- n[o] = {
891
+ if (b(this._matrix)) {
892
+ const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(), o = {};
893
+ e.forEach((r) => {
894
+ o[r] = {
878
895
  value: null,
879
896
  index: -1
880
897
  };
881
- }), t.forEach((o) => {
882
- this._matrix[o] = A(n);
883
- }), this.getDisplayData().forEach((o, i) => {
884
- this._matrix[o[s]][o[a]] = {
885
- value: o.value,
898
+ }), t.forEach((r) => {
899
+ this._matrix[r] = G(o);
900
+ }), this.getDisplayData().forEach((r, i) => {
901
+ this._matrix[r[s]][r[a]] = {
902
+ value: r.value,
886
903
  index: i
887
904
  };
888
905
  });
@@ -894,7 +911,7 @@ class xt extends T {
894
911
  * @param newData The new raw data to be set
895
912
  */
896
913
  setData(t) {
897
- const e = this.sanitize(A(t)), s = this.generateDataGroups(e);
914
+ const e = this.sanitize(G(t)), s = this.generateDataGroups(e);
898
915
  return this.set({
899
916
  data: e,
900
917
  dataGroups: s
@@ -905,67 +922,72 @@ class xt extends T {
905
922
  * @returns object[]
906
923
  */
907
924
  getMatrixAsArray() {
908
- y(this._matrix) && this.getMatrix();
909
- const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(), n = [];
910
- return t.forEach((o) => {
925
+ b(this._matrix) && this.getMatrix();
926
+ const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(), o = [];
927
+ return t.forEach((r) => {
911
928
  e.forEach((i) => {
912
- const r = {
913
- value: this._matrix[o][i].value,
914
- index: this._matrix[o][i].index
929
+ const n = {
930
+ value: this._matrix[r][i].value,
931
+ index: this._matrix[r][i].index
915
932
  };
916
- r[s] = o, r[a] = i, n.push(r);
933
+ n[s] = r, n[a] = i, o.push(n);
917
934
  });
918
- }), n;
935
+ }), o;
919
936
  }
920
937
  /**
921
938
  * Generate tabular data from display data
922
939
  * @returns Array<Object>
923
940
  */
924
941
  getTabularDataArray() {
925
- const t = this.getDisplayData(), { primaryDomain: e, primaryRange: s } = this.assignRangeAndDomains(), a = [e.label, s.label, "Value"], n = [
926
- ...t.map((o) => [
927
- o[e.identifier] === null ? "&ndash;" : o[e.identifier],
928
- o[s.identifier] === null ? "&ndash;" : o[s.identifier].toLocaleString(),
929
- o.value
942
+ const t = this.getDisplayData(), { primaryDomain: e, primaryRange: s } = this.assignRangeAndDomains(), { number: a, code: o } = u(this.getOptions(), "locale"), r = [e.label, s.label, "Value"], i = [
943
+ ...t.map((n) => [
944
+ n[e.identifier] === null ? "&ndash;" : n[e.identifier],
945
+ n[s.identifier] === null ? "&ndash;" : n[s.identifier],
946
+ a(n.value, o)
930
947
  ])
931
948
  ];
932
- return super.formatTable({ headers: a, cells: n });
949
+ return super.formatTable({ headers: r, cells: i });
933
950
  }
934
951
  // Uses quantize scale to return class names
935
952
  getColorClassName(t) {
936
953
  return `${t.originalClassName} ${this._colorScale(t.value)}`;
937
954
  }
938
955
  setColorClassNames() {
939
- const t = this.getOptions(), e = u(t, "color", "gradient", "colors"), s = !y(e);
956
+ const t = this.getOptions(), e = u(t, "color", "gradient", "colors"), s = !b(e);
940
957
  let a = u(t, "color", "pairing", "option");
941
- const n = this.getValueDomain(), o = n[0] < 0 && n[1] > 0 ? "diverge" : "mono";
942
- (a < 1 && a > 4 && o === "mono" || a < 1 && a > 2 && o === "diverge") && (a = 1);
958
+ const o = this.getValueDomain(), r = o[0] < 0 && o[1] > 0 ? "diverge" : "mono";
959
+ (a < 1 && a > 4 && r === "mono" || a < 1 && a > 2 && r === "diverge") && (a = 1);
943
960
  const i = s ? e : [];
944
961
  if (!s) {
945
- const c = o === "diverge" ? 17 : 11;
962
+ const c = r === "diverge" ? 17 : 11;
946
963
  for (let l = 1; l < c + 1; l++)
947
- i.push(`fill-${o}-${a}-${l}`);
964
+ i.push(`fill-${r}-${a}-${l}`);
948
965
  }
949
- this._colorScale = H().domain(n).range(i);
950
- const r = u(this.getOptions(), "color");
951
- this._colorScale = $(this.getDisplayData(), r);
966
+ this._colorScale = X().domain(o).range(i);
967
+ const n = u(this.getOptions(), "color");
968
+ this._colorScale = L(this.getDisplayData(), n);
952
969
  }
953
970
  }
954
- class Tt extends T {
971
+ class Ct extends T {
955
972
  getTabularDataArray() {
956
- const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getBinnedStackedData(), a = [
957
- b(t, "bins.rangeLabel") || "Range",
958
- ...s.map((o) => b(o, `0.${e}`))
959
- ], n = [
960
- ...b(s, 0).map((o, i) => [
961
- `${b(o, "data.x0")} – ${b(o, "data.x1")}`,
962
- ...s.map((r) => b(r[i], `data.${b(r[i], e)}`))
973
+ const t = this.getOptions(), { groupMapsTo: e } = t.data, { number: s, code: a } = u(this.getOptions(), "locale"), o = this.getBinnedStackedData(), r = [
974
+ C(t, "bins.rangeLabel") || "Range",
975
+ ...o.map((n) => C(n, `0.${e}`))
976
+ ], i = [
977
+ ...C(o, 0).map((n, c) => [
978
+ `${s(Number(C(n, "data.x0")), a)} – ${s(
979
+ Number(C(n, "data.x1")),
980
+ a
981
+ )}`,
982
+ ...o.map(
983
+ (l) => s(C(l[c], `data.${C(l[c], e)}`), a)
984
+ )
963
985
  ])
964
986
  ];
965
- return super.formatTable({ headers: a, cells: n });
987
+ return super.formatTable({ headers: r, cells: i });
966
988
  }
967
989
  }
968
- class Ct extends D {
990
+ class xt extends D {
969
991
  constructor(t) {
970
992
  super(t);
971
993
  }
@@ -985,53 +1007,62 @@ class Ct extends D {
985
1007
  * Get the associated status for the data by checking the ranges
986
1008
  */
987
1009
  getStatus() {
988
- const t = this.getOptions(), e = u(this.getDisplayData()), s = (e == null ? void 0 : e.reduce((o, i) => o + i.value, 0)) ?? 0, a = u(t, "meter", "proportional") ? s : s > 100 ? 100 : s, n = u(t, "meter", "status", "ranges");
989
- if (n) {
990
- const o = n.filter(
1010
+ const t = this.getOptions(), e = u(this.getDisplayData()), s = (e == null ? void 0 : e.reduce((r, i) => r + i.value, 0)) ?? 0, a = u(t, "meter", "proportional") ? s : s > 100 ? 100 : s, o = u(t, "meter", "status", "ranges");
1011
+ if (o) {
1012
+ const r = o.filter(
991
1013
  (i) => i.range[0] <= a && a <= i.range[1]
992
1014
  );
993
- if (o.length > 0)
994
- return o[0].status;
1015
+ if (r.length > 0)
1016
+ return r[0].status;
995
1017
  }
996
1018
  return null;
997
1019
  }
998
1020
  getTabularDataArray() {
999
- const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.getStatus(), n = u(e, "meter", "proportional");
1000
- let o = [], i = [], r;
1001
- if (n === null) {
1002
- r = 100;
1003
- const c = t[0];
1004
- o = ["Group", "Value", ...a ? ["Status"] : []], i = [[c[s], c.value, ...a ? [a] : []]];
1021
+ const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.getStatus(), o = u(e, "meter", "proportional"), { number: r, code: i } = u(this.getOptions(), "locale");
1022
+ let n = [], c = [], l;
1023
+ if (o === null) {
1024
+ l = 100;
1025
+ const p = t[0];
1026
+ n = ["Group", "Value", ...a ? ["Status"] : []], c = [
1027
+ [
1028
+ p[s],
1029
+ r(p.value, i),
1030
+ ...a ? [a] : []
1031
+ ]
1032
+ ];
1005
1033
  } else {
1006
- const c = u(n, "total");
1007
- r = c || this.getMaximumDomain(t), o = ["Group", "Value", "Percentage of total"], i = [
1008
- ...t.map((l) => [
1009
- l[s],
1010
- l.value,
1011
- (l.value / r * 100).toFixed(2) + " %"
1012
- ])
1034
+ const p = u(o, "total");
1035
+ l = p || this.getMaximumDomain(t), n = ["Group", "Value", "Percentage of total"], c = [
1036
+ ...t.map((h) => {
1037
+ const g = h.value, m = Number((h.value / l * 100).toFixed(2));
1038
+ return [
1039
+ h[s],
1040
+ r(g, i),
1041
+ r(m, i) + " %"
1042
+ ];
1043
+ })
1013
1044
  ];
1014
1045
  }
1015
- return super.formatTable({ headers: o, cells: i });
1046
+ return super.formatTable({ headers: n, cells: c });
1016
1047
  }
1017
1048
  }
1018
- class Ot extends T {
1049
+ class Tt extends T {
1019
1050
  constructor(t) {
1020
1051
  super(t);
1021
1052
  }
1022
1053
  getTabularDataArray() {
1023
- const t = this.getOptions(), e = this.getGroupedData(), { angle: s, value: a } = u(t, "radar", "axes"), n = u(e, "0", "data").map((r) => r[s]), o = ["Group", ...n], i = [
1024
- ...e.map((r) => [
1025
- r.name,
1026
- ...n.map(
1027
- (c, l) => u(r, "data", l, a) !== null ? u(r, "data", l, a).toLocaleString() : "&ndash;"
1054
+ const t = this.getOptions(), e = this.getGroupedData(), { angle: s, value: a } = u(t, "radar", "axes"), { number: o, code: r } = u(t, "locale"), i = u(e, "0", "data").map((l) => l[s]), n = ["Group", ...i], c = [
1055
+ ...e.map((l) => [
1056
+ l.name,
1057
+ ...i.map(
1058
+ (p, h) => u(l, "data", h, a) !== null ? o(u(l, "data", h, a), r) : "&ndash;"
1028
1059
  )
1029
1060
  ])
1030
1061
  ];
1031
- return super.formatTable({ headers: o, cells: i });
1062
+ return super.formatTable({ headers: n, cells: c });
1032
1063
  }
1033
1064
  }
1034
- class St extends D {
1065
+ class Ot extends D {
1035
1066
  constructor(t) {
1036
1067
  super(t);
1037
1068
  }
@@ -1057,12 +1088,12 @@ class At extends D {
1057
1088
  super(t);
1058
1089
  }
1059
1090
  getTabularDataArray() {
1060
- const t = this.getDisplayData(), e = ["Child", "Group", "Value"], s = [];
1061
- return t.forEach((a) => {
1062
- Array.isArray(a.children) ? a.children.forEach((n) => {
1063
- s.push([n.name, a.name, n.value]);
1064
- }) : u(a.name) !== null && u(a.value) && s.push(["–", a.name, a.value]);
1065
- }), super.formatTable({ headers: e, cells: s });
1091
+ const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale"), a = ["Child", "Group", "Value"], o = [];
1092
+ return t.forEach((r) => {
1093
+ Array.isArray(r.children) ? r.children.forEach((i) => {
1094
+ o.push([i.name, r.name, e(i.value, s)]);
1095
+ }) : u(r.name) !== null && u(r.value) && o.push(["–", r.name, e(r.value, s)]);
1096
+ }), super.formatTable({ headers: a, cells: o });
1066
1097
  }
1067
1098
  }
1068
1099
  class Gt extends D {
@@ -1070,32 +1101,32 @@ class Gt extends D {
1070
1101
  super(t);
1071
1102
  }
1072
1103
  getTabularDataArray() {
1073
- const t = this.getDisplayData(), e = this.getOptions(), { fontSizeMapsTo: s, wordMapsTo: a } = e.wordCloud, { groupMapsTo: n } = e.data, o = [e.tooltip.wordLabel, "Group", e.tooltip.valueLabel], i = [
1074
- ...t.map((r) => [
1075
- r[a],
1076
- r[n],
1077
- r[s]
1104
+ const t = this.getDisplayData(), e = this.getOptions(), { fontSizeMapsTo: s, wordMapsTo: a } = e.wordCloud, { groupMapsTo: o } = e.data, { code: r, number: i } = u(e, "locale"), n = [e.tooltip.wordLabel, "Group", e.tooltip.valueLabel], c = [
1105
+ ...t.map((l) => [
1106
+ l[a],
1107
+ l[o],
1108
+ i(l[s], r)
1078
1109
  ])
1079
1110
  ];
1080
- return super.formatTable({ headers: o, cells: i });
1111
+ return super.formatTable({ headers: n, cells: c });
1081
1112
  }
1082
1113
  }
1083
1114
  export {
1084
- dt as A,
1085
- ft as B,
1115
+ gt as A,
1116
+ dt as B,
1086
1117
  D as C,
1087
1118
  bt as G,
1088
- xt as H,
1089
- Ct as M,
1090
- vt as P,
1091
- Ot as R,
1092
- St as T,
1119
+ vt as H,
1120
+ xt as M,
1121
+ yt as P,
1122
+ Tt as R,
1123
+ Ot as T,
1093
1124
  Gt as W,
1094
1125
  mt as a,
1095
- Tt as b,
1126
+ Ct as b,
1096
1127
  T as c,
1097
- Dt as d,
1098
- yt as e,
1128
+ ft as d,
1129
+ Dt as e,
1099
1130
  At as f
1100
1131
  };
1101
- //# sourceMappingURL=wordcloud-a6lxyv6s.mjs.map
1132
+ //# sourceMappingURL=wordcloud-UWOp6fZX.mjs.map