@@ -359,12 +359,13 @@ Layer <- ggproto("Layer", NULL,
359
359
},
360
360
361
361
compute_statistic = function (self , data , layout ) {
362
- if (empty(data ))
363
- return (data_frame0())
362
+ if (empty(data )) return (data_frame0())
364
363
364
+ ptype <- vec_ptype(data )
365
365
self $ computed_stat_params <- self $ stat $ setup_params(data , self $ stat_params )
366
366
data <- self $ stat $ setup_data(data , self $ computed_stat_params )
367
- self $ stat $ compute_layer(data , self $ computed_stat_params , layout )
367
+ data <- self $ stat $ compute_layer(data , self $ computed_stat_params , layout )
368
+ merge_attrs(data , ptype )
368
369
},
369
370
370
371
map_statistic = function (self , data , plot ) {
@@ -420,23 +421,25 @@ Layer <- ggproto("Layer", NULL,
420
421
421
422
compute_geom_1 = function (self , data ) {
422
423
if (empty(data )) return (data_frame0())
424
+ ptype <- vec_ptype(data )
423
425
424
426
check_required_aesthetics(
425
427
self $ geom $ required_aes ,
426
428
c(names(data ), names(self $ aes_params )),
427
429
snake_class(self $ geom )
428
430
)
429
431
self $ computed_geom_params <- self $ geom $ setup_params(data , c(self $ geom_params , self $ aes_params ))
430
- self $ geom $ setup_data(data , self $ computed_geom_params )
432
+ data <- self $ geom $ setup_data(data , self $ computed_geom_params )
433
+ merge_attrs(data , ptype )
431
434
},
432
435
433
436
compute_position = function (self , data , layout ) {
434
437
if (empty(data )) return (data_frame0())
435
-
438
+ ptype <- vec_ptype( data )
436
439
params <- self $ position $ setup_params(data )
437
440
data <- self $ position $ setup_data(data , params )
438
-
439
- self $ position $ compute_layer (data , params , layout )
441
+ data <- self $ position $ compute_layer( data , params , layout )
442
+ merge_attrs (data , ptype )
440
443
},
441
444
442
445
compute_geom_2 = function (self , data , params = self $ aes_params , theme = NULL , ... ) {
0 commit comments