Skip to content

Commit e5f7864

Browse files
authored
Merge branch '1187_decorate_output@main' into tm_missing_data_module@1187_decorate_output@main
2 parents 8f0687b + 9375353 commit e5f7864

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

R/tm_g_distribution.R

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -913,10 +913,7 @@ srv_distribution <- function(id,
913913
teal.code::eval_code(
914914
qenv,
915915
substitute(
916-
expr = {
917-
plot <- plot_call
918-
print(plot)
919-
},
916+
expr = plot <- plot_call,
920917
env = list(plot_call = Reduce(function(x, y) call("+", x, y), c(plot_call, parsed_ggplot2_args)))
921918
)
922919
)
@@ -1045,10 +1042,7 @@ srv_distribution <- function(id,
10451042
teal.code::eval_code(
10461043
qenv,
10471044
substitute(
1048-
expr = {
1049-
plot <- plot_call
1050-
print(plot)
1051-
},
1045+
expr = plot <- plot_call,
10521046
env = list(plot_call = Reduce(function(x, y) call("+", x, y), c(plot_call, parsed_ggplot2_args)))
10531047
)
10541048
)
@@ -1242,18 +1236,22 @@ srv_distribution <- function(id,
12421236
output_dist_q <- reactive(c(output_common_q(), req(dist_q())))
12431237
output_qq_q <- reactive(c(output_common_q(), req(qq_q())))
12441238

1245-
decorated_output_dist_q <- srv_transform_teal_data(
1239+
decorated_output_dist_q_no_print <- srv_transform_teal_data(
12461240
"d_dist",
12471241
data = output_dist_q,
12481242
transformators = decorators
12491243
)
12501244

1251-
decorated_output_qq_q <- srv_transform_teal_data(
1245+
decorated_output_dist_q <- reactive(within(req(decorated_output_dist_q_no_print()), expr = print(plot)))
1246+
1247+
decorated_output_qq_q_no_print <- srv_transform_teal_data(
12521248
"d_qq",
12531249
data = output_qq_q,
12541250
transformators = decorators
12551251
)
12561252

1253+
decorated_output_qq_q <- reactive(within(req(decorated_output_qq_q_no_print()), expr = print(plot)))
1254+
12571255
decorated_output_q <- reactive({
12581256
tab <- req(input$tabs) # tab is NULL upon app launch, hence will crash without this statement
12591257
if (tab == "Histogram") {

0 commit comments

Comments
 (0)