Skip to content

Commit a3d3de8

Browse files
committed
remove examples and link to the vignette
1 parent d52361b commit a3d3de8

File tree

3 files changed

+11
-59
lines changed

3 files changed

+11
-59
lines changed

R/tm_a_regression.R

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -42,50 +42,20 @@
4242
#'
4343
#' @inherit shared_params return
4444
#'
45-
#' @section Decorating Module Outputs:
46-
#'
47-
#' Decorating module outputs involves modifying the tables and plots generated by a module. This module provides the
48-
#' ability to execute custom R code to adjust the visual or structural properties of objects displayed within the
49-
#' application.
50-
#'
51-
#' The code specified in [`teal_transform_module`] is executed prior to rendering the outputs in the application. This
52-
#' allows developers to modify attributes such as titles, labels, sizes, limits, and other features of rendered tables
53-
#' and plots. However, decorators should be applied with careful consideration of the module's internal object names
54-
#' to ensure compatibility.
55-
#'
56-
#' To customize an output, developers need to identify the name of the table or plot to be modified within the
57-
#' `teal_transform_module`. This requires specifying a `server` function that modifies the targeted object in the
58-
#' `data` object (of class `teal_data`). Since each module may use different internal object names or types for its
59-
#' outputs, there is no universal code to achieve this. However, `teal` provides convenient wrappers to simplify the
60-
#' process of decorating module outputs:
45+
#' @section Decorating `tm_a_regression`:
6146
#'
62-
#' - **Decorator as a Language/Expression**: Specify a simple R expression to modify the object of interest.
63-
#' For example,`plot <- plot + ggtitle("Custom Title")`. The expression must be valid and compatible with the module's
64-
#' internal environment.
65-
#' - **Decorator as a Function**: Provide a function that accepts the output object and modifies it as desired.
66-
#' When using this approach, the function does not need to align with the module’s internal naming conventions for its
67-
#' objects.
47+
#' This module creates below objects that can be modified with decorators:
48+
#' - `plot` (`ggplot2`)
6849
#'
6950
#' For additional details and examples of decorators, refer to the vignette
7051
#' `vignette("decorate-modules-output", package = "teal")` or the [`teal_transform_module()`] documentation.
7152
#'
72-
#' @section Decorating `tm_a_regression`:
73-
#'
74-
#' This module creates below objects that can be modified with decorators:
75-
#' - `plot` (`ggplot2`)#'
76-
#'
7753
#' @examplesShinylive
7854
#' library(teal.modules.general)
7955
#' interactive <- function() TRUE
8056
#' {{ next_example }}
8157
#' @examples
8258
#'
83-
#' footnote_regression <- teal_transform_module(
84-
#' server = make_teal_transform_server(expression(
85-
#' plot <- plot + labs(caption = deparse(summary(fit)[[1]]))
86-
#' ))
87-
#' )
88-
#'
8959
#' # general data example
9060
#' data <- teal_data()
9161
#' data <- within(data, {
@@ -117,8 +87,7 @@
11787
#' multiple = TRUE,
11888
#' fixed = FALSE
11989
#' )
120-
#' ),
121-
#' decorators = list(footnote_regression)
90+
#' )
12291
#' )
12392
#' )
12493
#' )
@@ -163,8 +132,7 @@
163132
#' multiple = TRUE,
164133
#' fixed = FALSE
165134
#' )
166-
#' ),
167-
#' decorators = list(footnote_regression)
135+
#' )
168136
#' )
169137
#' )
170138
#' )

R/tm_outliers.R

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,21 @@
2727
#'
2828
#' @inherit shared_params return
2929
#'
30-
#' @inheritSection tm_a_regression Decorating Module Outputs
3130
#' @section Decorating `tm_outliers`:
3231
#'
3332
#' This module creates below objects that can be modified with decorators:
3433
#' - `table` (`data.frame`)
3534
#' - `plot` (`ggplot2`)
3635
#'
36+
#' For additional details and examples of decorators, refer to the vignette
37+
#' `vignette("decorate-modules-output", package = "teal")` or the [`teal_transform_module()`] documentation.
38+
#'
3739
#' @examplesShinylive
3840
#' library(teal.modules.general)
3941
#' interactive <- function() TRUE
4042
#' {{ next_example }}
4143
#' @examples
4244
#'
43-
#' module_decorator <- teal_transform_module(
44-
#' server = make_teal_transform_server(
45-
#' expression({
46-
#' plot <- plot + ggplot2::ggtitle("A new title")
47-
#' })
48-
#' )
49-
#' )
50-
#'
5145
#' # general data example
5246
#' data <- teal_data()
5347
#' data <- within(data, {
@@ -84,8 +78,7 @@
8478
#' multiple = TRUE
8579
#' )
8680
#' )
87-
#' ),
88-
#' boxplot_decorator = module_decorator
81+
#' )
8982
#' )
9083
#' )
9184
#' )
@@ -99,14 +92,6 @@
9992
#' {{ next_example }}
10093
#' @examples
10194
#'
102-
#' module_decorator <- teal_transform_module(
103-
#' server = make_teal_transform_server(
104-
#' expression({
105-
#' plot <- plot + ggplot2::ggtitle("A new title")
106-
#' })
107-
#' )
108-
#' )
109-
#'
11095
#' # CDISC data example
11196
#' data <- teal_data()
11297
#' data <- within(data, {
@@ -145,8 +130,7 @@
145130
#' multiple = TRUE
146131
#' )
147132
#' )
148-
#' ),
149-
#' boxplot_decorator = module_decorator
133+
#' )
150134
#' )
151135
#' )
152136
#' )

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
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,
28+
#' @param decorators `r lifecycle::badge("experimental")` (`list` of `teal_transform_module`) optional,
2929
#' decorator for tables or plots included in the module.
3030
#'
3131
#' @param alpha (`integer(1)` or `integer(3)`) optional, specifies point opacity.

0 commit comments

Comments
 (0)