@carbon/charts 1.13.19 → 1.13.21

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 (33) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{_baseEach-L1oeNjGL.mjs → _baseEach-hXZ_iCmx.mjs} +2 -2
  3. package/dist/{_baseEach-L1oeNjGL.mjs.map → _baseEach-hXZ_iCmx.mjs.map} +1 -1
  4. package/dist/{angle-utils-rmLYuzkJ.mjs → angle-utils-A-okg7PT.mjs} +2 -2
  5. package/dist/{angle-utils-rmLYuzkJ.mjs.map → angle-utils-A-okg7PT.mjs.map} +1 -1
  6. package/dist/{choropleth-RkB2BywS.mjs → choropleth-s-WBhiE4.mjs} +4 -4
  7. package/dist/{choropleth-RkB2BywS.mjs.map → choropleth-s-WBhiE4.mjs.map} +1 -1
  8. package/dist/{color-scale-utils-GLd1MML3.mjs → color-scale-utils-H9cC5d7N.mjs} +40 -40
  9. package/dist/{color-scale-utils-GLd1MML3.mjs.map → color-scale-utils-H9cC5d7N.mjs.map} +1 -1
  10. package/dist/components/index.mjs +4 -4
  11. package/dist/demo/index.mjs +5 -5
  12. package/dist/index.mjs +24 -24
  13. package/dist/interfaces/charts.d.ts +5 -1
  14. package/dist/interfaces/components.d.ts +13 -0
  15. package/dist/model/binned-charts.d.ts +1 -1
  16. package/dist/model/boxplot.d.ts +1 -1
  17. package/dist/model/circle-pack.d.ts +1 -1
  18. package/dist/model/index.mjs +3 -3
  19. package/dist/model/meter.d.ts +1 -2
  20. package/dist/model/model.d.ts +4 -0
  21. package/dist/model/radar.d.ts +1 -1
  22. package/dist/model/tree.d.ts +1 -1
  23. package/dist/model/treemap.d.ts +1 -1
  24. package/dist/services/index.mjs +3 -3
  25. package/dist/umd/bundle.umd.js +14 -14
  26. package/dist/umd/bundle.umd.js.map +1 -1
  27. package/dist/{wordcloud-XkAQGXwu.mjs → wordcloud-je962F3R.mjs} +354 -362
  28. package/dist/wordcloud-je962F3R.mjs.map +1 -0
  29. package/dist/{zoom-LC_awnen.mjs → zoom-_zg_D2pq.mjs} +132 -132
  30. package/dist/zoom-_zg_D2pq.mjs.map +1 -0
  31. package/package.json +2 -2
  32. package/dist/wordcloud-XkAQGXwu.mjs.map +0 -1
  33. package/dist/zoom-LC_awnen.mjs.map +0 -1
@@ -1,23 +1,23 @@
1
- import { bin as z, stack as G, stackOffsetDiverging as F, scaleOrdinal as L, quantile as E, ascending as j, min as P, max as k, extent as U, scaleLinear as K, scaleQuantize as Z } from "d3";
2
- import { o as H, p as Q, q as W, m as u, s as b, t as A, u as X, v as M, f as N, w as V, x as _, y as $, z as Y, A as y, g as R, B as x } from "./color-scale-utils-GLd1MML3.mjs";
3
- import { S as D, _ as B, d as w, e as O, s as J } from "./enums-tMKLWMMm.mjs";
4
- import { b as tt } from "./_baseEach-L1oeNjGL.mjs";
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-H9cC5d7N.mjs";
3
+ import { S as f, _ as B, d as F, e as S, s as J } from "./enums-tMKLWMMm.mjs";
4
+ import { b as tt } from "./_baseEach-hXZ_iCmx.mjs";
5
5
  function et(h, t, e, s) {
6
- for (var a = -1, o = h == null ? 0 : h.length; ++a < o; ) {
7
- var i = h[a];
8
- t(s, i, e(i), h);
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);
9
9
  }
10
10
  return s;
11
11
  }
12
12
  function st(h, t, e, s) {
13
- return tt(h, function(a, o, i) {
14
- t(s, a, e(a), i);
13
+ return tt(h, function(a, n, o) {
14
+ t(s, a, e(a), o);
15
15
  }), s;
16
16
  }
17
17
  function at(h, t) {
18
18
  return function(e, s) {
19
- var a = H(e) ? et : st, o = t ? t() : {};
20
- return a(e, h, Q(s), o);
19
+ var a = Z(e) ? et : st, n = t ? t() : {};
20
+ return a(e, h, Q(s), n);
21
21
  };
22
22
  }
23
23
  function ot(h) {
@@ -27,43 +27,51 @@ function ot(h) {
27
27
  }
28
28
  return s;
29
29
  }
30
- var it = Object.prototype, nt = it.hasOwnProperty, rt = at(function(h, t, e) {
31
- nt.call(h, e) ? h[e].push(t) : W(h, e, [t]);
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]);
32
32
  });
33
- const lt = rt;
33
+ const lt = it;
34
34
  function ct(h) {
35
35
  const t = h.trim();
36
36
  return ["=", "+", "-", "@", " ", "\r"].includes(t.charAt(0)) ? ` ${t}` : /[,\"\n]/.test(t) ? `"${t}"` : t;
37
37
  }
38
- class m {
38
+ class D {
39
39
  constructor(t) {
40
40
  this.state = {
41
41
  options: {}
42
42
  }, this.colorScale = {}, this.colorClassNames = {}, this.services = t;
43
43
  }
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))
50
+ ];
51
+ }
44
52
  getAllDataFromDomain(t) {
45
53
  if (!this.getData())
46
54
  return null;
47
55
  const e = this.getOptions();
48
56
  let s = this.getData();
49
- const a = this.getDataGroups(), { groupMapsTo: o } = u(e, "data"), i = u(e, "axes");
50
- return t && (s = s.filter((n) => t.includes(n[o]))), i && Object.keys(i).forEach((n) => {
51
- const r = i[n].mapsTo, l = i[n].scaleType;
52
- if ((l === D.LINEAR || l === D.LOG) && (s = s.map((c) => ({
53
- ...c,
54
- [r]: c[r] === null ? c[r] : Number(c[r])
55
- }))), r && i[n].domain)
56
- if (l === D.LABELS)
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;
60
+ if ((c === f.LINEAR || c === f.LOG) && (s = s.map((l) => ({
61
+ ...l,
62
+ [r]: l[r] === null ? l[r] : Number(l[r])
63
+ }))), r && o[i].domain)
64
+ if (c === f.LABELS)
57
65
  s = s.filter(
58
- (c) => i[n].domain.includes(c[r])
66
+ (l) => o[i].domain.includes(l[r])
59
67
  );
60
68
  else {
61
- const [c, p] = i[n].domain;
69
+ const [l, p] = o[i].domain;
62
70
  s = s.filter(
63
- (g) => !(r in g) || g[r] >= c && g[r] <= p
71
+ (d) => !(r in d) || d[r] >= l && d[r] <= p
64
72
  );
65
73
  }
66
- }), s.filter((n) => a.find((r) => r.name === n[o]));
74
+ }), s.filter((i) => a.find((r) => r.name === i[n]));
67
75
  }
