@carbon/charts-react 1.15.1 → 1.15.2

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
@@ -10563,7 +10563,7 @@ let fn = class {
10563
10563
  ...t.map((a) => [
10564
10564
  a.source,
10565
10565
  a.target,
10566
- n(a.value, r)
10566
+ a.value === null ? "–" : n(a.value, r)
10567
10567
  ])
10568
10568
  ];
10569
10569
  return super.formatTable({ headers: i, cells: s });
@@ -10694,7 +10694,7 @@ let fn = class {
10694
10694
  ...t.map((a) => [
10695
10695
  a.id === null ? "–" : a.id,
10696
10696
  a.name,
10697
- n(a.value, r)
10697
+ a.value === null ? "–" : n(a.value, r)
10698
10698
  ])
10699
10699
  ];
10700
10700
  return super.formatTable({ headers: i, cells: s });
@@ -10963,7 +10963,7 @@ let fn = class {
10963
10963
  ...t.map((l) => [
10964
10964
  l[n.identifier] === null ? "–" : l[n.identifier],
10965
10965
  l[r.identifier] === null ? "–" : l[r.identifier],
10966
- i(l.value, s)
10966
+ l.value === null ? "–" : i(l.value, s)
10967
10967
  ])
10968
10968
  ];
10969
10969
  return super.formatTable({ headers: a, cells: o });
@@ -11044,17 +11044,19 @@ let fn = class {
11044
11044
  l = ["Group", "Value", ...i ? ["Status"] : []], c = [
11045
11045
  [
11046
11046
  d[r],
11047
- a(d.value, o),
11047
+ d.value === null ? "–" : a(d.value, o),
11048
11048
  ...i ? [i] : []
11049
11049
  ]
11050
11050
  ];
11051
11051
  } else
11052
11052
  u = x(s, "total") || this.getMaximumDomain(t), l = ["Group", "Value", "Percentage of total"], c = [
11053
11053
  ...t.map((h) => {
11054
- const f = h.value, p = Number((h.value / u * 100).toFixed(2));
11054
+ let f;
11055
+ h.value !== null && h.value !== void 0 ? f = Number(h.value) : f = 0;
11056
+ let p = Number((h.value / u * 100).toFixed(2));
11055
11057
  return [
11056
11058
  h[r],
11057
- a(f, o),
11059
+ h.value === null ? "–" : a(f, o),
11058
11060
  a(p, o) + " %"
11059
11061
  ];
11060
11062
  })
@@ -11104,7 +11106,11 @@ let fn = class {
11104
11106
  const t = this.getDisplayData(), { number: n, code: r } = x(this.getOptions(), "locale"), i = ["Child", "Group", "Value"], s = [];
11105
11107
  return t.forEach((a) => {
11106
11108
  Array.isArray(a.children) ? a.children.forEach((o) => {
11107
- s.push([o.name, a.name, n(o.value, r)]);
11109
+ s.push([
11110
+ o.name,
11111
+ a.name,
11112
+ o.value === null ? "–" : n(o.value, r)
11113
+ ]);
11108
11114
  }) : x(a.name) !== null && x(a.value) && s.push(["–", a.name, n(a.value, r)]);
11109
11115
  }), super.formatTable({ headers: i, cells: s });
11110
11116
  }
@@ -18606,7 +18612,7 @@ class lP extends Ps {
18606
18612
  */
18607
18613
  appendPercentage() {
18608
18614
  const t = x(this.model.getDisplayData(), 0, "value"), { code: n, number: r } = x(this.getOptions(), "locale"), i = this.getComponentContainer(), s = N.appendOrSelect(i, "text.meter-title"), a = x(this.getOptions(), "meter", "statusBar", "percentageIndicator", "enabled") === !0 ? [t] : [], o = i.selectAll("text.percent-value").data(a), l = re.statusBar.paddingRight;
18609
- o.enter().append("text").classed("percent-value", !0).merge(o).text((c) => `${r(c, n)}%`).attr("x", +s.attr("x") + s.node().getComputedTextLength() + l).attr("y", s.attr("y")), o.exit().remove();
18615
+ o.enter().append("text").classed("percent-value", !0).merge(o).text((c) => `${c != null ? r(c, n) : 0}%`).attr("x", +s.attr("x") + s.node().getComputedTextLength() + l).attr("y", s.attr("y")), o.exit().remove();
18610
18616
  }
18611
18617
  /**
18612
18618
  * Uses the parent class truncate logic