Skip to content

Commit f1e5311

Browse files
chlebowagogonzovedhav
authored
improve vignettes for transformers and decorators (#1476)
Some improvements. --------- Signed-off-by: Aleksander Chlebowski <[email protected]> Co-authored-by: Dawid Kałędkowski <[email protected]> Co-authored-by: vedhav <[email protected]>
1 parent 2fa9ba4 commit f1e5311

20 files changed

+687
-300
lines changed

R/dummy_functions.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#' This module creates an object called `object` that can be modified with decorators.
66
#' The `object` is determined by what's selected in `Choose a dataset` input in UI.
77
#' The object can be anything that can be handled by `renderPrint()`.
8-
#' See the `vignette("decorate-modules-output", package = "teal")` or [`teal_transform_module`]
8+
#' See the `vignette("customizing-module-output", package = "teal")` or [`teal_transform_module`]
99
#' to read more about decorators.
1010
#'
1111
#' @inheritParams teal_modules

R/modules.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ setOldClass("teal_modules")
2222
#'
2323
#' # Restricting datasets used by `teal_module`:
2424
#'
25-
#' The `datanames` argument controls which datasets are used by the modules server. These datasets,
25+
#' The `datanames` argument controls which datasets are used by the module's server. These datasets,
2626
#' passed via server's `data` argument, are the only ones shown in the module's tab.
2727
#'
2828
#' When `datanames` is set to `"all"`, all datasets in the data object are treated as relevant.
@@ -35,7 +35,7 @@ setOldClass("teal_modules")
3535
#' Please see the _"Hidden datasets"_ section in `vignette("including-data-in-teal-applications").
3636
#'
3737
#' # `datanames` with `transformators`
38-
#' When transformators are specified, their `datanames` are added to the modules `datanames`, which
38+
#' When transformators are specified, their `datanames` are added to the module's `datanames`, which
3939
#' changes the behavior as follows:
4040
#' - If `module(datanames)` is `NULL` and the `transformators` have defined `datanames`, the sidebar
4141
#' will appear showing the `transformators`' datasets, instead of being hidden.

R/teal_transform_module.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#' To manage these `decorators` within your module, use [`ui_transform_teal_data()`] and [`srv_transform_teal_data()`].
2424
#' (For further guidance on managing decorators, refer to `ui_args` and `srv_args` in the vignette documentation.)
2525
#'
26-
#' See the vignette `vignette("decorate-modules-output", package = "teal")` for additional examples.
26+
#' See the vignette `vignette("customizing-module-output", package = "teal")` for additional examples.
2727
#'
2828
#' # `server` as a language
2929
#'

_pkgdown.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ articles:
7272
- title: Using `teal`
7373
navbar: Using `teal`
7474
contents:
75-
- teal-as-a-module
75+
- teal-as-a-shiny-module
7676
- teal-options
7777
- bootstrap-themes-in-teal
7878
- title: 📃 Technical blueprint
7979
desc: >
80-
The purpose of the blueprint is to aid new developers comprehension of the
80+
The purpose of the blueprint is to aid new developer's comprehension of the
8181
fundamental principles of the `teal` framework. We will explore crucial `teal`
8282
concepts such as data flow, actors, and filter panel, among others.
8383
contents:

inst/WORDLIST

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Hoffmann
55
MAEs
66
ORCID
77
Reproducibility
8-
Shiny's
98
Shinylive
109
TLG
1110
UI

inst/design/teal-app-components-hover.drawio

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

man/example_module.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/teal_modules.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/teal_transform_module.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/adding-support-for-reporting.Rmd

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ interactive <- function() TRUE
3939
Let us consider an example module, based on the example module from `teal`:
4040
```{r module_1}
4141
library(teal)
42+
library(teal.reporter)
4243
4344
my_module <- function(label = "example teal module") {
4445
module(
@@ -138,6 +139,7 @@ if (interactive()) {
138139
```{r shinylive_iframe_2, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = requireNamespace("roxy.shinylive", quietly = TRUE) && knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")}
139140
code <- paste0(c(
140141
knitr::knit_code$get("as_interactive"),
142+
knitr::knit_code$get("setup"),
141143
knitr::knit_code$get("module_2"),
142144
knitr::knit_code$get("app_2")
143145
), collapse = "\n")
@@ -206,6 +208,7 @@ The user can now add a card to the report and view it in the `Report previewer`
206208
```{r shinylive_iframe_3, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = requireNamespace("roxy.shinylive", quietly = TRUE) && knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")}
207209
code <- paste0(c(
208210
knitr::knit_code$get("as_interactive"),
211+
knitr::knit_code$get("setup"),
209212
knitr::knit_code$get("module_3"),
210213
knitr::knit_code$get("app_3")
211214
), collapse = "\n")
@@ -278,6 +281,7 @@ Now, an application user can see the text added by `custom_function` in the `Rep
278281
```{r shinylive_iframe_4, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = requireNamespace("roxy.shinylive", quietly = TRUE) && knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")}
279282
code <- paste0(c(
280283
knitr::knit_code$get("as_interactive"),
284+
knitr::knit_code$get("setup"),
281285
knitr::knit_code$get("module_4"),
282286
knitr::knit_code$get("app_4")
283287
), collapse = "\n")
@@ -318,9 +322,6 @@ This allows `ReporterCard` to store the code necessary to generate the table alo
318322
To learn more about `teal.code` see the vignette _`qenv`_ in `teal.code`.
319323

320324
```{r app_5}
321-
library(teal)
322-
library(teal.reporter)
323-
324325
example_reporter_module <- function(label = "Example") {
325326
module(
326327
label = label,
@@ -420,7 +421,7 @@ app <- init(
420421
),
421422
filter = teal_slices(teal_slice(dataname = "AIR", varname = "Temp", selected = c(72, 85)))
422423
) |>
423-
modify_header("Example teal app with reporter")
424+
modify_header(tags$h2("Example teal app with reporter"))
424425
425426
if (interactive()) {
426427
shinyApp(app$ui, app$server)
@@ -430,6 +431,7 @@ if (interactive()) {
430431
```{r shinylive_iframe_5, echo = FALSE, out.width = '150%', out.extra = 'style = "position: relative; z-index:1"', eval = requireNamespace("roxy.shinylive", quietly = TRUE) && knitr::is_html_output() && identical(Sys.getenv("IN_PKGDOWN"), "true")}
431432
code <- paste0(c(
432433
knitr::knit_code$get("as_interactive"),
434+
knitr::knit_code$get("module_1"),
433435
knitr::knit_code$get("module_5"),
434436
knitr::knit_code$get("app_5")
435437
), collapse = "\n")

0 commit comments

Comments
 (0)