diff --git a/R/tm_g_gh_boxplot.R b/R/tm_g_gh_boxplot.R index 6118f7ef..bdd979e5 100644 --- a/R/tm_g_gh_boxplot.R +++ b/R/tm_g_gh_boxplot.R @@ -347,7 +347,10 @@ ui_g_boxplot <- function(id, ...) { ) ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -589,13 +592,18 @@ srv_g_boxplot <- function(id, DT::formatRound(numeric_cols, 4) }) + joined_qenvs <- reactive(teal.code::join(create_plot(), create_table())) + + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(joined_qenvs())), + title = "Warning", + disabled = reactive(is.null(teal.code::get_warnings(joined_qenvs()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", - verbatim_content = reactive( - teal.code::get_code( - teal.code::join(create_plot(), create_table()) - ) - ), + verbatim_content = reactive(teal.code::get_code(joined_qenvs())), title = "Show R Code for Boxplot" ) }) diff --git a/R/tm_g_gh_correlationplot.R b/R/tm_g_gh_correlationplot.R index 0b426eba..cfbc5587 100644 --- a/R/tm_g_gh_correlationplot.R +++ b/R/tm_g_gh_correlationplot.R @@ -414,7 +414,10 @@ ui_g_correlationplot <- function(id, ...) { ) ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -540,7 +543,7 @@ srv_g_correlationplot <- function(id, ) # analysis - private_qenv <- teal.code::new_qenv(tdata2env(data), code = get_code(data)) %>% + private_qenv <- teal.code::new_qenv(tdata2env(data), code = get_code_tdata(data)) %>% teal.code::eval_code( code = bquote({ ANL <- .(as.name(dataset_var)) %>% # nolint @@ -909,6 +912,13 @@ srv_g_correlationplot <- function(id, DT::formatRound(numeric_cols, 4) }) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(plot_q())), + title = "Warning", + disabled = reactive(is.null(teal.code::get_warnings(plot_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", verbatim_content = reactive(teal.code::get_code(plot_q())), diff --git a/R/tm_g_gh_density_distribution_plot.R b/R/tm_g_gh_density_distribution_plot.R index 799a3659..3500d2bc 100644 --- a/R/tm_g_gh_density_distribution_plot.R +++ b/R/tm_g_gh_density_distribution_plot.R @@ -272,7 +272,10 @@ ui_g_density_distribution_plot <- function(id, ...) { ) ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -414,12 +417,19 @@ srv_g_density_distribution_plot <- function(id, # nolint DT::formatRound(numeric_cols, 2) }) + joined_qenvs <- reactive(teal.code::join(create_plot(), create_table())) + + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(joined_qenvs())), + title = "Warning", + disabled = reactive(is.null(teal.code::get_warnings(joined_qenvs()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", verbatim_content = reactive( - teal.code::get_code( - teal.code::join(create_plot(), create_table()) - ) + teal.code::get_code(joined_qenvs()) ), title = "Show R Code for Density Distribution Plot" ) diff --git a/R/tm_g_gh_lineplot.R b/R/tm_g_gh_lineplot.R index 82a26755..f5ff80da 100644 --- a/R/tm_g_gh_lineplot.R +++ b/R/tm_g_gh_lineplot.R @@ -329,7 +329,10 @@ ui_lineplot <- function(id, ...) { ) ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -809,6 +812,13 @@ srv_lineplot <- function(id, } ### + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(plot_q)), + title = "Warning", + disabled = reactive(is.null(teal.code::get_warnings(plot_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", verbatim_content = reactive(teal.code::get_code(plot_q())), diff --git a/R/tm_g_gh_scatterplot.R b/R/tm_g_gh_scatterplot.R index 297ececc..b8dafffb 100644 --- a/R/tm_g_gh_scatterplot.R +++ b/R/tm_g_gh_scatterplot.R @@ -259,7 +259,10 @@ ui_g_scatterplot <- function(id, ...) { ) ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -425,6 +428,13 @@ srv_g_scatterplot <- function(id, DT::formatRound(numeric_cols, 4) }) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(plot_q)), + title = "Warning", + disabled = reactive(is.null(teal.code::get_warnings(plot_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", verbatim_content = reactive(teal.code::get_code(plot_q())), diff --git a/R/tm_g_gh_spaghettiplot.R b/R/tm_g_gh_spaghettiplot.R index 25b62475..76e75af1 100644 --- a/R/tm_g_gh_spaghettiplot.R +++ b/R/tm_g_gh_spaghettiplot.R @@ -346,7 +346,10 @@ g_ui_spaghettiplot <- function(id, ...) { ) ) ), - forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code"), + forms = tagList( + teal.widgets::verbatim_popup_ui(ns("warning"), "Show Warnings"), + teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code") + ), pre_output = a$pre_output, post_output = a$post_output ) @@ -547,6 +550,13 @@ srv_g_spaghettiplot <- function(id, DT::formatRound(numeric_cols, 4) }) + teal.widgets::verbatim_popup_srv( + id = "warning", + verbatim_content = reactive(teal.code::get_warnings(plot_q)), + title = "Warning", + disabled = reactive(is.null(teal.code::get_warnings(plot_q()))) + ) + teal.widgets::verbatim_popup_srv( id = "rcode", verbatim_content = reactive(teal.code::get_code(plot_q())),