Skip to content
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

Handle space_free parameter #330

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

teunbrand
Copy link

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

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.

1 participant