|
25 | 25 | #' - `by_subject_plot` (`ggplot2`) |
26 | 26 | #' - `table` (`listing_df` created with [rlistings::as_listing()]) |
27 | 27 | #' |
28 | | -#' Decorators can be applied to all outputs or only to specific objects using a |
29 | | -#' named list of `teal_transform_module` objects. |
30 | | -#' The `"default"` name is reserved for decorators that are applied to all outputs. |
| 28 | +#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects. |
| 29 | +#' The name of this list corresponds to the name of the output to which the decorator is applied. |
31 | 30 | #' See code snippet below: |
32 | 31 | #' |
33 | 32 | #' ``` |
34 | 33 | #' tm_missing_data( |
35 | 34 | #' ..., # arguments for module |
36 | 35 | #' decorators = list( |
37 | | -#' default = list(teal_transform_module(...)), # applied to all outputs |
38 | | -#' summary_plot = list(teal_transform_module(...)), # applied only to `summary_plot` output |
39 | | -#' combination_plot = list(teal_transform_module(...)) # applied only to `combination_plot` output |
40 | | -#' by_subject_plot = list(teal_transform_module(...)) # applied only to `by_subject_plot` output |
41 | | -#' table = list(teal_transform_module(...)) # applied only to `table` output |
| 36 | +#' summary_plot = teal_transform_module(...), # applied only to `summary_plot` output |
| 37 | +#' combination_plot = teal_transform_module(...), # applied only to `combination_plot` output |
| 38 | +#' by_subject_plot = teal_transform_module(...), # applied only to `by_subject_plot` output |
| 39 | +#' table = teal_transform_module(...) # applied only to `table` output |
42 | 40 | #' ) |
43 | 41 | #' ) |
44 | 42 | #' ``` |
@@ -147,8 +145,7 @@ tm_missing_data <- function(label = "Missing data", |
147 | 145 | checkmate::assert_multi_class(pre_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) |
148 | 146 | checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) |
149 | 147 |
|
150 | | - available_decorators <- c("summary_plot", "combination_plot", "by_subject_plot", "summary_table") |
151 | | - decorators <- normalize_decorators(decorators) |
| 148 | + available_decorators <- c("summary_plot", "combination_plot", "by_subject_plot", "table") |
152 | 149 | assert_decorators(decorators, names = available_decorators) |
153 | 150 | # End of assertions |
154 | 151 |
|
@@ -446,7 +443,7 @@ encoding_missing_data <- function(id, summary_per_patient = FALSE, ggtheme, data |
446 | 443 | selected = "counts", |
447 | 444 | inline = TRUE |
448 | 445 | ), |
449 | | - ui_decorate_teal_data(ns("dec_summary_table"), decorators = select_decorators(decorators, "summary_table")) |
| 446 | + ui_decorate_teal_data(ns("dec_summary_table"), decorators = select_decorators(decorators, "table")) |
450 | 447 | ), |
451 | 448 | teal.widgets::panel_item( |
452 | 449 | title = "Plot settings", |
@@ -1295,7 +1292,7 @@ srv_missing_data <- function(id, |
1295 | 1292 | decorated_summary_table_q <- srv_decorate_teal_data( |
1296 | 1293 | id = "dec_summary_table", |
1297 | 1294 | data = summary_table_q, |
1298 | | - decorators = select_decorators(decorators, "summary_table"), |
| 1295 | + decorators = select_decorators(decorators, "table"), |
1299 | 1296 | expr = table |
1300 | 1297 | ) |
1301 | 1298 |
|
|
0 commit comments