diff --git a/DESCRIPTION b/DESCRIPTION index 02afbd88..5cba83d6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: teal.goshawk Title: Longitudinal Visualization `teal` Modules -Version: 0.2.0.9013 -Date: 2024-10-09 +Version: 0.2.0.9014 +Date: 2024-10-10 Authors@R: c( person("Nick", "Paszty", , "nick.paszty@gene.com", role = c("aut", "cre")), person("Dawid", "Kaledkowski", , "dawid.kaledkowski@roche.com", role = "aut"), diff --git a/NEWS.md b/NEWS.md index f657c6a5..31a5dc68 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# teal.goshawk 0.2.0.9013 +# teal.goshawk 0.2.0.9014 # teal.goshawk 0.2.0 diff --git a/R/tm_g_gh_boxplot.R b/R/tm_g_gh_boxplot.R index 17a8635d..4f262c13 100644 --- a/R/tm_g_gh_boxplot.R +++ b/R/tm_g_gh_boxplot.R @@ -457,6 +457,7 @@ srv_g_boxplot <- function(id, font_size = .(font_size), unit = .("AVALU") ) + print(p) }) ) }), 800) @@ -480,6 +481,7 @@ srv_g_boxplot <- function(id, xaxis_var = .(xaxis_var), facet_var = .(facet_var) ) + tbl }) ) }), 800) @@ -508,6 +510,13 @@ srv_g_boxplot <- function(id, DT::formatRound(numeric_cols, 4) }) + joined_qenvs <- reactive({ + req(create_plot(), create_table()) + teal.code::join(create_plot(), create_table()) + }) + + code <- reactive(teal.code::get_code(joined_qenvs())) + ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { @@ -536,11 +545,7 @@ srv_g_boxplot <- function(id, card$append_text("Comment", "header3") card$append_text(comment) } - card$append_src( - teal.code::get_code( - teal.code::join(create_plot(), create_table()) - ) - ) + card$append_src(code()) card } teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun) @@ -579,14 +584,9 @@ srv_g_boxplot <- function(id, DT::formatRound(numeric_cols, 4) }) - joined_qenvs <- reactive({ - req(create_plot(), create_table()) - teal.code::join(create_plot(), create_table()) - }) - teal.widgets::verbatim_popup_srv( id = "rcode", - verbatim_content = reactive(teal.code::get_code(joined_qenvs())), + verbatim_content = reactive(code()), title = "Show R Code for Boxplot" ) }) diff --git a/R/tm_g_gh_correlationplot.R b/R/tm_g_gh_correlationplot.R index c273fba3..f26a282b 100644 --- a/R/tm_g_gh_correlationplot.R +++ b/R/tm_g_gh_correlationplot.R @@ -822,6 +822,7 @@ srv_g_correlationplot <- function(id, brushing = TRUE ) + code <- reactive(teal.code::get_code(plot_q())) ### REPORTER if (with_reporter) { @@ -851,7 +852,7 @@ srv_g_correlationplot <- function(id, card$append_text("Comment", "header3") card$append_text(comment) } - card$append_src(teal.code::get_code(plot_q())) + card$append_src(code()) card } teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun) @@ -885,7 +886,7 @@ srv_g_correlationplot <- function(id, teal.widgets::verbatim_popup_srv( id = "rcode", - verbatim_content = reactive(teal.code::get_code(plot_q())), + verbatim_content = reactive(code()), title = "Show R Code for Correlation Plot" ) }) diff --git a/R/tm_g_gh_density_distribution_plot.R b/R/tm_g_gh_density_distribution_plot.R index e2ee14be..3d3a2f85 100644 --- a/R/tm_g_gh_density_distribution_plot.R +++ b/R/tm_g_gh_density_distribution_plot.R @@ -364,6 +364,7 @@ srv_g_density_distribution_plot <- function(id, # nolint hline_arb_color = .(hline_arb_color), rug_plot = .(rug_plot) ) + print(p) }) ) }), 800) @@ -378,7 +379,7 @@ srv_g_density_distribution_plot <- function(id, # nolint teal.code::eval_code( object = anl_q()$qenv, - code = bquote( + code = bquote({ tbl <- goshawk::t_summarytable( data = ANL, trt_group = .(trt_group), @@ -387,7 +388,8 @@ srv_g_density_distribution_plot <- function(id, # nolint xaxis_var = .(xaxis_var), font_size = .(font_size) ) - ) + tbl + }) ) }), 800) @@ -418,11 +420,11 @@ srv_g_density_distribution_plot <- function(id, # nolint teal.code::join(create_plot(), create_table()) }) + code <- reactive(teal.code::get_code(joined_qenvs())) + teal.widgets::verbatim_popup_srv( id = "rcode", - verbatim_content = reactive( - teal.code::get_code(joined_qenvs()) - ), + verbatim_content = reactive(code()), title = "Show R Code for Density Distribution Plot" ) @@ -450,11 +452,7 @@ srv_g_density_distribution_plot <- function(id, # nolint card$append_text("Comment", "header3") card$append_text(comment) } - card$append_src( - teal.code::get_code( - teal.code::join(create_plot(), create_table()) - ) - ) + card$append_src(code()) card } teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun) diff --git a/R/tm_g_gh_lineplot.R b/R/tm_g_gh_lineplot.R index 822a9e24..516c13fd 100644 --- a/R/tm_g_gh_lineplot.R +++ b/R/tm_g_gh_lineplot.R @@ -773,6 +773,8 @@ srv_lineplot <- function(id, width = plot_width, ) + code <- reactive(teal.code::get_code(plot_q())) + ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { @@ -801,7 +803,7 @@ srv_lineplot <- function(id, card$append_text("Comment", "header3") card$append_text(comment) } - card$append_src(teal.code::get_code(plot_q())) + card$append_src(code()) card } teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun) @@ -810,7 +812,7 @@ srv_lineplot <- function(id, teal.widgets::verbatim_popup_srv( id = "rcode", - verbatim_content = reactive(teal.code::get_code(plot_q())), + verbatim_content = reactive(code()), title = "Show R Code for Line Plot" ) }) diff --git a/R/tm_g_gh_scatterplot.R b/R/tm_g_gh_scatterplot.R index 7f855bae..916876b3 100644 --- a/R/tm_g_gh_scatterplot.R +++ b/R/tm_g_gh_scatterplot.R @@ -367,6 +367,8 @@ srv_g_scatterplot <- function(id, brushing = TRUE ) + code <- reactive(teal.code::get_code(plot_q())) + ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { @@ -395,7 +397,7 @@ srv_g_scatterplot <- function(id, card$append_text("Comment", "header3") card$append_text(comment) } - card$append_src(teal.code::get_code(plot_q())) + card$append_src(code()) card } teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun) @@ -435,7 +437,7 @@ srv_g_scatterplot <- function(id, teal.widgets::verbatim_popup_srv( id = "rcode", - verbatim_content = reactive(teal.code::get_code(plot_q())), + verbatim_content = reactive(code()), title = "Show R Code for Scatterplot" ) }) diff --git a/R/tm_g_gh_spaghettiplot.R b/R/tm_g_gh_spaghettiplot.R index 85d03bb1..3077d655 100644 --- a/R/tm_g_gh_spaghettiplot.R +++ b/R/tm_g_gh_spaghettiplot.R @@ -525,6 +525,8 @@ srv_g_spaghettiplot <- function(id, brushing = TRUE ) + code <- reactive(teal.code::get_code(plot_q())) + ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { @@ -545,7 +547,7 @@ srv_g_spaghettiplot <- function(id, card$append_text("Comment", "header3") card$append_text(comment) } - card$append_src(teal.code::get_code(plot_q())) + card$append_src(code()) card } teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun) @@ -585,7 +587,7 @@ srv_g_spaghettiplot <- function(id, teal.widgets::verbatim_popup_srv( id = "rcode", - verbatim_content = reactive(teal.code::get_code(plot_q())), + verbatim_content = reactive(code()), title = "Show R Code for Spaghetti Plot" ) })