Skip to content

Commit

Permalink
1076 reorder formals (#1080)
Browse files Browse the repository at this point in the history
Closes #1076
  • Loading branch information
chlebowa authored Feb 2, 2024
1 parent 3df3fe8 commit 3bdb09a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* `tdata` has been deprecated and replaced with `teal_data`. Support for `tdata` passed to the `data` argument in `module(server)` will be removed in the next release.
* `module(ui)` argument no longer accepts `data` and `datasets` arguments. All data dependent logic should be set in the server function.
* `module(server)` argument deprecated `datasets` argument. `teal_module`s' server functions should accept `data` (`teal_data`) instead.
* Changed the order of formal arguments in `init`. `filter` now comes directly after `modules`, before `title`.

### Miscellaneous

Expand Down
8 changes: 4 additions & 4 deletions R/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
#' `teal_modules` or `teal_module` object. These are the specific output modules which
#' will be displayed in the `teal` application. See [modules()] and [module()] for
#' more details.
#' @param filter (`teal_slices`)
#' Specifies the initial filter using [teal_slices()].
#' @param title (`shiny.tag` or `character(1)`)
#' The browser window title. Defaults to a title "teal app" with the icon of NEST.
#' Can be created using the `build_app_title()` or
#' by passing a valid `shiny.tag` which is a head tag with title and link tag.
#' @param filter (`teal_slices`)
#' Specifies the initial filter using [teal_slices()].
#' @param header (`shiny.tag` or `character(1)`)
#' The header of the app.
#' @param footer (`shiny.tag` or `character(1)`)
Expand Down Expand Up @@ -74,7 +74,6 @@
#' datanames = "new_iris"
#' )
#' ),
#' title = "App title",
#' filter = teal_slices(
#' teal_slice(dataname = "new_iris", varname = "Species"),
#' teal_slice(dataname = "new_iris", varname = "Sepal.Length"),
Expand All @@ -86,6 +85,7 @@
#' global_filters = "new_mtcars cyl"
#' )
#' ),
#' title = "App title",
#' header = tags$h1("Sample App"),
#' footer = tags$p("Copyright 2017 - 2023")
#' )
Expand All @@ -95,8 +95,8 @@
#'
init <- function(data,
modules,
title = build_app_title(),
filter = teal_slices(),
title = build_app_title(),
header = tags$p(),
footer = tags$p(),
id = character(0)) {
Expand Down
2 changes: 1 addition & 1 deletion R/module_teal_with_splash.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ui_teal_with_splash <- function(id,
#' @rdname module_teal_with_splash
srv_teal_with_splash <- function(id, data, modules, filter = teal_slices()) {
checkmate::assert_character(id, max.len = 1, any.missing = FALSE)
checkmate::check_multi_class(data, c("teal_data", "teal_data_module"))
checkmate::assert_multi_class(data, c("teal_data", "teal_data_module"))
checkmate::assert_class(modules, "teal_modules")
checkmate::assert_class(filter, "teal_slices")

Expand Down
17 changes: 12 additions & 5 deletions man/init.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vignettes/data-as-shiny-module.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ data_module <- teal_data_module(
app <- init(
data = data_module,
module = example_module()
modules = example_module()
)
if (interactive()) {
Expand Down Expand Up @@ -109,7 +109,7 @@ data_module <- teal_data_module(
app <- init(
data = data_module,
module = example_module()
modules = example_module()
)
if (interactive()) {
Expand Down Expand Up @@ -146,7 +146,7 @@ data_module_2 <- within(
app <- init(
data = data_module_2,
module = example_module()
modules = example_module()
)
if (interactive()) {
Expand Down

0 comments on commit 3bdb09a

Please sign in to comment.