Skip to content

Commit 80deb96

Browse files
authored
1 parent 5d3972f commit 80deb96

11 files changed

+10
-157
lines changed

R/tm_a_pca.R

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,6 @@ ui_a_pca <- function(id, ...) {
341341
)
342342
)
343343
),
344-
forms = tagList(
345-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
346-
),
347344
pre_output = args$pre_output,
348345
post_output = args$post_output
349346
)
@@ -1080,8 +1077,6 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
10801077
graph_align = "center"
10811078
)
10821079

1083-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_q)
1084-
10851080
# tables ----
10861081
output$tbl_importance <- renderTable(
10871082
expr = {
@@ -1135,14 +1130,6 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
11351130
)
11361131
})
11371132

1138-
# Render R code.
1139-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))
1140-
1141-
teal.widgets::verbatim_popup_srv(
1142-
id = "rcode",
1143-
verbatim_content = source_code_r,
1144-
title = "R Code for PCA"
1145-
)
1146-
decorated_output_dims_q
1133+
set_chunk_dims(pws, decorated_output_q)
11471134
})
11481135
}

R/tm_a_regression.R

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,6 @@ ui_a_regression <- function(id, ...) {
374374
)
375375
)
376376
),
377-
forms = tagList(
378-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
379-
),
380377
pre_output = args$pre_output,
381378
post_output = args$post_output
382379
)
@@ -1021,22 +1018,12 @@ srv_a_regression <- function(id,
10211018
width = plot_width
10221019
)
10231020

1024-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_q)
1025-
10261021
output$text <- renderText({
10271022
req(iv_r()$is_valid())
10281023
req(iv_out$is_valid())
10291024
paste(utils::capture.output(summary(fitted()))[-1], collapse = "\n")
10301025
})
10311026

1032-
# Render R code.
1033-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))
1034-
1035-
teal.widgets::verbatim_popup_srv(
1036-
id = "rcode",
1037-
verbatim_content = source_code_r,
1038-
title = "R code for the regression plot",
1039-
)
1040-
decorated_output_dims_q
1027+
set_chunk_dims(pws, decorated_output_q)
10411028
})
10421029
}

R/tm_g_association.R

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,6 @@ ui_tm_g_association <- function(id, ...) {
289289
)
290290
)
291291
),
292-
forms = tagList(
293-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
294-
),
295292
pre_output = args$pre_output,
296293
post_output = args$post_output
297294
)
@@ -545,18 +542,8 @@ srv_tm_g_association <- function(id,
545542
width = plot_width
546543
)
547544

548-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_grob_q)
549-
550545
output$title <- renderText(output_q()[["title"]])
551546

552-
# Render R code.
553-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))
554-
555-
teal.widgets::verbatim_popup_srv(
556-
id = "rcode",
557-
verbatim_content = source_code_r,
558-
title = "Association Plot"
559-
)
560-
decorated_output_dims_q
547+
set_chunk_dims(pws, decorated_output_grob_q)
561548
})
562549
}

R/tm_g_bivariate.R

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,6 @@ ui_g_bivariate <- function(id, ...) {
466466
)
467467
)
468468
),
469-
forms = tagList(
470-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
471-
),
472469
pre_output = args$pre_output,
473470
post_output = args$post_output
474471
)
@@ -741,18 +738,7 @@ srv_g_bivariate <- function(id,
741738
width = plot_width
742739
)
743740

744-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_q_facets)
745-
746-
# Render R code.
747-
748-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))
749-
750-
teal.widgets::verbatim_popup_srv(
751-
id = "rcode",
752-
verbatim_content = source_code_r,
753-
title = "Bivariate Plot"
754-
)
755-
decorated_output_dims_q
741+
set_chunk_dims(pws, decorated_output_q_facets)
756742
})
757743
}
758744

R/tm_g_distribution.R

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,6 @@ ui_distribution <- function(id, ...) {
377377
)
378378
)
379379
),
380-
forms = tagList(
381-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
382-
),
383380
pre_output = args$pre_output,
384381
post_output = args$post_output
385382
)
@@ -1402,14 +1399,6 @@ srv_distribution <- function(id,
14021399

14031400
output$t_stats <- DT::renderDataTable(tests_r())
14041401

1405-
# Render R code.
1406-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))
1407-
1408-
teal.widgets::verbatim_popup_srv(
1409-
id = "rcode",
1410-
verbatim_content = source_code_r,
1411-
title = "R Code for distribution"
1412-
)
14131402
decorated_output_q
14141403
})
14151404
}

R/tm_g_response.R

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,6 @@ ui_g_response <- function(id, ...) {
320320
)
321321
)
322322
),
323-
forms = tagList(
324-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
325-
),
326323
pre_output = args$pre_output,
327324
post_output = args$post_output
328325
)
@@ -594,16 +591,6 @@ srv_g_response <- function(id,
594591
width = plot_width
595592
)
596593

597-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_plot_q)
598-
599-
# Render R code.
600-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))
601-
602-
teal.widgets::verbatim_popup_srv(
603-
id = "rcode",
604-
verbatim_content = source_code_r,
605-
title = "Show R Code for Response"
606-
)
607-
decorated_output_dims_q
594+
set_chunk_dims(pws, decorated_output_plot_q)
608595
})
609596
}

R/tm_g_scatterplot.R

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,6 @@ ui_g_scatterplot <- function(id, ...) {
495495
)
496496
)
497497
),
498-
forms = tagList(
499-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
500-
),
501498
pre_output = args$pre_output,
502499
post_output = args$post_output
503500
)
@@ -1037,8 +1034,6 @@ srv_g_scatterplot <- function(id,
10371034
brushing = TRUE
10381035
)
10391036

