tidyverse / ggplot2

An implementation of the Grammar of Graphics in R
https://ggplot2.tidyverse.org
Other
6.39k stars 2k forks source link

Encapsulate `sf_grob()` in `GeomSf$draw_panel()` #5904

Open teunbrand opened 1 month ago

teunbrand commented 1 month ago

This PR does not really solve an open issue, but does make GeomSf more consistent with other geoms.

Briefly, sf_grob() was a wrapper for sf::st_as_grob() that did two things that are usually handled by Geom classes. It removed missing data, which is usually handled by Geom$handle_na(), and wrangles the graphical parameters for a grob, which is usually done in Geom$draw_panel(). This PR divides these two responsibilities to the appropriate places in the class.