Skip to content

Switch to scales::Range classes - #5086

Merged
teunbrand merged 9 commits into
tidyverse:mainfrom
teunbrand:scales_range
Feb 21, 2023
Merged

teunbrand merged 9 commits into
tidyverse:mainfrom
teunbrand:scales_range

Conversation

@teunbrand

@teunbrand teunbrand commented Dec 5, 2022 •

Copy link
Copy Markdown
Collaborator

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.

@yutannihilation yutannihilation left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

teunbrand commented Feb 14, 2023 •

Copy link
Copy Markdown
Collaborator Author

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

@yutannihilation

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@teunbrand

Copy link
Copy Markdown
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