Skip to content

Commit

Permalink
Merge branch '1187_decorate_output@main' into tm_missing_data_module@…
Browse files Browse the repository at this point in the history
…1187_decorate_output@main
  • Loading branch information
m7pr authored Nov 22, 2024
2 parents cca4193 + 11d9ea8 commit ad975fd
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 28 deletions.
6 changes: 2 additions & 4 deletions R/tm_a_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ ui_a_pca <- function(id, ...) {
choices = args$plot_choices,
selected = args$plot_choices[1]
),
ui_teal_transform_data(ns("decorate"), transformators = args$decorators)
ui_transform_teal_data(ns("decorate"), transformators = args$decorators)
),
teal.widgets::panel_item(
title = "Pre-processing",
Expand Down Expand Up @@ -975,11 +975,9 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
)
})

decorated_output_q_no_print <- srv_teal_transform_data("decorate", data = output_q, transformators = decorators)
decorated_output_q_no_print <- srv_transform_teal_data("decorate", data = output_q, transformators = decorators)
decorated_output_q <- reactive(within(decorated_output_q_no_print(), expr = print(plot)))



plot_r <- reactive({
req(output_q())
decorated_output_q()[["plot"]]
Expand Down
28 changes: 14 additions & 14 deletions R/tm_a_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -292,37 +292,37 @@ ui_a_regression <- function(id, ...) {
conditionalPanel(
condition = "input.plot_type == 'Response vs Regressor'",
ns = ns,
ui_teal_transform_data(ns("d_0"), transformators = args$decorators[[1]])
ui_transform_teal_data(ns("d_0"), transformators = args$decorators)
),
conditionalPanel(
condition = "input.plot_type == 'Residuals vs Fitted'",
ns = ns,
ui_teal_transform_data(ns("d_1"), transformators = args$decorators[[1]])
ui_transform_teal_data(ns("d_1"), transformators = args$decorators)
),
conditionalPanel(
condition = "input.plot_type == 'Normal Q-Q'",
ns = ns,
ui_teal_transform_data(ns("d_2"), transformators = args$decorators[[1]])
ui_transform_teal_data(ns("d_2"), transformators = args$decorators)
),
conditionalPanel(
condition = "input.plot_type == 'Scale-Location'",
ns = ns,
ui_teal_transform_data(ns("d_3"), transformators = args$decorators[[1]])
ui_transform_teal_data(ns("d_3"), transformators = args$decorators)
),
conditionalPanel(
condition = "input.plot_type == 'Cook\\'s distance'",
ns = ns,
ui_teal_transform_data(ns("d_4"), transformators = args$decorators[[1]])
ui_transform_teal_data(ns("d_4"), transformators = args$decorators)
),
conditionalPanel(
condition = "input.plot_type == 'Residuals vs Leverage'",
ns = ns,
ui_teal_transform_data(ns("d_5"), transformators = args$decorators[[1]])
ui_transform_teal_data(ns("d_5"), transformators = args$decorators)
),
conditionalPanel(
condition = "input.plot_type == 'Cook\\'s dist vs Leverage'",
ns = ns,
ui_teal_transform_data(ns("d_6"), transformators = args$decorators[[1]])
ui_transform_teal_data(ns("d_6"), transformators = args$decorators)
),
),
checkboxInput(ns("show_outlier"), label = "Display outlier labels", value = TRUE),
Expand Down Expand Up @@ -1000,13 +1000,13 @@ srv_a_regression <- function(id,
)
})

decorated_output_0 <- srv_teal_transform_data(id = "d_0", data = output_plot_0, transformators = decorators[[1]])
decorated_output_1 <- srv_teal_transform_data(id = "d_1", data = output_plot_1, transformators = decorators[[1]])
decorated_output_2 <- srv_teal_transform_data(id = "d_2", data = output_plot_2, transformators = decorators[[1]])
decorated_output_3 <- srv_teal_transform_data(id = "d_3", data = output_plot_3, transformators = decorators[[1]])
decorated_output_4 <- srv_teal_transform_data(id = "d_4", data = output_plot_4, transformators = decorators[[1]])
decorated_output_5 <- srv_teal_transform_data(id = "d_5", data = output_plot_5, transformators = decorators[[1]])
decorated_output_6 <- srv_teal_transform_data(id = "d_6", data = output_plot_6, transformators = decorators[[1]])
decorated_output_0 <- srv_transform_teal_data(id = "d_0", data = output_plot_0, transformators = decorators)
decorated_output_1 <- srv_transform_teal_data(id = "d_1", data = output_plot_1, transformators = decorators)
decorated_output_2 <- srv_transform_teal_data(id = "d_2", data = output_plot_2, transformators = decorators)
decorated_output_3 <- srv_transform_teal_data(id = "d_3", data = output_plot_3, transformators = decorators)
decorated_output_4 <- srv_transform_teal_data(id = "d_4", data = output_plot_4, transformators = decorators)
decorated_output_5 <- srv_transform_teal_data(id = "d_5", data = output_plot_5, transformators = decorators)
decorated_output_6 <- srv_transform_teal_data(id = "d_6", data = output_plot_6, transformators = decorators)