1040-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_plot_q)
1041-
10421037
output$data_table <- DT::renderDataTable({
10431038
plot_brush <- pws$brush()
10441039

@@ -1067,14 +1062,6 @@ srv_g_scatterplot <- function(id,
10671062
}
10681063
})
10691064

1070-
# Render R code.
1071-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))
1072-
1073-
teal.widgets::verbatim_popup_srv(
1074-
id = "rcode",
1075-
verbatim_content = source_code_r,
1076-
title = "R Code for scatterplot"
1077-
)
1078-
decorated_output_dims_q
1065+
set_chunk_dims(pws, decorated_output_plot_q)
10791066
})
10801067
}

R/tm_g_scatterplotmatrix.R

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,6 @@ ui_g_scatterplotmatrix <- function(id, ...) {
288288
)
289289
)
290290
),
291-
forms = tagList(
292-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
293-
),
294291
pre_output = args$pre_output,
295292
post_output = args$post_output
296293
)
@@ -479,8 +476,6 @@ srv_g_scatterplotmatrix <- function(id,
479476
width = plot_width
480477
)
481478

482-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_q)
483-
484479
# show a message if conversion to factors took place
485480
output$message <- renderText({
486481
req(iv_r()$is_valid())
@@ -503,15 +498,7 @@ srv_g_scatterplotmatrix <- function(id,
503498
}
504499
})
505500

506-
# Render R code.
507-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))
508-
509-
teal.widgets::verbatim_popup_srv(
510-
id = "rcode",
511-
verbatim_content = source_code_r,
512-
title = "Show R Code for Scatterplotmatrix"
513-
)
514-
decorated_output_dims_q
501+
set_chunk_dims(pws, decorated_output_q)
515502
})
516503
}
517504

R/tm_missing_data.R

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ ui_page_missing_data <- function(id, pre_output = NULL, post_output = NULL) {
189189
encoding = tags$div(
190190
uiOutput(ns("dataset_encodings"))
191191
),
192-
uiOutput(ns("dataset_reporter")),
193192
pre_output = pre_output,
194193
post_output = post_output
195194
)
@@ -248,19 +247,6 @@ srv_page_missing_data <- function(id, data, datanames, parent_dataname,
248247
)
249248
})
250249

251-
output$dataset_reporter <- renderUI({
252-
lapply(datanames, function(x) {
253-
dataname_ns <- NS(ns(x))
254-
255-
conditionalPanel(
256-
is_tab_active_js(ns("dataname_tab"), x),
257-
tagList(
258-
teal.widgets::verbatim_popup_ui(dataname_ns("rcode"), "Show R code")
259-
)
260-
)
261-
})
262-
})
263-
264250
result <- sapply(
265251
datanames,
266252
function(x) {
@@ -727,7 +713,7 @@ srv_missing_data <- function(id,
727713
# Prepare qenvs for output objects
728714

729715
summary_plot_q <- reactive({
730-
req(input$summary_type == "Summary") # needed to trigger show r code update on tab change
716+
req(input$summary_type == "Summary") # needed to trigger update on tab change
731717
teal::validate_has_data(data_r(), 1)
732718

733719
qenv <- common_code_q()
@@ -1071,7 +1057,7 @@ srv_missing_data <- function(id,
10711057

10721058
summary_table_q <- reactive({
10731059
req(
1074-
input$summary_type == "By Variable Levels", # needed to trigger show r code update on tab change
1060+
input$summary_type == "By Variable Levels", # needed to trigger update on tab change
10751061
common_code_q()
10761062
)
10771063
teal::validate_has_data(data_r(), 1)
@@ -1158,7 +1144,7 @@ srv_missing_data <- function(id,
11581144
})
11591145

11601146
by_subject_plot_q <- reactive({
1161-
# needed to trigger show r code update on tab change
1147+
# needed to trigger update on tab change
11621148
req(input$summary_type == "Grouped by Subject", common_code_q())
11631149

11641150
teal::validate_has_data(data_r(), 1)
@@ -1391,14 +1377,6 @@ srv_missing_data <- function(id,
13911377
}
13921378
})
13931379

1394-
# Render R code.
1395-
source_code_r <- reactive(teal.code::get_code(req(decorated_final_q())))
1396-
1397-
teal.widgets::verbatim_popup_srv(
1398-
id = "rcode",
1399-
verbatim_content = source_code_r,
1400-
title = "Show R Code for Missing Data"
1401-
)
14021380
decorated_final_q
14031381
})
14041382
}

R/tm_outliers.R

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,6 @@ ui_outliers <- function(id, ...) {
374374
)
375375
)
376376
),
377-
forms = tagList(
378-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
379-
),
380377
pre_output = args$pre_output,
381378
post_output = args$post_output
382379
)
@@ -1336,14 +1333,6 @@ srv_outliers <- function(id, data, outlier_var,
13361333
)
13371334
})
13381335

1339-
# Render R code.
1340-
source_code_r <- reactive(teal.code::get_code(req(decorated_final_q())))
1341-
1342-
teal.widgets::verbatim_popup_srv(
1343-
id = "rcode",
1344-
verbatim_content = source_code_r,
1345-
title = "Show R Code for Outlier"
1346-
)
13471336
decorated_final_q
13481337
})
13491338
}

0 commit comments

Comments
 (0)