Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

ggplot2 is switching to scales::Range classes #1

Closed
teunbrand opened this issue Feb 21, 2023 · 4 comments
Closed

ggplot2 is switching to scales::Range classes #1

teunbrand opened this issue Feb 21, 2023 · 4 comments

Comments

@teunbrand
Copy link

Hi Constantin,

Funny that I found your repo that we discussed during the conference in this way :)

In any case, I have come to warn you that the unexported range constructors from ggplot2 are being superseded by the exported {scales} versions. Here is an example where you're using these:

new$range <- ggplot2:::discrete_range()
new$range_c <- ggplot2:::continuous_range()

If you replace these constructors with scales::ContinuousRange$new() and scales::DiscreteRange$new(), all should sync up with the impending dev version of ggplot2. For more context, see tidyverse/ggplot2#5086.

Cheers!

@const-ae
Copy link
Owner

Oh that's cool. Does scales::ContinuousRange$new() work only with the dev version? I.e., should I add a version check for ggplot to avoid breaking the compatibility if an older ggplot version is installed?

Anyways, I wrote the package for a specific plot I needed repeatedly in a paper and knew it was very fragile. Any chance you would add the increased distance between groups to one of your packages? I would be happy to abandon this hack of a package 😅

@teunbrand
Copy link
Author

Yeah that sounds like something that could fit in ggh4x. I've opened teunbrand/ggh4x#94, but I have no idea when I'll get around to implementing anything 😅

@const-ae
Copy link
Owner

That's great, and I very much feel you on the prioritization question 😄

@teunbrand
Copy link
Author

I'll close this here, unless you still plan on switching range classes :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants