-
Notifications
You must be signed in to change notification settings - Fork 698
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
feat(shape): add more segmentation for SplitLinePath #1261
Conversation
packages/visx-demo/src/sandboxes/visx-shape-splitlinepath/generateSnakePath.ts
Show resolved
Hide resolved
packages/visx-demo/src/sandboxes/visx-shape-splitlinepath/generateSinPoints.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow thanks for making this kick ass! love the new demo and the additional algorithms 🙌
I had a couple minor comments, some just about readability.
packages/visx-demo/src/sandboxes/visx-shape-splitlinepath/generateSnakePath.ts
Show resolved
Hide resolved
packages/visx-demo/src/sandboxes/visx-shape-splitlinepath/generateSinSegments.ts
Show resolved
Hide resolved
packages/visx-demo/src/sandboxes/visx-shape-splitlinepath/generateSinPoints.ts
Show resolved
Hide resolved
…/generateSnakePath.ts Co-authored-by: Chris Williams <williaster@users.noreply.github.com>
Co-authored-by: Chris Williams <williaster@users.noreply.github.com>
Thanks for all the comments. Addressed all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woo!
🎉 This PR is included in version |
🚀 Enhancements
SplitLinePath
can split line by multiple algorithmsx
: Split based on x-position, assuming x values increase only (segment[i].x > segment[i-1].x
) or decrease only (segment[i].x < segment[i-1].x
).y
: Split based on y-position, assuming y values increase only (segment[i].y > segment[i-1].y
) or decrease only (segment[i].y < segment[i-1].y
).length
: Assuming the path length between consecutive points are equal. (This was the original algorithm that led to SplitLinePath: The segments are not split correctly #920.)Default is set to
x
.📝 Documentation
SplitLinePath
example🐛 Bug Fix