-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support guide_axis() on CoordTrans #3972
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
Support guide_axis() on CoordTrans #3972
Conversation
Hmm, It turned out I failed to fix how |
is this ready for review? |
No, not yet. As this will tweak a lot of internals, I think we should not include this in v3.3.1 to avoid possible breakages on extension packages. |
R/coord-transform.r
Outdated
# TODO: Can I add here? This seems cause cryptic warning "In min(x) : no non-missing arguments to min; returning Inf" | ||
# sec = view_scale_secondary(scale, scale_limits, continuous_ranges$continuous_range_coord), |
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.
(Currently I'm stuck here...)
ok, no problem |
@yutannihilation do you want to take this up again for next release? |
Sure. I forgot everything, but I'll try again. |
Current progress:
|
Is it possible to get this done for the next release (soon) or should we punt it? |
I don't think I can finish |
Yes, we can do that |
Thanks, I reverted the change on |
Okay, I need to add some tests, but this should be basically ready for review now. I think I figured out how things should work. |
y.sec = guide_axis(title = "y (secondary)") | ||
) | ||
|
||
expect_doppelganger("guide titles with coord_trans()", plot + coord_trans()) |
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.
I was hoping to test the label without adding a visual case because then we'll need many for testing similar cases for issues like #4650, but I couldn't find any nice way...
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, but @paleolimbot may be good to loop in if he has time
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.
My memory of these internals is poor but I like the approach (move stuff from coord-cartesian to the base coord class where maybe it can be helpful in more future or current coord subclasses), and I appreciate the comments documenting the idiosyncrasies. Thank you!
Thank you for reviewing! I'm happy that I completed this at last. |
Address #3959 partly, fix #4551.
The plan was to support
guide_axis()
on all coords, but, as it might require some more consideration, I narrowed the scoped of this PR only toCoordCartesian
andCoordTrans
.labels()
,setup_panel_guides()
andtrain_panel_guides()
toCoord
panel_params
withoutViewScale
s for backward compatibilitysetup_panel_params()
to includeViewScale
Created on 2022-07-08 by the reprex package (v2.0.1)