@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.
- package/CHANGELOG.md +22 -0
- package/dist/{_baseEach-L1oeNjGL.mjs → _baseEach-hXZ_iCmx.mjs} +2 -2
- package/dist/{_baseEach-L1oeNjGL.mjs.map → _baseEach-hXZ_iCmx.mjs.map} +1 -1
- package/dist/{angle-utils-rmLYuzkJ.mjs → angle-utils-A-okg7PT.mjs} +2 -2
- package/dist/{angle-utils-rmLYuzkJ.mjs.map → angle-utils-A-okg7PT.mjs.map} +1 -1
- package/dist/{choropleth-RkB2BywS.mjs → choropleth-s-WBhiE4.mjs} +4 -4
- package/dist/{choropleth-RkB2BywS.mjs.map → choropleth-s-WBhiE4.mjs.map} +1 -1
- package/dist/{color-scale-utils-GLd1MML3.mjs → color-scale-utils-H9cC5d7N.mjs} +40 -40
- package/dist/{color-scale-utils-GLd1MML3.mjs.map → color-scale-utils-H9cC5d7N.mjs.map} +1 -1
- package/dist/components/index.mjs +4 -4
- package/dist/demo/index.mjs +5 -5
- package/dist/index.mjs +24 -24
- package/dist/interfaces/charts.d.ts +5 -1
- package/dist/interfaces/components.d.ts +13 -0
- package/dist/model/binned-charts.d.ts +1 -1
- package/dist/model/boxplot.d.ts +1 -1
- package/dist/model/circle-pack.d.ts +1 -1
- package/dist/model/index.mjs +3 -3
- package/dist/model/meter.d.ts +1 -2
- package/dist/model/model.d.ts +4 -0
- package/dist/model/radar.d.ts +1 -1
- package/dist/model/tree.d.ts +1 -1
- package/dist/model/treemap.d.ts +1 -1
- package/dist/services/index.mjs +3 -3
- package/dist/umd/bundle.umd.js +14 -14
- package/dist/umd/bundle.umd.js.map +1 -1
- package/dist/{wordcloud-XkAQGXwu.mjs → wordcloud-je962F3R.mjs} +354 -362
- package/dist/wordcloud-je962F3R.mjs.map +1 -0
- package/dist/{zoom-LC_awnen.mjs → zoom-_zg_D2pq.mjs} +132 -132
- package/dist/zoom-_zg_D2pq.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/wordcloud-XkAQGXwu.mjs.map +0 -1
- package/dist/zoom-LC_awnen.mjs.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { bin as
|
|
2
|
-
import { o as
|
|
3
|
-
import { S as
|
|
4
|
-
import { b as tt } from "./_baseEach-
|
|
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,
|
|
7
|
-
var
|
|
8
|
-
t(s,
|
|
6
|
+
for (var a = -1, n = h == null ? 0 : h.length; ++a < n; ) {
|
|
7
|
+
var o = h[a];
|
|
8
|
+
t(s, o, e(o), h);
|
|
9
9
|
}
|
|
10
10
|
return s;
|
|
11
11
|
}
|
|
12
12
|
function st(h, t, e, s) {
|
|
13
|
-
return tt(h, function(a,
|
|
14
|
-
t(s, a, e(a),
|
|
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 =
|
|
20
|
-
return a(e, h, Q(s),
|
|
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
|
|
31
|
-
|
|
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 =
|
|
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
|
|
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:
|
|
50
|
-
return t && (s = s.filter((
|
|
51
|
-
const r = i
|
|
52
|
-
if ((
|
|
53
|
-
...
|
|
54
|
-
[r]:
|
|
55
|
-
}))), r && i
|
|
56
|
-
if (
|
|
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
|
-
(
|
|
66
|
+
(l) => o[i].domain.includes(l[r])
|
|
59
67
|
);
|
|
60
68
|
else {
|
|
61
|
-
const [
|
|
69
|
+
const [l, p] = o[i].domain;
|
|
62
70
|
s = s.filter(
|
|
63
|
-
(
|
|
71
|
+
(d) => !(r in d) || d[r] >= l && d[r] <= p
|
|
64
72
|
);
|
|
65
73
|
}
|
|
66
|
-
}), s.filter((
|
|
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 } =
|
|
76
|
-
return this.getAllDataFromDomain(t).filter((
|
|
77
|
-
(
|
|
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 } =
|
|
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(),
|
|
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
|
-
|
|
124
|
+
c[c.length - 1].x1 = i[i.length - 1];
|
|
117
125
|
else {
|
|
118
|
-
const
|
|
119
|
-
|
|
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
|
|
122
|
-
return
|
|
123
|
-
const
|
|
124
|
-
p.forEach((
|
|
125
|
-
|
|
126
|
-
group:
|
|
127
|
-
key:
|
|
128
|
-
value:
|
|
129
|
-
bin:
|
|
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:
|
|
134
|
-
binsDomain:
|
|
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(),
|
|
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)(
|
|
142
|
-
const
|
|
143
|
-
return
|
|
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((
|
|
149
|
-
const
|
|
150
|
-
s[
|
|
151
|
-
}), Object.keys(s).map((
|
|
152
|
-
name:
|
|
153
|
-
data: s[
|
|
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
|
|
159
|
-
t ?
|
|
166
|
+
let n;
|
|
167
|
+
t ? n = t.map((r) => `${r.x0}:${r.x1}`) : n = E(
|
|
160
168
|
a.map((r) => {
|
|
161
|
-
const
|
|
162
|
-
return r[
|
|
169
|
+
const c = this.services.cartesianScales.getDomainIdentifier(r);
|
|
170
|
+
return r[c] instanceof Date ? N(r[c]) : r[c] && typeof r[c].toString == "function" ? r[c].toString() : r[c];
|
|
163
171
|
})
|
|
164
172
|
);
|
|
165
|
-
const
|
|
166
|
-
return
|
|
167
|
-
const
|
|
168
|
-
return
|
|
169
|
-
}) : (
|
|
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,
|
|
173
|
-
return t ?
|
|
174
|
-
const [
|
|
175
|
-
return
|
|
176
|
-
p[
|
|
177
|
-
(
|
|
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
|
-
}) :
|
|
181
|
-
const
|
|
182
|
-
return
|
|
183
|
-
const p =
|
|
184
|
-
const
|
|
185
|
-
return
|
|
186
|
-
}),
|
|
187
|
-
l
|
|
188
|
-
}),
|
|
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:
|
|
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
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
l
|
|
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
|
-
}),
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
l
|
|
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(
|
|
209
|
-
const
|
|
210
|
-
return
|
|
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 } =
|
|
254
|
-
if (
|
|
255
|
-
if (
|
|
256
|
-
a.forEach((
|
|
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
|
|
261
|
-
a[
|
|
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((
|
|
265
|
-
a[p].status =
|
|
272
|
+
a.forEach((l, p) => {
|
|
273
|
+
a[p].status = l.name === t ? e : s;
|
|
266
274
|
});
|
|
267
|
-
const
|
|
268
|
-
a.some((
|
|
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
|
|
283
|
-
return
|
|
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(),
|
|
287
|
-
return a.getFillColor ? a.getFillColor(t, e, s,
|
|
294
|
+
const a = this.getOptions(), n = u(this.colorScale, t);
|
|
295
|
+
return a.getFillColor ? a.getFillColor(t, e, s, n) : n;
|
|
288
296
|
}
|
|
289
297
|
getStrokeColor(t, e, s) {
|
|
290
|
-
const a = this.getOptions(),
|
|
291
|
-
return a.getStrokeColor ? a.getStrokeColor(t, e, s,
|
|
298
|
+
const a = this.getOptions(), n = u(this.colorScale, t);
|
|
299
|
+
return a.getStrokeColor ? a.getStrokeColor(t, e, s, n) : n;
|
|
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((
|
|
325
|
-
|
|
332
|
+
return s.forEach((n) => {
|
|
333
|
+
n.data.forEach((o, i) => {
|
|
326
334
|
let r;
|
|
327
|
-
const
|
|
328
|
-
if (
|
|
329
|
-
const p = u(a,
|
|
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 =
|
|
333
|
-
const
|
|
340
|
+
r = c;
|
|
341
|
+
const l = {
|
|
334
342
|
group: r,
|
|
335
|
-
key: a[
|
|
343
|
+
key: a[i]
|
|
336
344
|
};
|
|
337
|
-
isNaN(
|
|
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
|
-
(
|
|
347
|
-
).map((
|
|
354
|
+
(o) => o.map((i) => `"${(i === "–" ? "–" : 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
|
|
351
|
-
typeof
|
|
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 } =
|
|
369
|
-
|
|
370
|
-
(
|
|
371
|
-
) || (
|
|
372
|
-
const
|
|
373
|
-
return
|
|
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:
|
|
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 =
|
|
400
|
-
s = s <= a[
|
|
401
|
-
const
|
|
402
|
-
(r,
|
|
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(
|
|
412
|
+
this.colorClassNames = L().range(i).domain(this.allDataGroups);
|
|
405
413
|
}
|
|
406
414
|
}
|
|
407
|
-
class T extends
|
|
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 =
|
|
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
|
-
(
|
|
423
|
-
const
|
|
424
|
-
t.scales[
|
|
425
|
-
position:
|
|
426
|
-
label: t.getScaleLabel(
|
|
427
|
-
identifier: u(e, "axes",
|
|
428
|
-
} : a[
|
|
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, {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
],
|
|
443
|
-
...
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
g[r.identifier] === null || isNaN(g[r.identifier]) ? "–" : 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 ? "–" : l[a.identifier],
|
|
450
|
+
l[n.identifier] === null || isNaN(l[n.identifier]) ? "–" : l[n.identifier].toLocaleString(),
|
|
451
|
+
...o ? [
|
|
452
|
+
l[o.identifier] === null ? "–" : l[o.identifier]
|
|
453
|
+
] : [],
|
|
454
|
+
...i ? [
|
|
455
|
+
l[i.identifier] === null || isNaN(l[i.identifier]) ? "–" : 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",
|
|
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
|
-
|
|
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
|
|
478
|
-
let
|
|
479
|
-
|
|
480
|
-
let
|
|
481
|
-
const
|
|
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[
|
|
484
|
-
}),
|
|
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(
|
|
498
|
-
const
|
|
499
|
-
if (
|
|
500
|
-
const
|
|
501
|
-
(
|
|
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((
|
|
505
|
-
u(a,
|
|
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
|
-
|
|
520
|
-
|
|
521
|
-
...t.map((
|
|
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
|
|
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:
|
|
532
|
-
q_50:
|
|
533
|
-
q_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:
|
|
539
|
-
const
|
|
540
|
-
[e]:
|
|
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
|
-
},
|
|
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 <
|
|
548
|
-
|
|
549
|
-
const q = P(
|
|
550
|
-
|
|
551
|
-
min: q || P([
|
|
552
|
-
max: I || k([
|
|
553
|
-
}, a.push(
|
|
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 = ["–"]), [
|
|
@@ -568,21 +571,22 @@ class Dt extends T {
|
|
|
568
571
|
u(o, "quartiles", "q_75") !== null ? u(o, "quartiles", "q_75").toLocaleString() : "–",
|
|
569
572
|
u(o, "whiskers", "max") !== null ? u(o, "whiskers", "max").toLocaleString() : "–",
|
|
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() : "–",
|
|
571
|
-
i.map((
|
|
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 =
|
|
583
|
+
const a = R.pairingOptions;
|
|
580
584
|
s = s <= a["1-color"] ? s : 1;
|
|
581
|
-
const
|
|
582
|
-
this.colorClassNames = L().range(
|
|
585
|
+
const n = this.allDataGroups.map(() => `1-${s}-1`);
|
|
586
|
+
this.colorClassNames = L().range(n).domain(this.allDataGroups);
|
|
583
587
|
}
|
|
584
588
|
}
|
|
585
|
-
class
|
|
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(),
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
u(n, "marker") === null ? "–" : `${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 ? "–" : r.value,
|
|
613
|
+
u(r, "marker") === null ? "–" : r.marker,
|
|
614
|
+
u(r, "marker") === null ? "–" : `${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
|
|
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
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
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 ? "–" : 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 =
|
|
667
|
+
this._colorScale = $(this.getDisplayData(), t);
|
|
666
668
|
}
|
|
667
669
|
}
|
|
668
|
-
class yt extends
|
|
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(),
|
|
680
|
+
const a = this.getHierarchyLevel(), n = u(e, "circlePack", "hierarchyLevel");
|
|
679
681
|
this.set({
|
|
680
682
|
options: _(e, s),
|
|
681
|
-
depth:
|
|
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
|
|
689
|
-
return a.some((
|
|
690
|
-
if (
|
|
691
|
-
return
|
|
692
|
-
}), u(s, "canvasZoom", "enabled") === !0 &&
|
|
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((
|
|
719
|
-
const
|
|
720
|
-
return this.setChildrenDataGroup(
|
|
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 = [
|
|
739
|
-
return t.forEach((
|
|
740
|
-
let
|
|
741
|
-
|
|
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(["–", 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
|
|
754
|
-
return t.forEach((
|
|
755
|
-
const
|
|
755
|
+
const n = e;
|
|
756
|
+
return t.forEach((o) => {
|
|
757
|
+
const i = o.name;
|
|
756
758
|
let r = 0;
|
|
757
|
-
if (
|
|
758
|
-
|
|
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
|
|
761
|
-
typeof
|
|
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
|
|
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 ? "–" : 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
|
|
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 ? "–" : o.value.toLocaleString()
|
|
804
803
|
])
|
|
805
804
|
];
|
|
805
|
+
return super.formatTable({ headers: a, cells: n });
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
|
-
class
|
|
808
|
+
class xt extends T {
|
|
809
809
|
constructor(t) {
|
|
810
|
-
super(t), this.axisFlavor =
|
|
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") !==
|
|
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(),
|
|
842
|
-
if (
|
|
843
|
-
return
|
|
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((
|
|
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(),
|
|
859
|
-
if (
|
|
860
|
-
return
|
|
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((
|
|
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(),
|
|
876
|
-
e.forEach((
|
|
877
|
-
o
|
|
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((
|
|
882
|
-
this._matrix[
|
|
883
|
-
}), this.getDisplayData().forEach((
|
|
884
|
-
this._matrix[
|
|
885
|
-
value:
|
|
886
|
-
index:
|
|
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(),
|
|
910
|
-
return t.forEach((
|
|
911
|
-
e.forEach((
|
|
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[
|
|
914
|
-
index: this._matrix[
|
|
913
|
+
value: this._matrix[o][i].value,
|
|
914
|
+
index: this._matrix[o][i].index
|
|
915
915
|
};
|
|
916
|
-
r[s] =
|
|
916
|
+
r[s] = o, r[a] = i, n.push(r);
|
|
917
917
|
});
|
|
918
|
-
}),
|
|
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 ? "–" : o[e.identifier],
|
|
930
928
|
o[s.identifier] === null ? "–" : 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
|
|
943
|
-
(a < 1 && a > 4 &&
|
|
944
|
-
const
|
|
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
|
|
947
|
-
for (let
|
|
948
|
-
|
|
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 =
|
|
949
|
+
this._colorScale = H().domain(n).range(i);
|
|
951
950
|
const r = u(this.getOptions(), "color");
|
|
952
|
-
this._colorScale =
|
|
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
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
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
|
|
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((
|
|
991
|
-
if (
|
|
992
|
-
const
|
|
993
|
-
(
|
|
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 (
|
|
996
|
-
return
|
|
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(),
|
|
1002
|
-
let i = [],
|
|
1003
|
-
if (
|
|
1004
|
-
|
|
1005
|
-
const
|
|
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
|
|
1012
|
-
|
|
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 /
|
|
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
|
|
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"),
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
...o.map(
|
|
1035
|
-
(r, l) => u(n, "data", l, a) !== null ? u(n, "data", l, a).toLocaleString() : "–"
|
|
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() : "–"
|
|
1036
1028
|
)
|
|
1037
1029
|
])
|
|
1038
1030
|
];
|
|
1031
|
+
return super.formatTable({ headers: o, cells: i });
|
|
1039
1032
|
}
|
|
1040
1033
|
}
|
|
1041
|
-
class
|
|
1034
|
+
class St extends D {
|
|
1042
1035
|
constructor(t) {
|
|
1043
1036
|
super(t);
|
|
1044
1037
|
}
|
|
1045
1038
|
getTabularDataArray() {
|
|
1046
|
-
const t = this.getDisplayData(), e = [
|
|
1047
|
-
return t.forEach((
|
|
1048
|
-
this.getChildrenDatums(
|
|
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, "–"]);
|
|
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
|
|
1055
|
+
class At extends D {
|
|
1063
1056
|
constructor(t) {
|
|
1064
1057
|
super(t);
|
|
1065
1058
|
}
|
|
1066
1059
|
getTabularDataArray() {
|
|
1067
|
-
const t = this.getDisplayData(), e = [
|
|
1068
|
-
return t.forEach((
|
|
1069
|
-
Array.isArray(
|
|
1070
|
-
|
|
1071
|
-
}) : u(
|
|
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
|
|
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:
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
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
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
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
|
-
|
|
1100
|
-
|
|
1091
|
+
Ot as R,
|
|
1092
|
+
St as T,
|
|
1101
1093
|
Gt as W,
|
|
1102
|
-
|
|
1094
|
+
mt as a,
|
|
1103
1095
|
Tt as b,
|
|
1104
1096
|
T as c,
|
|
1105
|
-
|
|
1097
|
+
Dt as d,
|
|
1106
1098
|
yt as e,
|
|
1107
1099
|
At as f
|
|
1108
1100
|
};
|
|
1109
|
-
//# sourceMappingURL=wordcloud-
|
|
1101
|
+
//# sourceMappingURL=wordcloud-je962F3R.mjs.map
|