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

Fix for ggplot_3.3.0 scales issue #42

Closed

Conversation

rmcd1024
Copy link

This implements the fix suggested by @paleolimbot. Tested and it fixes the problem I reported.

@@ -31,7 +31,12 @@ product_labels <- function() {

is.waive <- getFromNamespace("is.waive", "ggplot2")


## Fix for ggplot_3.3
if (utils::packageVersion("ggplot2") >= "3.2.1.9000") {

Choose a reason for hiding this comment

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

This is outside of a function, which means this is determined on installation. Though I guess this works in most cases, there's a chance the user installs ggmisaic when their ggplot2 is version 3.2.1 and then update ggplot2 to version >=3.3.0.

What about setting ggplot2::waiver() as the default and replace it with "none" in scale_(x|y)_productlist() only when the version of ggplot2 is <= 3.2.1?

Choose a reason for hiding this comment

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

Thanks for catching that @yutannihilation! Putting that code inside a function will result in fewer accidentally hidden axes when you release the code!

@rmcd1024
Copy link
Author

rmcd1024 commented Mar 19, 2020 via email

@paleolimbot
Copy link

I think default_guide() as a function is the easiest way, and performance isn't an issue I don't think. The .onLoad() hook is a bit harder to read, but it's how the ggforce package handles this problem if you want to have a look.

@yutannihilation
Copy link

I have nothing add to @paleolimbot's comment. Both options sound good to me!

@clauswilke
Copy link

ggmosaic could also simply move to requiring ggplot2 3.3.0. It's for the maintainers to decide, but it's what I would probably do.

@haleyjeppson
Copy link
Owner

Thank you all for the valuable input (and patience while I finished up the semester). I have implemented these ideas (and a little extra) in the latest version.

@rmcd1024 rmcd1024 deleted the ggplot_3.3.0-scales/fix branch July 12, 2020 15:16
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.

5 participants