Often enough you want your x-scales to depend on the y-scale. For example, you want to order the x-axis based on the values of the y-axis. You can get around this now by pre-ordering factor levels, but this might as well happen at the scale level. I want to explore the following:
Can I make a variant of ggplot2:::RangeDiscrete that aside from tracking unique levels on the x-axis that will track a semblance of the y-values too?
Can I make a variant of ScaleDiscretePosition that maps the x-values to the tracked levels
There has to be a way to include/exclude layers from participating in training the range. Probably this is best done at the aes stage. I.e. aes(x = include(xvar), ...) or something; I still have to figure out the name. A convenient side-effect is that you can then wrap the output of include() in a class that will automatically trigger the scale_x_tracked() or however I'm going to name it.
Often enough you want your x-scales to depend on the y-scale. For example, you want to order the x-axis based on the values of the y-axis. You can get around this now by pre-ordering factor levels, but this might as well happen at the scale level. I want to explore the following:
ggplot2:::RangeDiscrete
that aside from tracking unique levels on the x-axis that will track a semblance of the y-values too?ScaleDiscretePosition
that maps the x-values to the tracked levelsaes(x = include(xvar), ...)
or something; I still have to figure out the name. A convenient side-effect is that you can then wrap the output ofinclude()
in a class that will automatically trigger thescale_x_tracked()
or however I'm going to name it.