You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At least a handful of pretty important packages (e.g., plotly, shiny, etc) rely on the data structure returned by ggplot_build()...it'd be really helpful to have a news note when these things change as well as a short statement on why they've changed.
Since the latest CRAN release (3.2.0), I've noticed at least one change, have there been any others?
It appears 6c2fe76 introduced another breaking change to [x/y].major (they are now NULL). I'm not sure if that is intentional or not...there are no unit tests on these fields
I think this is all part of @paleolimbot's refactoring of axes. The end result should be much cleaner and more maintainable, but there's going to be some pain transitioning.
@paleolimbot It might be helpful if you could prepare a brief document explaining the key design choices and showing with simple examples how relevant information about the panels and axes can be extracted under your new system. This might fit into the (as of yet nonexistent) ggplot2 internal development vignette, or alternatively into the vignette on extending ggplot2.
This pain could be significantly reduced if there was a "Breaking changes in internal API" section of the news that stated something like:
Break values of positional scales have moved from [x/y].major to [x/y]$break_positions()
Text labels of positional scales have moved from [x/y].labels to [x/y]$get_labels()
A vignette might be helpful in this particular case, but generally speaking, when these sort of changes are made, they should be documented in a simple and consistent fashion.
@clauswilke is right, this is my fault! The overarching theme of my internship is formalizing the structure of the panel_params between coordinate systems, and changing how the guides are drawn. We haven't documented the changes yet because they're a few PRs away from done, but there will definitely be a prominent NEWS item and improved documentation for the internal Coord ggproto docs (and at least a blog post).
In the future panel$x and panel$y will be Scale-like objects, and panel$guides will be a list of guide objects (which will hopefully be ggproto in the near future) for the left/right/top/bottom of the panel. In the meantime, we could easily add back in the old syntax to the panel_params and deprecate it more slowly. The panel_params are entirely undocumented (and coord-specific) and I could only find references to x.range and y.range internally, which is why the breaks and labels were removed.
We could do that if we make panel_params ggproto and make those fields active bindings? I think it would be easier just to add the breaks back into panel_params and phase them out in a future release.
Just a note that now that #3398 is merged, there are a few more changes in the CoordCartesian panel params (I don't think they break compatibility though). Between the previous changes implementing ViewScales and the most recent one (implementing the new axis guides), I think we will wait to see what problems come up, fix them, then document the changes.
Activity
cpsievert commentedon Jul 11, 2019
It appears 6c2fe76 introduced another breaking change to
[x/y].major(they are nowNULL). I'm not sure if that is intentional or not...there are no unit tests on these fieldsBefore 6c2fe76:
After 6c2fe76:
NULLcpsievert commentedon Jul 11, 2019
Ahhh, it must be
x$break_positions()now instead ofx.major?clauswilke commentedon Jul 11, 2019
I think this is all part of @paleolimbot's refactoring of axes. The end result should be much cleaner and more maintainable, but there's going to be some pain transitioning.
@paleolimbot It might be helpful if you could prepare a brief document explaining the key design choices and showing with simple examples how relevant information about the panels and axes can be extracted under your new system. This might fit into the (as of yet nonexistent) ggplot2 internal development vignette, or alternatively into the vignette on extending ggplot2.
cpsievert commentedon Jul 11, 2019
This pain could be significantly reduced if there was a "Breaking changes in internal API" section of the news that stated something like:
[x/y].majorto[x/y]$break_positions()[x/y].labelsto[x/y]$get_labels()A vignette might be helpful in this particular case, but generally speaking, when these sort of changes are made, they should be documented in a simple and consistent fashion.
paleolimbot commentedon Jul 11, 2019
@clauswilke is right, this is my fault! The overarching theme of my internship is formalizing the structure of the
panel_paramsbetween coordinate systems, and changing how the guides are drawn. We haven't documented the changes yet because they're a few PRs away from done, but there will definitely be a prominent NEWS item and improved documentation for the internal Coord ggproto docs (and at least a blog post).In the future
panel$xandpanel$ywill beScale-like objects, andpanel$guideswill be a list of guide objects (which will hopefully beggprotoin the near future) for the left/right/top/bottom of the panel. In the meantime, we could easily add back in the old syntax to thepanel_paramsand deprecate it more slowly. Thepanel_paramsare entirely undocumented (and coord-specific) and I could only find references tox.rangeandy.rangeinternally, which is why the breaks and labels were removed.cpsievert commentedon Jul 17, 2019
Now that I think of it, if possible, it'd be great to have informative warning (instead of NEWS item) if you try to access these deprecated fields.
paleolimbot commentedon Jul 17, 2019
We could do that if we make
panel_paramsggproto and make those fields active bindings? I think it would be easier just to add the breaks back intopanel_paramsand phase them out in a future release.paleolimbot commentedon Sep 29, 2019
Just a note that now that #3398 is merged, there are a few more changes in the
CoordCartesianpanel params (I don't think they break compatibility though). Between the previous changes implementingViewScalesand the most recent one (implementing the new axis guides), I think we will wait to see what problems come up, fix them, then document the changes.teunbrand commentedon Feb 28, 2024
This release we documented changes to the internals in its own header and I think this is probably something we should keep doing in the future.