react-native-gifted-charts 1.4.33 → 1.4.34

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.
@@ -116,7 +116,7 @@ var RenderStackBars = function (props) {
116
116
  ] })) : null, stackItem.innerBarComponent && stackItem.innerBarComponent()] }, index));
117
117
  }), (item.barBackgroundPattern || barBackgroundPattern) && (_jsxs(Svg, { children: [_jsx(Defs, { children: item.barBackgroundPattern
118
118
  ? item.barBackgroundPattern()
119
- : barBackgroundPattern === null || barBackgroundPattern === void 0 ? void 0 : barBackgroundPattern() }), _jsx(Rect, { stroke: "none", x: "1", y: "1", width: "100%", height: "100%", fill: "url(#".concat(item.patternId || patternId, ")") })] }))] }), localBarInnerComponent ? (_jsx(View, { style: { height: '100%', width: '100%' }, children: localBarInnerComponent(item, index) })) : null, (item.topLabelComponent || showValuesAsTopLabel) && (_jsx(View, { style: [
119
+ : barBackgroundPattern === null || barBackgroundPattern === void 0 ? void 0 : barBackgroundPattern() }), _jsx(Rect, { stroke: "none", x: "1", y: "1", width: "100%", height: totalHeight, fill: "url(#".concat(item.patternId || patternId, ")") })] }))] }), localBarInnerComponent ? (_jsx(View, { style: { height: '100%', width: '100%' }, children: localBarInnerComponent(item, index) })) : null, (item.topLabelComponent || showValuesAsTopLabel) && (_jsx(View, { style: [
120
120
  {
121
121
  position: 'absolute',
122
122
  top: containsNegativeValue
@@ -24,7 +24,7 @@ export var StripAndLabel = function (props) {
24
24
  : -pointerYLocal + 8,
25
25
  width: pointerStripWidth,
26
26
  height: pointerStripUptoDataPoint
27
- ? containerHeight - pointerYLocal + 10 - xAxisThickness
27
+ ? containerHeight - pointerYLocal + 4 - xAxisThickness
28
28
  : pointerStripHeight + (containsNegative ? 10 : 0),
29
29
  marginTop: pointerStripUptoDataPoint
30
30
  ? 0
@@ -34,7 +34,7 @@ export var StripAndLabel = function (props) {
34
34
  }, children: _jsx(Svg, { children: _jsx(Line, { stroke: pointerStripColor, strokeWidth: pointerStripWidth, strokeDasharray: (pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.strokeDashArray)
35
35
  ? pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.strokeDashArray
36
36
  : '', x1: 0, y1: 0, x2: 0, y2: pointerStripUptoDataPoint
37
- ? containerHeight - pointerYLocal + 10 - xAxisThickness
37
+ ? containerHeight - pointerYLocal + 4 - xAxisThickness
38
38
  : pointerStripHeight + 10 }) }) })) : null, pointerLabelComponent ? (_jsx(View, { pointerEvents: pointerEvents !== null && pointerEvents !== void 0 ? pointerEvents : 'none', style: [
39
39
  {
40
40
  position: 'absolute',
@@ -248,7 +248,7 @@ export var LineChartBicolor = function (props) {
248
248
  ? fillPointsArray.map(function (item, index) {
249
249
  return (_jsx(Path, { d: item.points, fill: item.color === 'green'
250
250
  ? 'url(#Gradient)'
251
- : 'url(#GradientNegative)', stroke: 'transparent', strokeWidth: currentLineThickness || thickness }, index));
251
+ : 'url(#GradientNegative)', stroke: 'none', strokeWidth: currentLineThickness || thickness }, index));
252
252
  })
253
253
  : null, renderSpecificVerticalLines(data), !hideDataPoints1
254
254
  ? renderDataPoints(data, dataPointsShape1, dataPointsWidth1, dataPointsHeight1, dataPointsColor1, dataPointsRadius1, textColor1, textFontSize1, startIndex1, endIndex1)
@@ -196,7 +196,7 @@ export var LineChart = function (props) {
196
196
  ]);
197
197
  var svgWrapperViewStyle = {
198
198
  position: 'absolute',
199
- bottom: 62 +
199
+ bottom: 63 +
200
200
  xAxisLabelsVerticalShift +
201
201
  labelsExtraHeight -
202
202
  xAxisThickness -
@@ -262,7 +262,7 @@ export var LineChart = function (props) {
262
262
  var getYOrSecondaryY = isSecondary ? getSecondaryY : getY;
263
263
  return dataForRender.map(function (item, index) {
264
264
  var _a;
265
- var _b, _c, _d, _e, _f;
265
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
266
266
  if (index < startIndex || index > endIndex)
267
267
  return null;
268
268
  if (item.hideDataPoint) {
@@ -290,10 +290,7 @@ export var LineChart = function (props) {
290
290
  props.focusedDataPointColor ||
291
291
  LineDefaults.focusedDataPointColor;
292
292
  dataPointsRadius =
293
- item.focusedDataPointRadius ||
294
- props.focusedDataPointRadius ||
295
- item.dataPointRadius ||
296
- dataPtsRadius;
293
+ (_d = (_c = (_b = item.focusedDataPointRadius) !== null && _b !== void 0 ? _b : props.focusedDataPointRadius) !== null && _c !== void 0 ? _c : item.dataPointRadius) !== null && _d !== void 0 ? _d : dataPtsRadius;
297
294
  if (showTextOnFocus) {
298
295
  text = item.dataPointText;
299
296
  }
@@ -310,7 +307,7 @@ export var LineChart = function (props) {
310
307
  dataPointsWidth = item.dataPointWidth || dataPtsWidth;
311
308
  dataPointsHeight = item.dataPointHeight || dataPtsHeight;
312
309
  dataPointsColor = item.dataPointColor || dataPtsColor;
313
- dataPointsRadius = item.dataPointRadius || dataPtsRadius;
310
+ dataPointsRadius = (_e = item.dataPointRadius) !== null && _e !== void 0 ? _e : dataPtsRadius;
314
311
  if (showTextOnFocus) {
315
312
  text = '';
316
313
  }
@@ -320,10 +317,10 @@ export var LineChart = function (props) {
320
317
  if (showValuesAsDataPointsText) {
321
318
  text = originalDataFromProps[index].value;
322
319
  }
323
- var currentStripHeight = (_b = item.stripHeight) !== null && _b !== void 0 ? _b : stripHeight;
324
- var currentStripWidth = (_c = item.stripWidth) !== null && _c !== void 0 ? _c : stripWidth;
325
- var currentStripOpacity = (_d = item.stripOpacity) !== null && _d !== void 0 ? _d : stripOpacity;
326
- var currentStripStrokeDashArray = (_f = (_e = item.stripStrokeDashArray) !== null && _e !== void 0 ? _e : stripStrokeDashArray) !== null && _f !== void 0 ? _f : '';
320
+ var currentStripHeight = (_f = item.stripHeight) !== null && _f !== void 0 ? _f : stripHeight;
321
+ var currentStripWidth = (_g = item.stripWidth) !== null && _g !== void 0 ? _g : stripWidth;
322
+ var currentStripOpacity = (_h = item.stripOpacity) !== null && _h !== void 0 ? _h : stripOpacity;
323
+ var currentStripStrokeDashArray = (_k = (_j = item.stripStrokeDashArray) !== null && _j !== void 0 ? _j : stripStrokeDashArray) !== null && _k !== void 0 ? _k : '';
327
324
  var currentStripColor = item.stripColor || stripColor;
328
325
  var position = I18nManager.isRTL ? 'right' : 'left';
329
326
  var y1 = currentStripHeight
@@ -765,7 +762,7 @@ export var LineChart = function (props) {
765
762
  onResponderEnd: function (evt) {
766
763
  // console.log('evt...end.......',evt);
767
764
  setResponderStartTime(0);
768
- setPointerIndex(-1);
765
+ // setPointerIndex(-1);
769
766
  setResponderActive(false);
770
767
  if (!persistPointer)
771
768
  setTimeout(function () { return setPointerX(0); }, pointerVanishDelay);
@@ -818,7 +815,7 @@ export var LineChart = function (props) {
818
815
  onResponderEnd: function (evt) {
819
816
  // console.log('evt...end.......',evt);
820
817
  setResponderStartTime(0);
821
- setPointerIndex(-1);
818
+ // setPointerIndex(-1);
822
819
  setResponderActive(false);
823
820
  if (!persistPointer)
824
821
  setTimeout(function () { return setPointerX(0); }, pointerVanishDelay);
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { View } from 'react-native';
13
+ import { Platform, View } from 'react-native';
14
14
  import { PieChartMain } from './main';
15
15
  import { pieColors, usePieChart } from 'gifted-charts-core';
16
16
  export var PieChart = function (props) {
@@ -77,7 +77,7 @@ export var PieChart = function (props) {
77
77
  position: 'absolute',
78
78
  top: -extraRadius,
79
79
  left: -extraRadius,
80
- zIndex: -1, // was not getting displayed in web (using Expo)
80
+ zIndex: Platform.OS === 'web' ? -1 : 0, // was not getting displayed in web (using Expo)
81
81
  }, children: _jsx(PieChartMain, __assign({}, props, { data: [
82
82
  {
83
83
  value: props.data[selectedIndex].value,
@@ -57,7 +57,7 @@ export var PieChartMain = function (props) {
57
57
  : item.strokeWidth === 0
58
58
  ? 0
59
59
  : item.strokeWidth || strokeWidth, fill: props.selectedIndex === index || item.peripheral
60
- ? 'transparent'
60
+ ? 'none'
61
61
  : showGradient
62
62
  ? "url(#grad".concat(index, ")")
63
63
  : item.color || pieColors[index % 9], onPressIn: function () {
@@ -71,10 +71,10 @@ export var PieChartPro = function (props) {
71
71
  }) }), data.map(function (item, index) {
72
72
  var _a, _b, _c, _d;
73
73
  var borderWidth = (_a = item.strokeWidth) !== null && _a !== void 0 ? _a : strokeWidth;
74
- var borderColor = (_c = (_b = item.strokeColor) !== null && _b !== void 0 ? _b : props.strokeColor) !== null && _c !== void 0 ? _c : (borderWidth ? 'black' : 'transparent');
74
+ var borderColor = (_c = (_b = item.strokeColor) !== null && _b !== void 0 ? _b : props.strokeColor) !== null && _c !== void 0 ? _c : (borderWidth ? 'black' : 'none');
75
75
  var strokeDashArrayLocal = (_d = item.strokeDashArray) !== null && _d !== void 0 ? _d : strokeDashArray;
76
76
  return (_jsx(AnimatedPath, { id: "renderPath", d: isAnimated ? animatedPaths[index] : dFinal[index], fill: ring
77
- ? 'transparent'
77
+ ? 'none'
78
78
  : showGradient
79
79
  ? "url(#grad".concat(index, ")")
80
80
  : data[index].color || pieColors[index % 9], strokeWidth: borderWidth, strokeDasharray: strokeDashArrayLocal, stroke: borderColor }, "path".concat(index)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gifted-charts",
3
- "version": "1.4.33",
3
+ "version": "1.4.34",
4
4
  "description": "The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar and Population Pyramid charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -25,7 +25,7 @@
25
25
  "registry": "https://registry.npmjs.org/"
26
26
  },
27
27
  "dependencies": {
28
- "gifted-charts-core": "^0.1.34"
28
+ "gifted-charts-core": "^0.1.35"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@babel/cli": "^7.24.8",