Skip to content

Commit

Permalink
add req statement so that when srv_teal_transform_data returns NULL y…
Browse files Browse the repository at this point in the history
…ou see error from original teal_data
  • Loading branch information
m7pr committed Nov 21, 2024
1 parent ddbc5a0 commit 2c661ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/tm_a_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ tm_a_pca <- function(label = "Principal Component Analysis",
size = c(2, 1, 8),
pre_output = NULL,
post_output = NULL,
decorators = list(default = teal_transform_module())) {
decorators = NULL) {
message("Initializing tm_a_pca")

# Normalize the parameters
Expand Down Expand Up @@ -165,7 +165,7 @@ tm_a_pca <- function(label = "Principal Component Analysis",
checkmate::assert_multi_class(pre_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE)
checkmate::assert_multi_class(post_output, c("shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE)

checkmate::assert_list(decorators, "teal_transform_module")
checkmate::assert_list(decorators, "teal_transform_module", null.ok = TRUE)
# End of assertions

# Make UI args
Expand Down Expand Up @@ -985,6 +985,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
decorated_output_q <- srv_teal_transform_data("decorate", data = output_q, transformators = decorators)

plot_r <- reactive({
req(output_q())
decorated_output_q()[["plot"]]
})

Expand Down

0 comments on commit 2c661ea

Please sign in to comment.