@carbon/charts-vue 0.52.2 → 0.53.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,38 @@
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.53.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.53.0...v0.53.1) (2021-12-02)
7
+
8
+ **Note:** Version bump only for package @carbon/charts-vue
9
+
10
+
11
+
12
+
13
+
14
+ # [0.53.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.52.4...v0.53.0) (2021-12-01)
15
+
16
+ **Note:** Version bump only for package @carbon/charts-vue
17
+
18
+
19
+
20
+
21
+
22
+ ## [0.52.4](https://github.com/carbon-design-system/carbon-charts/compare/v0.52.3...v0.52.4) (2021-12-01)
23
+
24
+ **Note:** Version bump only for package @carbon/charts-vue
25
+
26
+
27
+
28
+
29
+
30
+ ## [0.52.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.52.2...v0.52.3) (2021-11-22)
31
+
32
+ **Note:** Version bump only for package @carbon/charts-vue
33
+
34
+
35
+
36
+
37
+
6
38
  ## [0.52.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.52.1...v0.52.2) (2021-11-19)
7
39
 
8
40
  **Note:** Version bump only for package @carbon/charts-vue
@@ -1071,6 +1071,7 @@ var meter = {
1071
1071
  },
1072
1072
  total: {
1073
1073
  paddingLeft: 36,
1074
+ paddingRight: 24,
1074
1075
  },
