gifted-charts-core 0.1.37 → 0.1.39

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.
@@ -419,7 +419,7 @@ export var useLineChartBiColor = function (props) {
419
419
  horizontalRulesStyle: horizontalRulesStyle,
420
420
  noOfSections: noOfSections,
421
421
  showFractionalValues: showFractionalValues,
422
- axesAndRulesProps: getAxesAndRulesProps(props, containerHeight, stepHeight, stepValue, noOfSections, (_50 = props.roundToDigits) !== null && _50 !== void 0 ? _50 : 0, 0, 0, 0, false, 0),
422
+ axesAndRulesProps: getAxesAndRulesProps(props, containerHeight, stepHeight, stepValue, noOfSections, (_50 = props.roundToDigits) !== null && _50 !== void 0 ? _50 : 0, stepValue, 0, 0, false, 0),
423
423
  yAxisLabelTexts: props.yAxisLabelTexts,
424
424
  yAxisOffset: props.yAxisOffset,
425
425
  rotateYAxisTexts: 0,
@@ -275,10 +275,10 @@ export var useLineChart = function (props) {
275
275
  var valuesRange = Math.max.apply(Math, __spreadArray([], __read(mergedPrimaryDataArrays.map(function (i) { return Math.max(i.value, 0); })), false)) - // find the largest +ve number
276
276
  Math.min.apply(// find the largest +ve number
277
277
  Math, __spreadArray([], __read(mergedPrimaryDataArrays.map(function (i) { return Math.max(i.value, 0); })), false)); // find the smallest +ve number
278
- var showFractionalValues = (_104 = props.showFractionalValues) !== null && _104 !== void 0 ? _104 : valuesRange <= 1;
278
+ var showFractionalValues = (_104 = props.showFractionalValues) !== null && _104 !== void 0 ? _104 : (isFinite(valuesRange) && valuesRange <= 1);
279
279
  var roundToDigits = (_105 = props.roundToDigits) !== null && _105 !== void 0 ? _105 : (showFractionalValues ? indexOfFirstNonZeroDigit(valuesRange) + 1 : 0);
280
280
  var _352 = computeMaxAndMinItems(mergedPrimaryDataArrays, roundToDigits, showFractionalValues), maxItem = _352.maxItem, minItem = _352.minItem;
281
- var maxValue = getMaxValue(props.maxValue, props.stepValue, noOfSections, maxItem);
281
+ var maxValue = getMaxValue(props.maxValue, props.stepValue, noOfSections, maxItem) || 10;
282
282
  var mostNegativeValue = (_106 = props.mostNegativeValue) !== null && _106 !== void 0 ? _106 : minItem;
283
283
  var overflowTop = ((_107 = props.overflowTop) !== null && _107 !== void 0 ? _107 : props.secondaryXAxis)
284
284
  ? AxesAndRulesDefaults.overflowTopWithSecondaryXAxis
@@ -199,11 +199,11 @@ export var useBarAndLineChartsWrapper = function (props) {
199
199
  scrollEventThrottle: scrollEventThrottle,
200
200
  xAxisLabelsVerticalShift: xAxisLabelsVerticalShift,
201
201
  selectedIndex: selectedIndex,
202
- yAxisOffset: lineConfig.isSecondary
202
+ yAxisOffset: (lineConfig === null || lineConfig === void 0 ? void 0 : lineConfig.isSecondary)
203
203
  ? (_16 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.yAxisOffset) !== null && _16 !== void 0 ? _16 : 0
204
204
  : yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0
205
205
  };
206
- var lineInBarChartProps2 = __assign(__assign({}, lineInBarChartProps), { lineConfig: lineConfig2, points: points2, data: lineData2 !== null && lineData2 !== void 0 ? lineData2 : [], yAxisOffset: lineConfig2.isSecondary
206
+ var lineInBarChartProps2 = __assign(__assign({}, lineInBarChartProps), { lineConfig: lineConfig2, points: points2, data: lineData2 !== null && lineData2 !== void 0 ? lineData2 : [], yAxisOffset: (lineConfig2 === null || lineConfig2 === void 0 ? void 0 : lineConfig2.isSecondary)
207
207
  ? (_17 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.yAxisOffset) !== null && _17 !== void 0 ? _17 : 0
208
208
  : yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0 });
209
209
  var verticalLinesProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
5
  "main": "./dist/index.js",
6
6
  "files": [