Skip to content
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
15 changes: 1 addition & 14 deletions R/tm_a_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ ui_a_pca <- function(id, ...) {
)
)
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
),
pre_output = args$pre_output,
post_output = args$post_output
)
Expand Down Expand Up @@ -1080,8 +1077,6 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
graph_align = "center"
)

decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_q)

# tables ----
output$tbl_importance <- renderTable(
expr = {
Expand Down Expand Up @@ -1135,14 +1130,6 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
)
})

# Render R code.
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "R Code for PCA"
)
decorated_output_dims_q
set_chunk_dims(pws, decorated_output_q)
})
}
15 changes: 1 addition & 14 deletions R/tm_a_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,6 @@ ui_a_regression <- function(id, ...) {
)
)
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
),
pre_output = args$pre_output,
post_output = args$post_output
)
Expand Down Expand Up @@ -1021,22 +1018,12 @@ srv_a_regression <- function(id,
width = plot_width
)

decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_q)

output$text <- renderText({
req(iv_r()$is_valid())
req(iv_out$is_valid())
paste(utils::capture.output(summary(fitted()))[-1], collapse = "\n")
})

# Render R code.
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "R code for the regression plot",
)
decorated_output_dims_q
set_chunk_dims(pws, decorated_output_q)
})
}
15 changes: 1 addition & 14 deletions R/tm_g_association.R
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,6 @@ ui_tm_g_association <- function(id, ...) {
)
)
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
),
pre_output = args$pre_output,
post_output = args$post_output
)
Expand Down Expand Up @@ -545,18 +542,8 @@ srv_tm_g_association <- function(id,
width = plot_width
)

decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_grob_q)

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

# Render R code.
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "Association Plot"
)
decorated_output_dims_q
set_chunk_dims(pws, decorated_output_grob_q)
})
}
16 changes: 1 addition & 15 deletions R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,6 @@ ui_g_bivariate <- function(id, ...) {
)
)
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
),
pre_output = args$pre_output,
post_output = args$post_output
)
Expand Down Expand Up @@ -741,18 +738,7 @@ srv_g_bivariate <- function(id,
width = plot_width
)

decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_q_facets)

# Render R code.

source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "Bivariate Plot"
)
decorated_output_dims_q
set_chunk_dims(pws, decorated_output_q_facets)
})
}

Expand Down
11 changes: 0 additions & 11 deletions R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,6 @@ ui_distribution <- function(id, ...) {
)
)
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
),
pre_output = args$pre_output,
post_output = args$post_output
)
Expand Down Expand Up @@ -1402,14 +1399,6 @@ srv_distribution <- function(id,

output$t_stats <- DT::renderDataTable(tests_r())

# Render R code.
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "R Code for distribution"
)
decorated_output_q
})
}
15 changes: 1 addition & 14 deletions R/tm_g_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,6 @@ ui_g_response <- function(id, ...) {
)
)
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
),
pre_output = args$pre_output,
post_output = args$post_output
)
Expand Down Expand Up @@ -594,16 +591,6 @@ srv_g_response <- function(id,
width = plot_width
)

decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_plot_q)

# Render R code.
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "Show R Code for Response"
)
decorated_output_dims_q
set_chunk_dims(pws, decorated_output_plot_q)
})
}
15 changes: 1 addition & 14 deletions R/tm_g_scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,6 @@ ui_g_scatterplot <- function(id, ...) {
)
)
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
),
pre_output = args$pre_output,
post_output = args$post_output
)
Expand Down Expand Up @@ -1037,8 +1034,6 @@ srv_g_scatterplot <- function(id,
brushing = TRUE
)

decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_plot_q)

output$data_table <- DT::renderDataTable({
plot_brush <- pws$brush()

Expand Down Expand Up @@ -1067,14 +1062,6 @@ srv_g_scatterplot <- function(id,
}
})

# Render R code.
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "R Code for scatterplot"
)
decorated_output_dims_q
set_chunk_dims(pws, decorated_output_plot_q)
})
}
15 changes: 1 addition & 14 deletions R/tm_g_scatterplotmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,6 @@ ui_g_scatterplotmatrix <- function(id, ...) {
)
)
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
),
pre_output = args$pre_output,
post_output = args$post_output
)
Expand Down Expand Up @@ -479,8 +476,6 @@ srv_g_scatterplotmatrix <- function(id,
width = plot_width
)

