Skip to content

Commit

Permalink
fix: move print statement after decoration
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Nov 22, 2024
1 parent 11d9ea8 commit 5f2d532
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -913,10 +913,7 @@ srv_distribution <- function(id,
teal.code::eval_code(
qenv,
substitute(
expr = {
plot <- plot_call
print(plot)
},
expr = plot <- plot_call,
env = list(plot_call = Reduce(function(x, y) call("+", x, y), c(plot_call, parsed_ggplot2_args)))
)
)
Expand Down Expand Up @@ -1045,10 +1042,7 @@ srv_distribution <- function(id,
teal.code::eval_code(
qenv,
substitute(
expr = {
plot <- plot_call
print(plot)
},
expr = plot <- plot_call,
env = list(plot_call = Reduce(function(x, y) call("+", x, y), c(plot_call, parsed_ggplot2_args)))
)
)
Expand Down Expand Up @@ -1242,17 +1236,20 @@ srv_distribution <- function(id,
output_dist_q <- reactive(c(output_common_q(), req(dist_q())))
output_qq_q <- reactive(c(output_common_q(), req(qq_q())))

decorated_output_dist_q <- srv_transform_teal_data(
decorated_output_dist_q_no_print <- srv_transform_teal_data(

Check warning on line 1239 in R/tm_g_distribution.R

View workflow job for this annotation

GitHub Actions / SuperLinter 🦸‍♀️ / Lint R code 🧶

file=R/tm_g_distribution.R,line=1239,col=5,[object_length_linter] Variable and function names should not be longer than 30 characters.
"d_dist",
data = output_dist_q,
transformators = decorators
)
decorated_output_dist_q <- reactive(within(req(decorated_output_dist_q_no_print()), expr = print(plot)))

decorated_output_qq_q <- srv_transform_teal_data(
decorated_output_qq_q_no_print <- srv_transform_teal_data(
"d_qq",
data = output_qq_q,
transformators = decorators
)
decorated_output_qq_q <- reactive(within(req(decorated_output_qq_q_no_print()), expr = print(plot)))


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

0 comments on commit 5f2d532

Please sign in to comment.