68
76
  /**
69
77
  * Charts that have group configs passed into them, only want to retrieve the display data relevant to that chart
@@ -72,9 +80,9 @@ class m {
72
80
  getDisplayData(t) {
73
81
  if (!this.get("data"))
74
82
  return null;
75
- const { ACTIVE: e } = b.items.status, s = this.getDataGroups(t), { groupMapsTo: a } = this.getOptions().data;
76
- return this.getAllDataFromDomain(t).filter((i) => s.find(
77
- (n) => n.name === i[a] && n.status === e
83
+ 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
78
86
  ));
79
87
  }
80
88
  getData() {
@@ -98,7 +106,7 @@ class m {
98
106
  return u(this.getOptions(), "data", "loading") ? [] : t ? this.get("dataGroups").filter((s) => t.includes(s.name)) : this.get("dataGroups");
99
107
  }
100
108
  getActiveDataGroups(t) {
101
- const { ACTIVE: e } = b.items.status;
109
+ const { ACTIVE: e } = O.items.status;
102
110
  return this.getDataGroups(t).filter((s) => s.status === e);
103
111
  }
104
112
  getDataGroupNames(t) {
@@ -111,103 +119,103 @@ class m {
111
119
  return lt(t, "group");
112
120
  }
113
121
  getBinConfigurations() {
114
- const t = this.getDisplayData(), e = this.getOptions(), s = this.services.cartesianScales.getMainXAxisPosition(), a = this.services.cartesianScales.getDomainIdentifier(), o = e.axes[s], { groupMapsTo: i } = e.data, { bins: n = X.defaultBins } = o, r = Array.isArray(n), l = z().value((d) => d[a]).thresholds(n)(t);
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);
115
123
  if (r)
116
- l[l.length - 1].x1 = n[n.length - 1];
124
+ c[c.length - 1].x1 = i[i.length - 1];
117
125
  else {
118
- const d = l[0].x1 - l[0].x0;
119
- l[l.length - 1].x1 = +l[l.length - 1].x0 + d;
126
+ const g = c[0].x1 - c[0].x0;
127
+ c[c.length - 1].x1 = +c[c.length - 1].x0 + g;
120
128
  }
121
- const c = r ? [n[0], n[n.length - 1]] : [l[0].x0, l[l.length - 1].x1], p = Array.from(new Set(t.map((d) => d[i]))), g = [];
122
- return l.forEach((d) => {
123
- const f = `${d.x0}-${d.x1}`, S = this.aggregateBinDataByGroup(d);
124
- p.forEach((C) => {
125
- g.push({
126
- group: C,
127
- key: f,
128
- value: S[C] || 0,
129
- bin: d.x0
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 = [];
130
+ return c.forEach((g) => {
131
+ const m = `${g.x0}-${g.x1}`, C = this.aggregateBinDataByGroup(g);
132
+ p.forEach((x) => {
133
+ d.push({
134
+ group: x,
135
+ key: m,
136
+ value: C[x] || 0,
137
+ bin: g.x0
130
138
  });
131
139
  });
132
140
  }), {
133
- bins: l,
134
- binsDomain: c
141
+ bins: c,
142
+ binsDomain: l
135
143
  };
136
144
  }
137
145
  getBinnedStackedData() {
138
- const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getActiveDataGroupNames(), { bins: a } = this.getBinConfigurations(), o = this.getDataValuesGroupedByKeys({
146
+ const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getActiveDataGroupNames(), { bins: a } = this.getBinConfigurations(), n = this.getDataValuesGroupedByKeys({
139
147
  bins: a
140
148
  });
141
- return G().keys(s)(o).map((i, n) => Object.keys(i).filter((r) => !isNaN(r)).map((r) => {
142
- const l = i[r];
143
- return l[e] = s[n], l;
149
+ return G().keys(s)(n).map((o, i) => Object.keys(o).filter((r) => !isNaN(r)).map((r) => {
150
+ const c = o[r];
151
+ return c[e] = s[i], c;
144
152
  }));
145
153
  }
146
154
  getGroupedData(t) {
147
155
  const e = this.getDisplayData(t), s = {}, { groupMapsTo: a } = this.getOptions().data;
148
- return e.map((o) => {
149
- const i = o[a];
150
- s[i] !== null && s[i] !== void 0 ? s[i].push(o) : s[i] = [o];
151
- }), Object.keys(s).map((o) => ({
152
- name: o,
153
- data: s[o]
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]
154
162
  }));
155
163
  }
156
164
  getStackKeys({ bins: t = null, groups: e = null } = { bins: null, groups: null }) {
157
165
  const s = this.getOptions(), a = this.getDisplayData(e);
158
- let o;
159
- t ? o = t.map((r) => `${r.x0}:${r.x1}`) : o = M(
166
+ let n;
167
+ t ? n = t.map((r) => `${r.x0}:${r.x1}`) : n = E(
160
168
  a.map((r) => {
161
- const l = this.services.cartesianScales.getDomainIdentifier(r);
162
- return r[l] instanceof Date ? N(r[l]) : r[l] && typeof r[l].toString == "function" ? r[l].toString() : r[l];
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];
163
171
  })
164
172
  );
165
- const i = this.services.cartesianScales.domainAxisPosition, n = s.axes[i].scaleType;
166
- return n === D.TIME ? o.sort((r, l) => {
167
- const c = new Date(r), p = new Date(l);
168
- return c - p;
169
- }) : (n === D.LOG || n === D.LINEAR) && o.sort((r, l) => r - l), o;
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);
176
+ return l - p;
177
+ }) : (i === f.LOG || i === f.LINEAR) && n.sort((r, c) => r - c), n;
170
178
  }
171
179
  getDataValuesGroupedByKeys({ bins: t = null, groups: e = null }) {
172
- const s = this.getOptions(), { groupMapsTo: a } = s.data, o = this.getDisplayData(e), i = this.getDataGroupNames(), n = this.getStackKeys({ bins: t, groups: e });
173
- return t ? n.map((r) => {
174
- const [l, c] = r.split(":"), p = { x0: l, x1: c }, g = t.find((d) => d.x0.toString() === l.toString());
175
- return i.forEach((d) => {
176
- p[d] = g.filter(
177
- (f) => f[a] === d
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(
185
+ (m) => m[a] === g
178
186
  ).length;
179
187
  }), p;
180
- }) : n.map((r) => {
181
- const l = { sharedStackKey: r };
182
- return i.forEach((c) => {
183
- const p = o.find((d) => {
184
- const f = this.services.cartesianScales.getDomainIdentifier(d);
185
- return d[a] === c && Object.prototype.hasOwnProperty.call(d, f) && (d[f] instanceof Date ? N(d[f]) === r : d[f].toString() === r);
186
- }), g = this.services.cartesianScales.getRangeIdentifier(l);
187
- l[c] = p ? p[g] : null;
188
- }), l;
188
+ }) : i.map((r) => {
189
+ const c = { sharedStackKey: r };
190
+ return o.forEach((l) => {
191
+ const p = n.find((g) => {
192
+ 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;
196
+ }), c;
189
197
  });
190
198
  }
191
199
  getStackedData({ percentage: t = !1, groups: e = null, divergent: s = !1 }) {
192
- const a = this.getOptions(), { groupMapsTo: o } = a.data, i = this.getActiveDataGroupNames(e), n = this.getDataValuesGroupedByKeys({
200
+ const a = this.getOptions(), { groupMapsTo: n } = a.data, o = this.getActiveDataGroupNames(e), i = this.getDataValuesGroupedByKeys({
193
201
  groups: e
194
202
  });
195
203
  if (t) {
196
- const l = ot(n.map((c) => [c.sharedStackKey, 0]));
197
- n.forEach((c) => {
198
- i.forEach((p) => {
199
- l[c.sharedStackKey] += c[p];
204
+ const c = ot(i.map((l) => [l.sharedStackKey, 0]));
205
+ i.forEach((l) => {
206
+ o.forEach((p) => {
207
+ c[l.sharedStackKey] += l[p];
200
208
  });
201
- }), n.forEach((c) => {
202
- i.forEach((p) => {
203
- const g = l[c.sharedStackKey];
204
- l[c.sharedStackKey] ? c[p] = c[p] / g * 100 : c[p] = 0;
209
+ }), 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;
205
213
  });
206
214
  });
207
215
  }
208
- return (s ? G().offset(F) : G()).keys(i)(n).map((l, c) => Object.keys(l).filter((p) => !isNaN(p)).map((p) => {
209
- const g = l[p];
210
- return g[o] = i[c], g;
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;
211
219
  }));
212
220
  }
213
221
  /**
@@ -250,22 +258,22 @@ class m {
250
258
  * Data labels
251
259
  */
