Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom start #81

Closed
wants to merge 4 commits into from
Closed

Support custom start #81

wants to merge 4 commits into from

Conversation

rkyle35242
Copy link
Member

@rkyle35242 rkyle35242 commented Apr 25, 2024

Before After (angleStart = 90)
image image

@@ -41,7 +42,7 @@ export const SegmentedArc = ({
const totalSpacing = totalSpaces * spaceBetweenSegments;

const arcSegmentDegree = (arcDegree - totalSpacing) / totalArcs;
const arcsStart = 90 - arcDegree / 2;
const arcsStart = angleStart || 90 - arcDegree / 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think it's worth documenting any guidance on realistic values here? Or does it feel pretty obvious. Code makes sense, just thinking aloud

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is an unrealistic value. Starting at 720 would just effectively be 0, since the value represents degrees.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example of 720 angleStart:

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about arcStartDegree? Also, would you be able to update docs too along with the previously added arcDegreeScale property? Could be done separately. https://github.com/shipt/segmented-arc-for-react-native?tab=readme-ov-file#-props

"animationDuration": 1000,
"arcAnimatedValue": 0,
"arcSegmentDegree": 43.5,
"arcsStart": 420,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@shipt shipt deleted a comment from Lein-Haz Apr 29, 2024
@shipt shipt deleted a comment from Lein-Haz Apr 29, 2024
@rkyle35242
Copy link
Member Author

I'm actually going to close this. The use case I had in mind is no longer valid and this doesn't work in all cases that I'd like it to.

That being said, I will take some time to update the README to support the new scale property for segments

@rkyle35242 rkyle35242 closed this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants