@carbon/charts-vue 1.0.4 → 1.2.1

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,30 @@
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
+ ## [1.2.1](https://github.com/carbon-design-system/carbon-charts/compare/v1.2.0...v1.2.1) (2022-06-14)
7
+
8
+ **Note:** Version bump only for package @carbon/charts-vue
9
+
10
+
11
+
12
+
13
+
14
+ # [1.2.0](https://github.com/carbon-design-system/carbon-charts/compare/v1.1.0...v1.2.0) (2022-06-13)
15
+
16
+ **Note:** Version bump only for package @carbon/charts-vue
17
+
18
+
19
+
20
+
21
+
22
+ # [1.1.0](https://github.com/carbon-design-system/carbon-charts/compare/v1.0.4...v1.1.0) (2022-06-08)
23
+
24
+ **Note:** Version bump only for package @carbon/charts-vue
25
+
26
+
27
+
28
+
29
+
6
30
  ## [1.0.4](https://github.com/carbon-design-system/carbon-charts/compare/v1.0.3...v1.0.4) (2022-05-27)
7
31
 
8
32
  **Note:** Version bump only for package @carbon/charts-vue
@@ -11287,9 +11287,7 @@ var CSS_VERIFIER_ELEMENT_CLASSNAME = 'DONT_STYLE_ME_css_styles_verifier';
11287
11287
  var dom_utils_DOMUtils = /** @class */ (function (_super) {
11288
11288
  __extends(DOMUtils, _super);
11289
11289
  function DOMUtils(model, services) {
11290
- var _this = _super.call(this, model, services) || this;
11291
- _this.chartID = Math.floor((1 + Math.random()) * 0x1000000000000).toString(16);
11292
- return _this;
11290
+ return _super.call(this, model, services) || this;
11293
11291
  }
11294
11292
  DOMUtils.getHTMLElementSize = function (element) {
11295
11293
  return {
@@ -11425,6 +11423,8 @@ var dom_utils_DOMUtils = /** @class */ (function (_super) {
11425
11423
  DOMUtils.prototype.init = function () {
11426
11424
  // Add width & height to the chart holder if necessary, and add a classname
11427
11425
  this.styleHolderElement();
11426
+ // Initialize chart ID
11427
+ this.initializeID();
11428
11428
  this.addMainContainer();
11429
11429
  this.verifyCSSStylesBeingApplied();
11430
11430
  if (this.model.getOptions().resizable) {
@@ -11439,12 +11439,16 @@ var dom_utils_DOMUtils = /** @class */ (function (_super) {
11439
11439
  DOMUtils.prototype.generateElementIDString = function (originalID) {
11440
11440
  return "chart-" + this.chartID + "-" + originalID;
11441
11441
  };
11442
+ DOMUtils.prototype.initializeID = function () {
11443
+ this.chartID = Math.floor((1 + Math.random()) * 0x1000000000000).toString(16);
11444
+ };
11442
11445
  DOMUtils.prototype.addMainContainer = function () {
11443
11446
  var options = this.model.getOptions();
11444
11447
  var chartsprefix = tools_Tools.getProperty(options, 'style', 'prefix');
11445
11448
  var mainContainer = src_select(this.getHolder())
11446
11449
  .append('div')
11447
11450
  .classed(carbonPrefix + "--" + chartsprefix + "--chart-wrapper", true)
11451
+ .attr('id', "chart-" + this.getChartID())
11448
11452
  .style('height', '100%')
11449
11453
  .style('width', '100%');
11450
11454
  mainContainer.append('g').attr('class', CSS_VERIFIER_ELEMENT_CLASSNAME);
@@ -39625,7 +39629,9 @@ var toolbar_Toolbar = /** @class */ (function (_super) {
39625
39629
  Toolbar.prototype.render = function (animate) {
39626
39630
  var _this = this;
39627
39631
  if (animate === void 0) { animate = true; }
39628
- var container = this.getComponentContainer().attr('role', 'toolbar');
39632
+ var container = this.getComponentContainer()
39633
+ .attr('role', 'toolbar')
39634
+ .attr('aria-label', "chart-" + this.services.domUtils.getChartID() + " toolbar");
39629
39635
  var isDataLoading = tools_Tools.getProperty(this.getOptions(), 'data', 'loading');
39630
39636
  if (isDataLoading) {
39631
39637
  container.html('');
@@ -44179,6 +44185,10 @@ var heatmap_HeatmapModel = /** @class */ (function (_super) {
44179
44185
  if (domain[0] > 0) {
44180
44186
  domain[0] = 0;
44181
44187
  }
44188
+ else if (domain[0] === 0 && domain[1] === 0) {
44189
+ // Range cannot be between 0 and 0 (itself)
44190
+ return [0, 1];
44191
+ }
44182
44192
  // Ensure the median of the range is 0 if domain extends into both negative & positive
44183
44193
  if (domain[0] < 0 && domain[1] > 0) {
44184
44194
  if (Math.abs(domain[0]) > domain[1]) {
@@ -44326,7 +44336,7 @@ var heatmap_HeatmapModel = /** @class */ (function (_super) {
44326
44336
  */
44327
44337
  HeatmapModel.prototype.getTabularDataArray = function () {
44328
44338
  var displayData = this.getDisplayData();
44329
- var _a = this.assignRangeAndDomains(), primaryDomain = _a.primaryDomain, primaryRange = _a.primaryRange, secondaryDomain = _a.secondaryDomain, secondaryRange = _a.secondaryRange;
44339
+ var _a = this.assignRangeAndDomains(), primaryDomain = _a.primaryDomain, primaryRange = _a.primaryRange;
44330
44340
  var domainValueFormatter;
44331
44341
  var result = heatmap_spreadArrays([
44332
44342
  [primaryDomain.label, primaryRange.label, 'Value']
@@ -44378,7 +44388,7 @@ var heatmap_HeatmapModel = /** @class */ (function (_super) {
44378
44388
  }
44379
44389
  // Save scale type
44380
44390
  this._colorScale = quantize_quantize()
44381
- .domain(this.getValueDomain())
44391
+ .domain(domain)
44382
44392
  .range(colorPairing);
44383
44393
  };
44384
44394
  return HeatmapModel;