Skip to content

Commit

Permalink
remove print from the code, and add after the decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr committed Nov 21, 2024
1 parent 2c661ea commit f9d93c0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions R/tm_a_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,6 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
scale_fill_manual(values = c("Cumulative variance" = cols[2], "Single variance" = cols[1])) +
ggthemes +
themes

print(plot)
},
env = list(
ggthemes = parsed_ggplot2_args$ggtheme,
Expand Down Expand Up @@ -656,7 +654,6 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
labs +
ggthemes +
themes
print(plot)
},
env = list(
x_axis = x_axis,
Expand Down Expand Up @@ -878,7 +875,6 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
substitute(
expr = {
plot <- plot_call
print(plot)
},
env = list(
plot_call = Reduce(function(x, y) call("+", x, y), pca_plot_biplot_expr)
Expand Down Expand Up @@ -954,10 +950,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
expr = {
pca_rot <- pca$rotation[, pc, drop = FALSE] %>%
dplyr::as_tibble(rownames = "Variable")

plot <- plot_call

print(plot)
},
env = list(
pc = pc,
Expand All @@ -982,7 +975,10 @@ 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)
decorated_output_q_no_print <- srv_teal_transform_data("decorate", data = output_q, transformators = decorators)
decorated_output_q <- reactive(within(decorated_output_q_no_print(), expr = print(plot)))



plot_r <- reactive({
req(output_q())
Expand Down

0 comments on commit f9d93c0

Please sign in to comment.