@carbon/charts 1.22.14 → 1.22.16
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 +18 -0
- package/dist/{angle-utils-oUqMSPUJ.mjs → angle-utils-CqlSifly.mjs} +86 -86
- package/dist/{angle-utils-oUqMSPUJ.mjs.map → angle-utils-CqlSifly.mjs.map} +1 -1
- package/dist/{array-CpT8VxH2.mjs → array-j65rN_vo.mjs} +2 -2
- package/dist/{array-CpT8VxH2.mjs.map → array-j65rN_vo.mjs.map} +1 -1
- package/dist/{choropleth-DveQIPGG.mjs → choropleth-Ds5Q8kNS.mjs} +960 -979
- package/dist/choropleth-Ds5Q8kNS.mjs.map +1 -0
- package/dist/{color-scale-utils-BfTM18gQ.mjs → color-scale-utils-ycwO-Ibq.mjs} +5 -7
- package/dist/{color-scale-utils-BfTM18gQ.mjs.map → color-scale-utils-ycwO-Ibq.mjs.map} +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/{index-fH71cv3F.mjs → index-CuPdtS0D.mjs} +46 -46
- package/dist/{index-fH71cv3F.mjs.map → index-CuPdtS0D.mjs.map} +1 -1
- package/dist/index.mjs +64 -64
- package/dist/index.mjs.map +1 -1
- package/dist/interfaces/components.d.ts +2 -2
- package/dist/model/index.mjs +2 -2
- package/dist/services/index.mjs +3 -3
- package/dist/umd/bundle.umd.cjs +13 -13
- package/dist/umd/bundle.umd.cjs.map +1 -1
- package/dist/umd/bundle.umd.js +13 -13
- package/package.json +15 -15
- package/dist/choropleth-DveQIPGG.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as e, k as r, X as o, A as t, a8 as i, F as l, B as n, o as d, p as h, C as p, f as u, e as S, r as C, s as c, q as g, a9 as B, D as m, z as T, a7 as L, G as b,
|
|
1
|
+
import { h as e, k as r, X as o, A as t, a8 as i, F as l, B as n, o as d, p as h, C as p, f as u, e as S, r as C, s as c, q as g, a9 as B, D as m, z as T, a7 as L, G as b, v as k, E as A, H as x, I as P, Y as R, b as w, L as G, j as H, K as v, O as M, N as f, M as D, P as Z, Q as j, R as q, l as y, w as z, m as E, J as W, S as F, x as I, t as J, u as K, y as N, g as O, T as Q, a as U, d as V, U as X, V as Y, i as _, W as $, n as aa, Z as sa, _ as ea, $ as ra, a0 as oa, a1 as ta, a2 as ia, a3 as la, a4 as na, a5 as da, a6 as ha } from "../choropleth-Ds5Q8kNS.mjs";
|
|
2
2
|
export {
|
|
3
3
|
e as Alluvial,
|
|
4
4
|
r as Area,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a3 as Lt, aC as Nt, aD as Ct, aE as It, aF as ut, aG as Zt, aH as Ft, aI as zt,
|
|
2
|
-
import { z as ii, A as O,
|
|
3
|
-
import { $ as w, e as _, i as C, S as
|
|
1
|
+
import { a3 as Lt, aC as Nt, aD as Ct, aE as It, aF as ut, aG as Zt, aH as Ft, aI as zt, a0 as Vt, aJ as Ht, aK as Yt, aL as Xt, aM as Gt, _ as $t, W as Ut, ax as q, aN as Kt, aO as qt, n as j, g as c, F as W, aP as T, aQ as M, aR as E, aS as jt, aT as ft, aU as mt, h as J, ar as Wt, ao as Jt, ad as dt, ai as Qt, H as ti } from "./color-scale-utils-ycwO-Ibq.mjs";
|
|
2
|
+
import { z as ii, A as O, e as Q, S as A, D as ei, s as ni, v as si, x as oi, y as ai, u as ri } from "./angle-utils-CqlSifly.mjs";
|
|
3
|
+
import { $ as w, e as _, i as C, S as m } from "./axis-scales-CPuwbFQf.mjs";
|
|
4
4
|
function pt(i) {
|
|
5
5
|
var t = i == null ? 0 : i.length;
|
|
6
6
|
return t ? Lt(i, 1) : [];
|
|
@@ -24,14 +24,14 @@ function _i(i, t) {
|
|
|
24
24
|
function ui(i) {
|
|
25
25
|
return zt(i) ? void 0 : i;
|
|
26
26
|
}
|
|
27
|
-
var fi = 1,
|
|
27
|
+
var fi = 1, mi = 2, di = 4, pi = hi(function(i, t) {
|
|
28
28
|
var e = {};
|
|
29
29
|
if (i == null)
|
|
30
30
|
return e;
|
|
31
31
|
var n = !1;
|
|
32
32
|
t = Vt(t, function(o) {
|
|
33
33
|
return o = ut(o, i), n || (n = o.length > 1), o;
|
|
34
|
-
}), Ht(i, Yt(i), e), n && (e = Xt(e, fi |
|
|
34
|
+
}), Ht(i, Yt(i), e), n && (e = Xt(e, fi | mi | di, ui));
|
|
35
35
|
for (var s = t.length; s--; )
|
|
36
36
|
_i(e, t[s]);
|
|
37
37
|
return e;
|
|
@@ -75,22 +75,22 @@ function Di(i) {
|
|
|
75
75
|
let l = h[0], f = h[h.length - 1];
|
|
76
76
|
const y = f < l;
|
|
77
77
|
y && ([l, f] = [f, l]);
|
|
78
|
-
let p = s(l), v = s(f), g,
|
|
78
|
+
let p = s(l), v = s(f), g, d;
|
|
79
79
|
const D = r == null ? 10 : +r;
|
|
80
80
|
let u = [];
|
|
81
81
|
if (!(n % 1) && v - p < D) {
|
|
82
82
|
if (p = Math.floor(p), v = Math.ceil(v), l > 0) {
|
|
83
83
|
for (; p <= v; ++p)
|
|
84
84
|
for (g = 1; g < n; ++g)
|
|
85
|
-
if (
|
|
86
|
-
if (
|
|
87
|
-
u.push(
|
|
85
|
+
if (d = p < 0 ? g / o(-p) : g * o(p), !(d < l)) {
|
|
86
|
+
if (d > f) break;
|
|
87
|
+
u.push(d);
|
|
88
88
|
}
|
|
89
89
|
} else for (; p <= v; ++p)
|
|
90
90
|
for (g = n - 1; g >= 1; --g)
|
|
91
|
-
if (
|
|
92
|
-
if (
|
|
93
|
-
u.push(
|
|
91
|
+
if (d = p > 0 ? g / o(-p) : g * o(p), !(d < l)) {
|
|
92
|
+
if (d > f) break;
|
|
93
|
+
u.push(d);
|
|
94
94
|
}
|
|
95
95
|
u.length * 2 < D && (u = q(l, f, D));
|
|
96
96
|
} else
|
|
@@ -1005,12 +1005,12 @@ function kt(i, t) {
|
|
|
1005
1005
|
return +T(i) - +T(t);
|
|
1006
1006
|
}
|
|
1007
1007
|
function ht(i, t, e) {
|
|
1008
|
-
const n = kt(i, t) /
|
|
1008
|
+
const n = kt(i, t) / mt;
|
|
1009
1009
|
return G(e == null ? void 0 : e.roundingMethod)(n);
|
|
1010
1010
|
}
|
|
1011
1011
|
function Z(i, t, e) {
|
|
1012
1012
|
const n = T(i, e == null ? void 0 : e.in);
|
|
1013
|
-
return n.setTime(n.getTime() + t *
|
|
1013
|
+
return n.setTime(n.getTime() + t * mt), n;
|
|
1014
1014
|
}
|
|
1015
1015
|
function ct(i, t, e) {
|
|
1016
1016
|
return Z(i, -t, e);
|
|
@@ -1109,7 +1109,7 @@ class re extends A {
|
|
|
1109
1109
|
const e = c(this.model.getOptions(), "axes", t, "domain");
|
|
1110
1110
|
if (e && !Array.isArray(e))
|
|
1111
1111
|
throw new Error(`Domain in ${t} axis is not a valid array`);
|
|
1112
|
-
if (Array.isArray(e) && (this.scaleTypes[t] ===
|
|
1112
|
+
if (Array.isArray(e) && (this.scaleTypes[t] === m.LINEAR || this.scaleTypes[t] === m.TIME) && e.length !== 2)
|
|
1113
1113
|
throw new Error(
|
|
1114
1114
|
`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`
|
|
1115
1115
|
);
|
|
@@ -1162,10 +1162,10 @@ class re extends A {
|
|
|
1162
1162
|
const o = this.model.getOptions(), r = c(o, "axes")[n], { mapsTo: h } = r, l = c(s, h) !== null ? s[h] : s;
|
|
1163
1163
|
let f;
|
|
1164
1164
|
switch (e) {
|
|
1165
|
-
case
|
|
1165
|
+
case m.LABELS:
|
|
1166
1166
|
f = t(l) + t.step() / 2;
|
|
1167
1167
|
break;
|
|
1168
|
-
case
|
|
1168
|
+
case m.TIME:
|
|
1169
1169
|
f = t(new Date(l));
|
|
1170
1170
|
break;
|
|
1171
1171
|
default:
|
|
@@ -1212,7 +1212,7 @@ class re extends A {
|
|
|
1212
1212
|
}
|
|
1213
1213
|
extendsDomain(t, e) {
|
|
1214
1214
|
const n = this.model.getOptions(), s = c(n, "axes", t);
|
|
1215
|
-
if (s.scaleType ===
|
|
1215
|
+
if (s.scaleType === m.TIME) {
|
|
1216
1216
|
const o = c(n, "timeScale", "addSpaceOnEdges");
|
|
1217
1217
|
return Ji(e, o);
|
|
1218
1218
|
} else
|
|
@@ -1233,16 +1233,16 @@ class re extends A {
|
|
|
1233
1233
|
} : { primary: _.BOTTOM, secondary: _.TOP };
|
|
1234
1234
|
}
|
|
1235
1235
|
findDomainAndRangeAxesPositions(t, e) {
|
|
1236
|
-
const n = this.model.getOptions(), s = c(n, "axes", t.primary), o = c(n, "axes", e.primary), a = s.scaleType ||
|
|
1236
|
+
const n = this.model.getOptions(), s = c(n, "axes", t.primary), o = c(n, "axes", e.primary), a = s.scaleType || m.LINEAR, r = o.scaleType || m.LINEAR, h = {
|
|
1237
1237
|
primaryDomainAxisPosition: null,
|
|
1238
1238
|
secondaryDomainAxisPosition: null,
|
|
1239
1239
|
primaryRangeAxisPosition: null,
|
|
1240
1240
|
secondaryRangeAxisPosition: null
|
|
1241
1241
|
};
|
|
1242
|
-
return h.primaryDomainAxisPosition = e.primary, h.primaryRangeAxisPosition = t.primary, h.secondaryDomainAxisPosition = e.secondary, h.secondaryRangeAxisPosition = t.secondary, (!(r ===
|
|
1242
|
+
return h.primaryDomainAxisPosition = e.primary, h.primaryRangeAxisPosition = t.primary, h.secondaryDomainAxisPosition = e.secondary, h.secondaryRangeAxisPosition = t.secondary, (!(r === m.LABELS || r === m.TIME) && a === m.LABELS || a === m.TIME) && (h.primaryDomainAxisPosition = t.primary, h.primaryRangeAxisPosition = e.primary, h.secondaryDomainAxisPosition = t.secondary, h.secondaryRangeAxisPosition = e.secondary), h;
|
|
1243
1243
|
}
|
|
1244
1244
|
getScaleDomain(t) {
|
|
1245
|
-
const e = this.model.getOptions(), n = c(e, "axes", t), s = c(e, "bounds"), { includeZero: o } = n, a = c(n, "scaleType") ||
|
|
1245
|
+
const e = this.model.getOptions(), n = c(e, "axes", t), s = c(e, "bounds"), { includeZero: o } = n, a = c(n, "scaleType") || m.LINEAR;
|
|
1246
1246
|
if (this.model.isDataEmpty())
|
|
1247
1247
|
return [];
|
|
1248
1248
|
if (n.binned) {
|
|
@@ -1254,22 +1254,22 @@ class re extends A {
|
|
|
1254
1254
|
}
|
|
1255
1255
|
const r = this.model.getDisplayData(), { extendLinearDomainBy: h, mapsTo: l, percentage: f, thresholds: y } = n, { reference: p, compareTo: v } = J.ratio;
|
|
1256
1256
|
if (n.domain)
|
|
1257
|
-
return a ===
|
|
1257
|
+
return a === m.LABELS ? n.domain : (a === m.TIME && (n.domain = n.domain.map(
|
|
1258
1258
|
(u) => u.getTime === void 0 ? new Date(u) : u
|
|
1259
1259
|
)), this.extendsDomain(t, n.domain));
|
|
1260
1260
|
if (f)
|
|
1261
1261
|
return [0, 100];
|
|
1262
|
-
if (n && a ===
|
|
1262
|
+
if (n && a === m.LABELS)
|
|
1263
1263
|
return Jt(r.map((u) => u[l]));
|
|
1264
|
-
let g,
|
|
1264
|
+
let g, d;
|
|
1265
1265
|
const D = this.model.getDataGroupNames();
|
|
1266
|
-
if (a ===
|
|
1266
|
+
if (a === m.LABELS_RATIO)
|
|
1267
1267
|
return r.map((u) => `${u[p]}/${u[v]}`);
|
|
1268
|
-
if (a ===
|
|
1269
|
-
|
|
1268
|
+
if (a === m.TIME)
|
|
1269
|
+
d = r.map((u) => +new Date(u[l]));
|
|
1270
1270
|
else if (s && e.axes)
|
|
1271
|
-
|
|
1272
|
-
|
|
1271
|
+
d = [], r.forEach((u) => {
|
|
1272
|
+
d.push(u[l]), u[s.upperBoundMapsTo] && d.push(u[s.upperBoundMapsTo]), u[s.lowerBoundMapsTo] && d.push(u[s.lowerBoundMapsTo]);
|
|
1273
1273
|
});
|
|
1274
1274
|
else if (n.stacked === !0 && D && t === this.getRangeAxisPosition()) {
|
|
1275
1275
|
const { groupMapsTo: u } = e.data, x = this.model.getDataValuesGroupedByKeys({
|
|
@@ -1283,28 +1283,28 @@ class re extends A {
|
|
|
1283
1283
|
Object.values(pi(Bt, "sharedStackKey")).forEach((P) => {
|
|
1284
1284
|
isNaN(P) || (P < 0 ? K += P : U += P);
|
|
1285
1285
|
}), $.push([K, U]);
|
|
1286
|
-
}),
|
|
1286
|
+
}), d = [
|
|
1287
1287
|
...pt($),
|
|
1288
1288
|
...Rt.map((b) => b[l])
|
|
1289
1289
|
];
|
|
1290
1290
|
} else
|
|
1291
|
-
|
|
1291
|
+
d = [], r.forEach((u) => {
|
|
1292
1292
|
const x = u[l];
|
|
1293
|
-
Array.isArray(x) && x.length === 2 ? (
|
|
1293
|
+
Array.isArray(x) && x.length === 2 ? (d.push(x[0]), d.push(x[1])) : (h && d.push(Math.max(u[l], u[h])), d.push(x));
|
|
1294
1294
|
});
|
|
1295
|
-
return a !==
|
|
1295
|
+
return a !== m.TIME && a !== m.LOG && o && d.push(0), y && y.length > 0 && y.forEach((u) => {
|
|
1296
1296
|
const x = c(u, "value");
|
|
1297
|
-
x !== null &&
|
|
1298
|
-
}), g =
|
|
1297
|
+
x !== null && d.push(x);
|
|
1298
|
+
}), g = dt(d), g = this.extendsDomain(t, g), g;
|
|
1299
1299
|
}
|
|
1300
1300
|
createScale(t) {
|
|
1301
1301
|
const e = this.model.getOptions(), n = c(e, "axes", t);
|
|
1302
1302
|
if (!n)
|
|
1303
1303
|
return null;
|
|
1304
|
-
const s = c(n, "scaleType") ||
|
|
1304
|
+
const s = c(n, "scaleType") || m.LINEAR;
|
|
1305
1305
|
this.scaleTypes[t] = s;
|
|
1306
1306
|
let o;
|
|
1307
|
-
return s ===
|
|
1307
|
+
return s === m.TIME ? o = si() : s === m.LOG ? o = xt().base(n.base || 10) : s === m.LABELS || s === m.LABELS_RATIO ? o = oi() : o = Qt(), o.domain(this.getScaleDomain(t)), o;
|
|
1308
1308
|
}
|
|
1309
1309
|
getDomainLowerBound(t) {
|
|
1310
1310
|
let e, n = 0;
|
|
@@ -1315,7 +1315,7 @@ class re extends A {
|
|
|
1315
1315
|
if (!Array.isArray(n) || Array.isArray(n) && !n.length)
|
|
1316
1316
|
return null;
|
|
1317
1317
|
const s = this.getDomainScale(), o = n.sort((r, h) => h.value - r.value)[0];
|
|
1318
|
-
return this.getScaleTypeByPosition(e) ===
|
|
1318
|
+
return this.getScaleTypeByPosition(e) === m.TIME && (typeof o.value == "string" || o.value.getTime === void 0) && (o.value = new Date(o.value)), {
|
|
1319
1319
|
threshold: o,
|
|
1320
1320
|
scaleValue: s(o.value)
|
|
1321
1321
|
};
|
|
@@ -1344,7 +1344,7 @@ function Ji(i, t) {
|
|
|
1344
1344
|
function Qi([i, t], e, n) {
|
|
1345
1345
|
const o = (t - i) * e, a = t <= 0 && t + o > 0 ? 0 : t + o;
|
|
1346
1346
|
let r = i >= 0 && i - o < 0 ? 0 : i - o;
|
|
1347
|
-
if (n ===
|
|
1347
|
+
if (n === m.LOG && r <= 0) {
|
|
1348
1348
|
if (i <= 0)
|
|
1349
1349
|
throw Error("Data must have values greater than 0 if log scale type is used.");
|
|
1350
1350
|
r = i;
|
|
@@ -1354,8 +1354,8 @@ function Qi([i, t], e, n) {
|
|
|
1354
1354
|
class he extends A {
|
|
1355
1355
|
constructor() {
|
|
1356
1356
|
super(...arguments), this.curveTypes = {
|
|
1357
|
-
curveLinear:
|
|
1358
|
-
curveLinearClosed:
|
|
1357
|
+
curveLinear: ri,
|
|
1358
|
+
curveLinearClosed: ai,
|
|
1359
1359
|
curveBasis: Ai,
|
|
1360
1360
|
curveBasisClosed: Oi,
|
|
1361
1361
|
curveBasisOpen: Mi,
|
|
@@ -1397,7 +1397,7 @@ class ce extends A {
|
|
|
1397
1397
|
t,
|
|
1398
1398
|
"scaleType"
|
|
1399
1399
|
);
|
|
1400
|
-
return t === _.BOTTOM && e ===
|
|
1400
|
+
return t === _.BOTTOM && e === m.TIME;
|
|
1401
1401
|
}
|
|
1402
1402
|
// get display data for zoom bar
|
|
1403
1403
|
// basically it's sum of value grouped by time
|
|
@@ -1415,7 +1415,7 @@ class ce extends A {
|
|
|
1415
1415
|
if (!s) throw new Error("Not defined: mainXAxisPosition");
|
|
1416
1416
|
return n.extendsDomain(
|
|
1417
1417
|
s,
|
|
1418
|
-
|
|
1418
|
+
dt(e, (r) => r[o])
|
|
1419
1419
|
);
|
|
1420
1420
|
}
|
|
1421
1421
|
handleDomainChange(t, e = { dispatchEvent: !0 }) {
|
|
@@ -1501,9 +1501,9 @@ export {
|
|
|
1501
1501
|
oe as F,
|
|
1502
1502
|
ae as T,
|
|
1503
1503
|
ce as Z,
|
|
1504
|
-
|
|
1504
|
+
he as a,
|
|
1505
1505
|
ci as b,
|
|
1506
|
-
|
|
1506
|
+
re as c,
|
|
1507
1507
|
pt as f
|
|
1508
1508
|
};
|
|
1509
|
-
//# sourceMappingURL=index-
|
|
1509
|
+
//# sourceMappingURL=index-CuPdtS0D.mjs.map
|