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

reporter cleaning #430

Merged
merged 6 commits into from
Jul 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
16 changes: 3 additions & 13 deletions R/tm_a_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,7 @@ ui_a_pca <- function(id, ...) {
),
encoding = div(
### Reporter
shiny::tags$div(
teal.reporter::add_card_button_ui(ns("addReportCard")),
teal.reporter::download_report_button_ui(ns("downloadButton")),
teal.reporter::reset_report_button_ui(ns("resetButton"))
),
shiny::tags$br(),
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args["dat"]),
Expand Down Expand Up @@ -988,7 +983,6 @@ srv_a_pca <- function(id, datasets, reporter, dat, plot_height, plot_width, ggpl
card$set_name("PCA Plot")
card$append_text("PCA Plot", "header2")
card$append_text("Principal Component Analysis Plot", "header3")
card$append_text("Filter State", "header3")
card$append_fs(datasets$get_filter_state())
card$append_text("Principal Components Table", "header3")
card$append_table(teal.code::chunks_get_var("tbl_importance", chunks = computation()))
Expand All @@ -1000,19 +994,15 @@ srv_a_pca <- function(id, datasets, reporter, dat, plot_height, plot_width, ggpl
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_text("Show R Code", "header3")
card$append_src(paste(get_rcode(
chunks = teal.code::get_chunks_object(parent_idx = 1L),
chunks = teal.code::get_chunks_object(parent_idx = 2L),
datasets = datasets,
title = "",
description = ""
), collapse = "\n"))
card
}

teal.reporter::add_card_button_srv("addReportCard", reporter = reporter, card_fun = card_fun)
teal.reporter::download_report_button_srv("downloadButton", reporter = reporter)
teal.reporter::reset_report_button_srv("resetButton", reporter)
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
}
###
})
Expand Down
16 changes: 3 additions & 13 deletions R/tm_a_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,7 @@ ui_a_regression <- function(id, ...) {
)),
encoding = div(
### Reporter
shiny::tags$div(
teal.reporter::add_card_button_ui(ns("addReportCard")),
teal.reporter::download_report_button_ui(ns("downloadButton")),
teal.reporter::reset_report_button_ui(ns("resetButton"))
),
shiny::tags$br(),
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("response", "regressor")]),
Expand Down Expand Up @@ -886,27 +881,22 @@ srv_a_regression <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Linear Regression Plot")
card$append_text("Linear Regression Plot", "header2")
card$append_text("Filter State", "header3")
card$append_fs(datasets$get_filter_state())
card$append_text("Plot", "header3")
card$append_plot(plot_r(), dim = pws$dim())
if (!comment == "") {
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_text("Show R Code", "header3")
card$append_src(paste(get_rcode(
chunks = teal.code::get_chunks_object(parent_idx = 1L),
chunks = teal.code::get_chunks_object(parent_idx = 2L),
datasets = datasets,
title = "",
description = ""
), collapse = "\n"))
card
}

teal.reporter::add_card_button_srv("addReportCard", reporter = reporter, card_fun = card_fun)
teal.reporter::download_report_button_srv("downloadButton", reporter = reporter)
teal.reporter::reset_report_button_srv("resetButton", reporter)
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
}
###
})
Expand Down
16 changes: 3 additions & 13 deletions R/tm_g_association.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,7 @@ ui_tm_g_association <- function(id, ...) {
),
encoding = div(
### Reporter
shiny::tags$div(
teal.reporter::add_card_button_ui(ns("addReportCard")),
teal.reporter::download_report_button_ui(ns("downloadButton")),
teal.reporter::reset_report_button_ui(ns("resetButton"))
),
shiny::tags$br(),
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("ref", "vars")]),
Expand Down Expand Up @@ -414,27 +409,22 @@ srv_tm_g_association <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Association Plot")
card$append_text("Association Plot", "header2")
card$append_text("Filter State", "header3")
card$append_fs(datasets$get_filter_state())
card$append_text("Plot", "header3")
card$append_plot(plot_r(), dim = pws$dim())
if (!comment == "") {
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_text("Show R Code", "header3")
card$append_src(paste(get_rcode(
chunks = teal.code::get_chunks_object(parent_idx = 1L),
chunks = teal.code::get_chunks_object(parent_idx = 2L),
datasets = datasets,
title = "",
description = ""
), collapse = "\n"))
card
}

