@carbon/charts 1.15.0 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/{choropleth-o3sAu5GZ.mjs → choropleth-iPofCoEr.mjs} +1251 -1251
- package/dist/choropleth-iPofCoEr.mjs.map +1 -0
- package/dist/components/index.mjs +1 -1
- package/dist/demo/index.mjs +32 -32
- package/dist/demo/styles.css +169 -104
- package/dist/demo/styles.css.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/model/index.mjs +1 -1
- package/dist/styles.css +12 -0
- package/dist/styles.css.map +1 -1
- package/dist/styles.min.css +1 -1
- package/dist/styles.min.css.map +1 -1
- package/dist/umd/bundle.umd.js +19 -19
- package/dist/umd/bundle.umd.js.map +1 -1
- package/dist/{wordcloud-w4x7neZf.mjs → wordcloud-EFHcMnWt.mjs} +267 -261
- package/dist/wordcloud-EFHcMnWt.mjs.map +1 -0
- package/package.json +11 -11
- package/styles.css +12 -0
- package/styles.min.css +1 -1
- package/dist/choropleth-o3sAu5GZ.mjs.map +0 -1
- package/dist/wordcloud-w4x7neZf.mjs.map +0 -1
|
@@ -3,21 +3,21 @@ import { bin as K, stack as S, stackOffsetDiverging as H, scaleOrdinal as R, qua
|
|
|
3
3
|
import { S as f, _ as B, d as $, e as A, s as Y } from "./enums-sKf02OL8.mjs";
|
|
4
4
|
import { b as J } from "./_baseEach-FYvKsL62.mjs";
|
|
5
5
|
function tt(d, t, e, s) {
|
|
6
|
-
for (var a = -1,
|
|
7
|
-
var
|
|
8
|
-
t(s,
|
|
6
|
+
for (var a = -1, n = d == null ? 0 : d.length; ++a < n; ) {
|
|
7
|
+
var o = d[a];
|
|
8
|
+
t(s, o, e(o), d);
|
|
9
9
|
}
|
|
10
10
|
return s;
|
|
11
11
|
}
|
|
12
12
|
function et(d, t, e, s) {
|
|
13
|
-
return J(d, function(a,
|
|
14
|
-
t(s, a, e(a),
|
|
13
|
+
return J(d, function(a, n, o) {
|
|
14
|
+
t(s, a, e(a), o);
|
|
15
15
|
}), s;
|
|
16
16
|
}
|
|
17
17
|
function st(d, t) {
|
|
18
18
|
return function(e, s) {
|
|
19
|
-
var a = w(e) ? tt : et,
|
|
20
|
-
return a(e, d, z(s),
|
|
19
|
+
var a = w(e) ? tt : et, n = t ? t() : {};
|
|
20
|
+
return a(e, d, z(s), n);
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
function at(d) {
|
|
@@ -27,10 +27,10 @@ function at(d) {
|
|
|
27
27
|
}
|
|
28
28
|
return s;
|
|
29
29
|
}
|
|
30
|
-
var ot = Object.prototype,
|
|
31
|
-
|
|
30
|
+
var ot = Object.prototype, nt = ot.hasOwnProperty, rt = st(function(d, t, e) {
|
|
31
|
+
nt.call(d, e) ? d[e].push(t) : j(d, e, [t]);
|
|
32
32
|
});
|
|
33
|
-
const it =
|
|
33
|
+
const it = rt;
|
|
34
34
|
function lt(d) {
|
|
35
35
|
const t = d.trim();
|
|
36
36
|
return ["=", "+", "-", "@", " ", "\r"].includes(t.charAt(0)) ? ` ${t}` : /[,\"\n]/.test(t) ? `"${t}"` : t;
|
|
@@ -44,17 +44,17 @@ class D {
|
|
|
44
44
|
formatTable({ headers: t, cells: e }) {
|
|
45
45
|
const s = this.getOptions(), {
|
|
46
46
|
code: a,
|
|
47
|
-
date:
|
|
48
|
-
number:
|
|
49
|
-
} = u(s, "locale"), i = u(s, "tabularRepModal", "tableHeadingFormatter"),
|
|
47
|
+
date: n,
|
|
48
|
+
number: o
|
|
49
|
+
} = u(s, "locale"), i = u(s, "tabularRepModal", "tableHeadingFormatter"), r = u(s, "tabularRepModal", "tableCellFormatter"), { cartesianScales: c } = this.services, l = c == null ? void 0 : c.getDomainAxisScaleType();
|
|
50
50
|
let p;
|
|
51
|
-
return l === f.TIME && (p = (g) =>
|
|
51
|
+
return l === f.TIME && (p = (g) => n(g, a, { month: "short", day: "numeric", year: "numeric" })), [
|
|
52
52
|
typeof i == "function" ? i(t) : t,
|
|
53
|
-
...typeof
|
|
53
|
+
...typeof r == "function" ? r(e) : e.map((g) => {
|
|
54
54
|
p && (g[1] = p(g[1]));
|
|
55
55
|
for (let m in g) {
|
|
56
56
|
let y = g[m];
|
|
57
|
-
typeof y == "number" && (g[m] =
|
|
57
|
+
typeof y == "number" && (g[m] = o(y, a));
|
|
58
58
|
}
|
|
59
59
|
return g;
|
|
60
60
|
})
|
|
@@ -65,24 +65,24 @@ class D {
|
|
|
65
65
|
return null;
|
|
66
66
|
const e = this.getOptions();
|
|
67
67
|
let s = this.getData();
|
|
68
|
-
const a = this.getDataGroups(), { groupMapsTo:
|
|
69
|
-
return t && (s = s.filter((i) => t.includes(i[
|
|
70
|
-
const
|
|
68
|
+
const a = this.getDataGroups(), { groupMapsTo: n } = u(e, "data"), o = u(e, "axes");
|
|
69
|
+
return t && (s = s.filter((i) => t.includes(i[n]))), o && Object.keys(o).forEach((i) => {
|
|
70
|
+
const r = o[i].mapsTo, c = o[i].scaleType;
|
|
71
71
|
if ((c === f.LINEAR || c === f.LOG) && (s = s.map((l) => ({
|
|
72
72
|
...l,
|
|
73
|
-
[
|
|
74
|
-
}))),
|
|
73
|
+
[r]: l[r] === null ? l[r] : Number(l[r])
|
|
74
|
+
}))), r && o[i].domain)
|
|
75
75
|
if (c === f.LABELS)
|
|
76
76
|
s = s.filter(
|
|
77
|
-
(l) =>
|
|
77
|
+
(l) => o[i].domain.includes(l[r])
|
|
78
78
|
);
|
|
79
79
|
else {
|
|
80
|
-
const [l, p] =
|
|
80
|
+
const [l, p] = o[i].domain;
|
|
81
81
|
s = s.filter(
|
|
82
|
-
(h) => !(
|
|
82
|
+
(h) => !(r in h) || h[r] >= l && h[r] <= p
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
|
-
}), s.filter((i) => a.find((
|
|
85
|
+
}), s.filter((i) => a.find((r) => r.name === i[n]));
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* Charts that have group configs passed into them, only want to retrieve the display data relevant to that chart
|
|
@@ -92,8 +92,8 @@ class D {
|
|
|
92
92
|
if (!this.get("data"))
|
|
93
93
|
return null;
|
|
94
94
|
const { ACTIVE: e } = O.items.status, s = this.getDataGroups(t), { groupMapsTo: a } = this.getOptions().data;
|
|
95
|
-
return this.getAllDataFromDomain(t).filter((
|
|
96
|
-
(i) => i.name ===
|
|
95
|
+
return this.getAllDataFromDomain(t).filter((o) => s.find(
|
|
96
|
+
(i) => i.name === o[a] && i.status === e
|
|
97
97
|
));
|
|
98
98
|
}
|
|
99
99
|
getData() {
|
|
@@ -130,14 +130,14 @@ class D {
|
|
|
130
130
|
return it(t, "group");
|
|
131
131
|
}
|
|
132
132
|
getBinConfigurations() {
|
|
133
|
-
const t = this.getDisplayData(), e = this.getOptions(), s = this.services.cartesianScales.getMainXAxisPosition(), a = this.services.cartesianScales.getDomainIdentifier(),
|
|
134
|
-
if (
|
|
133
|
+
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 = U.defaultBins } = n, r = Array.isArray(i), c = K().value((g) => g[a]).thresholds(i)(t);
|
|
134
|
+
if (r)
|
|
135
135
|
c[c.length - 1].x1 = i[i.length - 1];
|
|
136
136
|
else {
|
|
137
137
|
const g = c[0].x1 - c[0].x0;
|
|
138
138
|
c[c.length - 1].x1 = +c[c.length - 1].x0 + g;
|
|
139
139
|
}
|
|
140
|
-
const l =
|
|
140
|
+
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]))), h = [];
|
|
141
141
|
return c.forEach((g) => {
|
|
142
142
|
const m = `${g.x0}-${g.x1}`, y = this.aggregateBinDataByGroup(g);
|
|
143
143
|
p.forEach((x) => {
|
|
@@ -154,79 +154,79 @@ class D {
|
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
156
|
getBinnedStackedData() {
|
|
157
|
-
const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getActiveDataGroupNames(), { bins: a } = this.getBinConfigurations(),
|
|
157
|
+
const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getActiveDataGroupNames(), { bins: a } = this.getBinConfigurations(), n = this.getDataValuesGroupedByKeys({
|
|
158
158
|
bins: a
|
|
159
159
|
});
|
|
160
|
-
return S().keys(s)(
|
|
161
|
-
const c = r
|
|
160
|
+
return S().keys(s)(n).map((o, i) => Object.keys(o).filter((r) => !isNaN(r)).map((r) => {
|
|
161
|
+
const c = o[r];
|
|
162
162
|
return c[e] = s[i], c;
|
|
163
163
|
}));
|
|
164
164
|
}
|
|
165
165
|
getGroupedData(t) {
|
|
166
166
|
const e = this.getDisplayData(t), s = {}, { groupMapsTo: a } = this.getOptions().data;
|
|
167
|
-
return e.map((
|
|
168
|
-
const
|
|
169
|
-
s[
|
|
170
|
-
}), Object.keys(s).map((
|
|
171
|
-
name:
|
|
172
|
-
data: s[
|
|
167
|
+
return e.map((n) => {
|
|
168
|
+
const o = n[a];
|
|
169
|
+
s[o] !== null && s[o] !== void 0 ? s[o].push(n) : s[o] = [n];
|
|
170
|
+
}), Object.keys(s).map((n) => ({
|
|
171
|
+
name: n,
|
|
172
|
+
data: s[n]
|
|
173
173
|
}));
|
|
174
174
|
}
|
|
175
175
|
getStackKeys({ bins: t = null, groups: e = null } = { bins: null, groups: null }) {
|
|
176
176
|
const s = this.getOptions(), a = this.getDisplayData(e);
|
|
177
|
-
let
|
|
178
|
-
t ?
|
|
179
|
-
a.map((
|
|
180
|
-
const c = this.services.cartesianScales.getDomainIdentifier(
|
|
181
|
-
return
|
|
177
|
+
let n;
|
|
178
|
+
t ? n = t.map((r) => `${r.x0}:${r.x1}`) : n = M(
|
|
179
|
+
a.map((r) => {
|
|
180
|
+
const c = this.services.cartesianScales.getDomainIdentifier(r);
|
|
181
|
+
return r[c] instanceof Date ? N(r[c]) : r[c] && typeof r[c].toString == "function" ? r[c].toString() : r[c];
|
|
182
182
|
})
|
|
183
183
|
);
|
|
184
|
-
const
|
|
185
|
-
return i === f.TIME ?
|
|
186
|
-
const l = new Date(
|
|
184
|
+
const o = this.services.cartesianScales.domainAxisPosition, i = s.axes[o].scaleType;
|
|
185
|
+
return i === f.TIME ? n.sort((r, c) => {
|
|
186
|
+
const l = new Date(r), p = new Date(c);
|
|
187
187
|
return l - p;
|
|
188
|
-
}) : (i === f.LOG || i === f.LINEAR) &&
|
|
188
|
+
}) : (i === f.LOG || i === f.LINEAR) && n.sort((r, c) => r - c), n;
|
|
189
189
|
}
|
|
190
190
|
getDataValuesGroupedByKeys({ bins: t = null, groups: e = null }) {
|
|
191
|
-
const s = this.getOptions(), { groupMapsTo: a } = s.data,
|
|
192
|
-
return t ? i.map((
|
|
193
|
-
const [c, l] =
|
|
194
|
-
return
|
|
191
|
+
const s = this.getOptions(), { groupMapsTo: a } = s.data, n = this.getDisplayData(e), o = this.getDataGroupNames(), i = this.getStackKeys({ bins: t, groups: e });
|
|
192
|
+
return t ? i.map((r) => {
|
|
193
|
+
const [c, l] = r.split(":"), p = { x0: c, x1: l }, h = t.find((g) => g.x0.toString() === c.toString());
|
|
194
|
+
return o.forEach((g) => {
|
|
195
195
|
p[g] = h.filter(
|
|
196
196
|
(m) => m[a] === g
|
|
197
197
|
).length;
|
|
198
198
|
}), p;
|
|
199
|
-
}) : i.map((
|
|
200
|
-
const c = { sharedStackKey:
|
|
201
|
-
return
|
|
202
|
-
const p =
|
|
199
|
+
}) : i.map((r) => {
|
|
200
|
+
const c = { sharedStackKey: r };
|
|
201
|
+
return o.forEach((l) => {
|
|
202
|
+
const p = n.find((g) => {
|
|
203
203
|
const m = this.services.cartesianScales.getDomainIdentifier(g);
|
|
204
|
-
return g[a] === l && Object.prototype.hasOwnProperty.call(g, m) && (g[m] instanceof Date ? N(g[m]) ===
|
|
204
|
+
return g[a] === l && Object.prototype.hasOwnProperty.call(g, m) && (g[m] instanceof Date ? N(g[m]) === r : g[m].toString() === r);
|
|
205
205
|
}), h = this.services.cartesianScales.getRangeIdentifier(c);
|
|
206
206
|
c[l] = p ? p[h] : null;
|
|
207
207
|
}), c;
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
getStackedData({ percentage: t = !1, groups: e = null, divergent: s = !1 }) {
|
|
211
|
-
const a = this.getOptions(), { groupMapsTo:
|
|
211
|
+
const a = this.getOptions(), { groupMapsTo: n } = a.data, o = this.getActiveDataGroupNames(e), i = this.getDataValuesGroupedByKeys({
|
|
212
212
|
groups: e
|
|
213
213
|
});
|
|
214
214
|
if (t) {
|
|
215
215
|
const c = at(i.map((l) => [l.sharedStackKey, 0]));
|
|
216
216
|
i.forEach((l) => {
|
|
217
|
-
|
|
217
|
+
o.forEach((p) => {
|
|
218
218
|
c[l.sharedStackKey] += l[p];
|
|
219
219
|
});
|
|
220
220
|
}), i.forEach((l) => {
|
|
221
|
-
|
|
221
|
+
o.forEach((p) => {
|
|
222
222
|
const h = c[l.sharedStackKey];
|
|
223
223
|
c[l.sharedStackKey] ? l[p] = l[p] / h * 100 : l[p] = 0;
|
|
224
224
|
});
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
-
return (s ? S().offset(H) : S()).keys(
|
|
227
|
+
return (s ? S().offset(H) : S()).keys(o)(i).map((c, l) => Object.keys(c).filter((p) => !isNaN(p)).map((p) => {
|
|
228
228
|
const h = c[p];
|
|
229
|
-
return h[
|
|
229
|
+
return h[n] = o[l], h;
|
|
230
230
|
}));
|
|
231
231
|
}
|
|
232
232
|
/**
|
|
@@ -269,9 +269,9 @@ class D {
|
|
|
269
269
|
* Data labels
|
|
270
270
|
*/
|
|
271
271
|
toggleDataLabel(t) {
|
|
272
|
-
const { ACTIVE: e, DISABLED: s } = O.items.status, a = this.getDataGroups(),
|
|
273
|
-
if (
|
|
274
|
-
if (
|
|
272
|
+
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);
|
|
273
|
+
if (n)
|
|
274
|
+
if (o.length === 1 && o[0].name === t)
|
|
275
275
|
a.forEach((l, p) => {
|
|
276
276
|
a[p].status = e;
|
|
277
277
|
});
|
|
@@ -283,8 +283,8 @@ class D {
|
|
|
283
283
|
a.forEach((l, p) => {
|
|
284
284
|
a[p].status = l.name === t ? e : s;
|
|
285
285
|
});
|
|
286
|
-
const i = a.filter((l) => l.status === e),
|
|
287
|
-
a.some((l) => l.status === s) ?
|
|
286
|
+
const i = a.filter((l) => l.status === e), r = this.getOptions();
|
|
287
|
+
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, {
|
|
288
288
|
dataGroups: a
|
|
289
289
|
}), this.set({
|
|
290
290
|
dataGroups: a
|
|
@@ -298,16 +298,16 @@ class D {
|
|
|
298
298
|
* @param defaultFilled the default for this chart
|
|
299
299
|
*/
|
|
300
300
|
getIsFilled(t, e, s, a) {
|
|
301
|
-
const
|
|
302
|
-
return
|
|
301
|
+
const n = this.getOptions();
|
|
302
|
+
return n.getIsFilled ? n.getIsFilled(t, e, s, a) : a;
|
|
303
303
|
}
|
|
304
304
|
getFillColor(t, e, s) {
|
|
305
|
-
const a = this.getOptions(),
|
|
306
|
-
return a.getFillColor ? a.getFillColor(t, e, s,
|
|
305
|
+
const a = this.getOptions(), n = u(this.colorScale, t);
|
|
306
|
+
return a.getFillColor ? a.getFillColor(t, e, s, n) : n;
|
|
307
307
|
}
|
|
308
308
|
getStrokeColor(t, e, s) {
|
|
309
|
-
const a = this.getOptions(),
|
|
310
|
-
return a.getStrokeColor ? a.getStrokeColor(t, e, s,
|
|
309
|
+
const a = this.getOptions(), n = u(this.colorScale, t);
|
|
310
|
+
return a.getStrokeColor ? a.getStrokeColor(t, e, s, n) : n;
|
|
311
311
|
}
|
|
312
312
|
isUserProvidedColorScaleValid() {
|
|
313
313
|
const t = u(this.getOptions(), "color", "scale"), e = this.getDataGroups();
|
|
@@ -340,20 +340,20 @@ class D {
|
|
|
340
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"
|
|
341
341
|
);
|
|
342
342
|
const e = [], { datasets: s, labels: a } = t;
|
|
343
|
-
return s.forEach((
|
|
344
|
-
|
|
345
|
-
let
|
|
346
|
-
const c = u(
|
|
343
|
+
return s.forEach((n) => {
|
|
344
|
+
n.data.forEach((o, i) => {
|
|
345
|
+
let r;
|
|
346
|
+
const c = u(n, "label");
|
|
347
347
|
if (c === null) {
|
|
348
348
|
const p = u(a, i);
|
|
349
|
-
p ?
|
|
349
|
+
p ? r = p : r = "Ungrouped";
|
|
350
350
|
} else
|
|
351
|
-
|
|
351
|
+
r = c;
|
|
352
352
|
const l = {
|
|
353
|
-
group:
|
|
353
|
+
group: r,
|
|
354
354
|
key: a[i]
|
|
355
355
|
};
|
|
356
|
-
isNaN(
|
|
356
|
+
isNaN(o) ? (l.value = o.value, l.date = o.date) : l.value = o, e.push(l);
|
|
357
357
|
});
|
|
358
358
|
}), e;
|
|
359
359
|
}
|
|
@@ -362,12 +362,12 @@ class D {
|
|
|
362
362
|
}
|
|
363
363
|
exportToCSV() {
|
|
364
364
|
const e = this.getTabularDataArray().map(
|
|
365
|
-
(
|
|
366
|
-
).map((
|
|
365
|
+
(o) => o.map((i) => `"${(i === "–" ? "–" : i).split(/[,;'"`]/).map((l) => lt(l)).join("")}"`)
|
|
366
|
+
).map((o) => o.join(",")).join(`
|
|
367
367
|
`), s = this.getOptions();
|
|
368
368
|
let a = "myChart";
|
|
369
|
-
const
|
|
370
|
-
typeof
|
|
369
|
+
const n = u(s, "fileDownload", "fileName");
|
|
370
|
+
typeof n == "function" ? a = n("csv") : typeof n == "string" && (a = n), this.services.files.downloadCSV(e, `${a}.csv`);
|
|
371
371
|
}
|
|
372
372
|
getTabularData(t) {
|
|
373
373
|
return Array.isArray(t) ? t : this.transformToTabularData(t);
|
|
@@ -384,14 +384,14 @@ class D {
|
|
|
384
384
|
}) : this.allDataGroups = this.getDataGroupNames();
|
|
385
385
|
}
|
|
386
386
|
generateDataGroups(t) {
|
|
387
|
-
const { groupMapsTo: e } = this.getOptions().data, { ACTIVE: s, DISABLED: a } = O.items.status,
|
|
388
|
-
|
|
389
|
-
(c) =>
|
|
390
|
-
) || (
|
|
391
|
-
const i = (
|
|
392
|
-
return
|
|
393
|
-
name:
|
|
394
|
-
status: i(
|
|
387
|
+
const { groupMapsTo: e } = this.getOptions().data, { ACTIVE: s, DISABLED: a } = O.items.status, n = this.getOptions(), o = M(t.map((r) => r[e]));
|
|
388
|
+
n.data.selectedGroups.length && (n.data.selectedGroups.every(
|
|
389
|
+
(c) => o.includes(c)
|
|
390
|
+
) || (n.data.selectedGroups = []));
|
|
391
|
+
const i = (r) => !n.data.selectedGroups.length || n.data.selectedGroups.includes(r) ? s : a;
|
|
392
|
+
return o.map((r) => ({
|
|
393
|
+
name: r,
|
|
394
|
+
status: i(r)
|
|
395
395
|
}));
|
|
396
396
|
}
|
|
397
397
|
/*
|
|
@@ -415,10 +415,10 @@ class D {
|
|
|
415
415
|
let e = u(t, "numberOfVariants");
|
|
416
416
|
(!e || e < this.allDataGroups.length) && (e = this.allDataGroups.length);
|
|
417
417
|
let s = u(t, "option");
|
|
418
|
-
const a = V.pairingOptions,
|
|
419
|
-
s = s <= a[
|
|
418
|
+
const a = V.pairingOptions, n = e > 5 ? 14 : e, o = `${n}-color`;
|
|
419
|
+
s = s <= a[o] ? s : 1;
|
|
420
420
|
const i = this.allDataGroups.map(
|
|
421
|
-
(
|
|
421
|
+
(r, c) => `${n}-${s}-${c % 14 + 1}`
|
|
422
422
|
);
|
|
423
423
|
this.colorClassNames = R().range(i).domain(this.allDataGroups);
|
|
424
424
|
}
|
|
@@ -438,29 +438,29 @@ class T extends D {
|
|
|
438
438
|
secondaryRange: null
|
|
439
439
|
};
|
|
440
440
|
return s && (a.secondaryDomain = t.secondaryDomainAxisPosition, a.secondaryRange = t.secondaryRangeAxisPosition), Object.keys(a).forEach(
|
|
441
|
-
(
|
|
442
|
-
const
|
|
443
|
-
t.scales[
|
|
444
|
-
position:
|
|
445
|
-
label: t.getScaleLabel(
|
|
446
|
-
identifier: u(e, "axes",
|
|
447
|
-
} : a[
|
|
441
|
+
(n) => {
|
|
442
|
+
const o = a[n];
|
|
443
|
+
t.scales[o] ? a[n] = {
|
|
444
|
+
position: o,
|
|
445
|
+
label: t.getScaleLabel(o),
|
|
446
|
+
identifier: u(e, "axes", o, "mapsTo")
|
|
447
|
+
} : a[n] = null;
|
|
448
448
|
}
|
|
449
449
|
), a;
|
|
450
450
|
}
|
|
451
451
|
getTabularDataArray() {
|
|
452
|
-
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { primaryDomain: a, primaryRange:
|
|
452
|
+
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { primaryDomain: a, primaryRange: n, secondaryDomain: o, secondaryRange: i } = this.assignRangeAndDomains(), { number: r, code: c } = u(this.getOptions(), "locale"), l = [
|
|
453
453
|
"Group",
|
|
454
454
|
a.label,
|
|
455
|
-
|
|
456
|
-
...
|
|
455
|
+
n.label,
|
|
456
|
+
...o ? [o.label] : [],
|
|
457
457
|
...i ? [i.label] : []
|
|
458
458
|
], p = t.map((h) => [
|
|
459
459
|
h[s],
|
|
460
460
|
h[a.identifier] === null ? "–" : h[a.identifier],
|
|
461
|
-
h[
|
|
462
|
-
...
|
|
463
|
-
h[
|
|
461
|
+
h[n.identifier] === null || isNaN(h[n.identifier]) ? "–" : r(h[n.identifier], c),
|
|
462
|
+
...o ? [
|
|
463
|
+
h[o.identifier] === null ? "–" : h[o.identifier]
|
|
464
464
|
] : [],
|
|
465
465
|
...i ? [
|
|
466
466
|
h[i.identifier] === null || isNaN(h[i.identifier]) ? "–" : h[i.identifier]
|
|
@@ -489,14 +489,14 @@ class T extends D {
|
|
|
489
489
|
let s = e;
|
|
490
490
|
const { cartesianScales: a } = this.services;
|
|
491
491
|
if (e && a.domainAxisPosition && a.rangeAxisPosition) {
|
|
492
|
-
const
|
|
493
|
-
let i = e.map((
|
|
494
|
-
i = M(i).sort(), s = i.map((
|
|
492
|
+
const n = a.getDomainIdentifier(), o = a.getRangeIdentifier();
|
|
493
|
+
let i = e.map((r) => r[n].getTime());
|
|
494
|
+
i = M(i).sort(), s = i.map((r) => {
|
|
495
495
|
let c = 0;
|
|
496
496
|
const l = {};
|
|
497
497
|
return e.forEach((p) => {
|
|
498
|
-
p[
|
|
499
|
-
}), l[
|
|
498
|
+
p[n].getTime() === r && (c += p[o]);
|
|
499
|
+
}), l[n] = new Date(r), l[o] = c, l;
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
502
|
this.set({ zoomBarData: s });
|
|
@@ -510,14 +510,14 @@ class T extends D {
|
|
|
510
510
|
return t;
|
|
511
511
|
const s = [];
|
|
512
512
|
return Object.keys(A).forEach((a) => {
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
const i =
|
|
513
|
+
const n = A[a], o = e.axes[n];
|
|
514
|
+
if (o && o.scaleType === f.TIME) {
|
|
515
|
+
const i = o.mapsTo;
|
|
516
516
|
(i !== null || i !== void 0) && s.push(i);
|
|
517
517
|
}
|
|
518
518
|
}), s.length > 0 && t.forEach((a) => {
|
|
519
|
-
s.forEach((
|
|
520
|
-
u(a,
|
|
519
|
+
s.forEach((n) => {
|
|
520
|
+
u(a, n, "getTime") === null && (a[n] = new Date(a[n]));
|
|
521
521
|
});
|
|
522
522
|
}), t;
|
|
523
523
|
}
|
|
@@ -531,15 +531,15 @@ class gt extends T {
|
|
|
531
531
|
}
|
|
532
532
|
getTabularDataArray() {
|
|
533
533
|
const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale");
|
|
534
|
-
t.sort((
|
|
535
|
-
const a = ["Source", "Target", "Value"],
|
|
536
|
-
...t.map((
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
e(
|
|
534
|
+
t.sort((o, i) => o.source.localeCompare(i.source));
|
|
535
|
+
const a = ["Source", "Target", "Value"], n = [
|
|
536
|
+
...t.map((o) => [
|
|
537
|
+
o.source,
|
|
538
|
+
o.target,
|
|
539
|
+
o.value === null ? "–" : e(o.value, s)
|
|
540
540
|
])
|
|
541
541
|
];
|
|
542
|
-
return super.formatTable({ headers: a, cells:
|
|
542
|
+
return super.formatTable({ headers: a, cells: n });
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
class dt extends T {
|
|
@@ -555,15 +555,15 @@ class dt extends T {
|
|
|
555
555
|
}
|
|
556
556
|
getBoxplotData() {
|
|
557
557
|
const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getGroupedData(), a = [];
|
|
558
|
-
for (const { name:
|
|
559
|
-
const i = this.services.cartesianScales.getRangeIdentifier(),
|
|
560
|
-
[e]:
|
|
561
|
-
counts:
|
|
562
|
-
quartiles: this.getBoxQuartiles(
|
|
558
|
+
for (const { name: n, data: o } of s) {
|
|
559
|
+
const i = this.services.cartesianScales.getRangeIdentifier(), r = o.map((v) => v[i]).sort(Z), c = {
|
|
560
|
+
[e]: n,
|
|
561
|
+
counts: r,
|
|
562
|
+
quartiles: this.getBoxQuartiles(r),
|
|
563
563
|
outliers: null,
|
|
564
564
|
whiskers: null
|
|
565
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
|
|
566
|
+
for (const v of r)
|
|
567
567
|
v < g || v > m ? y.push(v) : x.push(v);
|
|
568
568
|
c.outliers = y;
|
|
569
569
|
const q = P(x), I = k(x);
|
|
@@ -575,32 +575,32 @@ class dt extends T {
|
|
|
575
575
|
return a;
|
|
576
576
|
}
|
|
577
577
|
getTabularDataArray() {
|
|
578
|
-
const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getBoxplotData(), { number: a, code:
|
|
579
|
-
...s.map((
|
|
580
|
-
let c = u(
|
|
578
|
+
const t = this.getOptions(), { groupMapsTo: e } = t.data, s = this.getBoxplotData(), { number: a, code: n } = u(t, "locale"), o = ["Group", "Minimum", "Q1", "Median", "Q3", "Maximum", "IQR", "Outlier(s)"], i = [
|
|
579
|
+
...s.map((r) => {
|
|
580
|
+
let c = u(r, "outliers");
|
|
581
581
|
return (c === null || c.length === 0) && (c = ["–"]), [
|
|
582
|
-
|
|
583
|
-
u(
|
|
584
|
-
u(
|
|
585
|
-
u(
|
|
586
|
-
u(
|
|
587
|
-
u(
|
|
588
|
-
u(
|
|
589
|
-
u(
|
|
590
|
-
),
|
|
591
|
-
c.map((l) => a(l,
|
|
582
|
+
r[e],
|
|
583
|
+
u(r, "whiskers", "min") !== null ? a(u(r, "whiskers", "min"), n) : "–",
|
|
584
|
+
u(r, "quartiles", "q_25") !== null ? a(u(r, "quartiles", "q_25"), n) : "–",
|
|
585
|
+
u(r, "quartiles", "q_50") !== null ? a(u(r, "quartiles", "q_50"), n) : "–",
|
|
586
|
+
u(r, "quartiles", "q_75") !== null ? a(u(r, "quartiles", "q_75"), n) : "–",
|
|
587
|
+
u(r, "whiskers", "max") !== null ? a(u(r, "whiskers", "max"), n) : "–",
|
|
588
|
+
u(r, "quartiles", "q_75") !== null && u(r, "quartiles", "q_25") !== null ? (a(
|
|
589
|
+
u(r, "quartiles", "q_75") - u(r, "quartiles", "q_25")
|
|
590
|
+
), n) : "–",
|
|
591
|
+
c.map((l) => a(l, n)).join(",")
|
|
592
592
|
];
|
|
593
593
|
})
|
|
594
594
|
];
|
|
595
|
-
return super.formatTable({ headers:
|
|
595
|
+
return super.formatTable({ headers: o, cells: i });
|
|
596
596
|
}
|
|
597
597
|
setColorClassNames() {
|
|
598
598
|
const e = u(this.getOptions(), "color", "pairing");
|
|
599
599
|
let s = u(e, "option");
|
|
600
600
|
const a = V.pairingOptions;
|
|
601
601
|
s = s <= a["1-color"] ? s : 1;
|
|
602
|
-
const
|
|
603
|
-
this.colorClassNames = R().range(
|
|
602
|
+
const n = this.allDataGroups.map(() => `1-${s}-1`);
|
|
603
|
+
this.colorClassNames = R().range(n).domain(this.allDataGroups);
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
class mt extends T {
|
|
@@ -622,17 +622,17 @@ class mt extends T {
|
|
|
622
622
|
return 0;
|
|
623
623
|
}
|
|
624
624
|
getTabularDataArray() {
|
|
625
|
-
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.services.cartesianScales.getRangeIdentifier(), { number:
|
|
625
|
+
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.services.cartesianScales.getRangeIdentifier(), { number: n, code: o } = u(e, "locale"), i = u(e, "bullet", "performanceAreaTitles"), r = ["Title", "Group", "Value", "Target", "Percentage", "Performance"], c = [
|
|
626
626
|
...t.map((l) => [
|
|
627
627
|
l.title,
|
|
628
628
|
l[s],
|
|
629
|
-
l.value === null ? "–" :
|
|
630
|
-
u(l, "marker") === null ? "–" :
|
|
631
|
-
u(l, "marker") === null ? "–" : `${
|
|
629
|
+
l.value === null ? "–" : n(l.value, o),
|
|
630
|
+
u(l, "marker") === null ? "–" : n(l.marker, o),
|
|
631
|
+
u(l, "marker") === null ? "–" : `${n(Math.floor(l[a] / l.marker * 100), o)}%`,
|
|
632
632
|
i[this.getMatchingRangeIndexForDatapoint(l)]
|
|
633
633
|
])
|
|
634
634
|
];
|
|
635
|
-
return super.formatTable({ headers:
|
|
635
|
+
return super.formatTable({ headers: r, cells: c });
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
class ft extends D {
|
|
@@ -666,14 +666,14 @@ class ft extends D {
|
|
|
666
666
|
* @returns Array<Object>
|
|
667
667
|
*/
|
|
668
668
|
getTabularDataArray() {
|
|
669
|
-
const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale"), a = ["Country ID", "Country Name", "Value"],
|
|
670
|
-
...t.map((
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
e(
|
|
669
|
+
const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale"), a = ["Country ID", "Country Name", "Value"], n = [
|
|
670
|
+
...t.map((o) => [
|
|
671
|
+
o.id === null ? "–" : o.id,
|
|
672
|
+
o.name,
|
|
673
|
+
o.value === null ? "–" : e(o.value, s)
|
|
674
674
|
])
|
|
675
675
|
];
|
|
676
|
-
return super.formatTable({ headers: a, cells:
|
|
676
|
+
return super.formatTable({ headers: a, cells: n });
|
|
677
677
|
}
|
|
678
678
|
// Uses quantize scale to return class names
|
|
679
679
|
getColorClassName(t) {
|
|
@@ -694,21 +694,21 @@ class Dt extends D {
|
|
|
694
694
|
setOptions(t) {
|
|
695
695
|
const e = this.getOptions(), s = _({}, t, this.getZoomOptions(t));
|
|
696
696
|
F(e, s);
|
|
697
|
-
const a = this.getHierarchyLevel(),
|
|
697
|
+
const a = this.getHierarchyLevel(), n = u(e, "circlePack", "hierarchyLevel");
|
|
698
698
|
this.set({
|
|
699
699
|
options: _(e, s),
|
|
700
|
-
depth:
|
|
700
|
+
depth: n && n < 4 ? n : a
|
|
701
701
|
});
|
|
702
702
|
}
|
|
703
703
|
getZoomOptions(t) {
|
|
704
704
|
if (!this.getDisplayData())
|
|
705
705
|
return {};
|
|
706
706
|
const e = this.getDisplayData(), s = t || this.getOptions(), a = e.length === 1 && u(e, 0, "children") ? u(e, 0, "children") : e;
|
|
707
|
-
let
|
|
708
|
-
return a.some((
|
|
709
|
-
if (
|
|
710
|
-
return
|
|
711
|
-
}), u(s, "canvasZoom", "enabled") === !0 &&
|
|
707
|
+
let n = this.getHierarchyLevel();
|
|
708
|
+
return a.some((o) => {
|
|
709
|
+
if (o.children && o.children.some((i) => i.children))
|
|
710
|
+
return n = 3, !1;
|
|
711
|
+
}), u(s, "canvasZoom", "enabled") === !0 && n > 2 ? {
|
|
712
712
|
legend: {
|
|
713
713
|
additionalItems: [
|
|
714
714
|
{
|
|
@@ -734,9 +734,9 @@ class Dt extends D {
|
|
|
734
734
|
}
|
|
735
735
|
// set the datagroup name on the items that are it's children
|
|
736
736
|
setDataGroups() {
|
|
737
|
-
const t = this.getData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = t.map((
|
|
738
|
-
const
|
|
739
|
-
return this.setChildrenDataGroup(
|
|
737
|
+
const t = this.getData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = t.map((n) => {
|
|
738
|
+
const o = n[s];
|
|
739
|
+
return this.setChildrenDataGroup(n, o);
|
|
740
740
|
});
|
|
741
741
|
this.set(
|
|
742
742
|
{
|
|
@@ -754,11 +754,11 @@ class Dt extends D {
|
|
|
754
754
|
} : { ...t, dataGroupName: e };
|
|
755
755
|
}
|
|
756
756
|
getTabularDataArray() {
|
|
757
|
-
const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale"), a = ["Child", "Parent", "Value"],
|
|
758
|
-
return t.forEach((
|
|
759
|
-
let i =
|
|
760
|
-
|
|
761
|
-
}), super.formatTable({ headers: a, cells:
|
|
757
|
+
const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale"), a = ["Child", "Parent", "Value"], n = [];
|
|
758
|
+
return t.forEach((o) => {
|
|
759
|
+
let i = o.value ? o.value : 0;
|
|
760
|
+
o.children && (i += this.getChildrenDatums(o.children, o.name, n, 0)), n.push(["–", o.name, e(i, s)]);
|
|
761
|
+
}), super.formatTable({ headers: a, cells: n });
|
|
762
762
|
}
|
|
763
763
|
/**
|
|
764
764
|
* Recursively determine the relationship between all the nested elements in the child
|
|
@@ -769,15 +769,15 @@ class Dt extends D {
|
|
|
769
769
|
* @returns: number
|
|
770
770
|
*/
|
|
771
771
|
getChildrenDatums(t, e, s = [], a = 0) {
|
|
772
|
-
const
|
|
773
|
-
return t.forEach((
|
|
774
|
-
const c =
|
|
772
|
+
const n = e, { number: o, code: i } = u(this.getOptions(), "locale");
|
|
773
|
+
return t.forEach((r) => {
|
|
774
|
+
const c = r.name;
|
|
775
775
|
let l = 0;
|
|
776
|
-
if (
|
|
777
|
-
|
|
776
|
+
if (r.children)
|
|
777
|
+
r.children.length > 0 && (typeof r.value == "number" && (a += r.value), l += this.getChildrenDatums(r.children, c, s, l), s.push([c, n, o(l, i)]), a += l);
|
|
778
778
|
else {
|
|
779
779
|
let p = 0;
|
|
780
|
-
typeof
|
|
780
|
+
typeof r.value == "number" && (p = r.value, a += r.value), s.push([r.name, n, o(p, i)]);
|
|
781
781
|
}
|
|
782
782
|
}), a;
|
|
783
783
|
}
|
|
@@ -793,13 +793,13 @@ class yt extends D {
|
|
|
793
793
|
}), e;
|
|
794
794
|
}
|
|
795
795
|
getTabularDataArray() {
|
|
796
|
-
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { valueMapsTo: a } = e.pie, { number:
|
|
796
|
+
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { valueMapsTo: a } = e.pie, { number: n, code: o } = u(e, "locale"), i = ["Group", "Value"], r = [
|
|
797
797
|
...t.map((c) => [
|
|
798
798
|
c[s],
|
|
799
|
-
c[a] === null ? "–" :
|
|
799
|
+
c[a] === null ? "–" : n(c[a], o)
|
|
800
800
|
])
|
|
801
801
|
];
|
|
802
|
-
return super.formatTable({ headers: i, cells:
|
|
802
|
+
return super.formatTable({ headers: i, cells: r });
|
|
803
803
|
}
|
|
804
804
|
sanitize(t) {
|
|
805
805
|
return this.getTabularData(t).sort((s, a) => a.value - s.value);
|
|
@@ -813,13 +813,13 @@ class bt extends D {
|
|
|
813
813
|
return super.getDataGroups().filter((t) => t.name !== "delta");
|
|
814
814
|
}
|
|
815
815
|
getTabularDataArray() {
|
|
816
|
-
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { number: a, code:
|
|
817
|
-
...t.map((
|
|
818
|
-
|
|
819
|
-
|
|
816
|
+
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, { number: a, code: n } = u(this.getOptions(), "locale"), o = ["Group", "Value"], i = [
|
|
817
|
+
...t.map((r) => [
|
|
818
|
+
r[s],
|
|
819
|
+
r.value === null ? "–" : a(r.value, n)
|
|
820
820
|
])
|
|
821
821
|
];
|
|
822
|
-
return super.formatTable({ headers:
|
|
822
|
+
return super.formatTable({ headers: o, cells: i });
|
|
823
823
|
}
|
|
824
824
|
}
|
|
825
825
|
class vt extends T {
|
|
@@ -855,12 +855,12 @@ class vt extends T {
|
|
|
855
855
|
*/
|
|
856
856
|
getUniqueDomain() {
|
|
857
857
|
if (b(this._domains)) {
|
|
858
|
-
const t = this.getDisplayData(), { cartesianScales: e } = this.services, s = e.getDomainIdentifier(), a = e.getMainXAxisPosition(),
|
|
859
|
-
if (
|
|
860
|
-
return
|
|
858
|
+
const t = this.getDisplayData(), { cartesianScales: e } = this.services, s = e.getDomainIdentifier(), a = e.getMainXAxisPosition(), n = e.getCustomDomainValuesByposition(a);
|
|
859
|
+
if (n)
|
|
860
|
+
return n;
|
|
861
861
|
this._domains = Array.from(
|
|
862
862
|
new Set(
|
|
863
|
-
t.map((
|
|
863
|
+
t.map((o) => o[s])
|
|
864
864
|
)
|
|
865
865
|
);
|
|
866
866
|
}
|
|
@@ -872,12 +872,12 @@ class vt extends T {
|
|
|
872
872
|
*/
|
|
873
873
|
getUniqueRanges() {
|
|
874
874
|
if (b(this._ranges)) {
|
|
875
|
-
const t = this.getDisplayData(), { cartesianScales: e } = this.services, s = e.getRangeIdentifier(), a = e.getMainYAxisPosition(),
|
|
876
|
-
if (
|
|
877
|
-
return
|
|
875
|
+
const t = this.getDisplayData(), { cartesianScales: e } = this.services, s = e.getRangeIdentifier(), a = e.getMainYAxisPosition(), n = e.getCustomDomainValuesByposition(a);
|
|
876
|
+
if (n)
|
|
877
|
+
return n;
|
|
878
878
|
this._ranges = Array.from(
|
|
879
879
|
new Set(
|
|
880
|
-
t.map((
|
|
880
|
+
t.map((o) => o[s])
|
|
881
881
|
)
|
|
882
882
|
);
|
|
883
883
|
}
|
|
@@ -889,17 +889,17 @@ class vt extends T {
|
|
|
889
889
|
*/
|
|
890
890
|
getMatrix() {
|
|
891
891
|
if (b(this._matrix)) {
|
|
892
|
-
const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(),
|
|
893
|
-
e.forEach((
|
|
894
|
-
o
|
|
892
|
+
const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(), n = {};
|
|
893
|
+
e.forEach((o) => {
|
|
894
|
+
n[o] = {
|
|
895
895
|
value: null,
|
|
896
896
|
index: -1
|
|
897
897
|
};
|
|
898
|
-
}), t.forEach((
|
|
899
|
-
this._matrix[
|
|
900
|
-
}), this.getDisplayData().forEach((
|
|
901
|
-
this._matrix[
|
|
902
|
-
value:
|
|
898
|
+
}), t.forEach((o) => {
|
|
899
|
+
this._matrix[o] = G(n);
|
|
900
|
+
}), this.getDisplayData().forEach((o, i) => {
|
|
901
|
+
this._matrix[o[s]][o[a]] = {
|
|
902
|
+
value: o.value,
|
|
903
903
|
index: i
|
|
904
904
|
};
|
|
905
905
|
});
|
|
@@ -923,30 +923,30 @@ class vt extends T {
|
|
|
923
923
|
*/
|
|
924
924
|
getMatrixAsArray() {
|
|
925
925
|
b(this._matrix) && this.getMatrix();
|
|
926
|
-
const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(),
|
|
927
|
-
return t.forEach((
|
|
926
|
+
const t = this.getUniqueDomain(), e = this.getUniqueRanges(), s = this.services.cartesianScales.getDomainIdentifier(), a = this.services.cartesianScales.getRangeIdentifier(), n = [];
|
|
927
|
+
return t.forEach((o) => {
|
|
928
928
|
e.forEach((i) => {
|
|
929
|
-
const
|
|
930
|
-
value: this._matrix[
|
|
931
|
-
index: this._matrix[
|
|
929
|
+
const r = {
|
|
930
|
+
value: this._matrix[o][i].value,
|
|
931
|
+
index: this._matrix[o][i].index
|
|
932
932
|
};
|
|
933
|
-
|
|
933
|
+
r[s] = o, r[a] = i, n.push(r);
|
|
934
934
|
});
|
|
935
|
-
}),
|
|
935
|
+
}), n;
|
|
936
936
|
}
|
|
937
937
|
/**
|
|
938
938
|
* Generate tabular data from display data
|
|
939
939
|
* @returns Array<Object>
|
|
940
940
|
*/
|
|
941
941
|
getTabularDataArray() {
|
|
942
|
-
const t = this.getDisplayData(), { primaryDomain: e, primaryRange: s } = this.assignRangeAndDomains(), { number: a, code:
|
|
943
|
-
...t.map((
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
a(
|
|
942
|
+
const t = this.getDisplayData(), { primaryDomain: e, primaryRange: s } = this.assignRangeAndDomains(), { number: a, code: n } = u(this.getOptions(), "locale"), o = [e.label, s.label, "Value"], i = [
|
|
943
|
+
...t.map((r) => [
|
|
944
|
+
r[e.identifier] === null ? "–" : r[e.identifier],
|
|
945
|
+
r[s.identifier] === null ? "–" : r[s.identifier],
|
|
946
|
+
r.value === null ? "–" : a(r.value, n)
|
|
947
947
|
])
|
|
948
948
|
];
|
|
949
|
-
return super.formatTable({ headers:
|
|
949
|
+
return super.formatTable({ headers: o, cells: i });
|
|
950
950
|
}
|
|
951
951
|
// Uses quantize scale to return class names
|
|
952
952
|
getColorClassName(t) {
|
|
@@ -955,36 +955,36 @@ class vt extends T {
|
|
|
955
955
|
setColorClassNames() {
|
|
956
956
|
const t = this.getOptions(), e = u(t, "color", "gradient", "colors"), s = !b(e);
|
|
957
957
|
let a = u(t, "color", "pairing", "option");
|
|
958
|
-
const
|
|
959
|
-
(a < 1 && a > 4 &&
|
|
958
|
+
const n = this.getValueDomain(), o = n[0] < 0 && n[1] > 0 ? "diverge" : "mono";
|
|
959
|
+
(a < 1 && a > 4 && o === "mono" || a < 1 && a > 2 && o === "diverge") && (a = 1);
|
|
960
960
|
const i = s ? e : [];
|
|
961
961
|
if (!s) {
|
|
962
|
-
const c =
|
|
962
|
+
const c = o === "diverge" ? 17 : 11;
|
|
963
963
|
for (let l = 1; l < c + 1; l++)
|
|
964
|
-
i.push(`fill-${
|
|
964
|
+
i.push(`fill-${o}-${a}-${l}`);
|
|
965
965
|
}
|
|
966
|
-
this._colorScale = X().domain(
|
|
967
|
-
const
|
|
968
|
-
this._colorScale = L(this.getDisplayData(),
|
|
966
|
+
this._colorScale = X().domain(n).range(i);
|
|
967
|
+
const r = u(this.getOptions(), "color");
|
|
968
|
+
this._colorScale = L(this.getDisplayData(), r);
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
class Ct extends T {
|
|
972
972
|
getTabularDataArray() {
|
|
973
|
-
const t = this.getOptions(), { groupMapsTo: e } = t.data, { number: s, code: a } = u(this.getOptions(), "locale"),
|
|
973
|
+
const t = this.getOptions(), { groupMapsTo: e } = t.data, { number: s, code: a } = u(this.getOptions(), "locale"), n = this.getBinnedStackedData(), o = [
|
|
974
974
|
C(t, "bins.rangeLabel") || "Range",
|
|
975
|
-
...
|
|
975
|
+
...n.map((r) => C(r, `0.${e}`))
|
|
976
976
|
], i = [
|
|
977
|
-
...C(
|
|
978
|
-
`${s(Number(C(
|
|
979
|
-
Number(C(
|
|
977
|
+
...C(n, 0).map((r, c) => [
|
|
978
|
+
`${s(Number(C(r, "data.x0")), a)} – ${s(
|
|
979
|
+
Number(C(r, "data.x1")),
|
|
980
980
|
a
|
|
981
981
|
)}`,
|
|
982
|
-
...
|
|
982
|
+
...n.map(
|
|
983
983
|
(l) => s(C(l[c], `data.${C(l[c], e)}`), a)
|
|
984
984
|
)
|
|
985
985
|
])
|
|
986
986
|
];
|
|
987
|
-
return super.formatTable({ headers:
|
|
987
|
+
return super.formatTable({ headers: o, cells: i });
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
990
|
class xt extends D {
|
|
@@ -1007,43 +1007,45 @@ class xt extends D {
|
|
|
1007
1007
|
* Get the associated status for the data by checking the ranges
|
|
1008
1008
|
*/
|
|
1009
1009
|
getStatus() {
|
|
1010
|
-
const t = this.getOptions(), e = u(this.getDisplayData()), s = (e == null ? void 0 : e.reduce((
|
|
1011
|
-
if (
|
|
1012
|
-
const
|
|
1010
|
+
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");
|
|
1011
|
+
if (n) {
|
|
1012
|
+
const o = n.filter(
|
|
1013
1013
|
(i) => i.range[0] <= a && a <= i.range[1]
|
|
1014
1014
|
);
|
|
1015
|
-
if (
|
|
1016
|
-
return
|
|
1015
|
+
if (o.length > 0)
|
|
1016
|
+
return o[0].status;
|
|
1017
1017
|
}
|
|
1018
1018
|
return null;
|
|
1019
1019
|
}
|
|
1020
1020
|
getTabularDataArray() {
|
|
1021
|
-
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.getStatus(),
|
|
1022
|
-
let
|
|
1023
|
-
if (
|
|
1021
|
+
const t = this.getDisplayData(), e = this.getOptions(), { groupMapsTo: s } = e.data, a = this.getStatus(), n = u(e, "meter", "proportional"), { number: o, code: i } = u(this.getOptions(), "locale");
|
|
1022
|
+
let r = [], c = [], l;
|
|
1023
|
+
if (n === null) {
|
|
1024
1024
|
l = 100;
|
|
1025
1025
|
const p = t[0];
|
|
1026
|
-
|
|
1026
|
+
r = ["Group", "Value", ...a ? ["Status"] : []], c = [
|
|
1027
1027
|
[
|
|
1028
1028
|
p[s],
|
|
1029
|
-
|
|
1029
|
+
p.value === null ? "–" : o(p.value, i),
|
|
1030
1030
|
...a ? [a] : []
|
|
1031
1031
|
]
|
|
1032
1032
|
];
|
|
1033
1033
|
} else {
|
|
1034
|
-
const p = u(
|
|
1035
|
-
l = p || this.getMaximumDomain(t),
|
|
1034
|
+
const p = u(n, "total");
|
|
1035
|
+
l = p || this.getMaximumDomain(t), r = ["Group", "Value", "Percentage of total"], c = [
|
|
1036
1036
|
...t.map((h) => {
|
|
1037
|
-
|
|
1037
|
+
let g;
|
|
1038
|
+
h.value !== null && h.value !== void 0 ? g = Number(h.value) : g = 0;
|
|
1039
|
+
let m = Number((h.value / l * 100).toFixed(2));
|
|
1038
1040
|
return [
|
|
1039
1041
|
h[s],
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
+
h.value === null ? "–" : o(g, i),
|
|
1043
|
+
o(m, i) + " %"
|
|
1042
1044
|
];
|
|
1043
1045
|
})
|
|
1044
1046
|
];
|
|
1045
1047
|
}
|
|
1046
|
-
return super.formatTable({ headers:
|
|
1048
|
+
return super.formatTable({ headers: r, cells: c });
|
|
1047
1049
|
}
|
|
1048
1050
|
}
|
|
1049
1051
|
class Tt extends T {
|
|
@@ -1051,15 +1053,15 @@ class Tt extends T {
|
|
|
1051
1053
|
super(t);
|
|
1052
1054
|
}
|
|
1053
1055
|
getTabularDataArray() {
|
|
1054
|
-
const t = this.getOptions(), e = this.getGroupedData(), { angle: s, value: a } = u(t, "radar", "axes"), { number:
|
|
1056
|
+
const t = this.getOptions(), e = this.getGroupedData(), { angle: s, value: a } = u(t, "radar", "axes"), { number: n, code: o } = u(t, "locale"), i = u(e, "0", "data").map((l) => l[s]), r = ["Group", ...i], c = [
|
|
1055
1057
|
...e.map((l) => [
|
|
1056
1058
|
l.name,
|
|
1057
1059
|
...i.map(
|
|
1058
|
-
(p, h) => u(l, "data", h, a) !== null ?
|
|
1060
|
+
(p, h) => u(l, "data", h, a) !== null ? n(u(l, "data", h, a), o) : "–"
|
|
1059
1061
|
)
|
|
1060
1062
|
])
|
|
1061
1063
|
];
|
|
1062
|
-
return super.formatTable({ headers:
|
|
1064
|
+
return super.formatTable({ headers: r, cells: c });
|
|
1063
1065
|
}
|
|
1064
1066
|
}
|
|
1065
1067
|
class Ot extends D {
|
|
@@ -1088,12 +1090,16 @@ class At extends D {
|
|
|
1088
1090
|
super(t);
|
|
1089
1091
|
}
|
|
1090
1092
|
getTabularDataArray() {
|
|
1091
|
-
const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale"), a = ["Child", "Group", "Value"],
|
|
1092
|
-
return t.forEach((
|
|
1093
|
-
Array.isArray(
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1093
|
+
const t = this.getDisplayData(), { number: e, code: s } = u(this.getOptions(), "locale"), a = ["Child", "Group", "Value"], n = [];
|
|
1094
|
+
return t.forEach((o) => {
|
|
1095
|
+
Array.isArray(o.children) ? o.children.forEach((i) => {
|
|
1096
|
+
n.push([
|
|
1097
|
+
i.name,
|
|
1098
|
+
o.name,
|
|
1099
|
+
i.value === null ? "–" : e(i.value, s)
|
|
1100
|
+
]);
|
|
1101
|
+
}) : u(o.name) !== null && u(o.value) && n.push(["–", o.name, e(o.value, s)]);
|
|
1102
|
+
}), super.formatTable({ headers: a, cells: n });
|
|
1097
1103
|
}
|
|
1098
1104
|
}
|
|
1099
1105
|
class Gt extends D {
|
|
@@ -1101,14 +1107,14 @@ class Gt extends D {
|
|
|
1101
1107
|
super(t);
|
|
1102
1108
|
}
|
|
1103
1109
|
getTabularDataArray() {
|
|
1104
|
-
const t = this.getDisplayData(), e = this.getOptions(), { fontSizeMapsTo: s, wordMapsTo: a } = e.wordCloud, { groupMapsTo:
|
|
1110
|
+
const t = this.getDisplayData(), e = this.getOptions(), { fontSizeMapsTo: s, wordMapsTo: a } = e.wordCloud, { groupMapsTo: n } = e.data, { code: o, number: i } = u(e, "locale"), r = [e.tooltip.wordLabel, "Group", e.tooltip.valueLabel], c = [
|
|
1105
1111
|
...t.map((l) => [
|
|
1106
1112
|
l[a],
|
|
1107
|
-
l[
|
|
1108
|
-
i(l[s],
|
|
1113
|
+
l[n],
|
|
1114
|
+
i(l[s], o)
|
|
1109
1115
|
])
|
|
1110
1116
|
];
|
|
1111
|
-
return super.formatTable({ headers:
|
|
1117
|
+
return super.formatTable({ headers: r, cells: c });
|
|
1112
1118
|
}
|
|
1113
1119
|
}
|
|
1114
1120
|
export {
|
|
@@ -1129,4 +1135,4 @@ export {
|
|
|
1129
1135
|
Dt as e,
|
|
1130
1136
|
At as f
|
|
1131
1137
|
};
|
|
1132
|
-
//# sourceMappingURL=wordcloud-
|
|
1138
|
+
//# sourceMappingURL=wordcloud-EFHcMnWt.mjs.map
|