Closed LTLA closed 2 years ago
I'm semi-reluctant to do this given that users can already do this but I guess the whole point of the package at this point is to abstract away technicalities and provide some decent defaults
8e14600
Might change the default based on the input dim
My thinking was that we could apply the rasterize
specifically to the geom_point
layer with lots of points, so as to avoid accidental rasterization of other layers. Not sure how relevant this concern is, but if the ggrastr authors decide to change the defaults to include, e.g., rasterization of text, then our cluster labels might end up rasterized in the current implementation.
If we were to rasterize
the specific geom_point
layer, it would have to be done inside the central plotter function; it wouldn't be something that the user could do on the returned ggplot
object.
I guess for anything that's plot_grid
ed it wouldn't; anything else could use rasterise(p, layers="Point")
We could explore an option to wrap
geom_point
calls withrasterize
in the functions that involve plotting many thousands of points, e.g.,plotReducedDim
for large datasets. This would allow users to easily save the plots to PDF for editing in Illustrator or whatever in publication prep, without worrying about their computer crashing from attempting to load in >100000 vector objects.It might be as simple as wrapping things in
rasterize
on request. I remember seeing another method for rasterizing points but maybe it was the same.