-
Notifications
You must be signed in to change notification settings - Fork 2k
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
geom_rect()
can derive corners from x
/width
or y
/height
#5862
Conversation
Possibly CI failing due to the R4.4.0 release? Will run again tomorrow. |
I'm not really content with this PR as it seems like abusing the various aesthetics fields in the ggproto class. I'll put this as a draft for now. |
This comment was marked as resolved.
This comment was marked as resolved.
This reverts commit 65030f5.
I had to rewrite bits of |
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
This PR aims to fix #5861.
Briefly,
geom_rect()
can derive thexmin
/xmax
/ymin
/ymax
parameters fromx
/width
andy
/height
parameters.The trickiest thing with this PR is what is understood as 'required aesthetics'. Currently, all the parameters mentioned above are 'optional aesthetics' and the corners (
xmin
/xmax
/ymin
/ymax
) are marked as 'non missing aesthetics'. The corners are subjected to a secondcheck_required_aesthetics()
to throw a warning.A demo from the issue:
However, if there is only 1 known aesthetic per position (in the example, just the
y
aesthetic), it'll throw an error due to missing aesthetics. It might be worth considering throwing a more tailored warning in this case.Created on 2024-04-24 with reprex v2.1.0