teal.reporter::add_card_button_srv("addReportCard", reporter = reporter, card_fun = card_fun)
teal.reporter::download_report_button_srv("downloadButton", reporter = reporter)
teal.reporter::reset_report_button_srv("resetButton", reporter)
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
}
###
})
Expand Down
16 changes: 3 additions & 13 deletions R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,7 @@ ui_g_bivariate <- function(id, ...) {
),
encoding = div(
### Reporter
shiny::tags$div(
teal.reporter::add_card_button_ui(ns("addReportCard")),
teal.reporter::download_report_button_ui(ns("downloadButton")),
teal.reporter::reset_report_button_ui(ns("resetButton"))
),
shiny::tags$br(),
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("x", "y", "row_facet", "col_facet", "color", "fill", "size")]),
Expand Down Expand Up @@ -563,27 +558,22 @@ srv_g_bivariate <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Bivariate Plot")
card$append_text("Bivariate Plot", "header2")
card$append_text("Filter State", "header3")
card$append_fs(datasets$get_filter_state())
card$append_text("Plot", "header3")
card$append_plot(plot_r(), dim = pws$dim())
if (!comment == "") {
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_text("Show R Code", "header3")
card$append_src(paste(get_rcode(
chunks = teal.code::get_chunks_object(parent_idx = 1L),
chunks = teal.code::get_chunks_object(parent_idx = 2L),
datasets = datasets,
title = "",
description = ""
), collapse = "\n"))
card
}

teal.reporter::add_card_button_srv("addReportCard", reporter = reporter, card_fun = card_fun)
teal.reporter::download_report_button_srv("downloadButton", reporter = reporter)
teal.reporter::reset_report_button_srv("resetButton", reporter)
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
}
###
})
Expand Down
16 changes: 3 additions & 13 deletions R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,7 @@ ui_distribution <- function(id, ...) {
),
encoding = div(
### Reporter
shiny::tags$div(
teal.reporter::add_card_button_ui(ns("addReportCard")),
teal.reporter::download_report_button_ui(ns("downloadButton")),
teal.reporter::reset_report_button_ui(ns("resetButton"))
),
shiny::tags$br(),
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("dist_var", "strata_var")]),
Expand Down Expand Up @@ -1177,7 +1172,6 @@ srv_distribution <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Association Plot")
card$append_text("Association Plot", "header2")
card$append_text("Filter State", "header3")
card$append_fs(datasets$get_filter_state())
card$append_text("Plot", "header3")
if (input$tabs == "Histogram") {
Expand All @@ -1197,19 +1191,15 @@ srv_distribution <- function(id,
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_text("Show R Code", "header3")
card$append_src(paste(get_rcode(
chunks = teal.code::get_chunks_object(parent_idx = 1L),
chunks = teal.code::get_chunks_object(parent_idx = 2L),
datasets = datasets,
title = "",
description = ""
), collapse = "\n"))
card
}

teal.reporter::add_card_button_srv("addReportCard", reporter = reporter, card_fun = card_fun)
teal.reporter::download_report_button_srv("downloadButton", reporter = reporter)
teal.reporter::reset_report_button_srv("resetButton", reporter)
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
}
###
})
Expand Down
16 changes: 3 additions & 13 deletions R/tm_g_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,7 @@ ui_g_response <- function(id, ...) {
),
encoding = div(
### Reporter
shiny::tags$div(
teal.reporter::add_card_button_ui(ns("addReportCard")),
teal.reporter::download_report_button_ui(ns("downloadButton")),
teal.reporter::reset_report_button_ui(ns("resetButton"))
),
shiny::tags$br(),
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("response", "x", "row_facet", "col_facet")]),
Expand Down Expand Up @@ -454,27 +449,22 @@ srv_g_response <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Response Plot")
card$append_text("Response Plot", "header2")
card$append_text("Filter State", "header3")
card$append_fs(datasets$get_filter_state())
card$append_text("Plot", "header3")
card$append_plot(plot_r(), dim = pws$dim())
if (!comment == "") {
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_text("Show R Code", "header3")
card$append_src(paste(get_rcode(
chunks = teal.code::get_chunks_object(parent_idx = 1L),
chunks = teal.code::get_chunks_object(parent_idx = 2L),
datasets = datasets,
title = "",
description = ""
), collapse = "\n"))
card
}

teal.reporter::add_card_button_srv("addReportCard", reporter = reporter, card_fun = card_fun)
teal.reporter::download_report_button_srv("downloadButton", reporter = reporter)
teal.reporter::reset_report_button_srv("resetButton", reporter)
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
}
###
})
Expand Down
16 changes: 3 additions & 13 deletions R/tm_g_scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,7 @@ ui_g_scatterplot <- function(id, ...) {
),
encoding = div(
### Reporter
shiny::tags$div(
teal.reporter::add_card_button_ui(ns("addReportCard")),
teal.reporter::download_report_button_ui(ns("downloadButton")),
teal.reporter::reset_report_button_ui(ns("resetButton"))
),
shiny::tags$br(),
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("x", "y", "color_by", "size_by", "row_facet", "col_facet")]),
Expand Down Expand Up @@ -807,27 +802,22 @@ srv_g_scatterplot <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Scatter Plot")
card$append_text("Scatter Plot", "header2")
card$append_text("Filter State", "header3")
card$append_fs(datasets$get_filter_state())
card$append_text("Plot", "header3")
card$append_plot(plot_r(), dim = brush$dim())
if (!comment == "") {
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_text("Show R Code", "header3")
card$append_src(paste(get_rcode(
chunks = teal.code::get_chunks_object(parent_idx = 1L),
chunks = teal.code::get_chunks_object(parent_idx = 2L),
datasets = datasets,
title = "",
description = ""
), collapse = "\n"))
card
}

teal.reporter::add_card_button_srv("addReportCard", reporter = reporter, card_fun = card_fun)
teal.reporter::download_report_button_srv("downloadButton", reporter = reporter)
teal.reporter::reset_report_button_srv("resetButton", reporter)
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
}
###
})
Expand Down
16 changes: 3 additions & 13 deletions R/tm_g_scatterplotmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,7 @@ ui_g_scatterplotmatrix <- function(id, ...) {
),
encoding = div(
### Reporter
shiny::tags$div(
teal.reporter::add_card_button_ui(ns("addReportCard")),
teal.reporter::download_report_button_ui(ns("downloadButton")),
teal.reporter::reset_report_button_ui(ns("resetButton"))
),
shiny::tags$br(),
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args$variables),
Expand Down Expand Up @@ -338,27 +333,22 @@ srv_g_scatterplotmatrix <- function(id, datasets, reporter, variables, plot_heig
card <- teal.reporter::TealReportCard$new()
card$set_name("Scatter Plot Matrix")
card$append_text("Scatter Plot Matrix", "header2")
card$append_text("Filter State", "header3")
card$append_fs(datasets$get_filter_state())
card$append_text("Plot", "header3")
card$append_plot(plot_r(), dim = pws$dim())
if (!comment == "") {
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_text("Show R Code", "header3")
card$append_src(paste(get_rcode(
chunks = teal.code::get_chunks_object(parent_idx = 1L),
chunks = teal.code::get_chunks_object(parent_idx = 2L),
datasets = datasets,
title = "",
description = ""
), collapse = "\n"))
card
}

teal.reporter::add_card_button_srv("addReportCard", reporter = reporter, card_fun = card_fun)
teal.reporter::download_report_button_srv("downloadButton", reporter = reporter)
teal.reporter::reset_report_button_srv("resetButton", reporter)
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
}
###
})
Expand Down
16 changes: 3 additions & 13 deletions R/tm_missing_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,7 @@ encoding_missing_data <- function(id, summary_per_patient = FALSE, ggtheme, data

tagList(
### Reporter
shiny::tags$div(
teal.reporter::add_card_button_ui(ns("addReportCard")),
teal.reporter::download_report_button_ui(ns("downloadButton")),
teal.reporter::reset_report_button_ui(ns("resetButton"))
),
shiny::tags$br(),
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
###
tags$label("Encodings", class = "text-primary"),
helpText(
Expand Down Expand Up @@ -1219,7 +1214,6 @@ srv_missing_data <- function(id, datasets, reporter, dataname, plot_height, plot
title <- if (sum_type == "By Variable Levels") paste0(sum_type, " Table") else paste0(sum_type, " Plot")
card$set_name(paste0("Missing Data - ", sum_type))
card$append_text(title, "header2")
card$append_text("Filter State", "header3")
card$append_fs(datasets$get_filter_state())
if (sum_type == "Summary") {
card$append_text("Plot", "header3")
Expand All @@ -1238,19 +1232,15 @@ srv_missing_data <- function(id, datasets, reporter, dataname, plot_height, plot
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_text("Show R Code", "header3")
card$append_src(paste(get_rcode(
chunks = teal.code::get_chunks_object(parent_idx = 1L),
chunks = teal.code::get_chunks_object(parent_idx = 2L),
datasets = datasets,
title = "",
description = ""
), collapse = "\n"))
card
}

teal.reporter::add_card_button_srv("addReportCard", reporter = reporter, card_fun = card_fun)
teal.reporter::download_report_button_srv("downloadButton", reporter = reporter)
teal.reporter::reset_report_button_srv("resetButton", reporter)
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
}
###
})
Expand Down
Loading