@carbon/charts 1.15.2 → 1.15.3

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,7 +1,7 @@
1
1
  import { select as te, max as ne, extent as $, scaleTime as se, scaleLog as ie, scaleBand as oe, scaleLinear as ae, curveLinear as re, curveLinearClosed as ce, curveBasis as le, curveBasisClosed as ue, curveBasisOpen as me, curveBundle as de, curveCardinal as he, curveCardinalClosed as ge, curveCardinalOpen as fe, curveCatmullRom as pe, curveCatmullRomClosed as xe, curveCatmullRomOpen as De, curveMonotoneX as ye, curveMonotoneY as Ae, curveNatural as Oe, curveStep as ve, curveStepAfter as Te, curveStepBefore as Me } from "d3";
2
2
  import { S as y, D as Pe } from "./angle-utils-f1TpgqMV.mjs";
3
- import { _ as S, e as l, i as N, S as d } from "./enums-sKf02OL8.mjs";
4
- import { B as Se, C as H, m as c, D as _, E as g, F as B, G as Be, H as j, I as K, J as z, v as Re, K as Le } from "./color-scale-utils-ePX_zGmy.mjs";
3
+ import { _ as S, e as l, i as L, S as d } from "./enums-sKf02OL8.mjs";
4
+ import { B as Se, C as H, m as c, D as _, E as g, F as B, G as Be, H as j, I as K, J as Y, v as Re, K as Le } from "./color-scale-utils-ePX_zGmy.mjs";
5
5
  function Ee(i) {
6
6
  var e = i == null ? 0 : i.length;
7
7
  return e ? Se(i, 1) : [];
@@ -101,12 +101,12 @@ function v(i, e) {
101
101
  const t = g(i), n = g(e), s = t.getTime() - n.getTime();
102
102
  return s < 0 ? -1 : s > 0 ? 1 : s;
103
103
  }
104
- function be(i, e) {
104
+ function Ie(i, e) {
105
105
  const t = g(i), n = g(e);
106
106
  return t.getFullYear() - n.getFullYear();
107
107
  }
108
- function Ie(i, e) {
109
- const t = g(i), n = g(e), s = v(t, n), o = Math.abs(be(t, n));
108
+ function be(i, e) {
109
+ const t = g(i), n = g(e), s = v(t, n), o = Math.abs(Ie(t, n));
110
110
  t.setFullYear(1584), n.setFullYear(1584);
111
111
  const a = v(t, n) === -s, r = s * (o - +a);
112
112
  return r === 0 ? 0 : r;
@@ -166,12 +166,12 @@ function He(i, e) {
166
166
  return b(i, -e);
167
167
  }
168
168
  function _e(i, e) {
169
- const t = g(i), n = g(e), s = Y(t, n), o = Math.abs(Be(t, n));
169
+ const t = g(i), n = g(e), s = z(t, n), o = Math.abs(Be(t, n));
170
170
  t.setDate(t.getDate() - s * o);
171
- const a = +(Y(t, n) === -s), r = s * (o - a);
171
+ const a = +(z(t, n) === -s), r = s * (o - a);
172
172
  return r === 0 ? 0 : r;
173
173
  }
174
- function Y(i, e) {
174
+ function z(i, e) {
175
175
  const t = i.getFullYear() - e.getFullYear() || i.getMonth() - e.getMonth() || i.getDate() - e.getDate() || i.getHours() - e.getHours() || i.getMinutes() - e.getMinutes() || i.getSeconds() - e.getSeconds() || i.getMilliseconds() - e.getMilliseconds();
176
176
  return t < 0 ? -1 : t > 0 ? 1 : t;
177
177
  }
@@ -179,51 +179,51 @@ function q(i, e) {
179
179
  const t = g(i);
180
180
  return isNaN(e) ? B(i, NaN) : (e && t.setDate(t.getDate() + e), t);
181
181
  }
182
- function ze(i, e) {
182
+ function Ye(i, e) {
183
183
  return q(i, -e);
184
184
  }
185
- function I(i) {
185
+ function C(i) {
186
186
  return (e) => {
187
187
  const n = (i ? Math[i] : Math.trunc)(e);
188
188
  return n === 0 ? 0 : n;
189
189
  };
190
190
  }
191
- function C(i, e) {
191
+ function Z(i, e) {
192
192
  return +g(i) - +g(e);
193
193
  }
194
- function Ye(i, e, t) {
195
- const n = C(i, e) / j;
196
- return I(t == null ? void 0 : t.roundingMethod)(n);
194
+ function ze(i, e, t) {
195
+ const n = Z(i, e) / j;
196
+ return C(t == null ? void 0 : t.roundingMethod)(n);
197
197
  }
198
- function Z(i, e) {
198
+ function w(i, e) {
199
199
  const t = +g(i);
200
200
  return B(i, t + e);
201
201
  }
202
202
  function J(i, e) {
203
- return Z(i, e * j);
203
+ return w(i, e * j);
204
204
  }
205
205
  function Xe(i, e) {
206
206
  return J(i, -e);
207
207
  }
208
208
  function X(i, e, t) {
209
- const n = C(i, e) / K;
210
- return I(t == null ? void 0 : t.roundingMethod)(n);
209
+ const n = Z(i, e) / K;
210
+ return C(t == null ? void 0 : t.roundingMethod)(n);
211
211
  }
212
- function L(i, e) {
213
- return Z(i, e * K);
212
+ function E(i, e) {
213
+ return w(i, e * K);
214
214
  }
215
215
  function G(i, e) {
216
- return L(i, -e);
216
+ return E(i, -e);
217
217
  }
218
218
  function k(i, e, t) {
219
- const n = C(i, e) / 1e3;
220
- return I(t == null ? void 0 : t.roundingMethod)(n);
219
+ const n = Z(i, e) / 1e3;
220
+ return C(t == null ? void 0 : t.roundingMethod)(n);
221
221
  }
222
- function E(i, e) {
223
- return Z(i, e * 1e3);
222
+ function I(i, e) {
223
+ return w(i, e * 1e3);
224
224
  }
225
225
  function U(i, e) {
226
- return E(i, -e);
226
+ return I(i, -e);
227
227
  }
228
228
  class et extends y {
229
229
  constructor() {
@@ -293,7 +293,7 @@ class et extends y {
293
293
  this.domainAxisPosition = n.primaryDomainAxisPosition, this.rangeAxisPosition = n.primaryRangeAxisPosition, this.isDualAxes() && (this.secondaryDomainAxisPosition = n.secondaryDomainAxisPosition, this.secondaryRangeAxisPosition = n.secondaryRangeAxisPosition);
294
294
  }
295
295
  determineOrientation() {
296
- (this.rangeAxisPosition === l.LEFT || this.rangeAxisPosition === l.RIGHT) && (this.domainAxisPosition === l.BOTTOM || this.domainAxisPosition === l.TOP) ? this.orientation = N.VERTICAL : this.orientation = N.HORIZONTAL;
296
+ (this.rangeAxisPosition === l.LEFT || this.rangeAxisPosition === l.RIGHT) && (this.domainAxisPosition === l.BOTTOM || this.domainAxisPosition === l.TOP) ? this.orientation = L.VERTICAL : this.orientation = L.HORIZONTAL;
297
297
  }
298
298
  isDualAxes() {
299
299
  return this.dualAxes;
@@ -416,7 +416,7 @@ class et extends y {
416
416
  const o = c(n, "timeScale", "addSpaceOnEdges");
417
417
  return Ge(t, o);
418
418
  } else
419
- return ke(t, z.paddingRatio, s.scaleType);
419
+ return ke(t, Y.paddingRatio, s.scaleType);
420
420
  }
421
421
  findVerticalAxesPositions() {
422
422
  const e = this.model.getOptions(), t = c(e, "axes"), n = this.isDualAxes();
@@ -452,7 +452,7 @@ class et extends y {
452
452
  const { bins: m } = this.model.getBinConfigurations(), f = this.model.getStackKeys({ bins: m });
453
453
  return [f[0].split(":")[0], f[f.length - 1].split(":")[1]];
454
454
  }
455
- const r = this.model.getDisplayData(), { extendLinearDomainBy: u, mapsTo: h, percentage: p, thresholds: D } = n, { reference: A, compareTo: T } = z.ratio;
455
+ const r = this.model.getDisplayData(), { extendLinearDomainBy: u, mapsTo: h, percentage: p, thresholds: D } = n, { reference: A, compareTo: T } = Y.ratio;
456
456
  if (n.domain)
457
457
  return a === d.LABELS ? n.domain : (a === d.TIME && (n.domain = n.domain.map(
458
458
  (m) => m.getTime === void 0 ? new Date(m) : m
@@ -476,15 +476,15 @@ class et extends y {
476
476
  groups: R
477
477
  }), Q = r.filter(
478
478
  (O) => !R.includes(O[m])
479
- ), w = [];
479
+ ), F = [];
480
480
  f.forEach((O) => {
481
481
  const { ...ee } = O;
482
- let F = 0, V = 0;
482
+ let V = 0, N = 0;
483
483
  Object.values(ee).forEach((P) => {
484
- isNaN(P) || (P < 0 ? V += P : F += P);
485
- }), w.push([V, F]);
484
+ isNaN(P) || (P < 0 ? N += P : V += P);
485
+ }), F.push([N, V]);
486
486
  }), x = [
487
- ...Ee(w),
487
+ ...Ee(F),
488
488
  ...Q.map((O) => O[h])
489
489
  ];
490
490
  } else
@@ -506,6 +506,10 @@ class et extends y {
506
506
  let o;
507
507
  return s === d.TIME ? o = se() : s === d.LOG ? o = ie().base(n.base || 10) : s === d.LABELS || s === d.LABELS_RATIO ? o = oe() : o = ae(), o.domain(this.getScaleDomain(e)), o;
508
508
  }
509
+ getDomainLowerBound(e) {
510
+ let t, n = 0;
511
+ return this.getOrientation() === L.VERTICAL ? t = this.getMainYScale().domain() : t = this.getMainXScale().domain(), c(this.model.getOptions(), "axes", e, "includeZero") === !1 && t[0] > 0 && t[1] > 0 && (n = t[0]), n;
512
+ }
509
513
  getHighestDomainThreshold() {
510
514
  const e = c(this.model.getOptions(), "axes"), t = this.getDomainAxisPosition(), { thresholds: n } = e[t];
511
515
  if (!Array.isArray(n) || Array.isArray(n) && !n.length)
@@ -529,13 +533,13 @@ class et extends y {
529
533
  }
530
534
  function Ge(i, e) {
531
535
  const t = new Date(i[0]), n = new Date(i[1]);
532
- return Ie(n, t) > 1 ? [Ce(t, e), W(n, e)] : Ne(n, t) > 1 ? [He(t, e), b(n, e)] : _e(n, t) > 1 ? [ze(t, e), q(n, e)] : Ye(n, t) > 1 ? [Xe(t, e), J(n, e)] : X(n, t) > 30 ? [
536
+ return be(n, t) > 1 ? [Ce(t, e), W(n, e)] : Ne(n, t) > 1 ? [He(t, e), b(n, e)] : _e(n, t) > 1 ? [Ye(t, e), q(n, e)] : ze(n, t) > 1 ? [Xe(t, e), J(n, e)] : X(n, t) > 30 ? [
533
537
  G(t, e * 30),
534
- L(n, e * 30)
535
- ] : X(n, t) > 1 ? [G(t, e), L(n, e)] : k(n, t) > 15 ? [
538
+ E(n, e * 30)
539
+ ] : X(n, t) > 1 ? [G(t, e), E(n, e)] : k(n, t) > 15 ? [
536
540
  U(t, e * 15),
537
- E(n, e * 15)
538
- ] : k(n, t) > 1 ? [U(t, e), E(n, e)] : [t, n];
541
+ I(n, e * 15)
542
+ ] : k(n, t) > 1 ? [U(t, e), I(n, e)] : [t, n];
539
543
  }
540
544
  function ke([i, e], t, n) {
541
545
  const o = (e - i) * t, a = e <= 0 && e + o > 0 ? 0 : e + o;
@@ -705,4 +709,4 @@ export {
705
709
  et as b,
706
710
  Ee as f
707
711
  };
708
- //# sourceMappingURL=zoom-gdS20wKV.mjs.map
712
+ //# sourceMappingURL=zoom-llJ5-h9M.mjs.map