decorated_output_dims_q <- set_chunk_dims(pws, decorated_output_q)

# show a message if conversion to factors took place
output$message <- renderText({
req(iv_r()$is_valid())
Expand All @@ -503,15 +498,7 @@ srv_g_scatterplotmatrix <- function(id,
}
})

# Render R code.
source_code_r <- reactive(teal.code::get_code(req(decorated_output_dims_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "Show R Code for Scatterplotmatrix"
)
decorated_output_dims_q
set_chunk_dims(pws, decorated_output_q)
})
}

Expand Down
28 changes: 3 additions & 25 deletions R/tm_missing_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ ui_page_missing_data <- function(id, pre_output = NULL, post_output = NULL) {
encoding = tags$div(
uiOutput(ns("dataset_encodings"))
),
uiOutput(ns("dataset_reporter")),
pre_output = pre_output,
post_output = post_output
)
Expand Down Expand Up @@ -248,19 +247,6 @@ srv_page_missing_data <- function(id, data, datanames, parent_dataname,
)
})

output$dataset_reporter <- renderUI({
lapply(datanames, function(x) {
dataname_ns <- NS(ns(x))

conditionalPanel(
is_tab_active_js(ns("dataname_tab"), x),
tagList(
teal.widgets::verbatim_popup_ui(dataname_ns("rcode"), "Show R code")
)
)
})
})

result <- sapply(
datanames,
function(x) {
Expand Down Expand Up @@ -727,7 +713,7 @@ srv_missing_data <- function(id,
# Prepare qenvs for output objects

summary_plot_q <- reactive({
req(input$summary_type == "Summary") # needed to trigger show r code update on tab change
req(input$summary_type == "Summary") # needed to trigger update on tab change
teal::validate_has_data(data_r(), 1)

qenv <- common_code_q()
Expand Down Expand Up @@ -1071,7 +1057,7 @@ srv_missing_data <- function(id,

summary_table_q <- reactive({
req(
input$summary_type == "By Variable Levels", # needed to trigger show r code update on tab change
input$summary_type == "By Variable Levels", # needed to trigger update on tab change
common_code_q()
)
teal::validate_has_data(data_r(), 1)
Expand Down Expand Up @@ -1158,7 +1144,7 @@ srv_missing_data <- function(id,
})

by_subject_plot_q <- reactive({
# needed to trigger show r code update on tab change
# needed to trigger update on tab change
req(input$summary_type == "Grouped by Subject", common_code_q())

teal::validate_has_data(data_r(), 1)
Expand Down Expand Up @@ -1391,14 +1377,6 @@ srv_missing_data <- function(id,
}
})

# Render R code.
source_code_r <- reactive(teal.code::get_code(req(decorated_final_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "Show R Code for Missing Data"
)
decorated_final_q
})
}
11 changes: 0 additions & 11 deletions R/tm_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,6 @@ ui_outliers <- function(id, ...) {
)
)
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
),
pre_output = args$pre_output,
post_output = args$post_output
)
Expand Down Expand Up @@ -1336,14 +1333,6 @@ srv_outliers <- function(id, data, outlier_var,
)
})

# Render R code.
source_code_r <- reactive(teal.code::get_code(req(decorated_final_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "Show R Code for Outlier"
)
decorated_final_q
})
}
11 changes: 0 additions & 11 deletions R/tm_t_crosstable.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,6 @@ ui_t_crosstable <- function(id, x, y, show_percentage, show_total, remove_zero_c
),
ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "table"))
),
forms = tagList(
teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
),
pre_output = pre_output,
post_output = post_output
)
Expand Down Expand Up @@ -482,14 +479,6 @@ srv_t_crosstable <- function(id, data, label, x, y, remove_zero_columns, basic_t
table_r = table_r
)

# Render R code.
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = source_code_r,
title = "Show R Code for Cross-Table"
)
decorated_output_q
})
}
Loading