@widergy/energy-ui 1.132.2 → 1.132.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
@@ -1,3 +1,10 @@
1
+ ## [1.132.3](https://github.com/widergy/energy-ui/compare/v1.132.2...v1.132.3) (2022-10-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * round fix ([#315](https://github.com/widergy/energy-ui/issues/315)) ([419ea2e](https://github.com/widergy/energy-ui/commit/419ea2e7e705beaa12beebfeecd53109d240a6b4))
7
+
1
8
  ## [1.132.2](https://github.com/widergy/energy-ui/compare/v1.132.1...v1.132.2) (2022-10-31)
2
9
 
3
10
 
@@ -186,8 +186,8 @@ var UTBarChart = function UTBarChart(_ref) {
186
186
  GRAPH_Y_END = _getGraphAttributes.GRAPH_Y_END,
187
187
  GRAPH_Y_START = _getGraphAttributes.GRAPH_Y_START;
188
188
 
189
- var roundedMaxBarValue = (0, _utils.roundMaxValue)(maxBarValue);
190
- var roundedMaxLinearValue = (0, _utils.roundMaxValue)(maxLinearValue);
189
+ var roundedMaxBarValue = Math.round(maxBarValue);
190
+ var roundedMaxLinearValue = Math.round(maxLinearValue);
191
191
  var maxAbsoluteValue = Math.max(roundedMaxBarValue, roundedMaxLinearValue);
192
192
  var yAxis = d3.scaleLinear().domain([0, singleYAxis ? maxAbsoluteValue : roundedMaxBarValue]).range([GRAPH_Y_START, GRAPH_Y_END]);
193
193
  var xAxis = d3.scaleBand().domain(d3.range(formattedData[0].length)).range([GRAPH_X_START, GRAPH_X_END]).padding(barPadding);
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.roundMaxValue = exports.getPages = exports.getMinValue = exports.getMaxValues = exports.getMaxValue = exports.getGrid = exports.getGraphAttributes = exports.getFormattedLinearData = exports.getFormattedDecorators = exports.getFormattedData = exports.flattenData = exports.flattenAndReduceBarData = void 0;
8
+ exports.getPages = exports.getMinValue = exports.getMaxValues = exports.getMaxValue = exports.getGrid = exports.getGraphAttributes = exports.getFormattedLinearData = exports.getFormattedDecorators = exports.getFormattedData = exports.flattenData = exports.flattenAndReduceBarData = void 0;
9
9
 
10
10
  var _array = require("@widergy/web-utils/lib/array");
11
11
 
@@ -207,15 +207,4 @@ var getGrid = function getGrid(ticks, maxValue) {
207
207
  });
208
208
  };
209
209
 
210
- exports.getGrid = getGrid;
211
-
212
- var roundMaxValue = function roundMaxValue(maxValue) {
213
- var multipleOf = 5;
214
- var exponent = Math.floor(Math.log(maxValue) / Math.log(multipleOf));
215
- var fraction = maxValue / Math.pow(5, exponent);
216
- var niceFraction;
217
- if (fraction <= 1) niceFraction = 1;else if (fraction <= 2) niceFraction = 2;else niceFraction = multipleOf;
218
- return niceFraction * Math.pow(multipleOf, exponent);
219
- };
220
-
221
- exports.roundMaxValue = roundMaxValue;
210
+ exports.getGrid = getGrid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "1.132.2",
3
+ "version": "1.132.3",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",