-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
R/scale-product.R
Outdated
@@ -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") { |
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.
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?
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.
Thanks for catching that @yutannihilation! Putting that code inside a function will result in fewer accidentally hidden axes when you release the code!
That's an excellent point. Does your suggestion still run into the problem
of the user upgrading ggplot? Two other edits come to mind.
1. Define default_guide as a function. I presume this imposes some
performance penalty? Hard to imagine it would be significant but I'm
curious to know what you think.
2. Use .onLoad. I've never used this capability and don't know if there is
anything to be aware of.
Any thoughts?
…On Wed, Mar 18, 2020 at 6:37 PM Hiroaki Yutani ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In R/scale-product.R
<#42 (comment)>:
> @@ -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") {
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?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#42 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBGHVKFHFZ6EOSJ6WFJHJDRIFLM3ANCNFSM4LO35QJQ>
.
|
I think |
I have nothing add to @paleolimbot's comment. Both options sound good to me! |
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. |
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. |
This implements the fix suggested by @paleolimbot. Tested and it fixes the problem I reported.