@carbon/charts 1.16.8 → 1.16.9

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/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
- import { t as Y, g as l, m as a, o as r, c as J, a as V } from "./color-scale-utils-DAbXVtf-.mjs";
2
- import { T as yt, e as Dt, f as Lt, h as Ft, j as Pt, l as Mt, n as kt, p as Bt, q as It, r as Ht, I as Gt, d as Vt, s as Nt, J as Ut, K as Zt, L as _t, M as zt, N as Wt, u as jt, v as $t, O as Kt, w as Jt, x as qt, y as Xt, z as Qt, A as Yt, B as eo, C as so, D as to, G as oo, E as no, F as io, H as ro } from "./color-scale-utils-DAbXVtf-.mjs";
1
+ import { t as Y, g as l, m as a, o as r, c as J, a as V } from "./color-scale-utils-CSwgszB6.mjs";
2
+ import { T as yt, e as Dt, f as Lt, h as Ft, j as Pt, l as Mt, n as kt, p as Bt, q as It, r as Ht, I as Gt, d as Vt, s as Nt, J as Ut, K as Zt, L as _t, M as zt, N as Wt, u as jt, v as $t, O as Kt, w as Jt, x as qt, y as Xt, z as Qt, A as Yt, B as eo, C as so, D as to, G as oo, E as no, F as io, H as ro } from "./color-scale-utils-CSwgszB6.mjs";
3
3
  import { i as ho } from "./index-zSuueE1Q.mjs";
4
4
  import { ChartModel as Re, ChartModelCartesian as Te, AlluvialChartModel as be, BoxplotChartModel as Oe, BulletChartModel as Se, ChoroplethModel as fe, CirclePackChartModel as Ae, PieChartModel as xe, GaugeChartModel as ye, HeatmapModel as De, ChartModelBinned as Le, MeterChartModel as Fe, RadarChartModel as Pe, TreeChartModel as Me, TreemapChartModel as ke, WordCloudModel as Be } from "./model/index.mjs";
5
5
  import { _ as j, r as i, q as h, L as Z, y as A, t as N, e as $, S as Ie, u as K, F as p, l as R } from "./enums-DwsxZqjR.mjs";
6
6
  import { A as mo, a as lo, b as po, c as Co, d as uo, f as vo, B as go, g as wo, C as Eo, h as Ro, i as To, j as bo, k as Oo, m as So, n as fo, D as Ao, o as xo, G as yo, p as Do, s as Lo, v as Fo, M as Po, w as Mo, P as ko, x as Bo, R as Io, z as Ho, H as Go, T as Vo, I as No, J as Uo, K as Zo, N as _o, O as zo, Q as Wo, U as jo, V as $o, W as Ko, Z as Jo, X as qo, Y as Xo } from "./enums-DwsxZqjR.mjs";
