diff --git a/R/geom_edge_sf.R b/R/geom_edge_sf.R index 29c1e7a4..53621ae8 100644 --- a/R/geom_edge_sf.R +++ b/R/geom_edge_sf.R @@ -33,11 +33,12 @@ geom_edge_sf <- function(mapping = NULL, data = get_sf_edges(), position = 'identity', show.legend = NA, ...) { mapping <- complete_edge_aes(mapping) + mapping <- aes_intersect(mapping, aes(geometry = geometry)) c( layer_sf( geom = GeomEdgeSf, data = data, mapping = mapping, stat = StatFilterSf, position = position, show.legend = show.legend, inherit.aes = FALSE, - params = list(na.rm = FALSE, ...) + params = list2(na.rm = FALSE, ...) ), coord_sf(default = TRUE) ) @@ -61,4 +62,4 @@ GeomEdgeSf = ggproto("GeomEdgeSf", GeomSf, names(data)[names(data) == 'width'] <- 'size' GeomSf$draw_panel(data, panel_params, coords) } -) +) \ No newline at end of file diff --git a/R/geom_node_sf.R b/R/geom_node_sf.R index 2564b102..eaedabb4 100644 --- a/R/geom_node_sf.R +++ b/R/geom_node_sf.R @@ -34,11 +34,12 @@ #' geom_node_sf <- function(mapping = NULL, data = get_sf_nodes(), position = 'identity', show.legend = NA, ...) { + mapping <- aes_intersect(mapping, aes(geometry = geometry)) c( layer_sf( geom = GeomSf, data = data, mapping = mapping, stat = StatFilterSf, position = position, show.legend = show.legend, inherit.aes = FALSE, - params = list(na.rm = FALSE, ...) + params = list2(na.rm = FALSE, ...) ), coord_sf(default = TRUE) )