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

Remove ScalesListQuiet #125

Merged
merged 2 commits into from
Jan 10, 2024
Merged

Remove ScalesListQuiet #125

merged 2 commits into from
Jan 10, 2024

Conversation

teunbrand
Copy link
Contributor

TL;DR: This PR aims to fix compatibility with the new ggplot2 version.

Hi Malcolm,

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 ggdag. Given that other packages also import ggdag, we felt it was prudent to help out to transition to the new version.

The culprit of the breakage was the ScalesListQuiet class, which (to my best estimate) re-implements ggplot2:::ScalesList with minor modifications. We made internal changes to ggplot2:::ScalesList, see tidyverse/ggplot2#5144. However, as these changes aren't automatically transferred, ggdag would break.

This PR replaces the ScalesListQuiet class with a function that adds the custom ScalesListQuiet$add() method on the go. This should make ggdag immune to most* changes in the ggplot2:::ScalesList class, and works both with the CRAN version and release candidate of ggplot2.

To test the code changes 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 at the end of January / early Februari. The progress can be tracked in tidyverse/ggplot2#5588.
We are hoping that this PR might help ggside be ready around that time to soften the impact on downstream packages.

* I've added a 'canary in the coal mine'-test for modifications to ggplot2:::ScalesList$add().

@malcolmbarrett
Copy link
Collaborator

Thank you! I have a bigger release coming up but I'll try to make a patch release before then

@malcolmbarrett malcolmbarrett merged commit 5a4fbe3 into r-causal:main Jan 10, 2024
@teunbrand teunbrand deleted the ggplot2_3.5.0 branch January 23, 2024 08:01
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