@carbon/charts 1.22.13 → 1.22.14

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.
@@ -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, x 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, t as I, y as J, v as K, u 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-CAi734x5.mjs";
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, x 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, t as I, y as J, v as K, u 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-DveQIPGG.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, a2 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-Bxw257YA.mjs";
2
- import { z as ii, A as O, g as Q, S as A, D as ei, s as ni, v as si, x as oi, u as ai, y as ri } from "./angle-utils-Cxvps4Hd.mjs";
3
- import { $ as w, e as _, i as C, S as m } from "./axis-scales-CPuwbFQf.mjs";
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, a2 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 dt, h as J, ar as Wt, ao as Jt, ad as mt, ai as Qt, H as ti } from "./color-scale-utils-BfTM18gQ.mjs";
2
+ import { z as ii, A as O, g as Q, S as A, D as ei, s as ni, v as si, x as oi, u as ai, y as ri } from "./angle-utils-oUqMSPUJ.mjs";
3
+ import { $ as w, e as _, i as C, S as d } 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, mi = 2, di = 4, pi = hi(function(i, t) {
27
+ var fi = 1, di = 2, mi = 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 | mi | di, ui));
34
+ }), Ht(i, Yt(i), e), n && (e = Xt(e, fi | di | mi, 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, d;
78
+ let p = s(l), v = s(f), g, m;
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 (d = p < 0 ? g / o(-p) : g * o(p), !(d < l)) {
86
- if (d > f) break;
87
- u.push(d);
85
+ if (m = p < 0 ? g / o(-p) : g * o(p), !(m < l)) {
86
+ if (m > f) break;
87
+ u.push(m);
88
88
  }
89
89
  } else for (; p <= v; ++p)
90
90
  for (g = n - 1; g >= 1; --g)
91
- if (d = p > 0 ? g / o(-p) : g * o(p), !(d < l)) {
92
- if (d > f) break;
93
- u.push(d);
91
+ if (m = p > 0 ? g / o(-p) : g * o(p), !(m < l)) {
92
+ if (m > f) break;
93
+ u.push(m);
94
94
  }
95
95
  u.length * 2 < D && (u = q(l, f, D));
96
96
  } else
@@ -139,6 +139,7 @@ L.prototype = {
139
139
  switch (this._point) {
140
140
  case 3:
141
141
  k(this, this._x1, this._y1);
142
+ // falls through
142
143
  case 2:
143
144
  this._context.lineTo(this._x1, this._y1);
144
145
  break;
@@ -155,6 +156,7 @@ L.prototype = {
155
156
  break;
156
157
  case 2:
157
158
  this._point = 3, this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
159
+ // falls through
158
160
  default:
159
161
  k(this, i, t);
160
162
  break;
@@ -242,6 +244,7 @@ yt.prototype = {
242
244
  break;
243
245
  case 3:
244
246
  this._point = 4;
247
+ // falls through
245
248
  default:
246
249
  k(this, i, t);
247
250
  break;
@@ -325,6 +328,7 @@ z.prototype = {
325
328
  break;
326
329
  case 2:
327
330
  this._point = 3;
331
+ // falls through
328
332
  default:
329
333
  R(this, i, t);
330
334
  break;
@@ -420,6 +424,7 @@ H.prototype = {
420
424
  break;
421
425
  case 3:
422
426
  this._point = 4;
427
+ // falls through
423
428
  default:
424
429
  R(this, i, t);
425
430
  break;
@@ -485,6 +490,7 @@ Tt.prototype = {
485
490
  break;
486
491
  case 2:
487
492
  this._point = 3;
493
+ // falls through
488
494
  default:
489
495
  Y(this, i, t);
490
496
  break;
@@ -588,6 +594,7 @@ At.prototype = {
588
594
  break;
589
595
  case 3:
590
596
  this._point = 4;
597
+ // falls through
591
598
  default:
592
599
  Y(this, i, t);
593
600
  break;
@@ -753,6 +760,7 @@ N.prototype = {
753
760
  break;
754
761
  case 1:
755
762
  this._point = 2;
763
+ // falls through
756
764
  default: {
757
765
  if (this._t <= 0)
758
766
  this._context.lineTo(this._x, t), this._context.lineTo(i, t);
@@ -997,12 +1005,12 @@ function kt(i, t) {
997
1005
  return +T(i) - +T(t);
998
1006
  }
999
1007
  function ht(i, t, e) {
1000
- const n = kt(i, t) / mt;
1008
+ const n = kt(i, t) / dt;
1001
1009
  return G(e == null ? void 0 : e.roundingMethod)(n);
1002
1010
  }
1003
1011
  function Z(i, t, e) {
1004
1012
  const n = T(i, e == null ? void 0 : e.in);
1005
- return n.setTime(n.getTime() + t * mt), n;
1013
+ return n.setTime(n.getTime() + t * dt), n;
1006
1014
  }
1007
1015
  function ct(i, t, e) {
1008
1016
  return Z(i, -t, e);
@@ -1101,7 +1109,7 @@ class re extends A {
1101
1109
  const e = c(this.model.getOptions(), "axes", t, "domain");
1102
1110
  if (e && !Array.isArray(e))
1103
1111
  throw new Error(`Domain in ${t} axis is not a valid array`);
1104
- if (Array.isArray(e) && (this.scaleTypes[t] === m.LINEAR || this.scaleTypes[t] === m.TIME) && e.length !== 2)
1112
+ if (Array.isArray(e) && (this.scaleTypes[t] === d.LINEAR || this.scaleTypes[t] === d.TIME) && e.length !== 2)
1105
1113
  throw new Error(
1106
1114
  `There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`
1107
1115
  );
@@ -1154,10 +1162,10 @@ class re extends A {
1154
1162
  const o = this.model.getOptions(), r = c(o, "axes")[n], { mapsTo: h } = r, l = c(s, h) !== null ? s[h] : s;
1155
1163
  let f;
1156
1164
  switch (e) {
1157
- case m.LABELS:
1165
+ case d.LABELS:
1158
1166
  f = t(l) + t.step() / 2;
1159
1167
  break;
1160
- case m.TIME:
1168
+ case d.TIME:
1161
1169
  f = t(new Date(l));
1162
1170
  break;
1163
1171
  default:
@@ -1204,7 +1212,7 @@ class re extends A {
1204
1212
  }
1205
1213
  extendsDomain(t, e) {
1206
1214
  const n = this.model.getOptions(), s = c(n, "axes", t);
1207
- if (s.scaleType === m.TIME) {
1215
+ if (s.scaleType === d.TIME) {
1208
1216
  const o = c(n, "timeScale", "addSpaceOnEdges");
1209
1217
  return Ji(e, o);
1210
1218
  } else
@@ -1225,16 +1233,16 @@ class re extends A {
1225
1233
  } : { primary: _.BOTTOM, secondary: _.TOP };
1226
1234
  }
1227
1235
  findDomainAndRangeAxesPositions(t, e) {
1228
- 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 = {
1236
+ const n = this.model.getOptions(), s = c(n, "axes", t.primary), o = c(n, "axes", e.primary), a = s.scaleType || d.LINEAR, r = o.scaleType || d.LINEAR, h = {
1229
1237
  primaryDomainAxisPosition: null,
1230
1238
  secondaryDomainAxisPosition: null,
1231
1239
  primaryRangeAxisPosition: null,
1232
1240
  secondaryRangeAxisPosition: null
1233
1241
  };
1234
- 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;
1242
+ return h.primaryDomainAxisPosition = e.primary, h.primaryRangeAxisPosition = t.primary, h.secondaryDomainAxisPosition = e.secondary, h.secondaryRangeAxisPosition = t.secondary, (!(r === d.LABELS || r === d.TIME) && a === d.LABELS || a === d.TIME) && (h.primaryDomainAxisPosition = t.primary, h.primaryRangeAxisPosition = e.primary, h.secondaryDomainAxisPosition = t.secondary, h.secondaryRangeAxisPosition = e.secondary), h;
1235
1243
  }
1236
1244
  getScaleDomain(t) {
1237
- const e = this.model.getOptions(), n = c(e, "axes", t), s = c(e, "bounds"), { includeZero: o } = n, a = c(n, "scaleType") || m.LINEAR;
1245
+ const e = this.model.getOptions(), n = c(e, "axes", t), s = c(e, "bounds"), { includeZero: o } = n, a = c(n, "scaleType") || d.LINEAR;
1238
1246
  if (this.model.isDataEmpty())
1239
1247
  return [];
1240
1248
  if (n.binned) {
@@ -1246,22 +1254,22 @@ class re extends A {
1246
1254
  }
1247
1255
  const r = this.model.getDisplayData(), { extendLinearDomainBy: h, mapsTo: l, percentage: f, thresholds: y } = n, { reference: p, compareTo: v } = J.ratio;
1248
1256
  if (n.domain)
1249
- return a === m.LABELS ? n.domain : (a === m.TIME && (n.domain = n.domain.map(
1257
+ return a === d.LABELS ? n.domain : (a === d.TIME && (n.domain = n.domain.map(
1250
1258
  (u) => u.getTime === void 0 ? new Date(u) : u
1251
1259
  )), this.extendsDomain(t, n.domain));
1252
1260
  if (f)
1253
1261
  return [0, 100];
1254
- if (n && a === m.LABELS)
1262
+ if (n && a === d.LABELS)
1255
1263
  return Jt(r.map((u) => u[l]));
1256
- let g, d;
1264
+ let g, m;
1257
1265
  const D = this.model.getDataGroupNames();
1258
- if (a === m.LABELS_RATIO)
1266
+ if (a === d.LABELS_RATIO)
1259
1267
  return r.map((u) => `${u[p]}/${u[v]}`);
1260
- if (a === m.TIME)
1261
- d = r.map((u) => +new Date(u[l]));
1268
+ if (a === d.TIME)
1269
+ m = r.map((u) => +new Date(u[l]));
1262
1270
  else if (s && e.axes)
1263
- d = [], r.forEach((u) => {
1264
- d.push(u[l]), u[s.upperBoundMapsTo] && d.push(u[s.upperBoundMapsTo]), u[s.lowerBoundMapsTo] && d.push(u[s.lowerBoundMapsTo]);
1271
+ m = [], r.forEach((u) => {
1272
+ m.push(u[l]), u[s.upperBoundMapsTo] && m.push(u[s.upperBoundMapsTo]), u[s.lowerBoundMapsTo] && m.push(u[s.lowerBoundMapsTo]);
1265
1273
  });
1266
1274
  else if (n.stacked === !0 && D && t === this.getRangeAxisPosition()) {
1267
1275
  const { groupMapsTo: u } = e.data, x = this.model.getDataValuesGroupedByKeys({
@@ -1275,28 +1283,28 @@ class re extends A {
1275
1283
  Object.values(pi(Bt, "sharedStackKey")).forEach((P) => {
1276
1284
  isNaN(P) || (P < 0 ? K += P : U += P);
1277
1285
  }), $.push([K, U]);
1278
- }), d = [
1286
+ }), m = [
1279
1287
  ...pt($),
1280
1288
  ...Rt.map((b) => b[l])
1281
1289
  ];
1282
1290
  } else
1283
- d = [], r.forEach((u) => {
1291
+ m = [], r.forEach((u) => {
1284
1292
  const x = u[l];
1285
- 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));
1293
+ Array.isArray(x) && x.length === 2 ? (m.push(x[0]), m.push(x[1])) : (h && m.push(Math.max(u[l], u[h])), m.push(x));
1286
1294
  });
1287
- return a !== m.TIME && a !== m.LOG && o && d.push(0), y && y.length > 0 && y.forEach((u) => {
1295
+ return a !== d.TIME && a !== d.LOG && o && m.push(0), y && y.length > 0 && y.forEach((u) => {
1288
1296
  const x = c(u, "value");
1289
- x !== null && d.push(x);
1290
- }), g = dt(d), g = this.extendsDomain(t, g), g;
1297
+ x !== null && m.push(x);
1298
+ }), g = mt(m), g = this.extendsDomain(t, g), g;
1291
1299
  }
1292
1300
  createScale(t) {
1293
1301
  const e = this.model.getOptions(), n = c(e, "axes", t);
1294
1302
  if (!n)
1295
1303
  return null;
1296
- const s = c(n, "scaleType") || m.LINEAR;
1304
+ const s = c(n, "scaleType") || d.LINEAR;
1297
1305
  this.scaleTypes[t] = s;
1298
1306
  let o;
1299
- 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;
1307
+ return s === d.TIME ? o = si() : s === d.LOG ? o = xt().base(n.base || 10) : s === d.LABELS || s === d.LABELS_RATIO ? o = oi() : o = Qt(), o.domain(this.getScaleDomain(t)), o;
1300
1308
  }
1301
1309
  getDomainLowerBound(t) {
1302
1310
  let e, n = 0;
@@ -1307,7 +1315,7 @@ class re extends A {
1307
1315
  if (!Array.isArray(n) || Array.isArray(n) && !n.length)
1308
1316
  return null;
1309
1317
  const s = this.getDomainScale(), o = n.sort((r, h) => h.value - r.value)[0];
1310
- return this.getScaleTypeByPosition(e) === m.TIME && (typeof o.value == "string" || o.value.getTime === void 0) && (o.value = new Date(o.value)), {
1318
+ return this.getScaleTypeByPosition(e) === d.TIME && (typeof o.value == "string" || o.value.getTime === void 0) && (o.value = new Date(o.value)), {
1311
1319
  threshold: o,
1312
1320
  scaleValue: s(o.value)
1313
1321
  };
@@ -1336,7 +1344,7 @@ function Ji(i, t) {
1336
1344
  function Qi([i, t], e, n) {
1337
1345
  const o = (t - i) * e, a = t <= 0 && t + o > 0 ? 0 : t + o;
1338
1346
  let r = i >= 0 && i - o < 0 ? 0 : i - o;
1339
- if (n === m.LOG && r <= 0) {
1347
+ if (n === d.LOG && r <= 0) {
1340
1348
  if (i <= 0)
1341
1349
  throw Error("Data must have values greater than 0 if log scale type is used.");
1342
1350
  r = i;
@@ -1389,7 +1397,7 @@ class ce extends A {
1389
1397
  t,
1390
1398
  "scaleType"
1391
1399
  );
1392
- return t === _.BOTTOM && e === m.TIME;
1400
+ return t === _.BOTTOM && e === d.TIME;
1393
1401
  }
1394
1402
  // get display data for zoom bar
1395
1403
  // basically it's sum of value grouped by time
@@ -1407,7 +1415,7 @@ class ce extends A {
1407
1415
  if (!s) throw new Error("Not defined: mainXAxisPosition");
1408
1416
  return n.extendsDomain(
1409
1417
  s,
1410
- dt(e, (r) => r[o])
1418
+ mt(e, (r) => r[o])
1411
1419
  );
1412
1420
  }
1413
1421
  handleDomainChange(t, e = { dispatchEvent: !0 }) {
@@ -1498,4 +1506,4 @@ export {
1498
1506
  he as c,
1499
1507
  pt as f
1500
1508
  };
1501
- //# sourceMappingURL=index-Kltqng9e.mjs.map
1509
+ //# sourceMappingURL=index-fH71cv3F.mjs.map