output_q <- reactive({
Expand Down
4 changes: 2 additions & 2 deletions R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ ui_g_bivariate <- function(id, ...) {
justified = TRUE
)
),
ui_teal_transform_data(ns("decorate"), transformators = args$decorators),
ui_transform_teal_data(ns("decorate"), transformators = args$decorators),
if (!is.null(args$row_facet) || !is.null(args$col_facet)) {
tags$div(
class = "data-extract-box",
Expand Down Expand Up @@ -665,7 +665,7 @@ srv_g_bivariate <- function(id,
teal.code::eval_code(merged$anl_q_r(), substitute(expr = plot <- cl, env = list(cl = cl)))
})

decorated_output_q <- srv_teal_transform_data("decorate", data = output_q, transformators = decorators)
decorated_output_q <- srv_transform_teal_data("decorate", data = output_q, transformators = decorators)

decorated_output_q_facets <- reactive({
ANL <- merged$anl_q_r()[["ANL"]]
Expand Down
8 changes: 4 additions & 4 deletions R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ ui_distribution <- function(id, ...) {
inline = TRUE
),
checkboxInput(ns("add_dens"), label = "Overlay Density", value = TRUE),
ui_teal_transform_data(ns("d_dist"), transformators = args$decorators),
ui_transform_teal_data(ns("d_dist"), transformators = args$decorators),
collapsed = FALSE
)
),
Expand All @@ -289,7 +289,7 @@ ui_distribution <- function(id, ...) {
teal.widgets::panel_item(
"QQ Plot",
checkboxInput(ns("qq_line"), label = "Add diagonal line(s)", TRUE),
ui_teal_transform_data(ns("d_qq"), transformators = args$decorators),
ui_transform_teal_data(ns("d_qq"), transformators = args$decorators),
collapsed = FALSE
)
),
Expand Down Expand Up @@ -1242,13 +1242,13 @@ srv_distribution <- function(id,
output_dist_q <- reactive(c(output_common_q(), req(dist_q())))
output_qq_q <- reactive(c(output_common_q(), req(qq_q())))

decorated_output_dist_q <- srv_teal_transform_data(
decorated_output_dist_q <- srv_transform_teal_data(
"d_dist",
data = output_dist_q,
transformators = decorators
)

decorated_output_qq_q <- srv_teal_transform_data(
decorated_output_qq_q <- srv_transform_teal_data(
"d_qq",
data = output_qq_q,
transformators = decorators
Expand Down
4 changes: 2 additions & 2 deletions R/tm_g_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ ui_g_response <- function(id, ...) {
selected = ifelse(args$freq, "frequency", "density"),
justified = TRUE
),
ui_teal_transform_data(ns("decorator"), transformators = args$decorators),
ui_transform_teal_data(ns("decorator"), transformators = args$decorators),
teal.widgets::panel_group(
teal.widgets::panel_item(
title = "Plot settings",
Expand Down Expand Up @@ -552,7 +552,7 @@ srv_g_response <- function(id,
teal.code::eval_code(qenv, plot_call)
})

decorated_output_q <- srv_teal_transform_data(id = "decorator", data = output_q, transformators = decorators)
decorated_output_q <- srv_transform_teal_data(id = "decorator", data = output_q, transformators = decorators)

decorated_output_plot_q <- reactive(within(decorated_output_q(), print(plot)))
plot_r <- reactive({
Expand Down
4 changes: 2 additions & 2 deletions R/tm_t_crosstable.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ ui_t_crosstable <- function(id, x, y, show_percentage, show_total, pre_output, p
checkboxInput(ns("show_total"), "Show total column", value = show_total)
)
),
ui_teal_transform_data(ns("decorate"), transformators = args$decorators)
ui_transform_teal_data(ns("decorate"), transformators = args$decorators)
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
Expand Down Expand Up @@ -407,7 +407,7 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y,
)
})

decorated_output_q_no_print <- srv_teal_transform_data("decorate", data = output_q, transformators = decorators)
decorated_output_q_no_print <- srv_transform_teal_data("decorate", data = output_q, transformators = decorators)
decorated_output_q <- reactive(within(decorated_output_q_no_print(), expr = table))

output$title <- renderText(output_q()[["title"]])
Expand Down

0 comments on commit ad975fd

Please sign in to comment.