3636# '
3737# ' It takes the form of `c(value, min, max)` and it is passed to the `value_min_max`
3838# ' argument in `teal.widgets::optionalSliderInputValMinMax`.
39- # ' @param decorator (`teal_transform_module`, `language`, `function `)
39+ # ' @param decorators (`list` of `teal_transform_module `)
4040# '
4141# ' @templateVar ggnames `r regression_names`
4242# ' @template ggplot2_args_multi
@@ -162,14 +162,13 @@ tm_a_regression <- function(label = "Regression Analysis",
162162 default_plot_type = 1 ,
163163 default_outlier_label = " USUBJID" ,
164164 label_segment_threshold = c(0.5 , 0 , 10 ),
165- decorator = list (default = teal_transform_module())) {
165+ decorators = list (default = teal_transform_module())) {
166166 message(" Initializing tm_a_regression" )
167167
168168 # Normalize the parameters
169169 if (inherits(regressor , " data_extract_spec" )) regressor <- list (regressor )
170170 if (inherits(response , " data_extract_spec" )) response <- list (response )
171171 if (inherits(ggplot2_args , " ggplot2_args" )) ggplot2_args <- list (default = ggplot2_args )
172- decorate_objs <- lapply(decorator , FUN = decorate_teal_data , output_name = " g" )
173172
174173 # Start of assertions
175174 checkmate :: assert_string(label )
@@ -217,6 +216,7 @@ tm_a_regression <- function(label = "Regression Analysis",
217216 checkmate :: assert_multi_class(post_output , c(" shiny.tag" , " shiny.tag.list" , " html" ), null.ok = TRUE )
218217 checkmate :: assert_choice(default_plot_type , seq.int(1L , length(plot_choices )))
219218 checkmate :: assert_string(default_outlier_label )
219+ checkmate :: assert_list(decorators , " teal_transform_module" )
220220
221221 if (length(label_segment_threshold ) == 1 ) {
222222 checkmate :: assert_numeric(label_segment_threshold , any.missing = FALSE , finite = TRUE )
@@ -243,15 +243,15 @@ tm_a_regression <- function(label = "Regression Analysis",
243243 label = label ,
244244 server = srv_a_regression ,
245245 ui = ui_a_regression ,
246- ui_args = c( args , decorate_objs = decorate_objs ) ,
246+ ui_args = args ,
247247 server_args = c(
248248 data_extract_list ,
249249 list (
250250 plot_height = plot_height ,
251251 plot_width = plot_width ,
252252 default_outlier_label = default_outlier_label ,
253253 ggplot2_args = ggplot2_args ,
254- decorate_objs = decorate_objs
254+ decorators = decorators
255255 )
256256 ),
257257 datanames = teal.transform :: get_extract_datanames(data_extract_list )
@@ -261,7 +261,7 @@ tm_a_regression <- function(label = "Regression Analysis",
261261}
262262
263263# UI function for the regression module
264- ui_a_regression <- function (id , decorate_objs , ... ) {
264+ ui_a_regression <- function (id , decorators , ... ) {
265265 ns <- NS(id )
266266 args <- list (... )
267267 is_single_dataset_value <- teal.transform :: is_single_dataset(args $ regressor , args $ response )
@@ -298,37 +298,37 @@ ui_a_regression <- function(id, decorate_objs, ...) {
298298 conditionalPanel(
299299 condition = " input.plot_type == 'Response vs Regressor'" ,
300300 ns = ns ,
301- ui_transform_data (ns(" d_0" ), transforms = decorate_objs [[1 ]])
301+ ui_teal_transform_module (ns(" d_0" ), transforms = decorators [[1 ]])
302302 ),
303303 conditionalPanel(
304304 condition = " input.plot_type == 'Residuals vs Fitted'" ,
305305 ns = ns ,
306- ui_transform_data (ns(" d_1" ), transforms = decorate_objs [[1 ]])
306+ ui_teal_transform_module (ns(" d_1" ), transforms = decorators [[1 ]])
307307 ),
308308 conditionalPanel(
309309 condition = " input.plot_type == 'Normal Q-Q'" ,
310310 ns = ns ,
311- ui_transform_data (ns(" d_2" ), transforms = decorate_objs [[1 ]])
311+ ui_teal_transform_module (ns(" d_2" ), transforms = decorators [[1 ]])
312312 ),
313313 conditionalPanel(
314314 condition = " input.plot_type == 'Scale-Location'" ,
315315 ns = ns ,
316- ui_transform_data (ns(" d_3" ), transforms = decorate_objs [[1 ]])
316+ ui_teal_transform_module (ns(" d_3" ), transforms = decorators [[1 ]])
317317 ),
318318 conditionalPanel(
319319 condition = " input.plot_type == 'Cook\\ 's distance'" ,
320320 ns = ns ,
321- ui_transform_data (ns(" d_4" ), transforms = decorate_objs [[1 ]])
321+ ui_teal_transform_module (ns(" d_4" ), transforms = decorators [[1 ]])
322322 ),
323323 conditionalPanel(
324324 condition = " input.plot_type == 'Residuals vs Leverage'" ,
325325 ns = ns ,
326- ui_transform_data (ns(" d_5" ), transforms = decorate_objs [[1 ]])
326+ ui_teal_transform_module (ns(" d_5" ), transforms = decorators [[1 ]])
327327 ),
328328 conditionalPanel(
329329 condition = " input.plot_type == 'Cook\\ 's dist vs Leverage'" ,
330330 ns = ns ,
331- ui_transform_data (ns(" d_6" ), transforms = decorate_objs [[1 ]])
331+ ui_teal_transform_module (ns(" d_6" ), transforms = decorators [[1 ]])
332332 ),
333333 ),
334334 checkboxInput(ns(" show_outlier" ), label = " Display outlier labels" , value = TRUE ),
@@ -417,7 +417,7 @@ srv_a_regression <- function(id,
417417 plot_width ,
418418 ggplot2_args ,
419419 default_outlier_label ,
420- decorate_objs ) {
420+ decorators ) {
421421 with_reporter <- ! missing(reporter ) && inherits(reporter , " Reporter" )
422422 with_filter <- ! missing(filter_panel_api ) && inherits(filter_panel_api , " FilterPanelAPI" )
423423 checkmate :: assert_class(data , " reactive" )
@@ -1006,13 +1006,13 @@ srv_a_regression <- function(id,
10061006 )
10071007 })
10081008
1009- decorated_output_0 <- srv_transform_data (id = " d_0" , data = output_plot_0 , transforms = decorate_objs [[1 ]])
1010- decorated_output_1 <- srv_transform_data (id = " d_1" , data = output_plot_1 , transforms = decorate_objs [[1 ]])
1011- decorated_output_2 <- srv_transform_data (id = " d_2" , data = output_plot_2 , transforms = decorate_objs [[1 ]])
1012- decorated_output_3 <- srv_transform_data (id = " d_3" , data = output_plot_3 , transforms = decorate_objs [[1 ]])
1013- decorated_output_4 <- srv_transform_data (id = " d_4" , data = output_plot_4 , transforms = decorate_objs [[1 ]])
1014- decorated_output_5 <- srv_transform_data (id = " d_5" , data = output_plot_5 , transforms = decorate_objs [[1 ]])
1015- decorated_output_6 <- srv_transform_data (id = " d_6" , data = output_plot_6 , transforms = decorate_objs [[1 ]])
1009+ decorated_output_0 <- srv_teal_transform_module (id = " d_0" , data = output_plot_0 , transforms = decorators [[1 ]])
1010+ decorated_output_1 <- srv_teal_transform_module (id = " d_1" , data = output_plot_1 , transforms = decorators [[1 ]])
1011+ decorated_output_2 <- srv_teal_transform_module (id = " d_2" , data = output_plot_2 , transforms = decorators [[1 ]])
1012+ decorated_output_3 <- srv_teal_transform_module (id = " d_3" , data = output_plot_3 , transforms = decorators [[1 ]])
1013+ decorated_output_4 <- srv_teal_transform_module (id = " d_4" , data = output_plot_4 , transforms = decorators [[1 ]])
1014+ decorated_output_5 <- srv_teal_transform_module (id = " d_5" , data = output_plot_5 , transforms = decorators [[1 ]])
1015+ decorated_output_6 <- srv_teal_transform_module (id = " d_6" , data = output_plot_6 , transforms = decorators [[1 ]])
10161016
10171017
10181018 output_q <- reactive({
0 commit comments