@carbon/charts 1.13.8 → 1.13.11

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