@carbon/charts-vue 0.54.2 → 0.54.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.54.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.54.2...v0.54.3) (2022-01-07)
7
+
8
+ **Note:** Version bump only for package @carbon/charts-vue
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.54.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.54.1...v0.54.2) (2022-01-05)
7
15
 
8
16
  **Note:** Version bump only for package @carbon/charts-vue
@@ -9713,7 +9713,7 @@ var model_ChartModel = /** @class */ (function () {
9713
9713
  };
9714
9714
  ChartModel.prototype.getStackKeys = function (_a) {
9715
9715
  var _this = this;
9716
- var _b = _a.bins, bins = _b === void 0 ? null : _b, _c = _a.groups, groups = _c === void 0 ? null : _c;
9716
+ var _b = _a === void 0 ? { bins: null, groups: null } : _a, _c = _b.bins, bins = _c === void 0 ? null : _c, _d = _b.groups, groups = _d === void 0 ? null : _d;
9717
9717
  var options = this.getOptions();
9718
9718
  var displayData = this.getDisplayData(groups);
9719
9719
  var stackKeys;
@@ -25982,6 +25982,7 @@ var bar_stacked_extends = (undefined && undefined.__extends) || (function () {
25982
25982
 
25983
25983
 
25984
25984
 
25985
+
25985
25986
  // D3 Imports
25986
25987
 
25987
25988
  var bar_stacked_StackedBar = /** @class */ (function (_super) {
@@ -26213,6 +26214,21 @@ var bar_stacked_StackedBar = /** @class */ (function (_super) {
26213
26214
  });
26214
26215
  });
26215
26216
  };
26217
+ StackedBar.prototype.getBarWidth = function () {
26218
+ var options = this.getOptions();
26219
+ if (tools_Tools.getProperty(options, "bars", "width")) {
26220
+ return options.bars.width;
26221
+ }
26222
+ var mainXScale = this.services.cartesianScales.getMainXScale();
26223
+ var chartWidth = dom_utils_DOMUtils.getSVGElementSize(this.parent, {
26224
+ useAttrs: true,
26225
+ }).width;
26226
+ var numberOfDomainValues = this.model.getStackKeys().length;
26227
+ if (!mainXScale.step) {
26228
+ return Math.min(options.bars.maxWidth, (chartWidth * 0.25) / numberOfDomainValues);
26229
+ }
26230
+ return Math.min(options.bars.maxWidth, mainXScale.step() / 2);
26231
+ };
26216
26232
  StackedBar.prototype.destroy = function () {
26217
26233
  // Remove event listeners
26218
26234
  this.parent