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
Currently ggnewscale modifies all previous layers when a new_scale() is added. This means that new scales modify existing scales, making it hard to know the name of the new scales programmatically and also leading to a weird parity error. It also means I cannot add the ability of renaming aes to a particular string ala relayer.
An alternative implementation would change only the subsequent layers and don't touch the existing ones. Because the subsequent layers do not exist when new_scale() is added, then the implementation would "mark" a plot with a custom class with its custom + method and then modify layers as they are added.
I've been experimenting with this in the "reverse-internals" branch (e.g. e91f6d5).
The text was updated successfully, but these errors were encountered:
A big issue is that if the user doesn't add a layer explicitly after new_scale() then ggplot2 cannot find the correct scale (it will be looking for a scale_colour_new_continuous() or something like that. A solution would be to add the scale if needed when adding the layer, but it's not trivial to guess the type of scale that is needed. This is not a problem in the other implementation because I can build the plot and extract the relevant scale easily.
Currently ggnewscale modifies all previous layers when a
new_scale()
is added. This means that new scales modify existing scales, making it hard to know the name of the new scales programmatically and also leading to a weird parity error. It also means I cannot add the ability of renaming aes to a particular string alarelayer
.An alternative implementation would change only the subsequent layers and don't touch the existing ones. Because the subsequent layers do not exist when
new_scale()
is added, then the implementation would "mark" a plot with a custom class with its custom+
method and then modify layers as they are added.I've been experimenting with this in the "reverse-internals" branch (e.g. e91f6d5).
The text was updated successfully, but these errors were encountered: