Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warnings qenv #191

Merged
merged 6 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions R/tm_g_gh_boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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"
)
})
Expand Down
14 changes: 12 additions & 2 deletions R/tm_g_gh_correlationplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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())),
Expand Down
18 changes: 14 additions & 4 deletions R/tm_g_gh_density_distribution_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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"
)
Expand Down
12 changes: 11 additions & 1 deletion R/tm_g_gh_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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())),
Expand Down
12 changes: 11 additions & 1 deletion R/tm_g_gh_scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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())),
Expand Down
12 changes: 11 additions & 1 deletion R/tm_g_gh_spaghettiplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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())),
Expand Down