Skip to content

Commit 6921c2a

Browse files
committed
fiix: make that the filter panel changes affect module output
1 parent df7d1a7 commit 6921c2a

File tree

8 files changed

+27
-26
lines changed

8 files changed

+27
-26
lines changed

R/tm_a_pca.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,12 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
437437
selector_list = selector_list,
438438
datasets = data
439439
)
440-
qenv <- teal.code::eval_code(data(), 'library("ggplot2");library("dplyr");library("tidyr")') # nolint quotes
440+
qenv <- reactive(
441+
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr");library("tidyr")') # nolint quotes
442+
)
441443
anl_merged_q <- reactive({
442444
req(anl_merged_input())
443-
qenv %>%
445+
qenv() %>%
444446
teal.code::eval_code(as.expression(anl_merged_input()$expr))
445447
})
446448

R/tm_a_regression.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,14 +463,13 @@ srv_a_regression <- function(id,
463463
)
464464
})
465465

466-
qenv <- teal.code::eval_code(
467-
data(),
468-
'library("ggplot2");library("dplyr")' # nolint quotes
466+
qenv <- reactive(
467+
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr")') # nolint quotes
469468
)
470469

471470
anl_merged_q <- reactive({
472471
req(anl_merged_input())
473-
qenv %>%
472+
qenv() %>%
474473
teal.code::eval_code(as.expression(anl_merged_input()$expr))
475474
})
476475

R/tm_g_association.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,12 @@ srv_tm_g_association <- function(id,
345345
selector_list = selector_list
346346
)
347347

348-
qenv <- teal.code::eval_code(
349-
data(),
350-
'library("ggplot2");library("dplyr");library("tern");library("ggmosaic")' # nolint quotes
348+
qenv <- reactive(
349+
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr");library("tern");library("ggmosaic")') # nolint quotes
351350
)
352351
anl_merged_q <- reactive({
353352
req(anl_merged_input())
354-
qenv %>% teal.code::eval_code(as.expression(anl_merged_input()$expr))
353+
qenv() %>% teal.code::eval_code(as.expression(anl_merged_input()$expr))
355354
})
356355

357356
merged <- list(

R/tm_g_bivariate.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,14 +550,13 @@ srv_g_bivariate <- function(id,
550550
selector_list = selector_list,
551551
datasets = data
552552
)
553-
qenv <- teal.code::eval_code(
554-
data(),
555-
'library("ggplot2");library("dplyr");library("teal.modules.general")' # nolint quotes
553+
qenv <- reactive(
554+
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr");library("teal.modules.general")') # nolint quotes
556555
)
557556

558557
anl_merged_q <- reactive({
559558
req(anl_merged_input())
560-
qenv %>%
559+
qenv() %>%
561560
teal.code::eval_code(as.expression(anl_merged_input()$expr))
562561
})
563562

R/tm_g_distribution.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,14 +542,13 @@ srv_distribution <- function(id,
542542
datasets = data
543543
)
544544

545-
qenv <- teal.code::eval_code(
546-
data(),
547-
'library("ggplot2");library("dplyr")' # nolint quotes
545+
qenv <- reactive(
546+
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr")') # nolint quotes
548547
)
549548

550549
anl_merged_q <- reactive({
551550
req(anl_merged_input())
552-
qenv %>%
551+
qenv() %>%
553552
teal.code::eval_code(as.expression(anl_merged_input()$expr))
554553
})
555554

R/tm_g_response.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,14 +393,13 @@ srv_g_response <- function(id,
393393
datasets = data
394394
)
395395

396-
qenv <- teal.code::eval_code(
397-
data(),
398-
'library("ggplot2");library("dplyr")' # nolint quotes
396+
qenv <- reactive(
397+
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr")') # nolint quotes
399398
)
400399

401400
anl_merged_q <- reactive({
402401
req(anl_merged_input())
403-
qenv %>%
402+
qenv() %>%
404403
teal.code::eval_code(as.expression(anl_merged_input()$expr))
405404
})
406405

R/tm_g_scatterplot.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,11 +589,13 @@ srv_g_scatterplot <- function(id,
589589
datasets = data,
590590
merge_function = "dplyr::inner_join"
591591
)
592-
qenv <- teal.code::eval_code(data(), 'library("ggplot2");library("dplyr")') # nolint quotes
592+
qenv <- reactive(
593+
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr")') # nolint quotes
594+
)
593595

594596
anl_merged_q <- reactive({
595597
req(anl_merged_input())
596-
qenv %>%
598+
qenv() %>%
597599
teal.code::eval_code(as.expression(anl_merged_input()$expr)) %>%
598600
teal.code::eval_code(quote(ANL)) # used to display table when running show-r-code code
599601
})

R/tm_t_crosstable.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,12 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y,
314314
selector_list = selector_list,
315315
merge_function = merge_function
316316
)
317-
qenv <- teal.code::eval_code(data(), 'library("rtables");library("tern");library("dplyr")') # nolint quotes
317+
qenv <- reactive(
318+
teal.code::eval_code(data(), 'library("rtables");library("tern");library("dplyr")') # nolint quotes
319+
)
318320
anl_merged_q <- reactive({
319321
req(anl_merged_input())
320-
qenv %>%
322+
qenv() %>%
321323
teal.code::eval_code(as.expression(anl_merged_input()$expr))
322324
})
323325

0 commit comments

Comments
 (0)