Skip to content

Conversation

@teunbrand
Copy link
Collaborator

@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.

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
Collaborator 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