forked from magicismight/react-native-svg-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCircle.js
117 lines (109 loc) · 2.18 KB
/
Circle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import React, {
Component
} from 'react';
import Svg, {
Circle
} from 'react-native-svg';
class CircleExample extends Component{
static title = 'Circle';
render() {
return <Svg
height="100"
width="140"
>
<Circle
cx="50%"
cy="50%"
r="40%"
fill="pink"
/>
</Svg>;
}
}
class StrokeCircle extends Component{
static title = 'Stroke Circle';
render() {
return <Svg
height="100"
width="100"
>
<Circle
cx="50"
cy="50"
r="45"
stroke="purple"
strokeWidth="2.5"
fill="none"
/>
</Svg>;
}
}
class StrokeOpacityCircle extends Component{
static title = 'Circle with strokeOpacity';
render() {
return <Svg
height="100"
width="100"
>
<Circle
cx="50"
cy="50"
r="40"
stroke="purple"
strokeOpacity="0.5"
strokeWidth="10"
fill="pink"
/>
</Svg>;
}
}
class PieCircle extends Component{
static title = 'Draw a Pie shape with circle';
render() {
return <Svg
height="100"
width="100"
>
<Circle
cx="50"
cy="50"
r="40"
fill="#ddd"
/>
<Circle
origin="50, 50"
rotate="-90"
cx="50"
cy="50"
r="20"
stroke="#0074d9"
strokeWidth="40"
fill="none"
strokeDasharray="80, 160"
/>
</Svg>;
}
}
const icon = <Svg
height="20"
width="20"
>
<Circle
cx="10"
cy="10"
r="8"
stroke="purple"
strokeWidth="1"
fill="pink"
/>
</Svg>;
const samples = [
CircleExample,
StrokeCircle,
StrokeOpacityCircle,
PieCircle
];
export {
icon,
samples
};