7
- import { c as He, L as ee, C as Ge, T as _, a as z, b as g, S as L, d as se, M as W, e as Ve, f as Ne, g as Ue, H as Ze, Z as _e, A as te, h as ze, i as d, G as w, R as B, j as k, k as oe, l as M, m as C, B as We, n as I, o as je, p as $e, q as ne, r as Ke, s as Je, t as ie, u as re, v as U, w as ae, x as he, y as ce, P as qe, D as Xe, z as Qe, E as Ye, F as es, I as ss, J as ts, K as os, N as ns, O as is, Q as rs, U as as, V as hs, W as cs } from "./choropleth-BwaUZYh6.mjs";
8
- import { X as Yo, a8 as en, a9 as sn, a7 as tn, Y as on, _ as nn, $ as rn, a0 as an, a1 as hn, a2 as cn, a3 as mn, a4 as ln, a5 as pn, a6 as dn } from "./choropleth-BwaUZYh6.mjs";
9
- import { b as ms, C as ls, E as ps, F as ds, T as Cs, a as us, c as vs, Z as gs, f as ws } from "./index-DnyOi0rJ.mjs";
10
- import { D as Es, G as Rs } from "./angle-utils-BSzg7qin.mjs";
11
- import { S as un, d as vn, a as gn, p as wn, b as En, r as Rn } from "./angle-utils-BSzg7qin.mjs";
7
+ import { c as He, L as ee, C as Ge, T as _, a as z, b as g, S as L, d as se, M as W, e as Ve, f as Ne, g as Ue, H as Ze, Z as _e, A as te, h as ze, i as d, G as w, R as B, j as k, k as oe, l as M, m as C, B as We, n as I, o as je, p as $e, q as ne, r as Ke, s as Je, t as ie, u as re, v as U, w as ae, x as he, y as ce, P as qe, D as Xe, z as Qe, E as Ye, F as es, I as ss, J as ts, K as os, N as ns, O as is, Q as rs, U as as, V as hs, W as cs } from "./choropleth-BAn8HIaC.mjs";
8
+ import { X as Yo, a8 as en, a9 as sn, a7 as tn, Y as on, _ as nn, $ as rn, a0 as an, a1 as hn, a2 as cn, a3 as mn, a4 as ln, a5 as pn, a6 as dn } from "./choropleth-BAn8HIaC.mjs";
9
+ import { b as ms, C as ls, E as ps, F as ds, T as Cs, a as us, c as vs, Z as gs, f as ws } from "./index-fFi6OCaz.mjs";
10
+ import { D as Es, G as Rs } from "./angle-utils-ByrL6LVp.mjs";
11
+ import { S as un, d as vn, a as gn, p as wn, b as En, r as Rn } from "./angle-utils-ByrL6LVp.mjs";
12
12
  function Ts(t, s, e) {
13
13
  var n = t.length;
14
14
  return e = e === void 0 ? n : e, !s && e >= n ? t : ms(t, s, e);
@@ -108,6 +108,10 @@ export interface BasedAxisOptions {
108
108
  * axis that's being broken into bins
109
109
  */
110
110
  binned?: boolean;
111
+ /**
112
+ * used to map data on the secondary axis
113
+ */
114
+ correspondingDatasets?: Array<string>;
111
115
  }
112
116
  /**
113
117
  * options to configure a scale. not all options are used by all scales
@@ -128,10 +132,6 @@ export interface ComboChartAxisOptions extends AxisOptions {
128
132
  * left axis to be the primary axis
129
133
  */
130
134
  main?: boolean;
131
- /**
132
- * used to map data on the secondary axis
133
- */
134
- correspondingDatasets?: Array<string>;
135
135
  }
136
136
  export interface BinnedAxisOptions {
137
137
  /**
@@ -68,6 +68,9 @@ export interface BaseChartOptions {
68
68
  */
69
69
  prefix?: string;
70
70
  };
71
+ canvasZoom?: {
72
+ enabled?: boolean;
73
+ };
71
74
  /**
72
75
  * options related to charting data
73
76
  */
@@ -144,6 +147,24 @@ export interface AxisChartOptions extends BaseChartOptions {
144
147
  * zoombar configuration
145
148
  */
146
149
  zoomBar?: ZoomBarsOptions;
150
+ /**
151
+ * options for the points
152
+ */
153
+ points?: {
154
+ /**
155
+ * sets the radius of the point
156
+ */
157
+ radius?: number;
158
+ fillOpacity?: number;
159
+ filled?: boolean;
160
+ enabled?: boolean;
161
+ };
162
+ /**
163
+ * options for the curve of the line
164
+ */
165
+ curve?: string | {
166
+ name: string;
167
+ };
147
168
  }
148
169
  /**
149
170
  * Options common to binned charts with an axis
@@ -177,18 +198,6 @@ export interface StackedBarChartOptions extends BarChartOptions {
177
198
  * options specific to scatter charts
178
199
  */
179
200
  export interface ScatterChartOptions extends AxisChartOptions {
180
- /**
181
- * options for the points
182
- */
183
- points?: {
184
- /**
185
- * sets the radius of the point
186
- */
187
- radius: number;
188
- fillOpacity?: number;
189
- filled?: boolean;
190
- enabled?: boolean;
191
- };
192
201
  }
193
202
  /**
194
203
  * options specific to lollipop charts
@@ -251,23 +260,11 @@ export interface HistogramChartOptions extends AxisChartOptions {
251
260
  * options specific to line charts
252
261
  */
253
262
  export interface LineChartOptions extends ScatterChartOptions {
254
- /**
255
- * options for the curve of the line
256
- */
257
- curve?: string | {
258
- name: string;
259
- };
260
263
  }
261
264
  /**
262
265
  * options specific to area charts
263
266
  */
