Skip to content

Changes in ggplot2 #265

@teunbrand

Description

@teunbrand

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions