|
11 | 11 | #' Specifies variable(s) to be analyzed for outliers. |
12 | 12 | #' @param categorical_var (`data_extract_spec` or `list` of multiple `data_extract_spec`) optional, |
13 | 13 | #' specifies the categorical variable(s) to split the selected outlier variables on. |
14 | | -#' @param table_decorator (`list` of `teal_transform_module`) optional, |
| 14 | +#' @param table_decorator (`list` of `teal_transform_module` or `NULL`) optional, |
15 | 15 | #' decorator for the table. |
16 | | -#' @param boxplot_decorator (`list` of `teal_transform_module`) optional, |
| 16 | +#' @param boxplot_decorator (`list` of `teal_transform_module` or `NULL`) optional, |
17 | 17 | #' decorator for the box plot. |
18 | | -#' @param violin_decorator (`list` of `teal_transform_module`) optional, |
| 18 | +#' @param violin_decorator (`list` of `teal_transform_module` or `NULL`) optional, |
19 | 19 | #' decorator for the violin plot. |
20 | | -#' @param density_decorator (`list` of `teal_transform_module`) optional, |
| 20 | +#' @param density_decorator (`list` of `teal_transform_module` or `NULL`) optional, |
21 | 21 | #' decorator for the density plot. |
22 | | -#' @param cum_dist_decorator (`list` of `teal_transform_module`) optional, |
| 22 | +#' @param cum_dist_decorator (`list` of `teal_transform_module` or `NULL`) optional, |
23 | 23 | #' decorator for the cumulative distribution plot. |
24 | 24 | #' |
25 | 25 | #' @templateVar ggnames "Boxplot","Density Plot","Cumulative Distribution Plot" |
@@ -149,11 +149,11 @@ tm_outliers <- function(label = "Outliers Module", |
149 | 149 | plot_width = NULL, |
150 | 150 | pre_output = NULL, |
151 | 151 | post_output = NULL, |
152 | | - table_decorator = teal_transform_module(), |
153 | | - boxplot_decorator = teal_transform_module(), |
154 | | - violin_decorator = teal_transform_module(), |
155 | | - density_decorator = teal_transform_module(), |
156 | | - cum_dist_decorator = teal_transform_module()) { |
| 152 | + table_decorator = NULL, |
| 153 | + boxplot_decorator = NULL, |
| 154 | + violin_decorator = NULL, |
| 155 | + density_decorator = NULL, |
| 156 | + cum_dist_decorator = NULL) { |
157 | 157 | message("Initializing tm_outliers") |
158 | 158 |
|
159 | 159 | # Normalize the parameters |
@@ -190,6 +190,13 @@ tm_outliers <- function(label = "Outliers Module", |
190 | 190 |
|
191 | 191 | checkmate::assert_multi_class(pre_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) |
192 | 192 | checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE) |
| 193 | + |
| 194 | + checkmate::check_class(table_decorator, "teal_transform_module", null.ok = TRUE) |
| 195 | + checkmate::check_class(boxplot_decorator, "teal_transform_module", null.ok = TRUE) |
| 196 | + checkmate::check_class(violin_decorator, "teal_transform_module", null.ok = TRUE) |
| 197 | + checkmate::check_class(density_decorator, "teal_transform_module", null.ok = TRUE) |
| 198 | + checkmate::check_class(cum_dist_decorator, "teal_transform_module", null.ok = TRUE) |
| 199 | + |
193 | 200 | # End of assertions |
194 | 201 |
|
195 | 202 | # Make UI args |
@@ -1073,14 +1080,17 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, |
1073 | 1080 |
|
1074 | 1081 | boxplot_r <- reactive({ |
1075 | 1082 | teal::validate_inputs(iv_r()) |
| 1083 | + req(boxplot_q()) |
1076 | 1084 | decorated_boxplot_q()[["plot"]] |
1077 | 1085 | }) |
1078 | 1086 | density_plot_r <- reactive({ |
1079 | 1087 | teal::validate_inputs(iv_r()) |
| 1088 | + req(density_plot_q()) |
1080 | 1089 | decorated_density_plot_q()[["plot"]] |
1081 | 1090 | }) |
1082 | 1091 | cumulative_plot_r <- reactive({ |
1083 | 1092 | teal::validate_inputs(iv_r()) |
| 1093 | + req(cumulative_plot_q()) |
1084 | 1094 | decorated_cumulative_plot_q()[["plot"]] |
1085 | 1095 | }) |
1086 | 1096 |
|
|
0 commit comments