-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Move coord clipping responsibility from facet to coord #5953
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
Conversation
Merge branch 'main' into coord_clip # Conflicts: # R/facet-grid-.R # R/facet-wrap.R
As #5952 was code-adjacent to this PR, i've included a fix for that issue as well. The fix is to set |
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.
Seems to work fine for me 👍
I'm grateful for the thumbs up @BenVolpe94, but I'm afraid I need the approval of a maintainer to merge a PR 😅 |
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
Can you add a TODO about adding a unit test for when the time comes and vdiffr supports clipping paths |
This PR aims to fix #5951 and fix #5952.
Briefly, the solution here is that facets no longer clip panels to their rectangular cells in the gtable, but coords set the appropriate viewport on their panels. This also allows custom behaviour for
coord_radial()
to use a clipping path instead of rectangle.Reprex from issue; note that the points in upper quarter are appropriately clipped.
Created on 2024-06-20 with reprex v2.1.0
Of note, non-rectangular clipping paths are a newer feature in R graphics and are silently ignored prior to R4.1.0.