react-native-gifted-charts 1.4.20 → 1.4.21
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 +4 -3
- package/dist/BarChart/Animated2DWithGradient.js +1 -0
- package/dist/BarChart/RenderBars.js +1 -0
- package/dist/BarChart/RenderStackBars.js +1 -0
- package/dist/BarChart/index.js +1 -0
- package/dist/BarChart/styles.js +1 -0
- package/dist/Components/AnimatedThreeDBar/index.js +1 -0
- package/dist/Components/AnimatedThreeDBar/styles.js +1 -0
- package/dist/Components/BarAndLineChartsWrapper/index.js +1 -0
- package/dist/Components/BarAndLineChartsWrapper/renderHorizSections.js +1 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.js +1 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.js +1 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.js +1 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.js +1 -0
- package/dist/Components/BarAndLineChartsWrapper/renderVerticalLines.js +1 -0
- package/dist/Components/BarSpecificComponents/barBackgroundPattern.js +1 -0
- package/dist/Components/BarSpecificComponents/cap.js +1 -0
- package/dist/Components/BarSpecificComponents/tooltip.js +1 -0
- package/dist/Components/common/LinearGradient.js +1 -0
- package/dist/Components/common/Pointer.js +1 -0
- package/dist/Components/common/StripAndLabel.js +1 -0
- package/dist/Components/lineSvg.js +1 -0
- package/dist/LineChart/LineChartBicolor.js +1 -0
- package/dist/LineChart/index.js +1 -0
- package/dist/LineChart/styles.js +1 -0
- package/dist/PieChart/index.js +1 -0
- package/dist/PieChart/main.js +1 -0
- package/dist/PieChartPro/index.js +1 -0
- package/dist/PopulationPyramid/index.js +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +21 -20
- package/src/BarChart/Animated2DWithGradient.tsx +0 -197
- package/src/BarChart/RenderBars.tsx +0 -527
- package/src/BarChart/RenderStackBars.tsx +0 -359
- package/src/BarChart/index.tsx +0 -391
- package/src/BarChart/styles.tsx +0 -47
- package/src/Components/AnimatedThreeDBar/index.tsx +0 -258
- package/src/Components/AnimatedThreeDBar/styles.tsx +0 -14
- package/src/Components/BarAndLineChartsWrapper/index.tsx +0 -246
- package/src/Components/BarAndLineChartsWrapper/renderHorizSections.tsx +0 -607
- package/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.tsx +0 -151
- package/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.tsx +0 -175
- package/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.tsx +0 -86
- package/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.tsx +0 -42
- package/src/Components/BarAndLineChartsWrapper/renderVerticalLines.tsx +0 -131
- package/src/Components/BarSpecificComponents/barBackgroundPattern.tsx +0 -30
- package/src/Components/BarSpecificComponents/cap.tsx +0 -34
- package/src/Components/BarSpecificComponents/tooltip.tsx +0 -59
- package/src/Components/common/LinearGradient.tsx +0 -27
- package/src/Components/common/Pointer.tsx +0 -37
- package/src/Components/common/StripAndLabel.tsx +0 -98
- package/src/Components/lineSvg.tsx +0 -42
- package/src/LineChart/LineChartBicolor.tsx +0 -740
- package/src/LineChart/index.tsx +0 -2231
- package/src/LineChart/styles.tsx +0 -47
- package/src/PieChart/index.tsx +0 -168
- package/src/PieChart/main.tsx +0 -363
- package/src/PieChartPro/index.tsx +0 -267
- package/src/PopulationPyramid/index.tsx +0 -603
- package/src/index.tsx +0 -26
- package/src/todos.md +0 -24
- package/src/utils/index.ts +0 -16
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
type LinearGradientProps = {
|
|
4
|
-
style?: any;
|
|
5
|
-
start?: {x: number; y: number};
|
|
6
|
-
end?: {x: number; y: number};
|
|
7
|
-
colors: string[];
|
|
8
|
-
children?: any;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
let LinearGradient: React.FC<LinearGradientProps>;
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
// for bare react-native projects
|
|
15
|
-
LinearGradient = require('react-native-linear-gradient').LinearGradient;
|
|
16
|
-
} catch (e) {
|
|
17
|
-
try {
|
|
18
|
-
// for expo-based projects
|
|
19
|
-
LinearGradient = require('expo-linear-gradient').LinearGradient;
|
|
20
|
-
} catch (e) {
|
|
21
|
-
throw new Error(
|
|
22
|
-
'Gradient package was not found. Make sure "react-native-linear-gradient" or "expo-linear-gradient" is installed',
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default LinearGradient;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {View} from 'react-native';
|
|
3
|
-
|
|
4
|
-
export const Pointer = (props: any) => {
|
|
5
|
-
const {
|
|
6
|
-
pointerX,
|
|
7
|
-
pointerYLocal,
|
|
8
|
-
pointerComponent,
|
|
9
|
-
pointerHeight,
|
|
10
|
-
pointerRadius,
|
|
11
|
-
pointerWidth,
|
|
12
|
-
pointerItemLocal,
|
|
13
|
-
pointerColorLocal,
|
|
14
|
-
} = props;
|
|
15
|
-
return (
|
|
16
|
-
<View
|
|
17
|
-
style={{
|
|
18
|
-
position: 'absolute',
|
|
19
|
-
left: pointerX + (pointerX.pointerShiftX || 0),
|
|
20
|
-
top: pointerYLocal - 2,
|
|
21
|
-
}}>
|
|
22
|
-
{pointerComponent ? (
|
|
23
|
-
pointerComponent()
|
|
24
|
-
) : (
|
|
25
|
-
<View
|
|
26
|
-
style={{
|
|
27
|
-
height: pointerHeight || pointerRadius * 2,
|
|
28
|
-
width: pointerWidth || pointerRadius * 2,
|
|
29
|
-
marginTop: pointerItemLocal?.pointerShiftY || 0,
|
|
30
|
-
backgroundColor: pointerColorLocal,
|
|
31
|
-
borderRadius: pointerRadius || 0,
|
|
32
|
-
}}
|
|
33
|
-
/>
|
|
34
|
-
)}
|
|
35
|
-
</View>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {View} from 'react-native';
|
|
3
|
-
import Svg, {Line} from 'react-native-svg';
|
|
4
|
-
import {getTopAndLeftForStripAndLabel} from 'gifted-charts-core';
|
|
5
|
-
|
|
6
|
-
export const StripAndLabel = (props: any) => {
|
|
7
|
-
const {
|
|
8
|
-
pointerX,
|
|
9
|
-
pointerLabelWidth,
|
|
10
|
-
pointerRadius,
|
|
11
|
-
pointerWidth,
|
|
12
|
-
pointerYLocal,
|
|
13
|
-
pointerStripUptoDataPoint,
|
|
14
|
-
pointerStripHeight,
|
|
15
|
-
pointerItemLocal,
|
|
16
|
-
showPointerStrip,
|
|
17
|
-
pointerStripWidth,
|
|
18
|
-
containerHeight,
|
|
19
|
-
xAxisThickness,
|
|
20
|
-
pointerStripColor,
|
|
21
|
-
pointerConfig,
|
|
22
|
-
pointerLabelComponent,
|
|
23
|
-
secondaryPointerItem,
|
|
24
|
-
pointerEvents,
|
|
25
|
-
isBarChart,
|
|
26
|
-
} = props;
|
|
27
|
-
|
|
28
|
-
const {top, left} = getTopAndLeftForStripAndLabel(props);
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<View
|
|
32
|
-
style={{
|
|
33
|
-
position: 'absolute',
|
|
34
|
-
left: pointerX + (pointerItemLocal[0]?.pointerShiftX || 0),
|
|
35
|
-
top: pointerYLocal,
|
|
36
|
-
}}>
|
|
37
|
-
{(
|
|
38
|
-
isBarChart
|
|
39
|
-
? showPointerStrip && !pointerLabelComponent
|
|
40
|
-
: showPointerStrip
|
|
41
|
-
) ? (
|
|
42
|
-
<View
|
|
43
|
-
style={{
|
|
44
|
-
position: 'absolute',
|
|
45
|
-
left: (pointerRadius || pointerWidth) - pointerStripWidth / 4,
|
|
46
|
-
top: pointerStripUptoDataPoint
|
|
47
|
-
? pointerRadius || pointerStripHeight / 2
|
|
48
|
-
: -pointerYLocal + 8,
|
|
49
|
-
width: pointerStripWidth,
|
|
50
|
-
height: pointerStripUptoDataPoint
|
|
51
|
-
? containerHeight - pointerYLocal + 5 - xAxisThickness
|
|
52
|
-
: pointerStripHeight,
|
|
53
|
-
marginTop: pointerStripUptoDataPoint
|
|
54
|
-
? 0
|
|
55
|
-
: containerHeight - pointerStripHeight,
|
|
56
|
-
}}>
|
|
57
|
-
<Svg>
|
|
58
|
-
<Line
|
|
59
|
-
stroke={pointerStripColor}
|
|
60
|
-
strokeWidth={pointerStripWidth}
|
|
61
|
-
strokeDasharray={
|
|
62
|
-
pointerConfig?.strokeDashArray
|
|
63
|
-
? pointerConfig?.strokeDashArray
|
|
64
|
-
: ''
|
|
65
|
-
}
|
|
66
|
-
x1={0}
|
|
67
|
-
y1={0}
|
|
68
|
-
x2={0}
|
|
69
|
-
y2={
|
|
70
|
-
pointerStripUptoDataPoint
|
|
71
|
-
? containerHeight - pointerYLocal + 5 - xAxisThickness
|
|
72
|
-
: pointerStripHeight
|
|
73
|
-
}
|
|
74
|
-
/>
|
|
75
|
-
</Svg>
|
|
76
|
-
</View>
|
|
77
|
-
) : null}
|
|
78
|
-
|
|
79
|
-
{pointerLabelComponent ? (
|
|
80
|
-
<View
|
|
81
|
-
pointerEvents={pointerEvents ?? 'none'}
|
|
82
|
-
style={[
|
|
83
|
-
{
|
|
84
|
-
position: 'absolute',
|
|
85
|
-
left: left,
|
|
86
|
-
top: top,
|
|
87
|
-
marginTop: pointerStripUptoDataPoint
|
|
88
|
-
? 0
|
|
89
|
-
: containerHeight - pointerStripHeight,
|
|
90
|
-
width: pointerLabelWidth,
|
|
91
|
-
},
|
|
92
|
-
]}>
|
|
93
|
-
{pointerLabelComponent?.(pointerItemLocal, secondaryPointerItem)}
|
|
94
|
-
</View>
|
|
95
|
-
) : null}
|
|
96
|
-
</View>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {ColorValue} from 'react-native';
|
|
3
|
-
import Svg, {G, Path} from 'react-native-svg';
|
|
4
|
-
import { ruleTypes } from 'gifted-charts-core';
|
|
5
|
-
|
|
6
|
-
type ruleProps = {
|
|
7
|
-
thickness: number;
|
|
8
|
-
width: number;
|
|
9
|
-
color: ColorValue | String | any;
|
|
10
|
-
type: String;
|
|
11
|
-
dashWidth: number;
|
|
12
|
-
dashGap: number;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type configType = {
|
|
16
|
-
config: ruleProps;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
function Rule(props: configType) {
|
|
20
|
-
const {thickness, width, color, type, dashWidth, dashGap} = props.config;
|
|
21
|
-
if (type === ruleTypes.SOLID) {
|
|
22
|
-
return (
|
|
23
|
-
<Svg height={thickness} width={width} {...props}>
|
|
24
|
-
<G fill="lightgray" stroke={color} strokeWidth={thickness}>
|
|
25
|
-
<Path d={`M0 ${thickness / 2}h${width}`} />
|
|
26
|
-
</G>
|
|
27
|
-
</Svg>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
return (
|
|
31
|
-
<Svg height={thickness} width={width} {...props}>
|
|
32
|
-
<G fill="lightgray" stroke={color} strokeWidth={thickness}>
|
|
33
|
-
<Path
|
|
34
|
-
strokeDasharray={`${dashWidth},${dashGap}`}
|
|
35
|
-
d={`M0 ${thickness / 2}h${width}`}
|
|
36
|
-
/>
|
|
37
|
-
</G>
|
|
38
|
-
</Svg>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export default Rule;
|