Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various docs enhancements #182

Merged
merged 12 commits into from
Aug 22, 2023
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Imports:
checkmate,
ggplot2,
graphics,
grDevices,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @averissimo - change in deps

htmltools,
lifecycle,
methods,
Expand Down
2 changes: 1 addition & 1 deletion R/basic_table_args.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ basic_table_args <- function(...) {
#' module creator setup for [rtables::basic_table()] of a specific table.
#' Created with the [basic_table_args()] function. The `NULL` value is supported.
#' @param app_default (`basic_table_args`)\cr
#' teal option variable. The `NULL` value is supported.
#' Application level setting. Can be `NULL`.
#'
#' @return `basic_table_args` object.
#' @details
Expand Down
2 changes: 1 addition & 1 deletion R/ggplot2_args.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ggplot2_args <- function(labs = list(), theme = list()) {
#' module creator setup for theme and labs in the specific plot.
#' Created with the [ggplot2_args()] function. The `NULL` value is supported.
#' @param app_default (`ggplot2_args`)\cr
#' teal option variable. The `NULL` value is supported.
#' Application level setting. Can be `NULL`.
#'
#' @return `ggplot2_args` object.
#'
Expand Down
4 changes: 2 additions & 2 deletions R/optionalInput.R
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,12 @@ optionalSliderInput <- function(inputId, label, min, max, value, label_help = NU
}
}

#' For teal modules we parameterize an \code{optionalSliderInput} with one argument
#' For `teal` modules we parameterize an \code{optionalSliderInput} with one argument
#' \code{value_min_max}
#'
#' @description `r lifecycle::badge("stable")`
#' The [optionalSliderInput()] function needs three arguments to decided
pawelru marked this conversation as resolved.
Show resolved Hide resolved
#' whether to hide the `sliderInput` widget or not. For teal modules we specify an
#' whether to hide the `sliderInput` widget or not. For `teal` modules we specify an
#' optional slider input with one argument here called `value_min_max`.
#'
#' @inheritParams optionalSliderInput
Expand Down
4 changes: 2 additions & 2 deletions R/standard_layout.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#' the left
#'
#' @description `r lifecycle::badge("stable")`
#' This is the layout used for the teal modules in the `beam` package
#' This is the layout used by the `teal` modules.
#'
#' @param output (`shiny.tag`)\cr
#' object with the output element (table, plot, listing) such as for example returned
Expand Down Expand Up @@ -35,7 +35,7 @@ standard_layout <- function(output,
"post_output" = post_output
))) {
if (!is.null(l[[name]]) && !inherits(l[[name]], c("shiny.tag", "shiny.tag.list", "html"))) {
stop(paste(name, "is supposed to be NULL, shiny.tag or shiny.tag.list."))
stop(paste(name, "is supposed to be `NULL`, `shiny.tag` or `shiny.tag.list`."))
pawelru marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
4 changes: 2 additions & 2 deletions R/teal.widgets-package.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' teal.widgets: Custom widgets for teal applications
#' `teal.widgets`: Custom widgets for `teal` applications
#'
#' The `teal.widgets` package contains functionalities that can be used
#' for teal module development. The Package is dedicated to allow developers to extend modules
#' for `teal` module development. The package is dedicated to allow developers to extend modules
#' functionality by additional inputs and output controls.
#'
pawelru marked this conversation as resolved.
Show resolved Hide resolved
#' @keywords internal
Expand Down
4 changes: 2 additions & 2 deletions man/optionalSliderInputValMinMax.Rd

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

2 changes: 1 addition & 1 deletion man/resolve_basic_table_args.Rd

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

2 changes: 1 addition & 1 deletion man/resolve_ggplot2_args.Rd

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

2 changes: 1 addition & 1 deletion man/standard_layout.Rd

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

4 changes: 2 additions & 2 deletions man/teal.widgets-package.Rd

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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions tests/testthat/helpers-with-settings.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ app_pws <- function() {
#' @keywords internal
is_draw <- function(plot_fun) {
checkmate::assert_function(plot_fun)
graphics.off() # close any current graphics devices
cdev <- dev.cur()
grDevices::graphics.off() # close any current graphics devices
cdev <- grDevices::dev.cur()
plot_fun()
if (cdev != dev.cur()) {
on.exit(dev.off())
if (cdev != grDevices::dev.cur()) {
on.exit(grDevices::dev.off())
return(TRUE)
}
return(FALSE)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-plot_with_settings_ui.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
testthat::test_that("type_download_ui returns shiny.tag", {
testthat::test_that("type_download_ui returns `shiny.tag`", {
testthat::expect_s3_class(type_download_ui("STH"), "shiny.tag")
})

testthat::test_that("plot_with_settings_ui returns shiny.tag.list", {
testthat::test_that("plot_with_settings_ui returns `shiny.tag.list`", {
testthat::expect_s3_class(plot_with_settings_ui("STH"), "shiny.tag.list")
})

Expand Down
13 changes: 8 additions & 5 deletions tests/testthat/test-standard_layout.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@ testthat::test_that("Input validation", {

testthat::expect_error(
standard_layout(NULL),
regexp = "output is supposed to be of class shiny.tag or shiny.tag.list"
regexp = "output is supposed to be of class `shiny.tag` or `shiny.tag.list`"
)

testthat::expect_error(standard_layout(1), regexp = "output is supposed to be of class shiny.tag or shiny.tag.list")
testthat::expect_error(
standard_layout(1),
regexp = "output is supposed to be of class `shiny.tag` or `shiny.tag.list`"
)

testthat::expect_error(standard_layout(
output = tags$div(),
encoding = 1
), regexp = "encoding is supposed to be NULL, shiny.tag or shiny.tag.list.")
), regexp = "encoding is supposed to be `NULL`, `shiny.tag` or `shiny.tag.list`.")

testthat::expect_error(standard_layout(
output = tags$div(),
pre_output = 1
), regexp = "pre_output is supposed to be NULL, shiny.tag or shiny.tag.list.")
), regexp = "pre_output is supposed to be `NULL`, `shiny.tag` or `shiny.tag.list`.")

testthat::expect_error(standard_layout(
output = tags$div(),
post_output = 1
), regexp = "post_output is supposed to be NULL, shiny.tag or shiny.tag.list.")
), regexp = "post_output is supposed to be `NULL`, `shiny.tag` or `shiny.tag.list`.")
})

# Result ----
Expand Down
Loading