react-native-gifted-charts 1.4.73 → 1.4.75

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/README.md CHANGED
@@ -104,10 +104,10 @@ const data=[ {value:50}, {value:80}, {value:90}, {value:70} ]
104
104
  <PieChart data = {data} />
105
105
  <PopulationPyramid data = {[{left:10,right:12}, {left:9,right:8}]} />
106
106
  <RadarChart data = {[50, 80, 90, 70]} />
107
- <BubbleChart data = {
107
+ <BubbleChart data = {[
108
108
  {x: 20, y: 4, r: 10},
109
109
  {x: 40, y: 6, r: 20},
110
- } />
110
+ ]} />
111
111
 
112
112
  // For Horizontal Bar chart, just add the prop horizontal to the <BarChart/> component
113
113
 
@@ -9,25 +9,43 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __read = (this && this.__read) || function (o, n) {
13
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
14
+ if (!m) return o;
15
+ var i = m.call(o), r, ar = [], e;
16
+ try {
17
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
+ }
19
+ catch (error) { e = { error: error }; }
20
+ finally {
21
+ try {
22
+ if (r && !r.done && (m = i["return"])) m.call(i);
23
+ }
24
+ finally { if (e) throw e.error; }
25
+ }
26
+ return ar;
27
+ };
12
28
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { BubbleDefaults, useBubbleChart, } from 'gifted-charts-core';
29
+ import { BubbleDefaults, defaultBubbleColors, useBubbleChart, withinMinMaxRange, } from 'gifted-charts-core';
14
30
  import BarAndLineChartsWrapper from '../Components/BarAndLineChartsWrapper';
15
- import { Fragment, useCallback, useEffect, useMemo, useRef } from 'react';
31
+ import { Fragment, useCallback, useEffect, useMemo, useRef, useState, } from 'react';
16
32
  import { Animated, Easing, I18nManager, Text, View, } from 'react-native';
17
- import { Circle, ForeignObject, Rect, Svg, Line } from 'react-native-svg';
18
- import { isWebApp, screenWidth } from '../utils';
33
+ import { Circle, ForeignObject, Rect, Svg, Line, RadialGradient, Stop, Defs, } from 'react-native-svg';
34
+ import { isAndroid, isWebApp, screenWidth } from '../utils';
19
35
  var AnimatedCircle = Animated.createAnimatedComponent(Circle);
20
36
  var AnimatedRect = Animated.createAnimatedComponent(Rect);
21
37
  var AnimatedLine = Animated.createAnimatedComponent(Line);
