Skip to content

Commit 6ed5cbd

Browse files
committed
Merge branch 'use_evaluate' into teal_reportable
2 parents ba0e71e + 719fdaa commit 6ed5cbd

16 files changed

+99
-124
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.9009
9+
rev: v0.4.3.9011
1010
hooks:
1111
- id: style-files
1212
name: Style code with `styler`

DESCRIPTION

Lines changed: 9 additions & 7 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.4.1.9003
5-
Date: 2025-06-04
4+
Version: 0.4.1.9005
5+
Date: 2025-06-23
66
Authors@R: c(
77
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre")),
88
person("Pawel", "Rucki", , "[email protected]", role = "aut"),
@@ -27,8 +27,8 @@ Depends:
2727
ggplot2 (>= 3.4.0),
2828
R (>= 4.1),
2929
shiny (>= 1.6.0),
30-
teal (>= 0.16.0.9002),
31-
teal.transform (>= 0.6.0)
30+
teal (>= 0.16.0.9008),
31+
teal.transform (>= 0.6.0.9002)
3232
Imports:
3333
bslib (>= 0.8.0),
3434
checkmate (>= 2.1.0),
@@ -38,7 +38,7 @@ Imports:
3838
forcats (>= 1.0.0),
3939
generics (>= 0.1.3),
4040
ggExtra (>= 0.10.1),
41-
ggpmisc (>= 0.4.3),
41+
ggpmisc (>= 0.5.6),
4242
ggpp (>= 0.5.8-1),
4343
ggrepel (>= 0.9.6),
4444
goftest (>= 1.2-3),
@@ -60,9 +60,9 @@ Imports:
6060
stringr (>= 1.4.1),
6161
teal.code (>= 0.6.1),
6262
teal.data (>= 0.7.0),
63-
teal.logger (>= 0.3.2),
63+
teal.logger (>= 0.3.2.9001),
6464
teal.reporter (>= 0.4.0.9004),
65-
teal.widgets (>= 0.4.3.9001),
65+
teal.widgets (>= 0.4.3.9005),
6666
tern (>= 0.9.7),
6767
tibble (>= 2.0.0),
6868
tidyr (>= 0.8.3),
@@ -84,7 +84,9 @@ VignetteBuilder:
8484
knitr,
8585
rmarkdown
8686
Remotes:
87+
insightsengineering/teal.logger@main,
8788
insightsengineering/teal.reporter@main,
89+
insightsengineering/teal.transform@main,
8890
insightsengineering/teal.widgets@main,
8991
insightsengineering/teal@main
9092
Config/Needs/verdepcheck: haleyjeppson/ggmosaic, tidyverse/ggplot2,

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# teal.modules.general 0.4.1.9003
1+
# teal.modules.general 0.4.1.9005
22

33
# teal.modules.general 0.4.1
44

R/tm_a_pca.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,7 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
517517
quote({
518518
tbl_importance <- dplyr::as_tibble(pca$importance, rownames = "Metric")
519519
tbl_importance
520-
}),
521-
keep_output = "tbl_importance"
520+
})
522521
)
523522

524523
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Eigenvectors Table")
@@ -528,8 +527,7 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
528527
quote({
529528
tbl_eigenvector <- dplyr::as_tibble(pca$rotation, rownames = "Variable")
530529
tbl_eigenvector
531-
}),
532-
keep_output = "tbl_eigenvector"
530+
})
533531
)
534532
})
535533

@@ -1044,8 +1042,7 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
10441042
decorators = select_decorators(decorators, obj_name),
10451043
expr = reactive({
10461044
substitute(.plot, env = list(.plot = as.name(obj_name)))
1047-
}),
1048-
keep_output = obj_name
1045+
})
10491046
)
10501047
},
10511048
names(output_q),

R/tm_a_regression.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ srv_a_regression <- function(id,
536536
teal.code::eval_code(quote({
537537
fit_summary <- summary(fit)
538538
fit_summary
539-
}), keep_output = "fit_summary")
539+
}))
540540
teal.reporter::teal_card(anl_fit) <- append(teal.reporter::teal_card(anl_fit), "## Plot")
541541
anl_fit
542542
})
@@ -1000,8 +1000,7 @@ srv_a_regression <- function(id,
10001000
"decorator",
10011001
data = output_q,
10021002
decorators = select_decorators(decorators, "plot"),
1003-
expr = quote(plot),
1004-
keep_output = "plot"
1003+
expr = quote(plot)
10051004
)
10061005

