Skip to content

Facet: gain draw_facet_panels method to draw grobs for each panel #6421

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

Merged
merged 6 commits into from
Apr 29, 2025

Conversation

Yunuuuu
Copy link
Contributor

@Yunuuuu Yunuuuu commented Apr 13, 2025

fix #6406

Following the advice of @teunbrand

@teunbrand
Copy link
Collaborator

Thanks for the PR! I'll get around to reviewing it at some point after discussing with Thomas a bit

R/facet-.R Outdated
@@ -138,6 +142,34 @@ Facet <- ggproto("Facet", NULL,
draw_front = function(data, layout, x_scales, y_scales, theme, params) {
rep(list(zeroGrob()), vec_unique_count(layout$PANEL))
},
draw_facet_panels = function(self, panels, layout, x_scales, y_scales,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a better self-descriptive name for this method that we could choose here? Something like draw_panel_content()? It is a bit confusing that there already is a draw_panels() method and I don't think 'facet panels' is doing any favours clearing up any distinction.

@Yunuuuu
Copy link
Contributor Author

Yunuuuu commented Apr 24, 2025

Thanks for reviewing—I’ve renamed the method accordingly.

Copy link
Collaborator

@teunbrand teunbrand left a comment

Choose a reason for hiding this comment

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

Looks great, thank you for the contribution! I think the failing tests are due to the new scales release, so we might have to wait for #6441 to get merged in first.

Yunuuuu and others added 3 commits April 25, 2025 16:11
Co-authored-by: Teun van den Brand <49372158+teunbrand@users.noreply.github.com>
@teunbrand teunbrand merged commit 3aec34a into tidyverse:main Apr 29, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: make the input panels of Facet$draw_panels() predictable
2 participants