Skip to content

Handle space_free parameter #330

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 1 commit into from
Mar 25, 2025

Conversation

teunbrand
Copy link
Contributor

@teunbrand teunbrand commented Jan 23, 2025

This PR aims to fix an issue identified in tidyverse/ggplot2#6287.

Briefly, facet_wrap() now innately supports the space parameter, but is parameterised slightly differently than ggforce::facet_row/col(). This PR puts the parameter in the correct format that the new facet_wrap() expects.

@@ -53,7 +58,7 @@ facet_row <- function(facets, scales = "fixed", space = "fixed",
FacetRow <- ggproto('FacetRow', FacetWrap,
draw_panels = function(self, panels, layout, x_scales, y_scales, ranges, coord, data, theme, params) {
combined <- ggproto_parent(FacetWrap, self)$draw_panels(panels, layout, x_scales, y_scales, ranges, coord, data, theme, params)
if (params$space_free) {
if (isTRUE(params$space_free)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't enter this branch in new ggplot2 version because params$space_free is a list and the space is already applied by FacetWrap$draw_panels().

@thomasp85 thomasp85 merged commit 4f73e82 into thomasp85:main Mar 25, 2025
@teunbrand teunbrand deleted the adapt_row_col_facets branch March 25, 2025 06:49
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.

2 participants