Skip to content

Commit

Permalink
rename *_transofrm_data -> *_teal_transform_data
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr committed Nov 14, 2024
1 parent fc596d4 commit 986a7c8
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 18 deletions.
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ export(reporter_previewer_module)
export(set_datanames)
export(show_rcode_modal)
export(srv_teal)
export(srv_teal_transform_data)
export(srv_teal_with_splash)
export(srv_transform_data)
export(tdata2env)
export(teal_data_module)
export(teal_slices)
export(teal_transform_module)
export(ui_teal)
export(ui_teal_transform_data)
export(ui_teal_with_splash)
export(ui_transform_data)
export(validate_has_data)
export(validate_has_elements)
export(validate_has_variable)
Expand Down
4 changes: 2 additions & 2 deletions R/dummy_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ example_module <- function(label = "example teal module", datanames = "all", tra
)
})

table_data_decorated <- srv_transform_data("decorate", data = table_data, transforms = decorators)
table_data_decorated <- srv_teal_transform_data("decorate", data = table_data, transforms = decorators)

output$text <- renderPrint({
req(table_data_decorated)
Expand All @@ -70,7 +70,7 @@ example_module <- function(label = "example teal module", datanames = "all", tra
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
)
),
ui_transform_data(ns("decorate"), transforms = decorators)
ui_teal_transform_data(ns("decorate"), transforms = decorators)
)
},
ui_args = list(decorators = decorators),
Expand Down
4 changes: 2 additions & 2 deletions R/module_nested_tabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ui_teal_module.teal_module <- function(id, modules, depth = 0L) {
width = 3,
ui_data_summary(ns("data_summary")),
ui_filter_data(ns("filter_panel")),
ui_transform_data(ns("data_transform"), transforms = modules$transforms, class = "well"),
ui_teal_transform_data(ns("data_transform"), transforms = modules$transforms, class = "well"),
class = "teal_secondary_col"
)
)
Expand Down Expand Up @@ -261,7 +261,7 @@ srv_teal_module.teal_module <- function(id,
is_active = is_active
)
is_transform_failed <- reactiveValues()
transformed_teal_data <- srv_transform_data(
transformed_teal_data <- srv_teal_transform_data(
"data_transform",
data = filtered_teal_data,
transforms = modules$transforms,
Expand Down
6 changes: 3 additions & 3 deletions R/module_transform_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ NULL

#' @export
#' @rdname module_transform_data
ui_transform_data <- function(id, transforms, class = "well") {
ui_teal_transform_data <- function(id, transforms, class = "well") {
checkmate::assert_string(id)
if (length(transforms) == 0L) {
return(NULL)
Expand Down Expand Up @@ -71,7 +71,7 @@ ui_transform_data <- function(id, transforms, class = "well") {

#' @export
#' @rdname module_transform_data
srv_transform_data <- function(id, data, transforms, modules = NULL, is_transform_failed = reactiveValues()) {
srv_teal_transform_data <- function(id, data, transforms, modules = NULL, is_transform_failed = reactiveValues()) {
checkmate::assert_string(id)
assert_reactive(data)
checkmate::assert_class(modules, "teal_module", null.ok = TRUE)
Expand All @@ -90,7 +90,7 @@ srv_transform_data <- function(id, data, transforms, modules = NULL, is_transfor
Reduce(
function(data_previous, name) {
moduleServer(name, function(input, output, session) {
logger::log_debug("srv_transform_data initializing for { name }.")
logger::log_debug("srv_teal_transform_data initializing for { name }.")
is_transform_failed[[name]] <- FALSE
data_out <- transforms[[name]]$server(name, data = data_previous)
data_handled <- reactive(tryCatch(data_out(), error = function(e) e))
Expand Down
2 changes: 1 addition & 1 deletion R/teal_transform_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' `teal_transform_module` also allows developers to modify any object created within [`teal.data::teal_data`].
#' This means you can use it to customize not only datasets but also tables, listings, and graphs.
#' Some [`teal_modules`] permit developers to inject custom `shiny` modules to enhance displayed outputs.
#' To manage these `decorators` within your module, use [`ui_transform_data()`] and [`srv_transform_data()`].
#' To manage these `decorators` within your module, use [`ui_teal_transform_data()`] and [`srv_teal_transform_data()`].
#' (For further guidance on managing decorators, refer to `ui_args` and `srv_args` in the vignette documentation.)
#'
#' See the vignette `vignette("decorate-modules-output", package = "teal")` for additional examples.
Expand Down
3 changes: 2 additions & 1 deletion man/example_module.Rd

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

8 changes: 4 additions & 4 deletions man/module_transform_data.Rd

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

1 change: 0 additions & 1 deletion man/teal_modules.Rd

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

12 changes: 10 additions & 2 deletions man/teal_transform_module.Rd

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

0 comments on commit 986a7c8

Please sign in to comment.