10071006
fitted <- reactive({
@@ -1024,9 +1023,7 @@ srv_a_regression <- function(id,
10241023
output$text <- renderText({
10251024
req(iv_r()$is_valid())
10261025
req(iv_out$is_valid())
1027-
paste(utils::capture.output(summary(teal.code::dev_suppress(fitted())))[-1],
1028-
collapse = "\n"
1029-
)
1026+
paste(utils::capture.output(summary(fitted()))[-1], collapse = "\n")
10301027
})
10311028

10321029
# Render R code.

R/tm_g_association.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ srv_tm_g_association <- function(id,
492492
)
493493
)
494494
}
495-
obj <- merged$anl_q_r()
495+
obj <- merged$anl_q_r()
496496
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "## Plot")
497497
teal.code::eval_code(
498498
obj,
@@ -522,8 +522,7 @@ srv_tm_g_association <- function(id,
522522
id = "decorator",
523523
data = output_q,
524524
decorators = select_decorators(decorators, "plot"),
525-
expr = quote(plot),
526-
keep_output = "plot"
525+
expr = quote(plot)
527526
)
528527

529528
plot_r <- reactive({
@@ -538,9 +537,7 @@ srv_tm_g_association <- function(id,
538537
width = plot_width
539538
)
540539

541-
output$title <- renderText({
542-
teal.code::dev_suppress(output_q()[["title"]])
543-
})
540+
output$title <- renderText(output_q()[["title"]])
544541

545542
# Render R code.
546543
source_code_r <- reactive(teal.code::get_code(req(decorated_output_grob_q())))

R/tm_g_bivariate.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -553,16 +553,17 @@ srv_g_bivariate <- function(id,
553553
selector_list = selector_list,
554554
datasets = data
555555
)
556-
qenv <- reactive({
557-
obj <- data()
558-
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "# Bivariate Plot", after = 0)
559-
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr");library("teal.modules.general")') # nolint quotes
560-
})
561556

562557
anl_merged_q <- reactive({
563-
req(anl_merged_input())
564-
qenv() %>%
565-
teal.code::eval_code(as.expression(anl_merged_input()$expr))
558+
obj <- data()
559+
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "# Bivariate Plot", after = 0)
560+
obj |>
561+
teal.code::eval_code(
562+
c(
563+
expression(library(ggplot2), library(dplyr), library(teal.modules.general)),
564+
as.expression(anl_merged_input()$expr)
565+
)
566+
)
566567
})
567568

568569
merged <- list(
@@ -728,8 +729,7 @@ srv_g_bivariate <- function(id,
728729
)
729730
}
730731
print_call
731-
}),
732-
keep_output = "plot"
732+
})
733733
)
734734

735735
plot_r <- reactive(req(decorated_output_q_facets())[["plot"]])

R/tm_g_distribution.R

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ srv_distribution <- function(id,
637637

638638
obj <- merged$anl_q_r()
639639
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "# Distribution Plot", after = 0)
640-
640+
641641
ANL <- obj[["ANL"]]
642642
dist_var <- merge_vars()$dist_var
643643
s_var <- merge_vars()$s_var
@@ -1297,32 +1297,28 @@ srv_distribution <- function(id,
12971297
"d_density",
12981298
data = output_dist_q,
12991299
decorators = select_decorators(decorators, "histogram_plot"),
1300-
expr = quote(histogram_plot),
1301-
keep_output = "histogram_plot"
1300+
expr = quote(histogram_plot)
13021301
)
13031302

13041303
decorated_output_qq_q <- srv_decorate_teal_data(
13051304
"d_qq",
13061305
data = output_qq_q,
13071306
decorators = select_decorators(decorators, "qq_plot"),
1308-
expr = quote(qq_plot),
1309-
keep_output = "qq_plot"
1307+
expr = quote(qq_plot)
13101308
)
13111309

13121310
decorated_output_summary_q <- srv_decorate_teal_data(
13131311
"d_summary",
13141312
data = output_summary_q,
13151313
decorators = select_decorators(decorators, "summary_table"),
1316-
expr = quote(summary_table),
1317-
keep_output = "summary_table"
1314+
expr = quote(summary_table)
13181315
)
13191316

13201317
decorated_output_test_q <- srv_decorate_teal_data(
13211318
"d_test",
13221319
data = output_test_q,
13231320
decorators = select_decorators(decorators, "test_table"),
1324-
expr = quote(test_table),
1325-
keep_output = "test_table"
1321+
expr = quote(test_table)
13261322
)
13271323

13281324
decorated_output_q <- reactive({

R/tm_g_response.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,7 @@ srv_g_response <- function(id,
576576
id = "decorator",
577577
data = output_q,
578578
decorators = select_decorators(decorators, "plot"),
579-
expr = quote(plot),
580-
keep_output = "plot"
579+
expr = quote(plot)
581580
)
582581

583582
plot_r <- reactive(req(decorated_output_plot_q())[["plot"]])

R/tm_g_scatterplot.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ ui_g_scatterplot <- function(id, ...) {
372372
DT::dataTableOutput(ns("data_table"), width = "100%")
373373
),
374374
encoding = tags$div(
375-
tags$label("Encodings", class = "text-primary"),
375+
tags$label("Encodings", class = "text-primary"),
376376
teal.transform::datanames_input(args[c("x", "y", "color_by", "size_by", "row_facet", "col_facet")]),
377377
teal.transform::data_extract_ui(
378378
id = ns("x"),
@@ -1020,8 +1020,7 @@ srv_g_scatterplot <- function(id,
10201020
id = "decorator",
10211021
data = output_q,
10221022
decorators = select_decorators(decorators, "plot"),
1023-
expr = quote(plot),
1024-
keep_output = "plot"
1023+
expr = quote(plot)
10251024
)
10261025

10271026
plot_r <- reactive(req(decorated_output_plot_q())[["plot"]])
@@ -1042,7 +1041,7 @@ srv_g_scatterplot <- function(id,
10421041
validate(need(!input$add_density, "Brushing feature is currently not supported when plot has marginal density"))
10431042
}
10441043

1045-
merged_data <- isolate(teal.code::dev_suppress(output_q()[["ANL"]]))
1044+
merged_data <- isolate(output_q()[["ANL"]])
10461045

10471046
brushed_df <- teal.widgets::clean_brushedPoints(merged_data, plot_brush)
10481047
numeric_cols <- names(brushed_df)[

0 commit comments

Comments
 (0)