Skip to content

Commit e68c10a

Browse files
authored
Merge branch 'main' into 786_attached_packages@main
2 parents 6a9ab33 + 8cd7d71 commit e68c10a

27 files changed

+249
-151
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Type: Package
22
Package: teal.modules.general
33
Title: General Modules for 'teal' Applications
4-
Version: 0.3.0.9081
5-
Date: 2025-02-13
4+
Version: 0.3.0.9082
5+
Date: 2025-02-18
66
Authors@R: c(
77
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre")),
88
person("Pawel", "Rucki", , "[email protected]", role = "aut"),

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# teal.modules.general 0.3.0.9081
1+
# teal.modules.general 0.3.0.9082
22

33
* Removed `Show Warnings` modals from modules.
44
* Soft deprecated `datasets_selected` argument of modules in favor of `datanames`.

R/tm_a_pca.R

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,18 @@
2525
#' - `biplot` (`ggplot2`)
2626
#' - `eigenvector_plot` (`ggplot2`)
2727
#'
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.
3130
#' See code snippet below:
3231
#'
3332
#' ```
3433
#' tm_a_pca(
3534
#' ..., # arguments for module
3635
#' decorators = list(
37-
#' default = list(teal_transform_module(...)), # applied to all outputs
38-
#' elbow_plot = list(teal_transform_module(...)), # applied only to `elbow_plot` output
39-
#' circle_plot = list(teal_transform_module(...)) # applied only to `circle_plot` output
40-
#' biplot = list(teal_transform_module(...)) # applied only to `biplot` output
41-
#' eigenvector_plot = list(teal_transform_module(...)) # applied only to `eigenvector_plot` output
36+
#' elbow_plot = teal_transform_module(...), # applied to the `elbow_plot` output
37+
#' circle_plot = teal_transform_module(...), # applied to the `circle_plot` output
38+
#' biplot = teal_transform_module(...), # applied to the `biplot` output
39+
#' eigenvector_plot = teal_transform_module(...) # applied to the `eigenvector_plot` output
4240
#' )
4341
#' )
4442
#' ```
@@ -186,9 +184,7 @@ tm_a_pca <- function(label = "Principal Component Analysis",
186184
checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE)
187185

188186
available_decorators <- c("elbow_plot", "circle_plot", "biplot", "eigenvector_plot")
189-
decorators <- normalize_decorators(decorators)
190187
assert_decorators(decorators, available_decorators)
191-
# End of assertions
192188

193189
# Make UI args
194190
args <- as.list(environment())

R/tm_a_regression.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@
4848
#' This module generates the following objects, which can be modified in place using decorators:
4949
#' - `plot` (`ggplot2`)
5050
#'
51+
#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects.
52+
#' The name of this list corresponds to the name of the output to which the decorator is applied.
53+
#' See code snippet below:
54+
#'
55+
#' ```
56+
#' tm_a_regression(
57+
#' ..., # arguments for module
58+
#' decorators = list(
59+
#' plot = teal_transform_module(...) # applied to the `plot` output
60+
#' )
61+
#' )
62+
#' ```
63+
#'
5164
#' For additional details and examples of decorators, refer to the vignette
5265
#' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation.
5366
#'
@@ -225,7 +238,6 @@ tm_a_regression <- function(label = "Regression Analysis",
225238
.var.name = "label_segment_threshold"
226239
)
227240
}
228-
decorators <- normalize_decorators(decorators)
229241
assert_decorators(decorators, "plot")
230242
# End of assertions
231243

R/tm_g_association.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@
2929
#' This module generates the following objects, which can be modified in place using decorators:
3030
#' - `plot` (`grob` created with [ggplot2::ggplotGrob()])
3131
#'
32+
#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects.
33+
#' The name of this list corresponds to the name of the output to which the decorator is applied.
34+
#' See code snippet below:
35+
#'
36+
#' ```
37+
#' tm_g_association(
38+
#' ..., # arguments for module
39+
#' decorators = list(
40+
#' plot = teal_transform_module(...) # applied to the `plot` output
41+
#' )
42+
#' )
43+
#' ```
44+
#'
3245
#' For additional details and examples of decorators, refer to the vignette
3346
#' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation.
3447
#'
@@ -176,7 +189,6 @@ tm_g_association <- function(label = "Association",
176189
checkmate::assert_list(ggplot2_args, types = "ggplot2_args")
177190
checkmate::assert_subset(names(ggplot2_args), c("default", plot_choices))
178191

179-
decorators <- normalize_decorators(decorators)
180192
assert_decorators(decorators, "plot")
181193
# End of assertions
182194

R/tm_g_bivariate.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@
5151
#' This module generates the following objects, which can be modified in place using decorators:
5252
#' - `plot` (`ggplot2`)
5353
#'
54+
#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects.
55+
#' The name of this list corresponds to the name of the output to which the decorator is applied.
56+
#' See code snippet below:
57+
#'
58+
#' ```
59+
#' tm_g_bivariate(
60+
#' ..., # arguments for module
61+
#' decorators = list(
62+
#' plot = teal_transform_module(...) # applied to the `plot` output
63+
#' )
64+
#' )
65+
#' ```
66+
#'
5467
#' For additional details and examples of decorators, refer to the vignette
5568
#' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation.
5669
#'
@@ -277,7 +290,6 @@ tm_g_bivariate <- function(label = "Bivariate Plots",
277290
checkmate::assert_multi_class(pre_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE)
278291
checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE)
279292

280-
decorators <- normalize_decorators(decorators)
281293
assert_decorators(decorators, "plot")
282294
# End of assertions
283295

R/tm_g_distribution.R

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,18 @@
3434
#' - `summary_table` (`listing_df` created with [rlistings::as_listing()])
3535
#' - `test_table` (`listing_df` created with [rlistings::as_listing()])
3636
#'
37-
#' Decorators can be applied to all outputs or only to specific objects using a
38-
#' named list of `teal_transform_module` objects.
39-
#' The `"default"` name is reserved for decorators that are applied to all outputs.
37+
#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects.
38+
#' The name of this list corresponds to the name of the output to which the decorator is applied.
4039
#' See code snippet below:
4140
#'
4241
#' ```
4342
#' tm_g_distribution(
4443
#' ..., # arguments for module
4544
#' decorators = list(
46-
#' default = list(teal_transform_module(...)), # applied to all outputs
47-
#' histogram_plot = list(teal_transform_module(...)), # applied only to `histogram_plot` output
48-
#' qq_plot = list(teal_transform_module(...)) # applied only to `qq_plot` output
49-
#' summary_table = list(teal_transform_module(...)) # applied only to `summary_table` output
50-
#' test_table = list(teal_transform_module(...)) # applied only to `test_table` output
45+
#' histogram_plot = teal_transform_module(...), # applied only to `histogram_plot` output
46+
#' qq_plot = teal_transform_module(...), # applied only to `qq_plot` output
47+
#' summary_table = teal_transform_module(...), # applied only to `summary_table` output
48+
#' test_table = teal_transform_module(...) # applied only to `test_table` output
5149
#' )
5250
#' )
5351
#' ```
@@ -194,7 +192,6 @@ tm_g_distribution <- function(label = "Distribution Module",
194192
checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE)
195193

196194
available_decorators <- c("histogram_plot", "qq_plot", "test_table", "summary_table")
197-
decorators <- normalize_decorators(decorators)
198195
assert_decorators(decorators, names = available_decorators)
199196

200197
# End of assertions

R/tm_g_response.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@
4444
#' This module generates the following objects, which can be modified in place using decorators:
4545
#' - `plot` (`ggplot2`)
4646
#'
47+
#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects.
48+
#' The name of this list corresponds to the name of the output to which the decorator is applied.
49+
#' See code snippet below:
50+
#'
51+
#' ```
52+
#' tm_g_response(
53+
#' ..., # arguments for module
54+
#' decorators = list(
55+
#' plot = teal_transform_module(...) # applied to the `plot` output
56+
#' )
57+
#' )
58+
#' ```
59+
#'
4760
#' For additional details and examples of decorators, refer to the vignette
4861
#' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation.
4962
#'
@@ -202,7 +215,6 @@ tm_g_response <- function(label = "Response Plot",
202215
checkmate::assert_multi_class(pre_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE)
203216
checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE)
204217

205-
decorators <- normalize_decorators(decorators)
206218
assert_decorators(decorators, "plot")
207219
# End of assertions
208220

R/tm_g_scatterplot.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@
3535
#' This module generates the following objects, which can be modified in place using decorators:
3636
#' - `plot` (`ggplot2`)
3737
#'
38+
#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects.
39+
#' The name of this list corresponds to the name of the output to which the decorator is applied.
40+
#' See code snippet below:
41+
#'
42+
#' ```
43+
#' tm_g_scatterplot(
44+
#' ..., # arguments for module
45+
#' decorators = list(
46+
#' plot = teal_transform_module(...) # applied to the `plot` output
47+
#' )
48+
#' )
49+
#' ```
50+
#'
3851
#' For additional details and examples of decorators, refer to the vignette
3952
#' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation.
4053
#'
@@ -299,7 +312,6 @@ tm_g_scatterplot <- function(label = "Scatterplot",
299312
checkmate::assert_scalar(table_dec)
300313
checkmate::assert_class(ggplot2_args, "ggplot2_args")
301314

302-
decorators <- normalize_decorators(decorators)
303315
assert_decorators(decorators, "plot")
304316

305317
# End of assertions

R/tm_g_scatterplotmatrix.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@
2323
#' This module generates the following objects, which can be modified in place using decorators:
2424
#' - `plot` (`trellis` - output of `lattice::splom`)
2525
#'
26+
#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects.
27+
#' The name of this list corresponds to the name of the output to which the decorator is applied.
28+
#' See code snippet below:
29+
#'
30+
#' ```
31+
#' tm_g_scatterplotmatrix(
32+
#' ..., # arguments for module
33+
#' decorators = list(
34+
#' plot = teal_transform_module(...) # applied to the `plot` output
35+
#' )
36+
#' )
37+
#' ```
38+
#'
2639
#' For additional details and examples of decorators, refer to the vignette
2740
#' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation.
2841
#'
@@ -199,7 +212,6 @@ tm_g_scatterplotmatrix <- function(label = "Scatterplot Matrix",
199212
checkmate::assert_multi_class(pre_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE)
200213
checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE)
201214

202-
decorators <- normalize_decorators(decorators)
203215
assert_decorators(decorators, "plot")
204216
# End of assertions
205217

0 commit comments

Comments
 (0)