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

new(shape/Polygon): add optional 'points' override #1156

Merged
merged 7 commits into from
Apr 15, 2021

Conversation

jakeisnt
Copy link
Contributor

@jakeisnt jakeisnt commented Apr 11, 2021

🚀 Enhancements

  • The Polygon component can now accept points as a field to override its functionality for generating the points based on the size, sides and center props. This allows users of the library to leverage the underlying polygon's flexibility while still making use of visx's styles and utilities.

Note: If a points prop is provided to a Polygon component, it's now used by the Polygon rather than being passed to the children.

📝 Documentation

  • I've introduced an additional prop to the Polygon component and provided a comment as documentation for it.

@jakeisnt jakeisnt changed the title add optional points field to polygon add optional 'Points' field to Polygon component Apr 11, 2021
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.

Hey @jakeisnt thanks for the contribution! 🙏 This seems like a useful override.

There are a few issues with the resulting TypeScript which shouldn't be too bad to fix.

packages/visx-shape/src/shapes/Polygon.tsx Outdated Show resolved Hide resolved
packages/visx-shape/src/shapes/Polygon.tsx Show resolved Hide resolved
packages/visx-shape/src/shapes/Polygon.tsx Show resolved Hide resolved
@williaster williaster changed the title add optional 'Points' field to Polygon component new(shape/Polygon): add optional 'points' override Apr 13, 2021
@jakeisnt
Copy link
Contributor Author

Should be good to go! Let me know if you'd like me to restructure the commits.

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.

lgtm, thanks for the TS fixes!

Note I removed the comment about a breaking change, and moved that note under enhancements. I wouldn't consider this breaking since the points prop is new / shouldn't affect current usage.

@williaster williaster merged commit ff74a32 into airbnb:master Apr 15, 2021
@github-actions
Copy link

🎉 This PR is included in version v1.8.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.

2 participants