-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Miscellaneous improvements to guides #5345
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thomasp85
approved these changes
Aug 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to fix a series of backward compatibility issues that the
GuideOld
class didn't (perfectly) solve, in addition to a few polishes. It originates from a reverse dependency check which revealed what issues packages have with the guide system. This exercise has surfaced some problems that are being addressed in this PR. The main issues I have found are:NextMethod()
class inheritance. Since we've gutted these in ggplot2, we had anticipated that these needed to be reimplemented in the package extensions themselves. This is mostly handled in PRs towards these packages.guides()
throw an error with empty or unnamed input. Some of the packages relied onguides() == NULL
, which is now the case, whereas others provided unnamed guides, which is now a warning instead of an error.g <- guides(colour = "colourbar")
would store the information ing$colour
, whereas this information is now stored ing$guides$colour
and variations of this. This also has been addressed in PRs to those packages.All in all, surveying this has led to the following PRs that are ready for review:
guide_rampbar()
compatibility with ggplot2 >3.4.2 mjskay/ggdist#186And PRs that rely on fixes in this PR to become ready for review:
guide_level()
compatibility with ggplot2 >3.4.2 mitchelloharawild/distributional#92Unrelated to this PR: besides issues with the guide system, it was also common to see the
expect_equal(length(plot), 9)
in tests, which should now be 10, or the direct borrowing of internals that we've superseded.