Skip to content

Commit f28d40d

Browse files
committed
unify decorators usage with outliers
1 parent 5196b7f commit f28d40d

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

R/tm_a_regression.R

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
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 decorators (`list` of `teal_transform_module`)
4039
#'
4140
#' @templateVar ggnames `r regression_names`
4241
#' @template ggplot2_args_multi
@@ -288,7 +287,7 @@ tm_a_regression <- function(label = "Regression Analysis",
288287
}
289288

290289
# UI function for the regression module
291-
ui_a_regression <- function(id, decorators, ...) {
290+
ui_a_regression <- function(id, ...) {
292291
ns <- NS(id)
293292
args <- list(...)
294293
is_single_dataset_value <- teal.transform::is_single_dataset(args$regressor, args$response)
@@ -325,37 +324,37 @@ ui_a_regression <- function(id, decorators, ...) {
325324
conditionalPanel(
326325
condition = "input.plot_type == 'Response vs Regressor'",
327326
ns = ns,
328-
ui_teal_transform_data(ns("d_0"), transformators = decorators[[1]])
327+
ui_teal_transform_data(ns("d_0"), transformators = args$decorators[[1]])
329328
),
330329
conditionalPanel(
331330
condition = "input.plot_type == 'Residuals vs Fitted'",
332331
ns = ns,
333-
ui_teal_transform_data(ns("d_1"), transformators = decorators[[1]])
332+
ui_teal_transform_data(ns("d_1"), transformators = args$decorators[[1]])
334333
),
335334
conditionalPanel(
336335
condition = "input.plot_type == 'Normal Q-Q'",
337336
ns = ns,
338-
ui_teal_transform_data(ns("d_2"), transformators = decorators[[1]])
337+
ui_teal_transform_data(ns("d_2"), transformators = args$decorators[[1]])
339338
),
340339
conditionalPanel(
341340
condition = "input.plot_type == 'Scale-Location'",
342341
ns = ns,
343-
ui_teal_transform_data(ns("d_3"), transformators = decorators[[1]])
342+
ui_teal_transform_data(ns("d_3"), transformators = args$decorators[[1]])
344343
),
345344
conditionalPanel(
346345
condition = "input.plot_type == 'Cook\\'s distance'",
347346
ns = ns,
348-
ui_teal_transform_data(ns("d_4"), transformators = decorators[[1]])
347+
ui_teal_transform_data(ns("d_4"), transformators = args$decorators[[1]])
349348
),
350349
conditionalPanel(
351350
condition = "input.plot_type == 'Residuals vs Leverage'",
352351
ns = ns,
353-
ui_teal_transform_data(ns("d_5"), transformators = decorators[[1]])
352+
ui_teal_transform_data(ns("d_5"), transformators = args$decorators[[1]])
354353
),
355354
conditionalPanel(
356355
condition = "input.plot_type == 'Cook\\'s dist vs Leverage'",
357356
ns = ns,
358-
ui_teal_transform_data(ns("d_6"), transformators = decorators[[1]])
357+
ui_teal_transform_data(ns("d_6"), transformators = args$decorators[[1]])
359358
),
360359
),
361360
checkboxInput(ns("show_outlier"), label = "Display outlier labels", value = TRUE),

R/utils.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#' with text placed before the output to put the output into context. For example a title.
2626
#' @param post_output (`shiny.tag`) optional, text or UI element to be displayed after the module's output,
2727
#' adding context or further instructions. Elements like `shiny::helpText()` are useful.
28+
#' @param decorators (`list` of `teal_transform_module`) optional,
29+
#' decorator for tables or plots included in the module.
2830
#'
2931
#' @param alpha (`integer(1)` or `integer(3)`) optional, specifies point opacity.
3032
#' - When the length of `alpha` is one: the plot points will have a fixed opacity.

0 commit comments

Comments
 (0)