insightsengineering / teal.modules.general

General Purpose Teal Modules
https://insightsengineering.github.io/teal.modules.general/
Other
9 stars 13 forks source link

introduce decorators for `tm_g_bivariate` #797

Open m7pr opened 1 day ago

m7pr commented 1 day ago

Part of https://github.com/insightsengineering/teal/issues/1370

Working Example ```r devtools::load_all("../teal") devtools::load_all(".") plot_title <- teal_transform_module( server = make_teal_transform_server(expression( plot <- plot + ggtitle("Custom title") )) ) # general data example data <- teal_data() data <- within(data, { require(nestcolor) CO2 <- data.frame(CO2) }) app <- init( data = data, modules = tm_g_bivariate( x = data_extract_spec( dataname = "CO2", select = select_spec( label = "Select variable:", choices = variable_choices(data[["CO2"]]), selected = "conc", fixed = FALSE ) ), y = data_extract_spec( dataname = "CO2", select = select_spec( label = "Select variable:", choices = variable_choices(data[["CO2"]]), selected = "uptake", multiple = FALSE, fixed = FALSE ) ), row_facet = data_extract_spec( dataname = "CO2", select = select_spec( label = "Select variable:", choices = variable_choices(data[["CO2"]]), selected = "Type", fixed = FALSE ) ), col_facet = data_extract_spec( dataname = "CO2", select = select_spec( label = "Select variable:", choices = variable_choices(data[["CO2"]]), selected = "Treatment", fixed = FALSE ) ), decorators = list(plot_title) ) ) if (interactive()) { shinyApp(app$ui, app$server) } ```