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

Changes in ggplot2 #265

Closed
teunbrand opened this issue Jan 16, 2024 · 2 comments · Fixed by #295
Closed

Changes in ggplot2 #265

teunbrand opened this issue Jan 16, 2024 · 2 comments · Fixed by #295

Comments

@teunbrand
Copy link

Hi there!

We have been preparing a new release of ggplot2 and during a reverse dependency check, it became apparent that the prospective ggplot2 3.5.0 would break some functionality in constructive.

I wasn't able to thoroughly grasp what is the root cause of the breakage, but it would appear as if a scale's call field is (at least partially) responsible. As far is I understood the code, constructive is conconstituting a scale from its call. However, we have changed that field to more accurately reflect the user-level call, rather than the discrete_scale()/continuous_scale() intermediate plumbing. This helps ggplot2 to throw more informative errors and warnings, but unfortunately appears to depart from some assumptions in constructive.

library(ggplot2)

sc <- scale_colour_manual(values = c("blue", "green"))
sc$call
#> scale_colour_manual(values = c("blue", "green"))

constructive::construct(sc)
#> Error in `constructive::construct()`:
#> ! {constructive} could not build the requested code.
#> Caused by error in `endsWith()`:
#> ! non-character object(s)

sc <- xlim(c(10, 20))
sc$call
#> xlim(c(10, 20))

constructive::construct(sc)
#> Error in `constructive::construct()`:
#> ! {constructive} could not build the requested code.
#> Caused by error in `names(args_are_defaults)[args_are_defaults]`:
#> ! invalid subscript type 'list'

Created on 2024-01-16 with reprex v2.0.2

To test with the release candidate, you can install it with the code below:

remotes::install_github("tidyverse/ggplot2", ref = remotes::github_pull("5592"))

The release of ggplot2 3.5.0 is scheduled for the 12th of Februari. The progress of the release can be tracked in tidyverse/ggplot2#5588. We hope that this issue serves as a timely heads up.

@moodymudskipper
Copy link
Collaborator

Thank you very much, I'll take a look

@teunbrand
Copy link
Author

This is just a kind reminder that the ggplot2 release is scheduled soon.

This was referenced Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants