Skip to content

Commit 8217187

Browse files
committed
add print(plot) later in distirbution plat, after the decoration is applied
1 parent 11d9ea8 commit 8217187

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

R/tm_g_distribution.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,6 @@ srv_distribution <- function(id,
915915
substitute(
916916
expr = {
917917
plot <- plot_call
918-
print(plot)
919918
},
920919
env = list(plot_call = Reduce(function(x, y) call("+", x, y), c(plot_call, parsed_ggplot2_args)))
921920
)
@@ -1047,7 +1046,6 @@ srv_distribution <- function(id,
10471046
substitute(
10481047
expr = {
10491048
plot <- plot_call
1050-
print(plot)
10511049
},
10521050
env = list(plot_call = Reduce(function(x, y) call("+", x, y), c(plot_call, parsed_ggplot2_args)))
10531051
)
@@ -1242,18 +1240,22 @@ srv_distribution <- function(id,
12421240
output_dist_q <- reactive(c(output_common_q(), req(dist_q())))
12431241
output_qq_q <- reactive(c(output_common_q(), req(qq_q())))
12441242

1245-
decorated_output_dist_q <- srv_transform_teal_data(
1243+
decorated_output_dist_q_no_print <- srv_transform_teal_data(
12461244
"d_dist",
12471245
data = output_dist_q,
12481246
transformators = decorators
12491247
)
12501248

1251-
decorated_output_qq_q <- srv_transform_teal_data(
1249+
decorated_output_qq_q_no_print <- srv_transform_teal_data(
12521250
"d_qq",
12531251
data = output_qq_q,
12541252
transformators = decorators
12551253
)
12561254

1255+
decorated_output_dist_q <- reactive(within(decorated_output_dist_q_no_print(), print(plot)))
1256+
decorated_output_qq_q <- reactive(within(decorated_output_qq_q_no_print(), print(plot)))
1257+
1258+
12571259
decorated_output_q <- reactive({
12581260
tab <- req(input$tabs) # tab is NULL upon app launch, hence will crash without this statement
12591261
if (tab == "Histogram") {

0 commit comments

Comments
 (0)