@carbon/charts 1.22.14 → 1.22.15

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-DveQIPGG.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-G6hhqYGx.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 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";
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-BW_t5gbK.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-1yDCWVo3.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, di = 2, mi = 4, pi = hi(function(i, t) {
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 | di | mi, ui));
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, m;
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 (m = p < 0 ? g / o(-p) : g * o(p), !(m < l)) {
86
- if (m > f) break;
87
- u.push(m);
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 (m = p > 0 ? g / o(-p) : g * o(p), !(m < l)) {
92
- if (m > f) break;
93
- u.push(m);
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) / dt;
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 * dt), n;
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] === d.LINEAR || this.scaleTypes[t] === d.TIME) && e.length !== 2)
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 d.LABELS:
1165
+ case m.LABELS:
1166
1166
  f = t(l) + t.step() / 2;
1167
1167
  break;
1168
- case d.TIME:
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 === d.TIME) {
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 || d.LINEAR, r = o.scaleType || d.LINEAR, h = {
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 === 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;
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") || d.LINEAR;
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 === d.LABELS ? n.domain : (a === d.TIME && (n.domain = n.domain.map(
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 === d.LABELS)
1262
+ if (n && a === m.LABELS)
1263
1263
  return Jt(r.map((u) => u[l]));
1264
- let g, m;
1264
+ let g, d;
1265
1265
  const D = this.model.getDataGroupNames();
1266
- if (a === d.LABELS_RATIO)
1266
+ if (a === m.LABELS_RATIO)
1267
1267
  return r.map((u) => `${u[p]}/${u[v]}`);
1268
- if (a === d.TIME)
1269
- m = r.map((u) => +new Date(u[l]));
1268
+ if (a === m.TIME)
1269
+ d = r.map((u) => +new Date(u[l]));
1270
1270
  else if (s && e.axes)
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]);
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
- }), m = [
1286
+ }), d = [
1287
1287
  ...pt($),
1288
1288
  ...Rt.map((b) => b[l])
1289
1289
  ];
1290
1290
  } else
1291
- m = [], r.forEach((u) => {
1291
+ d = [], r.forEach((u) => {
1292
1292
  const x = u[l];
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));
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 !== d.TIME && a !== d.LOG && o && m.push(0), y && y.length > 0 && y.forEach((u) => {
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 && m.push(x);
1298
- }), g = mt(m), g = this.extendsDomain(t, g), 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") || d.LINEAR;
1304
+ const s = c(n, "scaleType") || m.LINEAR;
1305
1305
  this.scaleTypes[t] = s;
1306
1306
  let 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;
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) === d.TIME && (typeof o.value == "string" || o.value.getTime === void 0) && (o.value = new Date(o.value)), {
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 === d.LOG && r <= 0) {
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;
@@ -1397,7 +1397,7 @@ class ce extends A {
1397
1397
  t,
1398
1398
  "scaleType"
1399
1399
  );
1400
- return t === _.BOTTOM && e === d.TIME;
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
- mt(e, (r) => r[o])
1418
+ dt(e, (r) => r[o])
1419
1419
  );
1420
1420
  }
1421
1421
  handleDomainChange(t, e = { dispatchEvent: !0 }) {
@@ -1506,4 +1506,4 @@ export {
1506
1506
  he as c,
1507
1507
  pt as f
1508
1508
  };
1509
- //# sourceMappingURL=index-fH71cv3F.mjs.map
1509
+ //# sourceMappingURL=index-DgnXvTcC.mjs.map