264
267
  export interface AreaChartOptions extends AxisChartOptions {
265
- /**
266
- * options for the curve of the line
267
- */
268
- curve?: string | {
269
- name: string;
270
- };
271
268
  /**
272
269
  * options to bound the area of the chart
273
270
  */
@@ -380,6 +377,8 @@ export interface MeterChartOptions extends BaseChartOptions {
380
377
  proportional?: {
381
378
  total?: number;
382
379
  unit?: string;
380
+ totalFormatter?: (total: number) => string;
381
+ breakdownFormatter?: (x: any) => string;
383
382
  };
384
383
  peak?: number;
385
384
  status?: {
@@ -442,10 +441,10 @@ export interface TreeChartOptions extends BaseChartOptions {
442
441
  }
443
442
  export interface CirclePackChartOptions extends BaseChartOptions {
444
443
  circlePack?: {
445
- circles: {
444
+ circles?: {
446
445
  fillOpacity: number;
447
446
  };
448
- hierachyLevel: number;
447
+ depth: number;
449
448
  padding?: {
450
449
  outer?: number;
451
450
  inner?: number;
@@ -482,7 +481,7 @@ export interface AlluvialChartOptions extends BaseChartOptions {
482
481
  /**
483
482
  * options specific to Heatmap charts
484
483
  */
485
- export interface HeatmapChartOptions extends BaseChartOptions {
484
+ export interface HeatmapChartOptions extends AxisChartOptions {
486
485
  heatmap: {
487
486
  /**
488
487
  * Divider width state - will default to auto
@@ -530,8 +529,8 @@ export interface ChoroplethChartOptions extends ThematicChartOptions {
530
529
  title?: string;
531
530
  type: ColorLegendType | string;
532
531
  };
533
- geoData: Topology;
534
532
  };
533
+ geoData: Topology;
535
534
  }
536
535
  export type WorldCloudChartOptions = WordCloudChartOptions;
537
536
  export type ChartOptions = AlluvialChartOptions | AreaChartOptions | BarChartOptions | BoxplotChartOptions | BubbleChartOptions | BulletChartOptions | CirclePackChartOptions | ComboChartOptions | DonutChartOptions | GaugeChartOptions | HeatmapChartOptions | HistogramChartOptions | LineChartOptions | LollipopChartOptions | MeterChartOptions | PieChartOptions | RadarChartOptions | ScatterChartOptions | StackedAreaChartOptions | StackedBarChartOptions | TreeChartOptions | TreemapChartOptions | WordCloudChartOptions | WorldCloudChartOptions;
@@ -1,6 +1,6 @@
1
- import { a0 as tt, a1 as et, au as st, av as w, aw as L, ad as N, ax as at, ay as nt, az as ot, ap as P, ar as k, g as p, w as E, c as F, v as rt, ao as $, J as z, aA as H, a as R, r as Z, V as Q, ac as C, L as W, ai as it, aB as lt, aa as A } from "../color-scale-utils-DAbXVtf-.mjs";
1
+ import { a0 as tt, a1 as et, au as st, av as w, aw as $, ad as N, ax as at, ay as nt, az as ot, ap as P, ar as k, g as p, w as E, c as F, v as rt, ao as L, J as z, aA as H, a as R, r as Z, V as Q, ac as C, L as W, ai as it, aB as lt, aa as A } from "../color-scale-utils-CSwgszB6.mjs";
2
2
  import { S as b, _ as U, d as X, e as q, s as ct } from "../enums-DwsxZqjR.mjs";
3
- import { b as ut, c as I, a as pt } from "../array-BRmw0x1E.mjs";
3
+ import { b as ut, c as I, a as pt } from "../array-6NAAybxf.mjs";
4
4
  function ht(u, t, e, s) {
5
5
  for (var a = -1, n = u == null ? 0 : u.length; ++a < n; ) {
6
6
  var o = u[a];
@@ -56,7 +56,7 @@ function B(u) {
56
56
  function At(u, t, e) {
57
57
  let s;
58
58
  for (; ; ) {
59
- const a = L(u, t, e);
59
+ const a = $(u, t, e);
60
60
  if (a === s || a === 0 || !isFinite(a))
61
61
  return [u, t];
62
62
  a > 0 ? (u = Math.floor(u / a) * a, t = Math.ceil(t / a) * a) : a < 0 && (u = Math.ceil(u * a) / a, t = Math.floor(t * a) / a), s = a;
@@ -75,9 +75,9 @@ function Mt() {
75
75
  var c = t(l), h = c[0], g = c[1], f = e(l, h, g);
76
76
  if (!Array.isArray(f)) {
77
77
  const y = g, S = +f;
78
- if (t === N && ([h, g] = At(h, g, S)), f = at(h, g, S), f[0] <= h && (i = L(h, g, S)), f[f.length - 1] >= g)
78
+ if (t === N && ([h, g] = At(h, g, S)), f = at(h, g, S), f[0] <= h && (i = $(h, g, S)), f[f.length - 1] >= g)
79
79
  if (y >= g && t === N) {
80
- const T = L(h, g, S);
80
+ const T = $(h, g, S);
81
81
  isFinite(T) && (T > 0 ? g = (Math.floor(g / T) + 1) * T : T < 0 && (g = (Math.ceil(g * -T) + 1) / -T));
82
82
  } else
83
83
  f.pop();
@@ -334,7 +334,7 @@ class v {
334
334
  getStackKeys({ bins: t = null, groups: e = null } = { bins: null, groups: null }) {
335
335
  const s = this.getOptions(), a = this.getDisplayData(e);
336
336
  let n;
337
- t ? n = t.map((i) => `${i.x0}:${i.x1}`) : n = $(
337
+ t ? n = t.map((i) => `${i.x0}:${i.x1}`) : n = L(
338
338
  a.map((i) => {
339
339
  const l = this.services.cartesianScales.getDomainIdentifier(i);
340
340
  return i[l] instanceof Date ? z(i[l]) : i[l] && typeof i[l].toString == "function" ? i[l].toString() : i[l];
@@ -550,7 +550,7 @@ class v {
550
550
  }) : this.allDataGroups = this.getDataGroupNames();
551
551
  }
552
552
  generateDataGroups(t) {
553
- const { groupMapsTo: e } = this.getOptions().data, { ACTIVE: s, DISABLED: a } = E.items.status, n = this.getOptions(), o = $(t.map((i) => i[e]));
553
+ const { groupMapsTo: e } = this.getOptions().data, { ACTIVE: s, DISABLED: a } = E.items.status, n = this.getOptions(), o = L(t.map((i) => i[e]));
554
554
  n.data.selectedGroups.length && (n.data.selectedGroups.every(
555
555
  (l) => o.includes(l)
556
556
  ) || (n.data.selectedGroups = []));
@@ -663,7 +663,7 @@ class M extends v {
663
663
  if (e && a.domainAxisPosition && a.rangeAxisPosition) {
664
664
  const n = a.getDomainIdentifier(), o = a.getRangeIdentifier();
665
665
  let r = e.map((i) => i[n].getTime());
666
- r = $(r).sort(), s = r.map((i) => {
666
+ r = L(r).sort(), s = r.map((i) => {
667
667
  let l = 0;
668
668
  const c = {};
669
669
  return e.forEach((h) => {
@@ -866,7 +866,7 @@ class _t extends v {
866
866
  setOptions(t) {
867
867
  const e = this.getOptions(), s = R({}, t, this.getZoomOptions(t));
868
868
  H(e, s);
869
- const a = this.getHierarchyLevel(), n = p(e, "circlePack", "hierarchyLevel");
869
+ const a = this.getHierarchyLevel(), n = p(e, "circlePack", "depth");
870
870
  this.set({
871
871
  options: R(e, s),
872
872
  depth: n && n < 4 ? n : a
@@ -978,7 +978,7 @@ class wt extends v {
978
978
  return this.getTabularData(t).sort((s, a) => a.value - s.value);
979
979
  }
980
980
  }
981
- class Lt extends v {
981
+ class $t extends v {
982
982
  constructor(t) {
983
983
  super(t);
984
984
  }
@@ -995,7 +995,7 @@ class Lt extends v {
995
995
  return super.formatTable({ headers: o, cells: r });
996
996
  }
997
997
  }
998
- class $t extends M {
998
+ class Lt extends M {
999
999
  constructor(t) {
1000
1000
  super(t), this.axisFlavor = X.HOVERABLE, this._colorScale = void 0, this._domains = [], this._ranges = [], this._matrix = {};
1001
1001
  const e = p(this.getOptions(), "axes");
@@ -1312,8 +1312,8 @@ export {
1312
1312
  M as ChartModelCartesian,
1313
1313
  Vt as ChoroplethModel,
1314
1314
  _t as CirclePackChartModel,
1315
- Lt as GaugeChartModel,
1316
- $t as HeatmapModel,
1315
+ $t as GaugeChartModel,
1316
+ Lt as HeatmapModel,
1317
1317
  zt as MeterChartModel,
1318
1318
  wt as PieChartModel,
1319
1319
  Ut as RadarChartModel,