@carbon/charts-vue 0.41.31 → 0.41.32

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,7 +3,7 @@
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.41.31](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.30...v0.41.31) (2021-02-05)
6
+ ## [0.41.32](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.31...v0.41.32) (2021-02-12)
7
7
 
8
8
  **Note:** Version bump only for package @carbon/charts-vue
9
9
 
@@ -11,13 +11,13 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [0.41.30](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.29...v0.41.30) (2021-02-01)
14
+ ## [0.41.31](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.30...v0.41.31) (2021-02-05)
15
15
 
16
16
  **Note:** Version bump only for package @carbon/charts-vue
17
17
 
18
+ ## [0.41.30](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.29...v0.41.30) (2021-02-01)
18
19
 
19
-
20
-
20
+ **Note:** Version bump only for package @carbon/charts-vue
21
21
 
22
22
  ## [0.41.29](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.28...v0.41.29) (2021-01-29)
23
23
 
@@ -25765,8 +25765,9 @@ var gauge_Gauge = /** @class */ (function (_super) {
25765
25765
  }
25766
25766
  // Add the numbers at the center
25767
25767
  var numbersGroup = dom_utils_DOMUtils.appendOrSelect(svg, 'g.gauge-numbers').attr('transform', "translate(0, " + numbersYPosition + ")");
25768
+ var fontSize = valueFontSize(radius);
25768
25769
  // Add the big number
25769
- var valueNumberGroup = dom_utils_DOMUtils.appendOrSelect(numbersGroup, 'g.gauge-value-number').attr('transform', 'translate(-10, 0)'); // Optical centering for the presence of the smaller % symbol
25770
+ var valueNumberGroup = dom_utils_DOMUtils.appendOrSelect(numbersGroup, 'g.gauge-value-number');
25770
25771
  var numberFormatter = tools_Tools.getProperty(options, 'gauge', 'numberFormatter');
25771
25772
  var valueNumber = valueNumberGroup
25772
25773
  .selectAll('text.gauge-value-number')
@@ -25776,15 +25777,22 @@ var gauge_Gauge = /** @class */ (function (_super) {
25776
25777
  .append('text')
25777
25778
  .attr('class', 'gauge-value-number')
25778
25779
  .merge(valueNumber)
25779
- .style('font-size', valueFontSize(radius) + "px")
25780
+ .style('font-size', fontSize + "px")
25780
25781
  .attr('text-anchor', 'middle')
25781
25782
  .text(function (d) { return numberFormatter(d); });
25782
25783
  // add the percentage symbol beside the valueNumber
25783
25784
  var valueNumberWidth = dom_utils_DOMUtils.getSVGElementSize(dom_utils_DOMUtils.appendOrSelect(svg, 'text.gauge-value-number'), { useBBox: true }).width;
25784
- dom_utils_DOMUtils.appendOrSelect(valueNumberGroup, 'text.gauge-value-symbol')
25785
- .style('font-size', valueFontSize(radius) / 2 + "px")
25785
+ var symbolFontSize = fontSize / 2;
25786
+ var symbol = dom_utils_DOMUtils.appendOrSelect(valueNumberGroup, 'text.gauge-value-symbol')
25787
+ .style('font-size', symbolFontSize + "px")
25786
25788
  .attr('x', valueNumberWidth / 2)
25787
25789
  .text('%');
25790
+ var _a = dom_utils_DOMUtils.getSVGElementSize(symbol, { useBBox: true }), symbolWidth = _a.width, symbolHeight = _a.height;
25791
+ // adjust the symbol to superscript using the bbox instead of the font-size cause
25792
+ // we want to align the actual character to the value number
25793
+ symbol.attr('y', "-" + symbolHeight / 2 + "px");
25794
+ // move the value group depending on the symbol's drawn size
25795
+ valueNumberGroup.attr('transform', "translate(-" + symbolWidth / 2 + ", 0)"); // Optical centering for the presence of the smaller % symbol
25788
25796
  };
25789
25797
  /**
25790
25798
  * adds the delta number for the gauge