1075
1076
  height: {
1076
1077
  default: 8,
@@ -9717,7 +9718,9 @@ var model_ChartModel = /** @class */ (function () {
9717
9718
  var _b = _a.percentage, percentage = _b === void 0 ? false : _b, _c = _a.groups, groups = _c === void 0 ? null : _c, _d = _a.divergent, divergent = _d === void 0 ? false : _d;
9718
9719
  var options = this.getOptions();
9719
9720
  var groupMapsTo = options.data.groupMapsTo;
9720
- var dataGroupNames = this.getDataGroupNames(groups);
9721
+ // Get only active data groups so non-active data groups are not rendered
9722
+ // on legend item click
9723
+ var dataGroupNames = this.getActiveDataGroupNames(groups);
9721
9724
  var dataValuesGroupedByKeys = this.getDataValuesGroupedByKeys({
9722
9725
  groups: groups,
9723
9726
  });
@@ -23272,9 +23275,9 @@ var title_meter_MeterTitle = /** @class */ (function (_super) {
23272
23275
  title.exit().remove();
23273
23276
  // appends the associated percentage after title
23274
23277
  this.appendPercentage();
23275
- // if status ranges are provided (custom or default), display indicator
23276
- this.displayStatus();
23277
23278
  }
23279
+ // if status ranges are provided (custom or default), display indicator
23280
+ this.displayStatus();
23278
23281
  // get the max width of a title (with consideration for the status/percentage)
23279
23282
  var maxWidth = this.getMaxTitleWidth();
23280
23283
  var titleElement = dom_utils_DOMUtils.appendOrSelect(svg, 'text.meter-title');
@@ -23345,7 +23348,7 @@ var title_meter_MeterTitle = /** @class */ (function (_super) {
23345
23348
  var totalString = totalFormatter !== null
23346
23349
  ? totalFormatter(totalValue)
23347
23350
  : total + " " + unit + " total";
23348
- var containerBounds = dom_utils_DOMUtils.getSVGElementSize(this.services.domUtils.getMainContainer(), { useAttrs: true });
23351
+ var containerBounds = dom_utils_DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer());
23349
23352
  // need to check if the width is 0, and try to use the parent attribute
23350
23353
  // this can happen if the chart is toggled on/off and the height is 0 for the parent, it wont validateDimensions
23351
23354
  var containerWidth = containerBounds.width
@@ -23359,7 +23362,10 @@ var title_meter_MeterTitle = /** @class */ (function (_super) {
23359
23362
  .append('text')
23360
23363
  .classed('proportional-meter-total', true)
23361
23364
  .merge(title)
23362
- .attr('x', containerWidth)
23365
+ // Position the total text -24 pixels to add spacing between text and status icon (if status exists)
23366
+ .attr('x', this.model.getStatus()
23367
+ ? containerWidth - meter.total.paddingRight
23368
+ : containerWidth)
23363
23369
  .attr('y', '1em')
23364
23370
  .attr('text-anchor', 'end')
23365
23371
  .text(function (d) { return d; });
@@ -39249,7 +39255,7 @@ var zoom_bar_ZoomBar = /** @class */ (function (_super) {
39249
39255
  }, { skipUpdate: true });
39250
39256
  }
39251
39257
  else if (newInitialZoomDomain === null &&
39252
- oldInitialZoomDomain != null) {
39258
+ oldInitialZoomDomain !== null) {
39253
39259
  // if newInitialZoomDomain is set to null (when oldInitialZoomDomain is not null)
39254
39260
  // save initialZoomDomain and reset zoom domain to default domain
39255
39261
  this.model.set({
@@ -41545,9 +41551,18 @@ var meter_MeterChartModel = /** @class */ (function (_super) {
41545
41551
  */
41546
41552
  MeterChartModel.prototype.getStatus = function () {
41547
41553
  var options = this.getOptions();
41548
- var dataValue = tools_Tools.getProperty(this.getDisplayData(), 0, 'value');
41554
+ var dataValues = tools_Tools.getProperty(this.getDisplayData());
41555
+ var totalValue = (dataValues
41556
+ ? dataValues.reduce(function (previous, current) {
41557
+ return { value: previous.value + current.value };
41558
+ })
41559
+ : 0).value;
41549
41560
  // use max value if the percentage is bigger than 100%
41550
- var boundedValue = dataValue > 100 ? 100 : dataValue;
41561
+ var boundedValue = tools_Tools.getProperty(options, 'meter', 'proportional')
41562
+ ? totalValue
41563
+ : totalValue > 100
41564
+ ? 100
41565
+ : totalValue;
41551
41566
  // user needs to supply ranges
41552
41567
  var allRanges = tools_Tools.getProperty(options, 'meter', 'status', 'ranges');
41553
41568
  if (allRanges) {
@@ -41704,7 +41719,9 @@ var meter_Meter = /** @class */ (function (_super) {
41704
41719
  // rect with the value binded
41705
41720
  var valued = svg.selectAll('rect.value').data(stackedData);
41706
41721
  // if user provided a color for the bar, we dont want to attach a status class
41707
- var className = status != null && !self.model.isUserProvidedColorScaleValid()
41722
+ var className = status != null &&
41723
+ !self.model.isUserProvidedColorScaleValid() &&
41724
+ !proportional
41708
41725
  ? "value status--" + status
41709
41726
  : 'value';
41710
41727
  // draw the value bar
@@ -41750,9 +41767,7 @@ var meter_Meter = /** @class */ (function (_super) {
41750
41767
  .attr('aria-label', function (d) { return d.value; });
41751
41768
  valued.exit().remove();
41752
41769
  // draw the peak
41753
- var peakValue = proportional
41754
- ? null
41755
- : tools_Tools.getProperty(options, 'meter', 'peak');
41770
+ var peakValue = tools_Tools.getProperty(options, 'meter', 'peak');
41756
41771
  var peakData = peakValue;
41757
41772
  if (peakValue !== null) {
41758
41773
  if (peakValue > domainMax) {
@@ -41774,7 +41789,11 @@ var meter_Meter = /** @class */ (function (_super) {
41774
41789
  .attr('y1', 0)
41775
41790
  .attr('y2', function () {
41776
41791
  var userProvidedHeight = tools_Tools.getProperty(options, 'meter', 'height');
41777
- return userProvidedHeight ? userProvidedHeight : 8;
41792
+ return userProvidedHeight
41793
+ ? userProvidedHeight
41794
+ : proportional
41795
+ ? meter.height.proportional
41796
+ : meter.height.default;
41778
41797
  })
41779
41798
  .transition()
41780
41799
  .call(function (t) {