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.
(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.
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...
thomasp85
left a comment
There was a problem hiding this comment.
LGTM, but @paleolimbot may be good to loop in if he has time
paleolimbot
left a comment
There was a problem hiding this comment.
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 toCoordCartesianandCoordTrans.labels(),setup_panel_guides()andtrain_panel_guides()toCoordpanel_paramswithoutViewScales for backward compatibilitysetup_panel_params()to includeViewScaleCreated on 2022-07-08 by the reprex package (v2.0.1)