22
38
  export var BubbleChart = function (props) {
23
- var _a, _b, _c, _d, _e, _f;
39
+ var _a, _b, _c, _d;
24
40
  var opacityValue = useMemo(function () { return new Animated.Value(0); }, []);
25
41
  var pointsOpacityValue = useMemo(function () { return new Animated.Value(0); }, []);
26
42
  var secondaryXAxis = props.secondaryXAxis, xAxisLabelTextStyle = props.xAxisLabelTextStyle, formatBubbleLabel = props.formatBubbleLabel;
27
- var _g = useBubbleChart(__assign(__assign({}, props), { parentWidth: (_a = props.parentWidth) !== null && _a !== void 0 ? _a : screenWidth })), barAndLineChartsWrapperProps = _g.barAndLineChartsWrapperProps, totalWidth = _g.totalWidth, animationDuration = _g.animationDuration, _h = _g.containerHeightIncludingBelowXAxis, containerHeightIncludingBelowXAxis = _h === void 0 ? 0 : _h, getY = _g.getY, getX = _g.getX, maxValue = _g.maxValue, selectedIndex = _g.selectedIndex, setSelectedIndex = _g.setSelectedIndex, showTextOnFocus = _g.showTextOnFocus, focusEnabled = _g.focusEnabled, focusTogether = _g.focusTogether, selectedLineNumber = _g.selectedLineNumber, lastLineNumber = _g.lastLineNumber, initialSpacing = _g.initialSpacing, spacing = _g.spacing, containerHeight = _g.containerHeight, handleFocus = _g.handleFocus, handleUnFocus = _g.handleUnFocus, isAnimated = _g.isAnimated, showBubbleOnFocus = _g.showBubbleOnFocus, showBubbleLabelOnFocus = _g.showBubbleLabelOnFocus, bubblesShape = _g.bubblesShape, bubblesWidth = _g.bubblesWidth, bubblesHeight = _g.bubblesHeight, bubblesColor = _g.bubblesColor, bubblesRadius = _g.bubblesRadius, labelFontSize = _g.labelFontSize, labelTextStyle = _g.labelTextStyle, startIndex = _g.startIndex, endIndex = _g.endIndex, showValuesAsBubbleLabels = _g.showValuesAsBubbleLabels, hideBubbles = _g.hideBubbles, xAxisLabelsVerticalShift = _g.xAxisLabelsVerticalShift, labelsExtraHeight = _g.labelsExtraHeight, xAxisThickness = _g.xAxisThickness, xAxisTextNumberOfLines = _g.xAxisTextNumberOfLines, rotateLabel = _g.rotateLabel, allowFontScaling = _g.allowFontScaling, borderColor = _g.borderColor, borderWidth = _g.borderWidth, opacity = _g.opacity, xAxisLabelTexts = _g.xAxisLabelTexts, showRegressionLine = _g.showRegressionLine, regressionLineX1 = _g.regressionLineX1, regressionLineY1 = _g.regressionLineY1, regressionLineX2 = _g.regressionLineX2, regressionLineY2 = _g.regressionLineY2, regressionLineConfig = _g.regressionLineConfig, scatterChart = _g.scatterChart;
43
+ var _e = useBubbleChart(__assign(__assign({}, props), { parentWidth: (_a = props.parentWidth) !== null && _a !== void 0 ? _a : screenWidth })), data = _e.data, barAndLineChartsWrapperProps = _e.barAndLineChartsWrapperProps, totalWidth = _e.totalWidth, animationDuration = _e.animationDuration, _f = _e.containerHeightIncludingBelowXAxis, containerHeightIncludingBelowXAxis = _f === void 0 ? 0 : _f, getY = _e.getY, getX = _e.getX, maxValue = _e.maxValue, selectedIndex = _e.selectedIndex, setSelectedIndex = _e.setSelectedIndex, showTextOnFocus = _e.showTextOnFocus, focusEnabled = _e.focusEnabled, focusTogether = _e.focusTogether, selectedLineNumber = _e.selectedLineNumber, lastLineNumber = _e.lastLineNumber, initialSpacing = _e.initialSpacing, spacing = _e.spacing, containerHeight = _e.containerHeight, handleFocus = _e.handleFocus, handleUnFocus = _e.handleUnFocus, isAnimated = _e.isAnimated, showBubbleOnFocus = _e.showBubbleOnFocus, showBubbleLabelOnFocus = _e.showBubbleLabelOnFocus, bubblesShape = _e.bubblesShape, bubblesWidth = _e.bubblesWidth, bubblesHeight = _e.bubblesHeight, bubblesColor = _e.bubblesColor, bubblesRadius = _e.bubblesRadius, labelFontSize = _e.labelFontSize, labelMaxLength = _e.labelMaxLength, labelTextStyle = _e.labelTextStyle, startIndex = _e.startIndex, endIndex = _e.endIndex, showValuesAsBubbleLabels = _e.showValuesAsBubbleLabels, hideBubbles = _e.hideBubbles, xAxisLabelsVerticalShift = _e.xAxisLabelsVerticalShift, labelsExtraHeight = _e.labelsExtraHeight, xAxisThickness = _e.xAxisThickness, xAxisTextNumberOfLines = _e.xAxisTextNumberOfLines, rotateLabel = _e.rotateLabel, allowFontScaling = _e.allowFontScaling, borderColor = _e.borderColor, borderWidth = _e.borderWidth, opacity = _e.opacity, borderOpacity = _e.borderOpacity, xAxisLabelTexts = _e.xAxisLabelTexts, showRegressionLine = _e.showRegressionLine, regressionLineX1 = _e.regressionLineX1, regressionLineY1 = _e.regressionLineY1, regressionLineX2 = _e.regressionLineX2, regressionLineY2 = _e.regressionLineY2, regressionLineCoordinates = _e.regressionLineCoordinates, regressionLineConfig = _e.regressionLineConfig, regressionLineConfigs = _e.regressionLineConfigs, scatterChart = _e.scatterChart, maxRadius = _e.maxRadius, minRadius = _e.minRadius, extraWidthDueToBubble = _e.extraWidthDueToBubble, showGradient = _e.showGradient, centerColorForGradient = _e.centerColorForGradient;
28
44
  var progress = useRef(new Animated.Value(0)).current;
29
45
  var AnimatedRegressionLineX = useRef(new Animated.Value(0)).current;
30
46
  var AnimatedRegressionLineY = useRef(new Animated.Value(0)).current;
47
+ var animatedRegressionLineXValues = useMemo(function () { return regressionLineConfigs.map(function () { return new Animated.Value(0); }); }, [regressionLineConfigs.length]);
48
+ var animatedRegressionLineYValues = useMemo(function () { return regressionLineConfigs.map(function () { return new Animated.Value(0); }); }, [regressionLineConfigs.length]);
31
49
  var scrollRef = (_b = props.scrollRef) !== null && _b !== void 0 ? _b : useRef(null);
32
50
  var widthValue = useMemo(function () { return new Animated.Value(0); }, []);
33
51
  var appearingOpacity = opacityValue.interpolate({
@@ -39,36 +57,84 @@ export var BubbleChart = function (props) {
39
57
  // outputRange:[regressionLineX1,regressionLineX2]
40
58
  // })
41
59
  var growingRadii = useMemo(function () {
42
- var _a;
43
- return ((_a = props.data) !== null && _a !== void 0 ? _a : []).map(function (item) {
60
+ return (data !== null && data !== void 0 ? data : []).map(function (item) {
44
61
  var _a;
45
62
  return progress.interpolate({
46
63
  inputRange: [0, 1],
47
- outputRange: [0, (_a = item.r) !== null && _a !== void 0 ? _a : bubblesRadius],
64
+ outputRange: [
65
+ 0,
66
+ withinMinMaxRange((_a = item.r) !== null && _a !== void 0 ? _a : bubblesRadius, maxRadius, minRadius),
67
+ ],
48
68
  });
49
69
  });
50
- }, [props.data, progress]);
51
- var growingHeight = ((_c = props.data) !== null && _c !== void 0 ? _c : []).map(function (_, i) {
52
- var _a, _b;
70
+ }, [data, progress]);
71
+ var growingHeight = (data !== null && data !== void 0 ? data : []).map(function (_, i) {
72
+ var _a;
53
73
  return progress.interpolate({
54
74
  inputRange: [0, 1],
55
- outputRange: [0, (_b = (_a = props.data) === null || _a === void 0 ? void 0 : _a[i].bubbleHeight) !== null && _b !== void 0 ? _b : bubblesHeight],
75
+ outputRange: [0, (_a = data === null || data === void 0 ? void 0 : data[i].bubbleHeight) !== null && _a !== void 0 ? _a : bubblesHeight],
56
76
  });
57
77
  });
58
- var growingWidth = ((_d = props.data) !== null && _d !== void 0 ? _d : []).map(function (_, i) {
59
- var _a, _b;
78
+ var growingWidth = (data !== null && data !== void 0 ? data : []).map(function (_, i) {
79
+ var _a;
60
80
  return progress.interpolate({
61
81
  inputRange: [0, 1],
62
- outputRange: [0, (_b = (_a = props.data) === null || _a === void 0 ? void 0 : _a[i].bubbleWidth) !== null && _b !== void 0 ? _b : bubblesWidth],
82
+ outputRange: [0, (_a = data === null || data === void 0 ? void 0 : data[i].bubbleWidth) !== null && _a !== void 0 ? _a : bubblesWidth],
63
83
  });
64
84
  });
65
85
  var appearingDataPoints = pointsOpacityValue.interpolate({
66
86
  inputRange: [0, 1],
67
87
  outputRange: [0, opacity],
68
88
  });
89
+ var appearingDataPointsAndroid = pointsOpacityValue.interpolate({
90
+ inputRange: [0, 1],
91
+ outputRange: [0, opacity / 2], // hack to show slightly transparent bubbles while animating, as gradient on Android can't be animated
92
+ });
93
+ var appearingBorder = pointsOpacityValue.interpolate({
94
+ inputRange: [0, 1],
95
+ outputRange: [0, borderOpacity],
96
+ });
69
97
  var drawRegressionLine = useCallback(function () {
70
- if (!regressionLineConfig.isAnimated)
98
+ var hasMultipleRegressionLines = regressionLineConfigs.length > 0;
99
+ if (hasMultipleRegressionLines) {
100
+ var animations_1 = [];
101
+ regressionLineConfigs.forEach(function (config, index) {
102
+ if (!config.isAnimated) {
103
+ return;
104
+ }
105
+ var coordinates = regressionLineCoordinates[index];
106
+ if (!coordinates) {
107
+ return;
108
+ }
109
+ var x1 = coordinates.regressionLineX1, x2 = coordinates.regressionLineX2, y1 = coordinates.regressionLineY1, y2 = coordinates.regressionLineY2;
110
+ var animatedX = animatedRegressionLineXValues[index];
111
+ var animatedY = animatedRegressionLineYValues[index];
112
+ if (!animatedX || !animatedY) {
113
+ return;
114
+ }
115
+ animatedX.setValue(x1);
116
+ animatedY.setValue(y1);
117
+ animations_1.push(Animated.timing(animatedX, {
118
+ toValue: x2,
119
+ duration: config.animationDuration,
120
+ easing: Easing.linear,
121
+ useNativeDriver: false, // SVG props
122
+ }));
123
+ animations_1.push(Animated.timing(animatedY, {
124
+ toValue: y2,
125
+ duration: config.animationDuration,
126
+ easing: Easing.linear,
127
+ useNativeDriver: false, // SVG props
128
+ }));
129
+ });
130
+ if (animations_1.length) {
131
+ Animated.parallel(animations_1).start();
132
+ }
133
+ return;
134
+ }
135
+ if (!regressionLineConfig.isAnimated) {
71
136
  return;
137
+ }
72
138
  AnimatedRegressionLineX.setValue(regressionLineX1);
73
139
  AnimatedRegressionLineY.setValue(regressionLineY1);
74
140
  Animated.parallel([
@@ -85,7 +151,17 @@ export var BubbleChart = function (props) {
85
151
  useNativeDriver: false, // SVG props
86
152
  }),
87
153
  ]).start();
88
- }, [regressionLineConfig]);
154
+ }, [
155
+ regressionLineConfig,
156
+ regressionLineX1,
157
+ regressionLineX2,
158
+ regressionLineY1,
159
+ regressionLineY2,
160
+ regressionLineConfigs,
161
+ regressionLineCoordinates,
162
+ animatedRegressionLineXValues,
163
+ animatedRegressionLineYValues,
164
+ ]);
89
165
  var decreaseWidth = useCallback(function () {
90
166
  widthValue.setValue(0);
91
167
  Animated.timing(widthValue, {
@@ -135,6 +211,7 @@ export var BubbleChart = function (props) {
135
211
  useNativeDriver: false,
136
212
  }).start();
137
213
  }, [pointsOpacityValue]);
214
+ var _g = __read(useState(false), 2), isAnimationOver = _g[0], setIsAnimationOver = _g[1];
138
215
  useEffect(function () {
139
216
  if (isAnimated) {
140
217
  decreaseWidth();
@@ -146,12 +223,25 @@ export var BubbleChart = function (props) {
146
223
  else {
147
224
  radiiGrow();
148
225
  }
226
+ if (isAndroid) {
227
+ setTimeout(function () {
228
+ setIsAnimationOver(true);
229
+ }, animationDuration + 20);
230
+ }
149
231
  }
150
- if (regressionLineConfig.isAnimated) {
232
+ var hasAnimatedRegressionLine = regressionLineConfig.isAnimated ||
233
+ regressionLineConfigs.some(function (config) { return config.isAnimated; });
234
+ if (hasAnimatedRegressionLine) {
151
235
  drawRegressionLine();
152
236
  }
153
- }, [isAnimated, bubblesShape]);
154
- var svgHeight = containerHeightIncludingBelowXAxis + ((_e = props.overflowBottom) !== null && _e !== void 0 ? _e : 0);
237
+ }, [
238
+ isAnimated,
239
+ bubblesShape,
240
+ regressionLineConfig.isAnimated,
241
+ regressionLineConfigs,
242
+ drawRegressionLine,
243
+ ]);
244
+ var svgHeight = containerHeightIncludingBelowXAxis + ((_c = props.overflowBottom) !== null && _c !== void 0 ? _c : 0);
155
245
  // const onStripPress = (item: any, index: number) => {
156
246
  // if (props.focusedBubbleIndex === undefined || !props.onFocus) {
157
247
  // setSelectedIndex(index);
@@ -162,6 +252,9 @@ export var BubbleChart = function (props) {
162
252
  // };
163
253
  var renderLabel = function (top, index, label) {
164
254
  var _a, _b;
255
+ var left = index
256
+ ? initialSpacing + spacing * index - spacing / 2
257
+ : initialSpacing / 2;
165
258
  return (_jsx(View, { style: [
166
259
  {
167
260
  position: 'absolute',
@@ -172,14 +265,17 @@ export var BubbleChart = function (props) {
172
265
  : -xAxisTextNumberOfLines * 18 - (containerHeight - 200) / 20,
173
266
  zIndex: 10,
174
267
  width: spacing + labelsExtraHeight,
175
- left: initialSpacing + spacing * index - spacing / 2,
268
+ left: left,
176
269
  height: (_b = props.xAxisLabelsHeight) !== null && _b !== void 0 ? _b : xAxisTextNumberOfLines * 18,
177
270
  },
178
271
  rotateLabel && { transform: [{ rotate: '60deg' }] },
179
- ], children: _jsx(Text, { style: [{ textAlign: 'center' }, xAxisLabelTextStyle], allowFontScaling: allowFontScaling, numberOfLines: xAxisTextNumberOfLines, children: label }) }));
272
+ ], children: _jsx(Text, { style: [{ textAlign: index ? 'center' : 'left' }, xAxisLabelTextStyle], allowFontScaling: allowFontScaling, numberOfLines: xAxisTextNumberOfLines, children: label }) }));
180
273
  };
181
274
  var renderAnimatedLabel = function (top, index, label) {
182
275
  var _a, _b;
276
+ var left = index
277
+ ? initialSpacing + spacing * index - spacing / 2
278
+ : initialSpacing / 2;
183
279
  return (_jsx(Animated.View, { style: [
184
280
  {
185
281
  height: rotateLabel
@@ -194,19 +290,18 @@ export var BubbleChart = function (props) {
194
290
  ? 10
195
291
  : -xAxisTextNumberOfLines * 18,
196
292
  zIndex: 10,
197
- width: spacing,
198
- left: initialSpacing + spacing * index - spacing / 2,
293
+ width: spacing + labelsExtraHeight,
294
+ left: left,
199
295
  opacity: appearingOpacity,
200
296
  },
201
297
  rotateLabel && { transform: [{ rotate: '60deg' }] },
202
- ], children: _jsx(Text, { allowFontScaling: allowFontScaling, style: [{ textAlign: 'center' }, xAxisLabelTextStyle], numberOfLines: xAxisTextNumberOfLines, children: label }) }));
298
+ ], children: _jsx(Text, { allowFontScaling: allowFontScaling, style: [{ textAlign: index ? 'center' : 'left' }, xAxisLabelTextStyle], numberOfLines: xAxisTextNumberOfLines, children: label }) }));
203
299
  };
204
300
  var renderBubbles = function (hideBubbles, dataForRender, originalDataFromProps, bubsShape, bubsWidth, bubsHeight, bubsColor, bubsRadius, labelFontSize, startIndex, endIndex, isSecondary, showValuesAsDataPointsText, key) {
205
301
  var getYOrSecondaryY = getY; //isSecondary ? getSecondaryY : getY;
206
302
  return dataForRender.map(function (item, index) {
207
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
208
- if (index < startIndex || index > endIndex)
209
- return null;
303
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
304
+ // if (index < startIndex || index > endIndex) return null;
210
305
  if (item.hideBubble) {
211
306
  return null;
212
307
  }
@@ -232,8 +327,7 @@ export var BubbleChart = function (props) {
232
327
  item.focusedBubbleColor ||
233
328
  props.focusedBubbleColor ||
234
329
  BubbleDefaults.focusedBubbleColor;
235
- bubblesRadius =
236
- (_c = (_b = (_a = item.focusedBubbleRadius) !== null && _a !== void 0 ? _a : props.focusedBubbleRadius) !== null && _b !== void 0 ? _b : item.r) !== null && _c !== void 0 ? _c : bubsRadius;
330
+ bubblesRadius = withinMinMaxRange((_c = (_b = (_a = item.focusedBubbleRadius) !== null && _a !== void 0 ? _a : props.focusedBubbleRadius) !== null && _b !== void 0 ? _b : item.r) !== null && _c !== void 0 ? _c : bubsRadius, maxRadius, minRadius);
237
331
  if (showTextOnFocus) {
238
332
  text = item.label;
239
333
  }
@@ -252,8 +346,11 @@ export var BubbleChart = function (props) {
252
346
  bubblesShape = item.bubbleShape || bubsShape;
253
347
  bubblesWidth = item.bubbleWidth || bubsWidth;
254
348
  bubblesHeight = item.bubbleHeight || bubsHeight;
255
- dataPointsColor = item.bubbleColor || bubsColor;
256
- bubblesRadius = (_d = item.r) !== null && _d !== void 0 ? _d : bubsRadius;
349
+ dataPointsColor =
350
+ item.bubbleColor ||
351
+ bubsColor ||
352
+ defaultBubbleColors[index % defaultBubbleColors.length];
353
+ bubblesRadius = withinMinMaxRange((_d = item.r) !== null && _d !== void 0 ? _d : bubsRadius, maxRadius, minRadius);
257
354
  if (showTextOnFocus) {
258
355
  text = '';
259
356
  }
@@ -274,24 +371,34 @@ export var BubbleChart = function (props) {
274
371
  var formattedTextLabel = textLabel
275
372
  ? ((_e = formatBubbleLabel === null || formatBubbleLabel === void 0 ? void 0 : formatBubbleLabel(textLabel)) !== null && _e !== void 0 ? _e : textLabel)
276
373
  : '';
374
+ if (formattedTextLabel.length > labelMaxLength) {
375
+ formattedTextLabel =
376
+ formattedTextLabel.slice(0, labelMaxLength - 3) + '...';
377
+ }
277
378
  var textStyle = ((_g = (_f = item.labelTextStyle) !== null && _f !== void 0 ? _f : labelTextStyle) !== null && _g !== void 0 ? _g : {});
278
379
  var fontSize = textStyle.fontSize || item.labelFontSize || labelFontSize;
279
380
  var defaultFontSize = 14;
381
+ var fillColorForAnimatedGradientOnAndroid = isAnimationOver
382
+ ? "url(#radial".concat(index, ")")
383
+ : dataPointsColor;
384
+ var localBorderColor = (_j = (_h = item.borderColor) !== null && _h !== void 0 ? _h : borderColor) !== null && _j !== void 0 ? _j : defaultBubbleColors[index % defaultBubbleColors.length];
280
385
  return (_jsxs(Fragment, { children: [focusEnabled ? (_jsx(_Fragment, { children: key === lastLineNumber - 1 ? (_jsx(Rect, { x: initialSpacing + (spacing * index - spacing / 2), y: 8, width: spacing, height: containerHeight - 0, fill: 'none', onPressIn: function (evt) {
281
386
  var locationY = evt.nativeEvent.locationY; // Note that we have another property named pageY which can be useful
282
387
  handleFocus(index);
283
- }, onPressOut: handleUnFocus })) : null })) : null, hideBubbles ? null : (_jsxs(_Fragment, { children: [customBubble ? (isWebApp ? (_jsx(ForeignObject, { height: svgHeight, width: totalWidth, x: getX(index), y: getYOrSecondaryY(item.y) - bubblesHeight / 2, children: customBubble(item, index) })) : (_jsx(Animated.View, { style: {
388
+ }, onPressOut: handleUnFocus })) : null })) : null, hideBubbles ? null : (_jsxs(_Fragment, { children: [customBubble ? (isWebApp ? (_jsx(ForeignObject, { height: svgHeight, width: totalWidth, x: getX((_k = item.indexUsedInDevForDataSet) !== null && _k !== void 0 ? _k : index), y: getYOrSecondaryY(item.y) - bubblesHeight / 2, children: customBubble(item, index) })) : (_jsx(Animated.View, { style: {
284
389
  position: 'absolute',
285
390
  // height: svgHeight,
286
391
  // width: totalWidth,
287
- left: getX(index) - bubblesWidth / 2,
392
+ left: getX((_l = item.indexUsedInDevForDataSet) !== null && _l !== void 0 ? _l : index) -
393
+ bubblesWidth / 2,
288
394
  top: getYOrSecondaryY(item.y) - bubblesHeight / 2,
289
395
  opacity: isAnimated ? appearingOpacity : 1,
290
- }, children: customBubble(item, index) }))) : null, bubblesShape === 'rectangular' ? (_jsx(Fragment, { children: customBubble ? null : (_jsx(AnimatedRect, { x: getX(index) - bubblesWidth / 2, y: getYOrSecondaryY(item.y) - bubblesHeight / 2, width: isAnimated ? growingWidth[index] : bubblesWidth, height: isAnimated ? growingHeight[index] : bubblesHeight, opacity: isAnimated ? appearingDataPoints : opacity, fill: showBubbleOnFocus
396
+ }, children: customBubble(item, index) }))) : null, bubblesShape === 'rectangular' ? (_jsx(Fragment, { children: customBubble ? null : (_jsx(AnimatedRect, { x: getX((_m = item.indexUsedInDevForDataSet) !== null && _m !== void 0 ? _m : index) -
397
+ bubblesWidth / 2, y: getYOrSecondaryY(item.y) - bubblesHeight / 2, width: isAnimated ? growingWidth[index] : bubblesWidth, height: isAnimated ? growingHeight[index] : bubblesHeight, opacity: isAnimated ? appearingDataPoints : opacity, fill: showBubbleOnFocus
291
398
  ? index === selectedIndex
292
399
  ? dataPointsColor
293
400
  : 'none'
294
- : dataPointsColor, stroke: (_h = item.borderColor) !== null && _h !== void 0 ? _h : borderColor, strokeWidth: (_j = item.borderWidth) !== null && _j !== void 0 ? _j : borderWidth, strokeOpacity: (_l = (_k = item.borderOpacity) !== null && _k !== void 0 ? _k : props.borderOpacity) !== null && _l !== void 0 ? _l : (isAnimated ? appearingDataPoints : opacity), onPress: function () {
401
+ : dataPointsColor, fillOpacity: isAnimated ? appearingDataPoints : opacity, stroke: localBorderColor, strokeWidth: (_o = item.borderWidth) !== null && _o !== void 0 ? _o : borderWidth, strokeOpacity: (_q = (_p = item.borderOpacity) !== null && _p !== void 0 ? _p : props.borderOpacity) !== null && _q !== void 0 ? _q : (isAnimated ? appearingBorder : borderOpacity), onPress: function () {
295
402
  item.onPress
296
403
  ? item.onPress(item, index)
297
404
  : props.onPress
@@ -303,11 +410,17 @@ export var BubbleChart = function (props) {
303
410
  if (!item.onPress && !props.onPress && focusEnabled) {
304
411
  handleUnFocus();
305
412
  }
306
- } })) }, index)) : (_jsx(Fragment, { children: customBubble ? null : (_jsx(AnimatedCircle, { cx: getX(index), cy: getYOrSecondaryY(item.y), r: isAnimated ? growingRadii[index] : bubblesRadius, fill: showBubbleOnFocus
307
- ? index === selectedIndex
308
- ? dataPointsColor
309
- : 'none'
310
- : dataPointsColor, opacity: isAnimated ? appearingDataPoints : opacity, stroke: (_m = item.borderColor) !== null && _m !== void 0 ? _m : borderColor, strokeWidth: (_o = item.borderWidth) !== null && _o !== void 0 ? _o : borderWidth, strokeOpacity: (_q = (_p = item.borderOpacity) !== null && _p !== void 0 ? _p : props.borderOpacity) !== null && _q !== void 0 ? _q : (isAnimated ? appearingDataPoints : opacity), onPress: function () {
413
+ } })) }, index)) : (_jsx(Fragment, { children: customBubble ? null : (_jsx(AnimatedCircle, { cx: getX((_r = item.indexUsedInDevForDataSet) !== null && _r !== void 0 ? _r : index), cy: getYOrSecondaryY(item.y), r: isAnimated ? growingRadii[index] : bubblesRadius, fill: ((_s = item.showGradient) !== null && _s !== void 0 ? _s : showGradient)
414
+ ? isAndroid && isAnimated
415
+ ? fillColorForAnimatedGradientOnAndroid
416
+ : "url(#radial".concat(index, ")")
417
+ : dataPointsColor, fillOpacity: isAnimated
418
+ ? isAndroid && showGradient
419
+ ? isAnimationOver
420
+ ? opacity
421
+ : appearingDataPointsAndroid
422
+ : appearingDataPoints
423
+ : opacity, stroke: localBorderColor, strokeWidth: (_t = item.borderWidth) !== null && _t !== void 0 ? _t : borderWidth, strokeOpacity: (_v = (_u = item.borderOpacity) !== null && _u !== void 0 ? _u : props.borderOpacity) !== null && _v !== void 0 ? _v : (isAnimated ? appearingBorder : borderOpacity), onPress: function () {
311
424
  item.onPress
312
425
  ? item.onPress(item, index)
313
426
  : props.onPress
@@ -319,7 +432,7 @@ export var BubbleChart = function (props) {
319
432
  if (!item.onPress && !props.onPress && focusEnabled) {
320
433
  handleUnFocus();
321
434
  }
322
- } })) }, index)), labelComponent ? (!showTextOnFocus || index === selectedIndex ? (isWebApp ? (_jsx(ForeignObject, { height: svgHeight, width: totalWidth, x: getX(index) -
435
+ } })) }, index)), labelComponent ? (!showTextOnFocus || index === selectedIndex ? (isWebApp ? (_jsx(ForeignObject, { height: svgHeight, width: totalWidth, x: getX((_w = item.indexUsedInDevForDataSet) !== null && _w !== void 0 ? _w : index) -
323
436
  labelWidth / 2 +
324
437
  6 +
325
438
  (item.labelShiftX || props.labelShiftX || 0), y: getYOrSecondaryY(item.y) -
@@ -334,7 +447,7 @@ export var BubbleChart = function (props) {
334
447
  position: 'absolute',
335
448
  height: svgHeight,
336
449
  width: labelWidth,
337
- left: getX(index) -
450
+ left: getX((_x = item.indexUsedInDevForDataSet) !== null && _x !== void 0 ? _x : index) -
338
451
  defaultFontSize / 2 +
339
452
  (item.labelShiftX || props.labelShiftX || 0),
340
453
  top: getYOrSecondaryY(item.y) -
@@ -347,19 +460,19 @@ export var BubbleChart = function (props) {
347
460
  (focusTogether || key == selectedLineNumber)
348
461
  ? labelComponent(item, index) // not pushed in latest release
349
462
  : null
350
- : labelComponent(item, index) }))) : null) : formattedTextLabel ? (!showTextOnFocus || index === selectedIndex ? (isWebApp ? (_jsx(ForeignObject, { height: svgHeight, width: totalWidth, x: getX(index) -
351
- Math.min(bubblesRadius, (formattedTextLabel.length * fontSize) / 3) +
463
+ : labelComponent(item, index) }))) : null) : formattedTextLabel ? (!showTextOnFocus || index === selectedIndex ? (isWebApp ? (_jsx(ForeignObject, { height: svgHeight, width: totalWidth, x: getX((_y = item.indexUsedInDevForDataSet) !== null && _y !== void 0 ? _y : index) -
464
+ (formattedTextLabel.length * fontSize) / 4 +
352
465
  (item.labelShiftX || props.labelShiftX || 0), y: getYOrSecondaryY(item.y) -
353
466
  Math.max(10, fontSize / 1.5) +
354
467
  (item.labelShiftY || props.labelShiftY || 0) -
355
- (scatterChart ? bubblesRadius + 10 : 0), children: _jsx(Text, { style: __assign(__assign({}, textStyle), { fontSize: fontSize }), children: formattedTextLabel }) })) : (_jsx(Animated.Text, { style: __assign(__assign({}, textStyle), { position: 'absolute', left: getX(index) -
356
- Math.min(bubblesRadius, (formattedTextLabel.length * fontSize) / 3) +
468
+ (scatterChart ? bubblesRadius + 10 : 0), children: _jsx(Text, { style: __assign(__assign({}, textStyle), { fontSize: fontSize }), children: formattedTextLabel }) })) : (_jsx(Animated.Text, { style: __assign(__assign({}, textStyle), { position: 'absolute', left: getX((_z = item.indexUsedInDevForDataSet) !== null && _z !== void 0 ? _z : index) -
469
+ (formattedTextLabel.length * fontSize) / 4 +
357
470
  (item.labelShiftX || props.labelShiftX || 0), top: getYOrSecondaryY(item.y) -
358
471
  fontSize / 1.5 +
359
472
  (item.labelShiftY || props.labelShiftY || 0) -
360
473
  (scatterChart ? bubblesRadius + 10 : 0), fontSize: fontSize, opacity: isAnimated
361
474
  ? appearingDataPoints
362
- : ((_r = textStyle.opacity) !== null && _r !== void 0 ? _r : 1) }), children: formattedTextLabel }))) : null) : null, index === selectedIndex ? _jsx(Text, { children: '' }) : null] }))] }, index));
475
+ : ((_0 = textStyle.opacity) !== null && _0 !== void 0 ? _0 : 1) }), children: formattedTextLabel }))) : null) : null, index === selectedIndex ? _jsx(Text, { children: '' }) : null] }))] }, index));
363
476
  });
