Skip to content

Commit

Permalink
add aes_intersect
Browse files Browse the repository at this point in the history
  • Loading branch information
loreabad6 committed Jan 19, 2024
1 parent 6dfa17e commit 02f760a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions R/geom_edge_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand All @@ -61,4 +62,4 @@ GeomEdgeSf = ggproto("GeomEdgeSf", GeomSf,
names(data)[names(data) == 'width'] <- 'size'
GeomSf$draw_panel(data, panel_params, coords)
}
)
)
3 changes: 2 additions & 1 deletion R/geom_node_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down

0 comments on commit 02f760a

Please sign in to comment.