Skip to content

Commit 460cb36

Browse files
committed
Merge branch 'main' into redesign_extraction@main
2 parents ea0bae0 + 84871a5 commit 460cb36

14 files changed

+26
-169
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ default_language_version:
66
python: python3
77
repos:
88
- repo: https://github.com/lorenzwalthert/precommit
9-
rev: v0.4.3.9014
9+
rev: v0.4.3.9015
1010
hooks:
1111
- id: style-files
1212
name: Style code with `styler`

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Type: Package
22
Package: teal.modules.general
33
Title: General Modules for 'teal' Applications
4-
Version: 0.5.0.9003
5-
Date: 2025-09-23
4+
Version: 0.5.0.9005
5+
Date: 2025-10-07
66
Authors@R: c(
77
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre")),
88
person("Pawel", "Rucki", , "[email protected]", role = "aut"),

NEWS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# teal.modules.general 0.5.0.9003
1+
# teal.modules.general 0.5.0.9005
2+
3+
### Enhancements
4+
5+
- Modules now return a `teal_report` object that contains the data, code and reporter. All the reporter buttons were removed from the modules' UI.
26

37
# teal.modules.general 0.5.0
48

R/tm_a_pca.R

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,6 @@ ui_a_pca.default <- function(id, ...) {
351351
)
352352
)
353353
),
354-
forms = tagList(
355-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
356-
),
357354
pre_output = args$pre_output,
358355
post_output = args$post_output
359356
)
@@ -1090,8 +1087,6 @@ srv_a_pca.default <- function(id, data, dat, plot_height, plot_width, ggplot2_ar
10901087
graph_align = "center"
10911088
)
10921089

1093-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_q)
1094-
10951090
# tables ----
10961091
output$tbl_importance <- renderTable(
10971092
expr = {
@@ -1145,14 +1140,6 @@ srv_a_pca.default <- function(id, data, dat, plot_height, plot_width, ggplot2_ar
11451140
)
11461141
})
11471142

1148-
# Render R code.
1149-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))
1150-
1151-
teal.widgets::verbatim_popup_srv(
1152-
id = "rcode",
1153-
verbatim_content = source_code_r,
1154-
title = "R Code for PCA"
1155-
)
1156-
decorated_output_dims_q
1143+
set_chunk_dims(pws, decorated_output_q)
11571144
})
11581145
}

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.default <- 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.default <- 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
@@ -307,9 +307,6 @@ ui_tm_g_association.default <- function(id, ...) {
307307
)
308308
)
309309
),
310-
forms = tagList(
311-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
312-
),
313310
pre_output = args$pre_output,
314311
post_output = args$post_output
315312
)
@@ -563,18 +560,8 @@ srv_tm_g_association.default <- function(id,
563560
width = plot_width
564561
)
565562

566-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_grob_q)
567-
568563
output$title <- renderText(output_q()[["title"]])
569564

570-
# Render R code.
571-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))
572-
573-
teal.widgets::verbatim_popup_srv(
574-
id = "rcode",
575-
verbatim_content = source_code_r,
576-
title = "Association Plot"
577-
)
578-
decorated_output_dims_q
565+
set_chunk_dims(pws, decorated_output_grob_q)
579566
})
580567
}

R/tm_g_bivariate.R

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,6 @@ ui_g_bivariate.default <- function(id, ...) {
464464
)
465465
)
466466
),
467-
forms = tagList(
468-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
469-
),
470467
pre_output = args$pre_output,
471468
post_output = args$post_output
472469
)
@@ -739,18 +736,7 @@ srv_g_bivariate.default <- function(id,
739736
width = plot_width
740737
)
741738

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