364
477
  };
365
478
  var svgWrapperViewStyle = {
@@ -373,15 +486,29 @@ export var BubbleChart = function (props) {
373
486
  return (_jsxs(View, { style: [
374
487
  svgWrapperViewStyle,
375
488
  {
376
- width: totalWidth,
489
+ width: totalWidth + extraWidthDueToBubble,
377
490
  height: containerHeightIncludingBelowXAxis,
378
491
  // zIndex,
379
492
  },
380
- ], children: [_jsxs(Svg, { height: svgHeight, width: totalWidth, onPress: props.onBackgroundPress, children: [renderBubbles(hideBubbles, props.data, props.data, bubblesShape, bubblesWidth, bubblesHeight, bubblesColor, bubblesRadius, labelFontSize, startIndex, endIndex, false, showValuesAsBubbleLabels, 0), showRegressionLine && (_jsx(AnimatedLine, { x1: regressionLineX1, y1: regressionLineY1, x2: regressionLineConfig.isAnimated
493
+ ], children: [_jsxs(Svg, { height: svgHeight, width: totalWidth + extraWidthDueToBubble, onPress: props.onBackgroundPress, children: [showGradient && (_jsx(Defs, { children: data === null || data === void 0 ? void 0 : data.map(function (item, index) {
494
+ var _a;
495
+ return (_jsxs(RadialGradient, { id: "radial".concat(index), cx: "50%", cy: "50%", r: "50%", children: [_jsx(Stop, { offset: "0%", stopColor: (_a = item.centerColorForGradient) !== null && _a !== void 0 ? _a : centerColorForGradient }), _jsx(Stop, { offset: "100%", stopColor: item.bubbleColor ||
496
+ bubblesColor ||
497
+ defaultBubbleColors[index % defaultBubbleColors.length] })] }, index));
498
+ }) })), renderBubbles(hideBubbles, data, data, bubblesShape, bubblesWidth, bubblesHeight, bubblesColor, bubblesRadius, labelFontSize, startIndex, endIndex, false, showValuesAsBubbleLabels, 0), regressionLineConfigs.length ? (regressionLineConfigs.map(function (config, index) {
499
+ var _a = regressionLineCoordinates[index], regressionLineX1 = _a.regressionLineX1, regressionLineX2 = _a.regressionLineX2, regressionLineY1 = _a.regressionLineY1, regressionLineY2 = _a.regressionLineY2;
500
+ var animatedX = animatedRegressionLineXValues[index];
501
+ var animatedY = animatedRegressionLineYValues[index];
502
+ return (_jsx(AnimatedLine, { x1: regressionLineX1, y1: regressionLineY1, x2: config.isAnimated
503
+ ? (animatedX !== null && animatedX !== void 0 ? animatedX : regressionLineX2)
504
+ : regressionLineX2, y2: config.isAnimated
505
+ ? (animatedY !== null && animatedY !== void 0 ? animatedY : regressionLineY2)
506
+ : regressionLineY2, stroke: config.color, strokeOpacity: config.opacity, strokeWidth: config.thickness, strokeDasharray: config.strokeDashArray }));
507
+ })) : showRegressionLine ? (_jsx(AnimatedLine, { x1: regressionLineX1, y1: regressionLineY1, x2: regressionLineConfig.isAnimated
381
508
  ? AnimatedRegressionLineX
382
509
  : regressionLineX2, y2: regressionLineConfig.isAnimated
383
510
  ? AnimatedRegressionLineY
384
- : regressionLineY2, stroke: regressionLineConfig.color, strokeOpacity: regressionLineConfig.opacity, strokeWidth: regressionLineConfig.thickness, strokeDasharray: regressionLineConfig.strokeDashArray }))] }), xAxisLabelTexts === null || xAxisLabelTexts === void 0 ? void 0 : xAxisLabelTexts.map(function (label, index) {
511
+ : regressionLineY2, stroke: regressionLineConfig.color, strokeOpacity: regressionLineConfig.opacity, strokeWidth: regressionLineConfig.thickness, strokeDasharray: regressionLineConfig.strokeDashArray })) : null] }), xAxisLabelTexts === null || xAxisLabelTexts === void 0 ? void 0 : xAxisLabelTexts.map(function (label, index) {
385
512
  return (_jsx(View, { children: isAnimated
386
513
  ? renderAnimatedLabel(false, index, label)
387
514
  : renderLabel(false, index, label) }, index));
@@ -393,7 +520,7 @@ export var BubbleChart = function (props) {
393
520
  (_a = props.onScroll) === null || _a === void 0 ? void 0 : _a.call(props, ev);
394
521
  },
395
522
  bounces: props.bounces,
396
- overScrollMode: (_f = props.overScrollMode) !== null && _f !== void 0 ? _f : 'auto',
523
+ overScrollMode: (_d = props.overScrollMode) !== null && _d !== void 0 ? _d : 'auto',
397
524
  };
398
525
  return (_jsx(BarAndLineChartsWrapper, __assign({}, barAndLineChartsWrapperProps, { scrollRef: scrollRef, animatedWidth: widthValue, renderChartContent: renderChartContent, remainingScrollViewProps: remainingScrollViewProps, nestedScrollEnabled: props.nestedScrollEnabled })));
399
526
  };
@@ -26,9 +26,9 @@ var isCloseToLeft = function (_a, endReachedOffset) {
26
26
  contentSize.width - endReachedOffset);
27
27
  };
28
28
  var BarAndLineChartsWrapper = function (props) {
29
- var _a, _b, _c, _d, _e;
30
- var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, stepHeight = props.stepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, scrollRef = props.scrollRef, initialSpacing = props.initialSpacing, data = props.data, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, disableScroll = props.disableScroll, showScrollIndicator = props.showScrollIndicator, scrollToEnd = props.scrollToEnd, scrollToIndex = props.scrollToIndex, scrollAnimation = props.scrollAnimation, indicatorColor = props.indicatorColor, spacing = props.spacing, renderChartContent = props.renderChartContent, remainingScrollViewProps = props.remainingScrollViewProps, endSpacing = props.endSpacing, hideAxesAndRules = props.hideAxesAndRules, showXAxisIndices = props.showXAxisIndices, xAxisIndicesHeight = props.xAxisIndicesHeight, xAxisIndicesWidth = props.xAxisIndicesWidth, xAxisIndicesColor = props.xAxisIndicesColor, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, onEndReached = props.onEndReached, onStartReached = props.onStartReached, endReachedOffset = props.endReachedOffset, onMomentumScrollEnd = props.onMomentumScrollEnd, onScrollEndDrag = props.onScrollEndDrag, nestedScrollEnabled = props.nestedScrollEnabled, _f = props.extraWidthDueToDataPoint, extraWidthDueToDataPoint = _f === void 0 ? 0 : _f;
31
- var _g = useBarAndLineChartsWrapper(__assign(__assign({}, props), { isRTL: I18nManager.isRTL })), containerHeightIncludingBelowXAxis = _g.containerHeightIncludingBelowXAxis, xAxisLabelsVerticalShift = _g.xAxisLabelsVerticalShift, trimYAxisAtTop = _g.trimYAxisAtTop, yAxisExtraHeight = _g.yAxisExtraHeight, overflowTop = _g.overflowTop, xAxisLabelsHeight = _g.xAxisLabelsHeight, xAxisTextNumberOfLines = _g.xAxisTextNumberOfLines, actualContainerWidth = _g.actualContainerWidth, transformForHorizontal = _g.transformForHorizontal, horizSectionProps = _g.horizSectionProps, referenceLinesOverChartContent = _g.referenceLinesOverChartContent, setCanMomentum = _g.setCanMomentum, isCloseToStart = _g.isCloseToStart, isCloseToEnd = _g.isCloseToEnd, canMomentum = _g.canMomentum, yAxisAtTop = _g.yAxisAtTop, yAxisThickness = _g.yAxisThickness, yAxisSide = _g.yAxisSide, showVerticalLines = _g.showVerticalLines, verticalLinesProps = _g.verticalLinesProps;
29
+ var _a, _b, _c, _d, _e, _f;
30
+ var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, stepHeight = props.stepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, scrollRef = props.scrollRef, initialSpacing = props.initialSpacing, data = props.data, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, disableScroll = props.disableScroll, showScrollIndicator = props.showScrollIndicator, scrollToEnd = props.scrollToEnd, scrollToIndex = props.scrollToIndex, scrollAnimation = props.scrollAnimation, indicatorColor = props.indicatorColor, spacing = props.spacing, renderChartContent = props.renderChartContent, remainingScrollViewProps = props.remainingScrollViewProps, endSpacing = props.endSpacing, hideAxesAndRules = props.hideAxesAndRules, showXAxisIndices = props.showXAxisIndices, xAxisIndicesHeight = props.xAxisIndicesHeight, xAxisIndicesWidth = props.xAxisIndicesWidth, xAxisIndicesColor = props.xAxisIndicesColor, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, onEndReached = props.onEndReached, onStartReached = props.onStartReached, endReachedOffset = props.endReachedOffset, onMomentumScrollEnd = props.onMomentumScrollEnd, onScrollEndDrag = props.onScrollEndDrag, nestedScrollEnabled = props.nestedScrollEnabled, _g = props.extraWidthDueToDataPoint, extraWidthDueToDataPoint = _g === void 0 ? 0 : _g;
31
+ var _h = useBarAndLineChartsWrapper(__assign(__assign({}, props), { isRTL: I18nManager.isRTL })), containerHeightIncludingBelowXAxis = _h.containerHeightIncludingBelowXAxis, xAxisLabelsVerticalShift = _h.xAxisLabelsVerticalShift, trimYAxisAtTop = _h.trimYAxisAtTop, yAxisExtraHeight = _h.yAxisExtraHeight, overflowTop = _h.overflowTop, xAxisLabelsHeight = _h.xAxisLabelsHeight, xAxisTextNumberOfLines = _h.xAxisTextNumberOfLines, actualContainerWidth = _h.actualContainerWidth, transformForHorizontal = _h.transformForHorizontal, horizSectionProps = _h.horizSectionProps, referenceLinesOverChartContent = _h.referenceLinesOverChartContent, setCanMomentum = _h.setCanMomentum, isCloseToStart = _h.isCloseToStart, isCloseToEnd = _h.isCloseToEnd, canMomentum = _h.canMomentum, yAxisAtTop = _h.yAxisAtTop, yAxisThickness = _h.yAxisThickness, yAxisSide = _h.yAxisSide, showVerticalLines = _h.showVerticalLines, verticalLinesProps = _h.verticalLinesProps;
32
32
  useEffect(function () {
33
33
  if (pointerConfig && getPointerProps) {
34
34
  getPointerProps({ pointerIndex: pointerIndex, pointerX: pointerX, pointerY: pointerY });
@@ -97,9 +97,11 @@ var BarAndLineChartsWrapper = function (props) {
97
97
  position: 'absolute',
98
98
  bottom: chartType === chartTypes.LINE_BI_COLOR ? 0 : xAxisThickness,
99
99
  },
100
- !!props.width && { width: props.width + extraWidthDueToDataPoint },
100
+ (!!props.width || chartType === chartTypes.BUBBLE) && {
101
+ width: ((_d = props.width) !== null && _d !== void 0 ? _d : totalWidth) + extraWidthDueToDataPoint,
102
+ },
101
103
  horizontal && {
102
- width: ((_d = props.width) !== null && _d !== void 0 ? _d : totalWidth) + (props.width ? endSpacing : -20),
104
+ width: ((_e = props.width) !== null && _e !== void 0 ? _e : totalWidth) + (props.width ? endSpacing : -20),
103
105
  },
104
106
  ], contentContainerStyle: [
105
107
  {
@@ -107,7 +109,7 @@ var BarAndLineChartsWrapper = function (props) {
107
109
  yAxisExtraHeight +
108
110
  labelsExtraHeight +
109
111
  (50 + xAxisLabelsVerticalShift),
110
- width: Math.max((_e = props.width) !== null && _e !== void 0 ? _e : 0, totalWidth - spacing + endSpacing) +
112
+ width: Math.max((_f = props.width) !== null && _f !== void 0 ? _f : 0, totalWidth - spacing + endSpacing) +
111
113
  extraWidthDueToDataPoint,
112
114
  paddingLeft: initialSpacing,
113
115
  paddingBottom: noOfSectionsBelowXAxis * stepHeight + labelsExtraHeight,
package/dist/index.d.ts CHANGED
@@ -6,4 +6,4 @@ export { LineChartBicolor } from './LineChart/LineChartBicolor';
6
6
  export { PopulationPyramid } from './PopulationPyramid';
7
7
  export { RadarChart } from './RadarChart';
8
8
  export { BubbleChart } from './BubbleChart';
9
- export { type barDataItem, type barDataItemNullSafe, type stackDataItem, type BarChartPropsType, type StackedBarChartPropsType, type pieDataItem, type PieChartPropsType, type lineDataItem, type lineDataItemNullSafe, type bicolorLineDataItem, type LineChartPropsType, type LineChartBicolorPropsType, type popnPyramidDataItem, type PopulationPyramidPropsType, chartTypes, ruleTypes, CurveType, yAxisSides, EdgePosition, type DataSet, type DataSetNullSafe, type Linecap, type RulesConfig, type LabelsPosition, type PointerEvents, type secondaryYAxisType, type secondaryLineConfigType, type referenceConfigType, type arrowConfigType, type Pointer, type HighlightedRange, type LineSegment, type LineProperties, Framework, type XAxisConfig, type DataPointProps, type IntersectionAreaConfig, type LabelLineConfig, type TooltipProps, type RadarChartProps, type BubbleChartPropsType, type PolygonConfig, type GridConfig, type GridSectionConfig, type AsterLinesConfig, } from 'gifted-charts-core';
9
+ export { type barDataItem, type barDataItemNullSafe, type stackDataItem, type BarChartPropsType, type StackedBarChartPropsType, type pieDataItem, type PieChartPropsType, type lineDataItem, type lineDataItemNullSafe, type bicolorLineDataItem, type LineChartPropsType, type LineChartBicolorPropsType, type popnPyramidDataItem, type PopulationPyramidPropsType, chartTypes, ruleTypes, CurveType, yAxisSides, EdgePosition, type DataSet, type DataSetNullSafe, type DataSetForBubbleChart, type Linecap, type RulesConfig, type LabelsPosition, type PointerEvents, type secondaryYAxisType, type secondaryLineConfigType, type referenceConfigType, type arrowConfigType, type Pointer, type HighlightedRange, type LineSegment, type LineProperties, Framework, type XAxisConfig, type DataPointProps, type IntersectionAreaConfig, type LabelLineConfig, type TooltipProps, type RadarChartProps, type BubbleChartPropsType, type PolygonConfig, type GridConfig, type GridSectionConfig, type AsterLinesConfig, } from 'gifted-charts-core';
@@ -3,3 +3,4 @@ export declare const screenWidth: number;
3
3
  export declare function usePrevious(value: string): string;
4
4
  export declare const isWebApp: boolean;
5
5
  export declare const isIos: boolean;
6
+ export declare const isAndroid: boolean;
@@ -20,3 +20,4 @@ export function usePrevious(value) {
20
20
  }
21
21
  export var isWebApp = Platform.OS === 'web';
22
22
  export var isIos = Platform.OS === 'ios';
23
+ export var isAndroid = Platform.OS === 'android';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gifted-charts",
3
- "version": "1.4.73",
3
+ "version": "1.4.75",
4
4
  "description": "The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar, Population Pyramid, Radar and Bubble charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -26,7 +26,7 @@
26
26
  "registry": "https://registry.npmjs.org/"
27
27
  },
28
28
  "dependencies": {
29
- "gifted-charts-core": "0.1.76"
29
+ "gifted-charts-core": "0.1.79"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@babel/cli": "^7.24.8",