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

feat(shape): add more segmentation for SplitLinePath #1261

Merged
merged 15 commits into from
Jul 2, 2021

Conversation

kristw
Copy link
Collaborator

@kristw kristw commented Jun 30, 2021

🚀 Enhancements

SplitLinePath can split line by multiple algorithms

<SplitLinePath segmentation="x" />
  • x: 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

  • Update SplitLinePath example

🐛 Bug Fix

image

@kristw kristw requested a review from williaster July 1, 2021 05:57
Copy link
Collaborator

@williaster williaster left a 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.

kristw and others added 4 commits July 1, 2021 18:28
…/generateSnakePath.ts

Co-authored-by: Chris Williams <williaster@users.noreply.github.com>
Co-authored-by: Chris Williams <williaster@users.noreply.github.com>
@kristw
Copy link
Collaborator Author

kristw commented Jul 2, 2021

Thanks for all the comments. Addressed all.

Copy link
Collaborator

@williaster williaster left a comment

Choose a reason for hiding this comment

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

woo!

@williaster williaster merged commit 15e3f8c into airbnb:master Jul 2, 2021
@github-actions
Copy link

github-actions bot commented Jul 2, 2021

🎉 This PR is included in version v1.16.0 of the packages modified 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SplitLinePath: The segments are not split correctly
2 participants