R/tm_g_distribution.R

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,6 @@ ui_g_distribution.default <- function(id, ...) {
381381
)
382382
)
383383
),
384-
forms = tagList(
385-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
386-
),
387384
pre_output = args$pre_output,
388385
post_output = args$post_output
389386
)
@@ -1276,13 +1273,13 @@ srv_g_distribution.default <- function(id,
12761273
output_dist_q <- reactive(c(common_q(), req(dist_q())))
12771274
output_qq_q <- reactive(c(common_q(), req(qq_q())))
12781275

1279-
# Summary table listing has to be created separately to allow for qenv join
1280-
q_common <- common_q()
1281-
teal.reporter::teal_card(q_common) <- c(
1282-
teal.reporter::teal_card(q_common),
1283-
"## Statistics table"
1284-
)
12851276
output_summary_q <- reactive({
1277+
# Summary table listing has to be created separately to allow for qenv join
1278+
q_common <- common_q()
1279+
teal.reporter::teal_card(q_common) <- c(
1280+
teal.reporter::teal_card(q_common),
1281+
"## Statistics table"
1282+
)
12861283
if (iv_r()$is_valid()) {
12871284
within(q_common, {
12881285
summary_table <- rtables::df_to_tt(summary_table_data)
@@ -1362,7 +1359,7 @@ srv_g_distribution.default <- function(id,
13621359
output$summary_table <- DT::renderDataTable(summary_r())
13631360

13641361
tests_r <- reactive({
1365-
q <- req(output_test_q())
1362+
q <- req(decorated_output_test_q())
13661363
DT::datatable(q[["test_table_data"]])
13671364
})
13681365

@@ -1388,7 +1385,7 @@ srv_g_distribution.default <- function(id,
13881385

13891386
decorated_output_q <- reactive({
13901387
tab <- req(input$tabs) # tab is NULL upon app launch, hence will crash without this statement
1391-
test_q_out <- output_test_q()
1388+
test_q_out <- decorated_output_test_q()
13921389

13931390
out_q <- switch(tab,
13941391
Histogram = decorated_output_dist_dims_q(),
@@ -1406,14 +1403,6 @@ srv_g_distribution.default <- function(id,
14061403

14071404
output$t_stats <- DT::renderDataTable(tests_r())
14081405

1409-
# Render R code.
1410-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))
1411-
1412-
teal.widgets::verbatim_popup_srv(
1413-
id = "rcode",
1414-
verbatim_content = source_code_r,
1415-
title = "R Code for distribution"
1416-
)
14171406
decorated_output_q
14181407
})
14191408
}

R/tm_g_response.R

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,6 @@ ui_g_response.default <- function(id, ...) {
344344
)
345345
)
346346
),
347-
forms = tagList(
348-
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
349-
),
350347
pre_output = args$pre_output,
351348
post_output = args$post_output
352349
)
@@ -618,16 +615,6 @@ srv_g_response.default <- function(id,
618615
width = plot_width
619616
)
620617

621-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_plot_q)
622-
623-
# Render R code.
624-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))
625-
626-
teal.widgets::verbatim_popup_srv(
627-
id = "rcode",
628-
verbatim_content = source_code_r,
629-
title = "Show R Code for Response"
630-
)
631-
decorated_output_dims_q
618+
set_chunk_dims(pws, decorated_output_plot_q)
632619
})
633620
}

R/tm_g_scatterplot.R

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,6 @@ ui_g_scatterplot.default <- 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
)
@@ -1009,8 +1006,6 @@ srv_g_scatterplot.default <- function(id,
10091006
click = TRUE
10101007
)
10111008

1012-
decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_plot_q)
1013-
10141009
output$data_table <- DT::renderDataTable({
10151010
plot_brush <- pws$brush()
10161011

@@ -1039,14 +1034,6 @@ srv_g_scatterplot.default <- function(id,
10391034
}
10401035
})
10411036

1042-
# Render R code.
1043-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))
1044-
1045-
teal.widgets::verbatim_popup_srv(
1046-
id = "rcode",
1047-
verbatim_content = source_code_r,
1048-
title = "R Code for scatterplot"
1049-
)
1050-
decorated_output_dims_q
1037+
set_chunk_dims(pws, decorated_output_plot_q)
10511038
})
10521039
}

0 commit comments

Comments
 (0)