I'm working on making my own geom for ggplot2, and I've noticed that in ggplot2's documentation, it explicitly says that there is no setup_params()
for geoms:
Compared to
Stat
andPosition
,Geom
is a little different because the execution of the setup and compute functions is split up.setup_data
runs before position adjustments, anddraw_layer()
is not run until render time, much later. This means there is nosetup_params
because it's hard to communicate the changes.
However, when I make a ggproto Geom that has setup_params = function(data, params) {...}
, it calls that function fine, and it seemingly works.
What gives? Can I use this function to modify parameters or not?