Skip to content

Commit b1591c0

Browse files
committed
also apply to geom_chull()
1 parent 261e69a commit b1591c0

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

vignettes/extending-ggplot2.Rmd

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -493,17 +493,7 @@ GeomPolygonHollow <- ggproto("GeomPolygonHollow", GeomPolygon,
493493
alpha = NA)
494494
)
495495
496-
# We're baking in StatChull instead of exposing it via an argument, so we
497-
# need a custom constructor
498-
geom_chull <- function(mapping = NULL, data = NULL,
499-
position = "identity", na.rm = FALSE, show.legend = NA,
500-
inherit.aes = TRUE, ...) {
501-
layer(
502-
stat = StatChull, geom = GeomPolygonHollow, data = data, mapping = mapping,
503-
position = position, show.legend = show.legend, inherit.aes = inherit.aes,
504-
params = list(na.rm = na.rm, ...)
505-
)
506-
}
496+
geom_chull <- make_constructor(GeomPolygonHollow, stat = "chull")
507497
508498
ggplot(mpg, aes(displ, hwy)) +
509499
geom_point() +

0 commit comments

Comments
 (0)