react-native-gifted-charts 1.2.13 → 1.2.16
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/package.json +4 -6
- package/src/LineChart/index.tsx +36 -4
- package/src/todos.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-gifted-charts",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.16",
|
|
4
4
|
"description": "The most complete library for Bar, Line, Area, Pie, Donut and Stacked Bar charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"files": [
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"eslint": "^7.31.0",
|
|
42
42
|
"jest": "^27.0.6",
|
|
43
43
|
"metro-react-native-babel-preset": "^0.66.2",
|
|
44
|
-
"react-test-renderer": "17.0.1"
|
|
44
|
+
"react-test-renderer": "17.0.1",
|
|
45
|
+
"ts-jest": "^27.1.4"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
48
|
"react": "*",
|
|
@@ -57,8 +58,5 @@
|
|
|
57
58
|
"donut",
|
|
58
59
|
"area",
|
|
59
60
|
"line"
|
|
60
|
-
]
|
|
61
|
-
"jest": {
|
|
62
|
-
"preset": "react-native"
|
|
63
|
-
}
|
|
61
|
+
]
|
|
64
62
|
}
|
package/src/LineChart/index.tsx
CHANGED
|
@@ -413,6 +413,7 @@ export const LineChart = (props: propTypes) => {
|
|
|
413
413
|
return item;
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
|
+
return props.data;
|
|
416
417
|
}, [props.yAxisOffset, props.data]);
|
|
417
418
|
const data2 = useMemo(() => {
|
|
418
419
|
if (!props.data2) {
|
|
@@ -424,6 +425,7 @@ export const LineChart = (props: propTypes) => {
|
|
|
424
425
|
return item;
|
|
425
426
|
});
|
|
426
427
|
}
|
|
428
|
+
return props.data2;
|
|
427
429
|
}, [props.yAxisOffset, props.data2]);
|
|
428
430
|
const data3 = useMemo(() => {
|
|
429
431
|
if (!props.data3) {
|
|
@@ -435,6 +437,7 @@ export const LineChart = (props: propTypes) => {
|
|
|
435
437
|
return item;
|
|
436
438
|
});
|
|
437
439
|
}
|
|
440
|
+
return props.data3;
|
|
438
441
|
}, [props.yAxisOffset, props.data3]);
|
|
439
442
|
const data4 = useMemo(() => {
|
|
440
443
|
if (!props.data4) {
|
|
@@ -446,6 +449,7 @@ export const LineChart = (props: propTypes) => {
|
|
|
446
449
|
return item;
|
|
447
450
|
});
|
|
448
451
|
}
|
|
452
|
+
return props.data4;
|
|
449
453
|
}, [props.yAxisOffset, props.data4]);
|
|
450
454
|
const data5 = useMemo(() => {
|
|
451
455
|
if (!props.data5) {
|
|
@@ -457,6 +461,7 @@ export const LineChart = (props: propTypes) => {
|
|
|
457
461
|
return item;
|
|
458
462
|
});
|
|
459
463
|
}
|
|
464
|
+
return props.data5;
|
|
460
465
|
}, [props.yAxisOffset, props.data5]);
|
|
461
466
|
|
|
462
467
|
const scrollToEnd = props.scrollToEnd || false;
|
|
@@ -1478,8 +1483,8 @@ export const LineChart = (props: propTypes) => {
|
|
|
1478
1483
|
? pointerConfig.pointerLabelHeight
|
|
1479
1484
|
: defaultPointerConfig.pointerLabelHeight;
|
|
1480
1485
|
const autoAdjustPointerLabelPosition =
|
|
1481
|
-
pointerConfig && pointerConfig.autoAdjustPointerLabelPosition
|
|
1482
|
-
?
|
|
1486
|
+
pointerConfig && pointerConfig.autoAdjustPointerLabelPosition === false
|
|
1487
|
+
? false
|
|
1483
1488
|
: defaultPointerConfig.autoAdjustPointerLabelPosition;
|
|
1484
1489
|
const pointerVanishDelay =
|
|
1485
1490
|
pointerConfig && pointerConfig.pointerVanishDelay
|
|
@@ -2845,6 +2850,7 @@ export const LineChart = (props: propTypes) => {
|
|
|
2845
2850
|
}
|
|
2846
2851
|
}}
|
|
2847
2852
|
onResponderMove={evt => {
|
|
2853
|
+
// console.log('onResponderMove++++++++++',evt);
|
|
2848
2854
|
if (!pointerConfig) return;
|
|
2849
2855
|
if (
|
|
2850
2856
|
activatePointersOnLongPress &&
|
|
@@ -2928,11 +2934,24 @@ export const LineChart = (props: propTypes) => {
|
|
|
2928
2934
|
}
|
|
2929
2935
|
}
|
|
2930
2936
|
}}
|
|
2931
|
-
|
|
2937
|
+
// onResponderReject={evt => {
|
|
2938
|
+
// console.log('evt...reject.......',evt);
|
|
2939
|
+
// }}
|
|
2940
|
+
onResponderEnd={evt => {
|
|
2941
|
+
// console.log('evt...end.......',evt);
|
|
2932
2942
|
setResponderStartTime(0);
|
|
2933
2943
|
setResponderActive(false);
|
|
2934
2944
|
setTimeout(() => setPointerX(0), pointerVanishDelay);
|
|
2935
2945
|
}}
|
|
2946
|
+
onResponderTerminationRequest={(evt) => false}
|
|
2947
|
+
// onResponderTerminate={evt => {
|
|
2948
|
+
// console.log('evt...terminate.......',evt);
|
|
2949
|
+
// }}
|
|
2950
|
+
// onResponderRelease={evt => {
|
|
2951
|
+
// setResponderStartTime(0);
|
|
2952
|
+
// setResponderActive(false);
|
|
2953
|
+
// setTimeout(() => setPointerX(0), pointerVanishDelay);
|
|
2954
|
+
// }}
|
|
2936
2955
|
style={{
|
|
2937
2956
|
position: 'absolute',
|
|
2938
2957
|
height: containerHeight + 10 + horizSectionsBelow.length * stepHeight,
|
|
@@ -3138,11 +3157,24 @@ export const LineChart = (props: propTypes) => {
|
|
|
3138
3157
|
}
|
|
3139
3158
|
}
|
|
3140
3159
|
}}
|
|
3141
|
-
|
|
3160
|
+
// onResponderReject={evt => {
|
|
3161
|
+
// console.log('evt...reject.......',evt);
|
|
3162
|
+
// }}
|
|
3163
|
+
onResponderEnd={evt => {
|
|
3164
|
+
// console.log('evt...end.......',evt);
|
|
3142
3165
|
setResponderStartTime(0);
|
|
3143
3166
|
setResponderActive(false);
|
|
3144
3167
|
setTimeout(() => setPointerX(0), pointerVanishDelay);
|
|
3145
3168
|
}}
|
|
3169
|
+
onResponderTerminationRequest={(evt) => false}
|
|
3170
|
+
// onResponderTerminate={evt => {
|
|
3171
|
+
// console.log('evt...terminate.......',evt);
|
|
3172
|
+
// }}
|
|
3173
|
+
// onResponderRelease={evt => {
|
|
3174
|
+
// setResponderStartTime(0);
|
|
3175
|
+
// setResponderActive(false);
|
|
3176
|
+
// setTimeout(() => setPointerX(0), pointerVanishDelay);
|
|
3177
|
+
// }}
|
|
3146
3178
|
style={{
|
|
3147
3179
|
position: 'absolute',
|
|
3148
3180
|
height: containerHeight + 10 + horizSectionsBelow.length * stepHeight,
|
package/src/todos.md
CHANGED