Skip to content

Commit 6bce655

Browse files
committed
use layer_data for data extraction rather that direct
1 parent 47e6eb3 commit 6bce655

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/plot-build.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ggplot_build <- function(plot) {
2222
}
2323

2424
layers <- plot$layers
25-
layer_data <- lapply(layers, function(y) y$data)
25+
layer_data <- lapply(layers, function(y) y$layer_data(plot$data))
2626

2727
scales <- plot$scales
2828
# Apply function to layer and matching data
@@ -39,7 +39,7 @@ ggplot_build <- function(plot) {
3939

4040
panel <- new_panel()
4141
panel <- train_layout(panel, plot$facet, layer_data, plot$data)
42-
data <- map_layout(panel, plot$facet, layer_data, plot$data)
42+
data <- map_layout(panel, plot$facet, layer_data)
4343

4444
# Compute aesthetics to produce data with generalised variable names
4545
data <- by_layer(function(l, d) l$compute_aesthetics(d, plot))

0 commit comments

Comments
 (0)