-
Notifications
You must be signed in to change notification settings - Fork 715
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
Conversation
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.
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.
Co-authored-by: Chris Williams <williaster@users.noreply.github.com>
Should be good to go! Let me know if you'd like me to restructure the commits. |
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.
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.
🎉 This PR is included in version |
🚀 Enhancements
points
as a field to override its functionality for generating the points based on thesize
,sides
andcenter
props. This allows users of the library to leverage the underlyingpolygon
'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
Polygon
component and provided a comment as documentation for it.