Skip to content

Commit

Permalink
Merge branch 'main' into 1128_fluff@main
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikeyakirar authored May 9, 2024
2 parents dd33cbe + 743c8db commit f50feca
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 32 deletions.
4 changes: 2 additions & 2 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.9034
Date: 2024-05-08
Version: 0.15.2.9035
Date: 2024-05-09
Authors@R: c(
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-9533-457X")),
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.9034
# teal 0.15.2.9035

### Miscellaneous
* Filter mapping display is no longer coupled to the snapshot manager.
Expand Down
27 changes: 12 additions & 15 deletions R/TealAppDriver.R
Original file line number Diff line number Diff line change
Expand Up @@ -243,23 +243,20 @@ TealAppDriver <- R6::R6Class( # nolint: object_name.
self$get_value(output = sprintf("%s-%s", self$active_module_ns(), output_id))
},
#' @description
#' Get the output from the module's `teal.widgets::table_with_settings` in the `teal` app.
#' Get the output from the module's `teal.widgets::table_with_settings` or `DT::DTOutput` in the `teal` app.
#' This function will only access outputs from the name space of the current active teal module.
#'
#' @param tws (`character(1)`) `table_with_settings` namespace name.
#' @param table_id (`character(1)`) The id of the table in the active teal module's name space.
#' @param which (integer) If there is more than one table, which should be extracted.
#' By default it will look for a table that is built using `teal.widgets::table_with_settings`.
#'
#' @return The data.frame with table contents.
get_active_module_tws_output = function(tws, which = 1) {
get_active_module_table_output = function(table_id, which = 1) {
checkmate::check_number(which, lower = 1)
checkmate::check_string(tws)
table <-
rvest::html_table(
self$get_html_rvest(
self$active_module_element(sprintf("%s-table-with-settings", tws))
),
fill = TRUE
)
checkmate::check_string(table_id)
table <- self$active_module_element(table_id) %>%
self$get_html_rvest() %>%
rvest::html_table(fill = TRUE)
if (length(table) == 0) {
data.frame()
} else {
Expand All @@ -270,13 +267,13 @@ TealAppDriver <- R6::R6Class( # nolint: object_name.
#' Get the output from the module's `teal.widgets::plot_with_settings` in the `teal` app.
#' This function will only access plots from the name space of the current active teal module.
#'
#' @param pws (`character(1)`) `plot_with_settings` namespace name.
#' @param plot_id (`character(1)`) The id of the plot in the active teal module's name space.
#'
#' @return The `src` attribute as `character(1)` vector.
get_active_module_pws_output = function(pws) {
checkmate::check_string(pws)
get_active_module_plot_output = function(plot_id) {
checkmate::check_string(plot_id)
self$get_attr(
self$active_module_element(sprintf("%s-plot_main > img", pws)),
self$active_module_element(sprintf("%s-plot_main > img", plot_id)),
"src"
)
},
Expand Down
29 changes: 15 additions & 14 deletions man/TealAppDriver.Rd

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

0 comments on commit f50feca

Please sign in to comment.