252
260
  toggleDataLabel(t) {
253
- const { ACTIVE: e, DISABLED: s } = b.items.status, a = this.getDataGroups(), o = a.some((c) => c.status === s), i = a.filter((c) => c.status === e);
254
- if (o)
255
- if (i.length === 1 && i[0].name === t)
256
- a.forEach((c, p) => {
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)
264
+ a.forEach((l, p) => {
257
265
  a[p].status = e;
258
266
  });
259
267
  else {
260
- const c = a.findIndex((p) => p.name === t);
261
- a[c].status = a[c].status === s ? e : s;
268
+ const l = a.findIndex((p) => p.name === t);
269
+ a[l].status = a[l].status === s ? e : s;
262
270
  }
263
271
  else
264
- a.forEach((c, p) => {
265
- a[p].status = c.name === t ? e : s;
272
+ a.forEach((l, p) => {
273
+ a[p].status = l.name === t ? e : s;
266
274
  });
267
- const n = a.filter((c) => c.status === e), r = this.getOptions();
268
- a.some((c) => c.status === s) ? r.data.selectedGroups = n.map((c) => c.name) : r.data.selectedGroups = [], this.services.events.dispatchEvent(B.Legend.ITEMS_UPDATE, {
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, {
269
277
  dataGroups: a
270
278
  }), this.set({
271
279
  dataGroups: a
@@ -279,16 +287,16 @@ class m {
279
287
  * @param defaultFilled the default for this chart
280
288
  */
281
289
  getIsFilled(t, e, s, a) {
282
- const o = this.getOptions();
283
- return o.getIsFilled ? o.getIsFilled(t, e, s, a) : a;
290
+ const n = this.getOptions();
291
+ return n.getIsFilled ? n.getIsFilled(t, e, s, a) : a;
284
292
  }
285
293
  getFillColor(t, e, s) {
286
- const a = this.getOptions(), o = u(this.colorScale, t);
287
- return a.getFillColor ? a.getFillColor(t, e, s, o) : o;
294
+ const a = this.getOptions(), n = u(this.colorScale, t);
295
+ return a.getFillColor ? a.getFillColor(t, e, s, n) : n;
288
296
  }
289
297
  getStrokeColor(t, e, s) {
290
- const a = this.getOptions(), o = u(this.colorScale, t);
291
- return a.getStrokeColor ? a.getStrokeColor(t, e, s, o) : o;
298
+ const a = this.getOptions(), n = u(this.colorScale, t);
299
+ return a.getStrokeColor ? a.getStrokeColor(t, e, s, n) : n;
292
300
  }
293
301
  isUserProvidedColorScaleValid() {
294
302
  const t = u(this.getOptions(), "color", "scale"), e = this.getDataGroups();
@@ -321,20 +329,20 @@ class m {
321
329
  "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"
322
330
  );
323
331
  const e = [], { datasets: s, labels: a } = t;
324
- return s.forEach((o) => {
325
- o.data.forEach((i, n) => {
332
+ return s.forEach((n) => {
333
+ n.data.forEach((o, i) => {
326
334
  let r;
327
- const l = u(o, "label");
328
- if (l === null) {
329
- const p = u(a, n);
335
+ const c = u(n, "label");
336
+ if (c === null) {
337
+ const p = u(a, i);
330
338
  p ? r = p : r = "Ungrouped";
331
339
  } else
332
- r = l;
333
- const c = {
340
+ r = c;
341
+ const l = {
334
342
  group: r,
335
- key: a[n]
343
+ key: a[i]
336
344
  };
337
- isNaN(i) ? (c.value = i.value, c.date = i.date) : c.value = i, e.push(c);
345
+ isNaN(o) ? (l.value = o.value, l.date = o.date) : l.value = o, e.push(l);
338
346
  });
339
347
  }), e;
340
348
  }
@@ -343,12 +351,12 @@ class m {
343
351
  }
344
352
  exportToCSV() {
345
353
  const e = this.getTabularDataArray().map(
346
- (i) => i.map((n) => `"${(n === "&ndash;" ? "–" : n).split(/[,;'"`]/).map((c) => ct(c)).join("")}"`)
347
- ).map((i) => i.join(",")).join(`
354
+ (o) => o.map((i) => `"${(i === "&ndash;" ? "–" : i).split(/[,;'"`]/).map((l) => ct(l)).join("")}"`)
355
+ ).map((o) => o.join(",")).join(`
348
356
  `), s = this.getOptions();
349
357
  let a = "myChart";
350
- const o = u(s, "fileDownload", "fileName");
351
- typeof o == "function" ? a = o("csv") : typeof o == "string" && (a = o), this.services.files.downloadCSV(e, `${a}.csv`);
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`);
352
360
  }
353
361
  getTabularData(t) {
354
362
  return Array.isArray(t) ? t : this.transformToTabularData(t);
@@ -365,14 +373,14 @@ class m {
365
373
  }) : this.allDataGroups = this.getDataGroupNames();
366
374
  }
367
375
  generateDataGroups(t) {
368
- const { groupMapsTo: e } = this.getOptions().data, { ACTIVE: s, DISABLED: a } = b.items.status, o = this.getOptions(), i = M(t.map((r) => r[e]));
369
- o.data.selectedGroups.length && (o.data.selectedGroups.every(
370
- (l) => i.includes(l)
371
- ) || (o.data.selectedGroups = []));
372
- const n = (r) => !o.data.selectedGroups.length || o.data.selectedGroups.includes(r) ? s : a;
373
- return i.map((r) => ({
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) => ({
374
382
  name: r,
375
- status: n(r)
383
+ status: i(r)
376
384
  }));
377
385
  }
378
386
  /*
@@ -396,18 +404,18 @@ class m {
396
404
  let e = u(t, "numberOfVariants");
397
405
  (!e || e < this.allDataGroups.length) && (e = this.allDataGroups.length);
398
406
  let s = u(t, "option");
399
- const a = $.pairingOptions, o = e > 5 ? 14 : e, i = `${o}-color`;
400
- s = s <= a[i] ? s : 1;
401
- const n = this.allDataGroups.map(
402
- (r, l) => `${o}-${s}-${l % 14 + 1}`
407
+ const a = R.pairingOptions, n = e > 5 ? 14 : e, o = `${n}-color`;
408
+ s = s <= a[o] ? s : 1;
409
+ const i = this.allDataGroups.map(
410
+ (r, c) => `${n}-${s}-${c % 14 + 1}`
403
411
  );
404
- this.colorClassNames = L().range(n).domain(this.allDataGroups);
412
+ this.colorClassNames = L().range(i).domain(this.allDataGroups);
405
413
  }
406
414
  }
407
- class T extends m {
415
+ class T extends D {
408
416
  // can't be protected as it's used by two-dimensional-axes.ts
409
417
  constructor(t) {
410
- super(t), this.axisFlavor = w.DEFAULT;
418
+ super(t), this.axisFlavor = F.DEFAULT;
411
419
  }
412
420
  // get the scales information
413
421
  // needed for getTabularArray()
@@ -419,47 +427,43 @@ class T extends m {
419
427
  secondaryRange: null
420
428
  };
421
429
  return s && (a.secondaryDomain = t.secondaryDomainAxisPosition, a.secondaryRange = t.secondaryRangeAxisPosition), Object.keys(a).forEach(
422
- (o) => {
423
- const i = a[o];
424
- t.scales[i] ? a[o] = {
425
- position: i,
426
- label: t.getScaleLabel(i),
427
- identifier: u(e, "axes", i, "mapsTo")
428
- } : a[o] = null;
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;
429
437
  }
430
438
  ), a;
431
439
  }
432
440
  getTabularDataArray() {
433
- const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { cartesianScales: a } = this.services, { primaryDomain: o, primaryRange: i, secondaryDomain: n, secondaryRange: r } = this.assignRangeAndDomains(), l = a.getDomainAxisScaleType();
434
- let c;
435
- return l === D.TIME && (c = (g) => Y(g, "MMM d, yyyy")), [
436
- [
437
- "Group",
438
- o.label,
439
- i.label,
440
- ...n ? [n.label] : [],
441
- ...r ? [r.label] : []
442
- ],
443
- ...t.map((g) => [
444
- g[s],
445
- g[o.identifier] === null ? "&ndash;" : c ? c(g[o.identifier]) : g[o.identifier],
446
- g[i.identifier] === null || isNaN(g[i.identifier]) ? "&ndash;" : g[i.identifier].toLocaleString(),
447
- ...n ? [
448
- g[n.identifier] === null ? "&ndash;" : g[n.identifier]
449
- ] : [],
450
- ...r ? [
451
- g[r.identifier] === null || isNaN(g[r.identifier]) ? "&ndash;" : g[r.identifier]
452
- ] : []
453
- ])
454
- ];
441
+ const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { primaryDomain: a, primaryRange: n, secondaryDomain: o, secondaryRange: i } = this.assignRangeAndDomains(), r = [
442
+ "Group",
443
+ a.label,
444
+ n.label,
445
+ ...o ? [o.label] : [],
446
+ ...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]
453
+ ] : [],
454
+ ...i ? [
455
+ l[i.identifier] === null || isNaN(l[i.identifier]) ? "&ndash;" : l[i.identifier]
456
+ ] : []
457
+ ]);
458
+ return super.formatTable({ headers: r, cells: c });
455
459
  }
456
460
  setData(t) {
457
461
  let e;
458
- if (t && (e = super.setData(t), u(this.getOptions(), "zoomBar", O.TOP, "enabled"))) {
462
+ if (t && (e = super.setData(t), u(this.getOptions(), "zoomBar", S.TOP, "enabled"))) {
459
463
  const s = u(
460
464
  this.getOptions(),
461
465
  "zoomBar",
462
- O.TOP,
466
+ S.TOP,
463
467
  "data"
464
468
  );
465
469
  this.setZoomBarData(s);
@@ -474,14 +478,14 @@ class T extends m {
474
478
  let s = e;
475
479
  const { cartesianScales: a } = this.services;
476
480
  if (e && a.domainAxisPosition && a.rangeAxisPosition) {
477
- const o = a.getDomainIdentifier(), i = a.getRangeIdentifier();
478
- let n = e.map((r) => r[o].getTime());
479
- n = M(n).sort(), s = n.map((r) => {
480
- let l = 0;
481
- const c = {};
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) => {
484
+ let c = 0;
485
+ const l = {};
482
486
  return e.forEach((p) => {
483
- p[o].getTime() === r && (l += p[i]);
484
- }), c[o] = new Date(r), c[i] = l, c;
487
+ p[n].getTime() === r && (c += p[o]);
488
+ }), l[n] = new Date(r), l[o] = c, l;
485
489
  });
486
490
  }
487
491
  this.set({ zoomBarData: s });
@@ -494,15 +498,15 @@ class T extends m {
494
498
  if (!e.axes)
495
499
  return t;
496
500
  const s = [];
497
- return Object.keys(O).forEach((a) => {
498
- const o = O[a], i = e.axes[o];
499
- if (i && i.scaleType === D.TIME) {
500
- const n = i.mapsTo;
501
- (n !== null || n !== void 0) && s.push(n);
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;
505
+ (i !== null || i !== void 0) && s.push(i);
502
506
  }
503
507
  }), s.length > 0 && t.forEach((a) => {
504
- s.forEach((o) => {
505
- u(a, o, "getTime") === null && (a[o] = new Date(a[o]));
508
+ s.forEach((n) => {
509
+ u(a, n, "getTime") === null && (a[n] = new Date(a[n]));
506
510
  });
507
511
  }), t;
508
512
  }
@@ -516,48 +520,47 @@ class dt extends T {
516
520
  }
517
521
  getTabularDataArray() {
518
522
  const t = this.getDisplayData();
519
- return t.sort((s, a) => s.source.localeCompare(a.source)), [
520
- ["Source", "Target", "Value"],
521
- ...t.map((s) => [s.source, s.target, s.value])
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])
522
526
  ];
527
+ return super.formatTable({ headers: e, cells: s });
523
528
  }
524
529
  }
525
- class Dt extends T {
530
+ class ft extends T {
526
531
  constructor(t) {
527
532
  super(t);
528
533
  }
529
534
  getBoxQuartiles(t) {
530
535
  return {
531
- q_25: E(t, 0.25),
532
- q_50: E(t, 0.5),
533
- q_75: E(t, 0.75)
536
+ q_25: M(t, 0.25),
537
+ q_50: M(t, 0.5),
538
+ q_75: M(t, 0.75)
534
539
  };
535
540
  }
536
541
  getBoxplotData() {
537
542
  const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getGroupedData(), a = [];
538
- for (const { name: o, data: i } of s) {
539
- const n = this.services.cartesianScales.getRangeIdentifier(), r = i.map((v) => v[n]).sort(j), l = {
540
- [e]: o,
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,
541
546
  counts: r,
542
547
  quartiles: this.getBoxQuartiles(r),
543
548
  outliers: null,
544
549
  whiskers: null
545
- }, c = l.quartiles.q_25, p = l.quartiles.q_75, g = (p - c) * 1.5, d = c - g, f = p + g, S = [], C = [];
550
+ }, l = c.quartiles.q_25, p = c.quartiles.q_75, d = (p - l) * 1.5, g = l - d, m = p + d, C = [], x = [];
546
551
  for (const v of r)
547
- v < d || v > f ? S.push(v) : C.push(v);
548
- l.outliers = S;
549
- const q = P(C), I = k(C);
550
- l.whiskers = {
551
- min: q || P([l.quartiles.q_25, l.quartiles.q_50, l.quartiles.q_75]),
552
- max: I || k([l.quartiles.q_25, l.quartiles.q_50, l.quartiles.q_75])
553
- }, a.push(l);
552
+ v < g || v > m ? C.push(v) : x.push(v);
553
+ c.outliers = C;
554
+ const q = P(x), I = k(x);
555
+ c.whiskers = {
556
+ min: q || P([c.quartiles.q_25, c.quartiles.q_50, c.quartiles.q_75]),
557
+ max: I || k([c.quartiles.q_25, c.quartiles.q_50, c.quartiles.q_75])
558
+ }, a.push(c);
554
559
  }
555
560
  return a;
556
561
  }
557
562
  getTabularDataArray() {
558
- const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getBoxplotData();
559
- return [
560
- ["Group", "Minimum", "Q1", "Median", "Q3", "Maximum", "IQR", "Outlier(s)"],
563
+ const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getBoxplotData(), a = ["Group", "Minimum", "Q1", "Median", "Q3", "Maximum", "IQR", "Outlier(s)"], n = [
561
564
  ...s.map((o) => {
562
565
  let i = u(o, "outliers");
563
566
  return (i === null || i.length === 0) && (i = ["&ndash;"]), [
@@ -568,21 +571,22 @@ class Dt extends T {
568
571
  u(o, "quartiles", "q_75") !== null ? u(o, "quartiles", "q_75").toLocaleString() : "&ndash;",
569
572
  u(o, "whiskers", "max") !== null ? u(o, "whiskers", "max").toLocaleString() : "&ndash;",
570
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;",
571
- i.map((n) => n.toLocaleString()).join(",")
574
+ i.map((r) => r.toLocaleString()).join(",")
572
575
  ];
573
576
  })
574
577
  ];
578
+ return super.formatTable({ headers: a, cells: n });
575
579
  }
576
580
  setColorClassNames() {
577
581
  const e = u(this.getOptions(), "color", "pairing");
578
582
  let s = u(e, "option");
579
- const a = $.pairingOptions;
583
+ const a = R.pairingOptions;
580
584
  s = s <= a["1-color"] ? s : 1;
581
- const o = this.allDataGroups.map(() => `1-${s}-1`);
582
- this.colorClassNames = L().range(o).domain(this.allDataGroups);
585
+ const n = this.allDataGroups.map(() => `1-${s}-1`);
586
+ this.colorClassNames = L().range(n).domain(this.allDataGroups);
583
587
  }
584
588
  }
585
- class ft extends T {
589
+ class mt extends T {
586
590
  constructor(t) {
587
591
  super(t);
588
592
  }
@@ -601,21 +605,20 @@ class ft extends T {
601
605
  return 0;
602
606
  }
603
607
  getTabularDataArray() {
604
- const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.services.cartesianScales.getRangeIdentifier(), o = u(e, "bullet", "performanceAreaTitles");
605
- return [
606
- ["Title", "Group", "Value", "Target", "Percentage", "Performance"],
607
- ...t.map((n) => [
608
- n.title,
609
- n[s],
610
- n.value === null ? "&ndash;" : n.value,
611
- u(n, "marker") === null ? "&ndash;" : n.marker,
612
- u(n, "marker") === null ? "&ndash;" : `${Math.floor(n[a] / n.marker * 100)}%`,
613
- o[this.getMatchingRangeIndexForDatapoint(n)]
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)]
614
616
  ])
615
617
  ];
618
+ return super.formatTable({ headers: o, cells: i });
616
619
  }
617
620
  }
618
- class mt extends m {
621
+ class Dt extends D {
619
622
  constructor(t) {
620
623
  super(t), this._colorScale = void 0, this._matrix = {};
621
624
  }
@@ -646,15 +649,14 @@ class mt extends m {
646
649
  * @returns Array<Object>
647
650
  */
648
651
  getTabularDataArray() {
649
- const t = this.getDisplayData();
650
- return [
651
- ["Country ID", "Country Name", "Value"],
652
- ...t.map((s) => [
653
- s.id === null ? "&ndash;" : s.id,
654
- s.name,
655
- s.value
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
656
657
  ])
657
658
  ];
659
+ return super.formatTable({ headers: e, cells: s });
658
660
  }
659
661
  // Uses quantize scale to return class names
660
662
  getColorClassName(t) {
@@ -662,10 +664,10 @@ class mt extends m {
662
664
  }
663
665
  setColorClassNames() {
664
666
  const t = u(this.getOptions(), "color");
665
- this._colorScale = R(this.getDisplayData(), t);
667
+ this._colorScale = $(this.getDisplayData(), t);
666
668
  }
667
669
  }
668
- class yt extends m {
670
+ class yt extends D {
669
671
  constructor(t) {
670
672
  super(t), this.parentNode = !1, this.set({ depth: 2 }, { skipUpdate: !0 });
671
673
  }
@@ -675,21 +677,21 @@ class yt extends m {
675
677
  setOptions(t) {
676
678
  const e = this.getOptions(), s = _({}, t, this.getZoomOptions(t));
677
679
  V(e, s);
678
- const a = this.getHierarchyLevel(), o = u(e, "circlePack", "hierarchyLevel");
680
+ const a = this.getHierarchyLevel(), n = u(e, "circlePack", "hierarchyLevel");
679
681
  this.set({
680
682
  options: _(e, s),
681
- depth: o && o < 4 ? o : a
683
+ depth: n && n < 4 ? n : a
682
684
  });
683
685
  }
684
686
  getZoomOptions(t) {
685
687
  if (!this.getDisplayData())
686
688
  return {};
687
689
  const e = this.getDisplayData(), s = t || this.getOptions(), a = e.length === 1 && u(e, 0, "children") ? u(e, 0, "children") : e;
688
- let o = this.getHierarchyLevel();
689
- return a.some((i) => {
690
- if (i.children && i.children.some((n) => n.children))
691
- return o = 3, !1;
692
- }), u(s, "canvasZoom", "enabled") === !0 && o > 2 ? {
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 ? {
693
695
  legend: {
694
696
  additionalItems: [
695
697
  {
@@ -715,9 +717,9 @@ class yt extends m {
715
717
  }
716
718
  // set the datagroup name on the items that are it's children
717
719
  setDataGroups() {
718
- const t = this.getData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = t.map((o) => {
719
- const i = o[s];
720
- return this.setChildrenDataGroup(o, i);
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);
721
723
  });
722
724
  this.set(
723
725
  {
@@ -735,11 +737,11 @@ class yt extends m {
735
737
  } : { ...t, dataGroupName: e };
736
738
  }
737
739
  getTabularDataArray() {
738
- const t = this.getDisplayData(), e = [["Child", "Parent", "Value"]];
739
- return t.forEach((s) => {
740
- let a = s.value ? s.value : 0;
741
- s.children && (a += this.getChildrenDatums(s.children, s.name, e, 0)), e.push(["&ndash;", s.name, a]);
742
- }), e;
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 });
743
745
  }
744
746
  /**
745
747
  * Recursively determine the relationship between all the nested elements in the child
@@ -750,20 +752,20 @@ class yt extends m {
750
752
  * @returns: number
751
753
  */
752
754
  getChildrenDatums(t, e, s = [], a = 0) {
753
- const o = e;
754
- return t.forEach((i) => {
755
- const n = i.name;
755
+ const n = e;
756
+ return t.forEach((o) => {
757
+ const i = o.name;
756
758
  let r = 0;
757
- if (i.children)
758
- i.children.length > 0 && (typeof i.value == "number" && (a += i.value), r += this.getChildrenDatums(i.children, n, s, r), s.push([n, o, r]), a += r);
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);
759
761
  else {
760
- let l = 0;
761
- typeof i.value == "number" && (l = i.value, a += i.value), s.push([i.name, o, l]);
762
+ let c = 0;
763
+ typeof o.value == "number" && (c = o.value, a += o.value), s.push([o.name, n, c]);
762
764
  }
763
765
  }), a;
764
766
  }
765
767
  }
766
- class vt extends m {
768
+ class vt extends D {
767
769
  constructor(t) {
768
770
  super(t);
769
771
  }
@@ -774,20 +776,19 @@ class vt extends m {
774
776
  }), e;
775
777
  }
776
778
  getTabularDataArray() {
777
- const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { valueMapsTo: a } = e.pie;
778
- return [
779
- ["Group", "Value"],
779
+ const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { valueMapsTo: a } = e.pie, n = ["Group", "Value"], o = [
780
780
  ...t.map((i) => [
781
781
  i[s],
782
782
  i[a] === null ? "&ndash;" : i[a].toLocaleString()
783
783
  ])
784
784
  ];
785
+ return super.formatTable({ headers: n, cells: o });
785
786
  }
786
787
  sanitize(t) {
787
788
  return this.getTabularData(t).sort((s, a) => a.value - s.value);
788
789
  }
789
790
  }
790
- class xt extends m {
791
+ class bt extends D {
791
792
  constructor(t) {
792
793
  super(t);
793
794
  }
@@ -795,21 +796,20 @@ class xt extends m {
795
796
  return super.getDataGroups().filter((t) => t.name !== "delta");
796
797
  }
797
798
  getTabularDataArray() {
798
- const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data;
799
- return [
800
- ["Group", "Value"],
799
+ const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = ["Group", "Value"], n = [
801
800
  ...t.map((o) => [
802
801
  o[s],
803
802
  o.value === null ? "&ndash;" : o.value.toLocaleString()
804
803
  ])
805
804
  ];
805
+ return super.formatTable({ headers: a, cells: n });
806
806
  }
807
807
  }
808
- class Ct extends T {
808
+ class xt extends T {
809
809
  constructor(t) {
810
- super(t), this.axisFlavor = w.HOVERABLE, this._colorScale = void 0, this._domains = [], this._ranges = [], this._matrix = {};
810
+ super(t), this.axisFlavor = F.HOVERABLE, this._colorScale = void 0, this._domains = [], this._ranges = [], this._matrix = {};
811
811
  const e = u(this.getOptions(), "axes");
812
- if (u(e, "left", "scaleType") && u(e, "left", "scaleType") !== D.LABELS || u(e, "right", "scaleType") && u(e, "right", "scaleType") !== D.LABELS || u(e, "top", "scaleType") && u(e, "top", "scaleType") !== D.LABELS || u(e, "bottom", "scaleType") && u(e, "bottom", "scaleType") !== D.LABELS)
812
+ 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
813
  throw Error("Heatmap only supports label scaletypes.");
814
814
  }
815
815
  /**
@@ -838,12 +838,12 @@ class Ct extends T {
838
838
  */
839
839
  getUniqueDomain() {
840
840
  if (y(this._domains)) {
841
- const t = this.getDisplayData(), { cartesianScales: e } = this.services, s = e.getDomainIdentifier(), a = e.getMainXAxisPosition(), o = e.getCustomDomainValuesByposition(a);
842
- if (o)
843
- return o;
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;
844
844
  this._domains = Array.from(
845
845
  new Set(
846
- t.map((i) => i[s])
846
+ t.map((o) => o[s])
847
847
  )
848
848
  );
849
849
  }
@@ -855,12 +855,12 @@ class Ct extends T {
855
855
  */
856
856
  getUniqueRanges() {
857
857
  if (y(this._ranges)) {
858
- const t = this.getDisplayData(), { cartesianScales: e } = this.services, s = e.getRangeIdentifier(), a = e.getMainYAxisPosition(), o = e.getCustomDomainValuesByposition(a);
859
- if (o)
860
- return o;
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;
861
861
  this._ranges = Array.from(
862
862
  new Set(
863
- t.map((i) => i[s])
863
+ t.map((o) => o[s])
864
864
  )
865
865
  );
866
866
  }
@@ -872,18 +872,18 @@ class Ct extends T {
872
872
  */
873
873
  getMatrix() {
874
874
  if (y(this._matrix)) {
875
- const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(), o = {};
876
- e.forEach((i) => {
877
- o[i] = {
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] = {
878
878
  value: null,
879
879
  index: -1
880
880
  };
881
- }), t.forEach((i) => {
882
- this._matrix[i] = A(o);
883
- }), this.getDisplayData().forEach((i, n) => {
884
- this._matrix[i[s]][i[a]] = {
885
- value: i.value,
886
- index: n
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,
886
+ index: i
887
887
  };
888
888
  });
889
889
  }
@@ -906,31 +906,30 @@ class Ct extends T {
906
906
  */
907
907
  getMatrixAsArray() {
908
908
  y(this._matrix) && this.getMatrix();
909
- const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(), o = [];
910
- return t.forEach((i) => {
911
- e.forEach((n) => {
909
+ const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(), n = [];
910
+ return t.forEach((o) => {
911
+ e.forEach((i) => {
912
912
  const r = {
913
- value: this._matrix[i][n].value,
914
- index: this._matrix[i][n].index
913
+ value: this._matrix[o][i].value,
914
+ index: this._matrix[o][i].index
915
915
  };
916
- r[s] = i, r[a] = n, o.push(r);
916
+ r[s] = o, r[a] = i, n.push(r);
917
917
  });
918
- }), o;
918
+ }), n;
919
919
  }
920
920
  /**
921
921
  * Generate tabular data from display data
922
922
  * @returns Array<Object>
923
923
  */
924
924
  getTabularDataArray() {
925
- const t = this.getDisplayData(), { primaryDomain: e, primaryRange: s } = this.assignRangeAndDomains();
926
- return [
927
- [e.label, s.label, "Value"],
925
+ const t = this.getDisplayData(), { primaryDomain: e, primaryRange: s } = this.assignRangeAndDomains(), a = [e.label, s.label, "Value"], n = [
928
926
  ...t.map((o) => [
929
927
  o[e.identifier] === null ? "&ndash;" : o[e.identifier],
930
928
  o[s.identifier] === null ? "&ndash;" : o[s.identifier].toLocaleString(),
931
929
  o.value
932
930
  ])
933
931
  ];
932
+ return super.formatTable({ headers: a, cells: n });
934
933
  }
935
934
  // Uses quantize scale to return class names
936
935
  getColorClassName(t) {
@@ -939,35 +938,34 @@ class Ct extends T {
939
938
  setColorClassNames() {
940
939
  const t = this.getOptions(), e = u(t, "color", "gradient", "colors"), s = !y(e);
941
940
  let a = u(t, "color", "pairing", "option");
942
- const o = this.getValueDomain(), i = o[0] < 0 && o[1] > 0 ? "diverge" : "mono";
943
- (a < 1 && a > 4 && i === "mono" || a < 1 && a > 2 && i === "diverge") && (a = 1);
944
- const n = s ? e : [];
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);
943
+ const i = s ? e : [];
945
944
  if (!s) {
946
- const l = i === "diverge" ? 17 : 11;
947
- for (let c = 1; c < l + 1; c++)
948
- n.push(`fill-${i}-${a}-${c}`);
945
+ const c = o === "diverge" ? 17 : 11;
946
+ for (let l = 1; l < c + 1; l++)
947
+ i.push(`fill-${o}-${a}-${l}`);
949
948
  }
950
- this._colorScale = Z().domain(o).range(n);
949
+ this._colorScale = H().domain(n).range(i);
951
950
  const r = u(this.getOptions(), "color");
952
- this._colorScale = R(this.getDisplayData(), r);
951
+ this._colorScale = $(this.getDisplayData(), r);
953
952
  }
954
953
  }
955
954
  class Tt extends T {
956
955
  getTabularDataArray() {
957
- const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getBinnedStackedData();
958
- return [
959
- [
960
- x(t, "bins.rangeLabel") || "Range",
961
- ...s.map((o) => x(o, `0.${e}`))
962
- ],
963
- ...x(s, 0).map((o, i) => [
964
- `${x(o, "data.x0")} – ${x(o, "data.x1")}`,
965
- ...s.map((n) => x(n[i], `data.${x(n[i], e)}`))
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)}`))
966
963
  ])
967
964
  ];
965
+ return super.formatTable({ headers: a, cells: n });
968
966
  }
969
967
  }
970
- class St extends m {
968
+ class Ct extends D {
971
969
  constructor(t) {
972
970
  super(t);
973
971
  }
@@ -987,66 +985,61 @@ class St extends m {
987
985
  * Get the associated status for the data by checking the ranges
988
986
  */
989
987
  getStatus() {
990
- const t = this.getOptions(), e = u(this.getDisplayData()), s = (e == null ? void 0 : e.reduce((i, n) => i + n.value, 0)) ?? 0, a = u(t, "meter", "proportional") ? s : s > 100 ? 100 : s, o = u(t, "meter", "status", "ranges");
991
- if (o) {
992
- const i = o.filter(
993
- (n) => n.range[0] <= a && a <= n.range[1]
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(
991
+ (i) => i.range[0] <= a && a <= i.range[1]
994
992
  );
995
- if (i.length > 0)
996
- return i[0].status;
993
+ if (o.length > 0)
994
+ return o[0].status;
997
995
  }
998
996
  return null;
999
997
  }
1000
998
  getTabularDataArray() {
1001
- const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.getStatus(), o = u(e, "meter", "proportional");
1002
- let i = [], n;
1003
- if (o === null) {
1004
- n = 100;
1005
- const r = t[0];
1006
- i = [
1007
- ["Group", "Value", ...a ? ["Status"] : []],
1008
- [r[s], r.value, ...a ? [a] : []]
1009
- ];
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] : []]];
1010
1005
  } else {
1011
- const r = u(o, "total");
1012
- n = r || this.getMaximumDomain(t), i = [
1013
- ["Group", "Value", "Percentage of total"],
1006
+ const c = u(n, "total");
1007
+ r = c || this.getMaximumDomain(t), o = ["Group", "Value", "Percentage of total"], i = [
1014
1008
  ...t.map((l) => [
1015
1009
  l[s],
1016
1010
  l.value,
1017
- (l.value / n * 100).toFixed(2) + " %"
1011
+ (l.value / r * 100).toFixed(2) + " %"
1018
1012
  ])
1019
1013
  ];
1020
1014
  }
1021
- return i;
1015
+ return super.formatTable({ headers: o, cells: i });
1022
1016
  }
1023
1017
  }
1024
- class bt extends T {
1018
+ class Ot extends T {
1025
1019
  constructor(t) {
1026
1020
  super(t);
1027
1021
  }
1028
1022
  getTabularDataArray() {
1029
- const t = this.getOptions(), e = this.getGroupedData(), { angle: s, value: a } = u(t, "radar", "axes"), o = u(e, "0", "data").map((n) => n[s]);
1030
- return [
1031
- ["Group", ...o],
1032
- ...e.map((n) => [
1033
- n.name,
1034
- ...o.map(
1035
- (r, l) => u(n, "data", l, a) !== null ? u(n, "data", l, a).toLocaleString() : "&ndash;"
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;"
1036
1028
  )
1037
1029
  ])
1038
1030
  ];
1031
+ return super.formatTable({ headers: o, cells: i });
1039
1032
  }
1040
1033
  }
1041
- class Ot extends m {
1034
+ class St extends D {
1042
1035
  constructor(t) {
1043
1036
  super(t);
1044
1037
  }
1045
1038
  getTabularDataArray() {
1046
- const t = this.getDisplayData(), e = [["Child", "Parent"]];
1047
- return t.forEach((s) => {
1048
- this.getChildrenDatums(s, e), e.push([s.name, "&ndash;"]);
1049
- }), e;
1039
+ const t = this.getDisplayData(), e = ["Child", "Parent"], s = [];
1040
+ return t.forEach((a) => {
1041
+ this.getChildrenDatums(a, s), s.push([a.name, "&ndash;"]);
1042
+ }), super.formatTable({ headers: e, cells: s });
1050
1043
  }
1051
1044
  /**
1052
1045
  * Determine the child parent relationship in nested data
@@ -1059,51 +1052,50 @@ class Ot extends m {
1059
1052
  });
1060
1053
  }
1061
1054
  }
1062
- class At extends m {
1055
+ class At extends D {
1063
1056
  constructor(t) {
1064
1057
  super(t);
1065
1058
  }
1066
1059
  getTabularDataArray() {
1067
- const t = this.getDisplayData(), e = [["Child", "Group", "Value"]];
1068
- return t.forEach((s) => {
1069
- Array.isArray(s.children) ? s.children.forEach((a) => {
1070
- e.push([a.name, s.name, a.value]);
1071
- }) : u(s.name) !== null && u(s.value) && e.push(["–", s.name, s.value]);
1072
- }), e;
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 });
1073
1066
  }
1074
1067
  }
1075
- class Gt extends m {
1068
+ class Gt extends D {
1076
1069
  constructor(t) {
1077
1070
  super(t);
1078
1071
  }
1079
1072
  getTabularDataArray() {
1080
- const t = this.getDisplayData(), e = this.getOptions(), { fontSizeMapsTo: s, wordMapsTo: a } = e.wordCloud, { groupMapsTo: o } = e.data;
1081
- return [
1082
- [e.tooltip.wordLabel, "Group", e.tooltip.valueLabel],
1083
- ...t.map((n) => [
1084
- n[a],
1085
- n[o],
1086
- n[s]
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]
1087
1078
  ])
1088
1079
  ];
1080
+ return super.formatTable({ headers: o, cells: i });
1089
1081
  }
1090
1082
  }
1091
1083
  export {
1092
1084
  dt as A,
1093
- Dt as B,
1094
- m as C,
1095
- xt as G,
1096
- Ct as H,
1097
- St as M,
1085
+ ft as B,
1086
+ D as C,
1087
+ bt as G,
1088
+ xt as H,
1089
+ Ct as M,
1098
1090
  vt as P,
1099
- bt as R,
1100
- Ot as T,
1091
+ Ot as R,
1092
+ St as T,
1101
1093
  Gt as W,
1102
- ft as a,
1094
+ mt as a,
1103
1095
  Tt as b,
1104
1096
  T as c,
1105
- mt as d,
1097
+ Dt as d,
1106
1098
  yt as e,
1107
1099
  At as f
1108
1100
  };
1109
- //# sourceMappingURL=wordcloud-XkAQGXwu.mjs.map
1101
+ //# sourceMappingURL=wordcloud-je962F3R.mjs.map