@@ -128,14 +128,15 @@ GeomSf <- ggproto("GeomSf", Geom,
128
128
129
129
draw_panel = function (data , panel_params , coord , legend = NULL ,
130
130
lineend = " butt" , linejoin = " round" , linemitre = 10 ,
131
- na.rm = TRUE ) {
131
+ arrow = NULL , na.rm = TRUE ) {
132
132
if (! inherits(coord , " CoordSf" )) {
133
133
abort(" geom_sf() must be used with coord_sf()" )
134
134
}
135
135
136
136
# Need to refactor this to generate one grob per geometry type
137
137
coord <- coord $ transform(data , panel_params )
138
- sf_grob(coord , lineend = lineend , linejoin = linejoin , linemitre = linemitre , na.rm = na.rm )
138
+ sf_grob(coord , lineend = lineend , linejoin = linejoin , linemitre = linemitre ,
139
+ arrow = arrow , na.rm = na.rm )
139
140
},
140
141
141
142
draw_key = function (data , params , size ) {
@@ -160,7 +161,8 @@ default_aesthetics <- function(type) {
160
161
}
161
162
}
162
163
163
- sf_grob <- function (x , lineend = " butt" , linejoin = " round" , linemitre = 10 , na.rm = TRUE ) {
164
+ sf_grob <- function (x , lineend = " butt" , linejoin = " round" , linemitre = 10 ,
165
+ arrow = NULL , na.rm = TRUE ) {
164
166
type <- sf_types [sf :: st_geometry_type(x $ geometry )]
165
167
is_point <- type == " point"
166
168
is_line <- type == " line"
@@ -208,7 +210,8 @@ sf_grob <- function(x, lineend = "butt", linejoin = "round", linemitre = 10, na.
208
210
lty <- x $ linetype %|| % defaults $ linetype [type_ind ]
209
211
gp <- gpar(
210
212
col = col , fill = fill , fontsize = fontsize , lwd = lwd , lty = lty ,
211
- lineend = lineend , linejoin = linejoin , linemitre = linemitre
213
+ lineend = lineend , linejoin = linejoin , linemitre = linemitre ,
214
+ arrow = arrow
212
215
)
213
216
sf :: st_as_grob(x $ geometry , pch = pch , gp = gp )
214
217
}
0 commit comments