Skip to content

Commit 2f06f3a

Browse files
Pradeetoblador
authored andcommitted
Adding endAngle prop for Progress.Circle. (#90)
* adding `endAngle` prop for `Progress.Circle`. * updated docmentation for endAngle prop in Progress.Circle
1 parent b373b0d commit 2f06f3a

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Circle.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export class ProgressCircle extends Component {
4848
textStyle: Text.propTypes.style,
4949
thickness: PropTypes.number,
5050
unfilledColor: PropTypes.string,
51+
strokeCap: PropTypes.string,
52+
endAngle: PropTypes.number,
5153
};
5254

5355
static defaultProps = {
@@ -59,6 +61,7 @@ export class ProgressCircle extends Component {
5961
showsText: false,
6062
size: 40,
6163
thickness: 3,
64+
endAngle: 0.9,
6265
};
6366

6467
constructor(props, context) {
@@ -97,6 +100,7 @@ export class ProgressCircle extends Component {
97100
textStyle,
98101
thickness,
99102
unfilledColor,
103+
endAngle,
100104
...restProps
101105
} = this.props;
102106

@@ -158,7 +162,7 @@ export class ProgressCircle extends Component {
158162
<Arc
159163
radius={size / 2}
160164
startAngle={0}
161-
endAngle={(indeterminate ? 1.8 : 2) * Math.PI}
165+
endAngle={(indeterminate ? endAngle * 2 : 2) * Math.PI}
162166
stroke={borderColor || color}
163167
strokeCap={strokeCap}
164168
strokeWidth={border}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ All of the props under *Properties* in addition to the following:
7070
| Prop | Description | Default |
7171
|---|---|---|
7272
|**`size`**|Diameter of the circle. |`40`|
73+
|**`endAngle`**|Determines the endAngle of the circle. A number between `0` and `1`. The final endAngle would be the number multiplied by 2π |`0.9`|
7374
|**`thickness`**|Thickness of the inner circle. |`3`|
7475
|**`showsText`**|Whether or not to show a text representation of current progress. |`false`|
7576
|**`formatText(progress)`**|A function returning a string to be displayed for the textual representation. |*See source*|

0 commit comments

Comments
 (0)