Open DivadNojnarg opened 7 months ago
I have something @JohnCoene :
new_facet_block <- function(data, ...) {
sel_cols <- function(data){
colnames(data$data)
}
sel_cols_1 <- function(data){
sel_cols(data)[1]
}
new_block(
expr = quote(
ggplot2::facet_wrap(facets = .(facet_var))
),
fields = list(
facet_var = new_select_field(sel_cols_1, sel_cols)
),
class = c("facet_block", "plot_layer_block", "plot_block")
)
}
The data passed to the facet_block layer is a plot object and we should get its data with data$data
(I acknowledge we should maybe rename the function parameters to make it more clear because it's confusing).
Can't build a facet wrap layer block. cc @nbenn @JohnCoene
After checking within
generate_code.plot_block
, the latest layer does not seem to be initialised.