Skip to content

Commit

Permalink
Merge branch 'main' into proof__vignettes@main
Browse files Browse the repository at this point in the history
# Conflicts:
#	vignettes/customizing-module-output.Rmd
#	vignettes/data-transform-as-shiny-module.Rmd
  • Loading branch information
chlebowa committed Feb 5, 2025
2 parents 95133ff + dd753f8 commit e9d36a2
Show file tree
Hide file tree
Showing 46 changed files with 715 additions and 165 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ repos:
- shiny
- shinyjs
- stats
- insightsengineering/roxy.shinylive
- insightsengineering/teal.code
- insightsengineering/teal.data
- insightsengineering/teal.logger
Expand Down
17 changes: 8 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: teal
Title: Exploratory Web Apps for Analyzing Clinical Trials Data
Version: 0.15.2.9119
Date: 2025-01-31
Version: 0.15.2.9125
Date: 2025-02-05
Authors@R: c(
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-9533-457X")),
Expand Down Expand Up @@ -38,7 +38,7 @@ Depends:
R (>= 4.1),
shiny (>= 1.8.1),
teal.data (>= 0.7.0),
teal.slice (>= 0.5.1.9022)
teal.slice (>= 0.6.0)
Imports:
checkmate (>= 2.1.0),
cli,
Expand All @@ -53,7 +53,7 @@ Imports:
teal.code (>= 0.6.0),
teal.logger (>= 0.3.1),
teal.reporter (>= 0.4.0),
teal.widgets (>= 0.4.0),
teal.widgets (>= 0.4.3),
tools,
utils
Suggests:
Expand All @@ -65,6 +65,7 @@ Suggests:
R6,
renv (>= 1.0.11),
rmarkdown (>= 2.23),
roxy.shinylive,
rvest (>= 1.0.0),
shinytest2,
shinyvalidate,
Expand All @@ -76,8 +77,6 @@ VignetteBuilder:
rmarkdown
RdMacros:
lifecycle
Remotes:
insightsengineering/teal.slice
Config/Needs/verdepcheck: rstudio/shiny, insightsengineering/teal.data,
insightsengineering/teal.slice, mllg/checkmate, jeroen/jsonlite,
r-lib/lifecycle, daroczig/logger, shikokuchuo/mirai, r-lib/cli,
Expand All @@ -87,18 +86,18 @@ Config/Needs/verdepcheck: rstudio/shiny, insightsengineering/teal.data,
rstudio/bslib, yihui/knitr, bioc::MultiAssayExperiment, r-lib/R6,
rstudio/rmarkdown, tidyverse/rvest, rstudio/shinytest2,
rstudio/shinyvalidate, r-lib/testthat, r-lib/withr,
yaml=vubiostat/r-yaml, rstudio/htmltools, bioc::matrixStats
yaml=vubiostat/r-yaml, rstudio/htmltools, bioc::matrixStats,
insightsengineering/roxy.shinylive
Config/Needs/website: insightsengineering/nesttemplate
Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
Roxygen: list(markdown = TRUE, packages = c("roxy.shinylive"))
RoxygenNote: 7.3.2
Collate:
'TealAppDriver.R'
'checkmate.R'
'dummy_functions.R'
'get_rcode_utils.R'
'include_css_js.R'
'modules.R'
'init.R'
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# teal 0.15.2.9119
# teal 0.15.2.9125

### New features

Expand Down
5 changes: 5 additions & 0 deletions R/dummy_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
#' decorator for `object` included in the module.
#'
#' @return A `teal` module which can be included in the `modules` argument to [init()].
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' app <- init(
#' data = teal_data(IRIS = iris, MTCARS = mtcars),
Expand Down
28 changes: 0 additions & 28 deletions R/get_rcode_utils.R

This file was deleted.

4 changes: 4 additions & 0 deletions R/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
#'
#' @include modules.R
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' app <- init(
#' data = within(
Expand Down
8 changes: 7 additions & 1 deletion R/module_session_info.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#' `teal` user session info module
#'
#' Module to display the user session info popup and to download a lockfile.
#' Module to display the user session info popup and to download a lockfile. Module is included
#' when running [init()] but skipped when using [`module_teal`]. Please be aware that session info
#' contains R session information, so multiple module's calls will share the same information.
#'
#' @rdname module_session_info
#' @name module_session_info
#'
#' @inheritParams module_teal
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' ui <- fluidPage(
#' ui_session_info("session_info")
Expand Down
3 changes: 1 addition & 2 deletions R/module_teal.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#'
#' @details
#' This module can be used instead of [init()] in custom Shiny applications. Unlike [init()], it doesn't
#' automatically include `reporter_previewer_module`, `module_session_info`, or UI components like
#' `header`, `footer`, and `title` which can be added separately in the Shiny app consuming this module.
#' automatically include [`module_session_info`].
#'
#' Module is responsible for creating the main `shiny` app layout and initializing all the necessary
#' components. This module establishes reactive connection between the input `data` and every other
Expand Down
4 changes: 4 additions & 0 deletions R/modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ setOldClass("teal_modules")
#' @name teal_modules
#' @aliases teal_module
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' library(shiny)
#'
Expand Down
20 changes: 20 additions & 0 deletions R/teal_modifiers.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ teal_replace_ui <- function(x, selector, element) {

#' @rdname teal_modifiers
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' app <- init(
#' data = teal_data(IRIS = iris, MTCARS = mtcars),
Expand Down Expand Up @@ -84,6 +89,11 @@ modify_title <- function(

#' @rdname teal_modifiers
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' app <- init(
#' data = teal_data(IRIS = iris),
Expand All @@ -102,6 +112,11 @@ modify_header <- function(x, element = tags$p()) {

#' @rdname teal_modifiers
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' app <- init(
#' data = teal_data(IRIS = iris),
Expand All @@ -128,6 +143,11 @@ modify_footer <- function(x, element = tags$p()) {
#' @param content (`character(1)`, `shiny.tag` or `shiny.tag.list`) with the content of the popup.
#' @param ... Additional arguments to [shiny::modalDialog()].
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' app <- init(
#' data = teal_data(IRIS = iris, MTCARS = mtcars),
Expand Down
4 changes: 4 additions & 0 deletions R/teal_slices.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
#'
#' @seealso [`teal.slice::teal_slices`], [`teal.slice::teal_slice`], [slices_store()]
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' filter <- teal_slices(
#' teal_slice(dataname = "iris", varname = "Species", id = "species"),
Expand Down
10 changes: 9 additions & 1 deletion R/teal_transform_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@
#' in the filter panel. The keyword `"all"` can be used to display filters for all datasets. `datanames` are
#' automatically appended to the [`modules()`] `datanames`.
#'
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' data_transformators <- list(
#' teal_transform_module(
Expand Down Expand Up @@ -169,6 +172,11 @@ teal_transform_module <- function(ui = NULL,
#' @param expr (`language`)
#' An R call which will be evaluated within [`teal.data::teal_data`] environment.
#' @return `function(id, data)` returning `shiny` module
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#'
#' trim_iris <- teal_transform_module(
Expand Down
5 changes: 5 additions & 0 deletions R/validate_inputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
#'
#' @seealso [`shinyvalidate::InputValidator`], [`shiny::validate`]
#'
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examplesIf require("shinyvalidate")
#' library(shiny)
#' library(shinyvalidate)
Expand Down
29 changes: 29 additions & 0 deletions R/validations.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#'
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' library(teal)
#' ui <- fluidPage(
Expand Down Expand Up @@ -82,6 +86,10 @@ validate_has_data <- function(x,
#'
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' iris$id <- rep(1:50, times = 3)
#' ui <- fluidPage(
Expand Down Expand Up @@ -122,6 +130,10 @@ validate_one_row_per_id <- function(x, key = c("USUBJID", "STUDYID")) {
#'
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' ui <- fluidPage(
#' selectInput(
Expand Down Expand Up @@ -159,6 +171,10 @@ validate_in <- function(x, choices, msg) {
#'
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' data <- data.frame(
#' id = c(1:10, 11:20, 1:10),
Expand Down Expand Up @@ -207,6 +223,10 @@ validate_has_elements <- function(x, msg) {
#'
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' data <- data.frame(
#' id = c(1:10, 11:20, 1:10),
Expand Down Expand Up @@ -261,6 +281,10 @@ validate_no_intersection <- function(x, y, msg) {
#'
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' data <- data.frame(
#' one = rep("a", length.out = 20),
Expand Down Expand Up @@ -318,6 +342,11 @@ validate_has_variable <- function(data, varname, msg) {
#' validation message
#'
#' @export
#'
#' @examplesShinylive
#' library(teal)
#' interactive <- function() TRUE
#' {{ next_example }}
#' @examples
#' data <- data.frame(
#' one = rep("a", length.out = 20),
Expand Down
15 changes: 8 additions & 7 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,25 @@ articles:
navbar: Get started
contents:
- getting-started-with-teal
- title: Using `teal`
navbar: Using `teal`
contents:
- filter-panel
- teal-options
- bootstrap-themes-in-teal
- title: Data in `teal` apps
navbar: Data in `teal` apps
contents:
- including-data-in-teal-applications
- data-as-shiny-module
- filter-panel
- data-transform-as-shiny-module
- title: Extending `teal`
navbar: Extending `teal`
contents:
- creating-custom-modules
- adding-support-for-reporting
- decorate-module-output
- customizing-module-output
- title: Using `teal`
navbar: Using `teal`
contents:
- teal-as-a-module
- teal-options
- bootstrap-themes-in-teal
- title: 📃 Technical blueprint
desc: >
The purpose of the blueprint is to aid new developer’s comprehension of the
Expand Down
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ MAEs
ORCID
Reproducibility
Shiny's
Shinylive
TLG
UI
UX
Expand Down
Loading

0 comments on commit e9d36a2

Please sign in to comment.