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

Switch to scales::Range classes #5086

Merged
merged 9 commits into from
Feb 21, 2023
Merged

Conversation

teunbrand
Copy link
Collaborator

@teunbrand teunbrand commented Dec 5, 2022

This PR aims to fix #2710.

In brief, it replaces the unexported Range ggproto classes with the scales::Range R6 classes. This makes it slightly easier for extension developers to use the Range systems. Extenders have been able to do this for a while, but hopefully this serves as an 'endorsement' of using scales' Range classes.

Copy link
Member

@yutannihilation yutannihilation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I'm not fully sure if there's no package that expects a range object is a ggproto, so let me keep this unmerged for a while.

@teunbrand
Copy link
Collaborator Author

Yeah good point. It seems like a good idea to search github for the use of ggplot2:::continuous_range()/ggplot2:::discrete_range() and inform people that they might consider to switch to the scales::Range classes.

@teunbrand
Copy link
Collaborator Author

Moreover, this move would be a little bit too risky for an upcoming patch release, so I think it'd be best to wait for after that has happened. I'll convert this to a draft until that happens, so it isn't accidentally merged.

@teunbrand teunbrand marked this pull request as draft December 14, 2022 20:40
@yutannihilation
Copy link
Member

I agree with you. Thanks, let's wait.

@teunbrand teunbrand marked this pull request as ready for review February 14, 2023 17:19
@teunbrand
Copy link
Collaborator Author

teunbrand commented Feb 14, 2023

Hi @yutannihilation, with ggplot2 3.4.1 having landed on CRAN, do you think this is OK to merge now?

@yutannihilation
Copy link
Member

Oh, thanks for the notice. I think so, but maybe we can merge #5171 first? We'll anyway need to resolve conflict on NEWS.md there, so I think either is fine.

@yutannihilation
Copy link
Member

Now that #5171 got merged, let's merge this.

@teunbrand
Copy link
Collaborator Author

Thanks Hiroaki!

@teunbrand teunbrand merged commit 5074f11 into tidyverse:main Feb 21, 2023
@teunbrand teunbrand deleted the scales_range branch February 21, 2023 17:58
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.

Range functions should be exported
2 participants