Skip to content

Commit 5f2d532

Browse files
committed
fix: move print statement after decoration
1 parent 11d9ea8 commit 5f2d532

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

R/tm_g_distribution.R

Lines changed: 7 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,17 +1236,20 @@ 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
)
1244+
decorated_output_dist_q <- reactive(within(req(decorated_output_dist_q_no_print()), expr = print(plot)))
12501245

1251-
decorated_output_qq_q <- srv_transform_teal_data(
1246+
decorated_output_qq_q_no_print <- srv_transform_teal_data(
12521247
"d_qq",
12531248
data = output_qq_q,
12541249
transformators = decorators
12551250
)
1251+
decorated_output_qq_q <- reactive(within(req(decorated_output_qq_q_no_print()), expr = print(plot)))
1252+
12561253

12571254
decorated_output_q <- reactive({
12581255
tab <- req(input$tabs) # tab is NULL upon app launch, hence will crash without this statement

0 commit comments

Comments
 (0)