From f2f1d1576b4c1ab65962093b9d5ca184e5640ff4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Oct 2023 14:18:28 +0530 Subject: [PATCH 01/15] add card_template function and allow to pass label to reporter card content --- R/tm_a_pca.R | 14 ++++++++------ R/tm_a_regression.R | 13 ++++++++----- R/tm_g_association.R | 12 ++++++++---- R/tm_g_bivariate.R | 13 ++++++++----- R/tm_g_distribution.R | 13 ++++++++----- R/tm_g_response.R | 13 ++++++++----- R/tm_g_scatterplot.R | 13 ++++++++----- R/tm_g_scatterplotmatrix.R | 13 ++++++++----- R/tm_missing_data.R | 7 +++++-- R/tm_outliers.R | 12 +++++++----- R/tm_t_crosstable.R | 11 +++++++---- R/tm_variable_browser.R | 11 +++++++---- R/utils.R | 25 +++++++++++++++++++++++++ man/card_template.Rd | 33 +++++++++++++++++++++++++++++++++ 14 files changed, 148 insertions(+), 55 deletions(-) create mode 100644 man/card_template.Rd diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index e5bbc62d0..c3d974db4 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -999,12 +999,14 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("PCA Plot") - card$append_text("PCA Plot", "header2") - card$append_text("Principal Component Analysis Plot", "header3") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "PCA Plot", + label = label, + description = "Principal Component Analysis Plot", + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Principal Components Table", "header3") card$append_table(computation()[["tbl_importance"]]) card$append_text("Eigenvectors Table", "header3") diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index e7f3650d8..7580187c1 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -869,11 +869,14 @@ srv_a_regression <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Linear Regression Plot") - card$append_text("Linear Regression Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Linear Regression Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = pws$dim()) if (!comment == "") { diff --git a/R/tm_g_association.R b/R/tm_g_association.R index ca524a1e6..1958f900f 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -458,10 +458,14 @@ srv_tm_g_association <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Association Plot") - card$append_text("Association Plot", "header2") + card_fun <- function(comment, label) { + card <- card_template( + title = "Association Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = pws$dim()) diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index 464f6e19f..04a4c7d1e 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -620,11 +620,14 @@ srv_g_bivariate <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Bivariate Plot") - card$append_text("Bivariate Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Bivariate Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = pws$dim()) if (!comment == "") { diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 9fa6eaaad..65af8cd6a 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -1225,11 +1225,14 @@ srv_distribution <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Distribution Plot") - card$append_text("Distribution Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Distribution Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Plot", "header3") if (input$tabs == "Histogram") { card$append_plot(dist_r(), dim = pws1$dim()) diff --git a/R/tm_g_response.R b/R/tm_g_response.R index 483a6a1c3..670e3adfd 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -476,11 +476,14 @@ srv_g_response <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Response Plot") - card$append_text("Response Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Response Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = pws$dim()) if (!comment == "") { diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index f7aea4ff2..caa489f9a 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -948,11 +948,14 @@ srv_g_scatterplot <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Scatter Plot") - card$append_text("Scatter Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Scatter Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = pws$dim()) if (!comment == "") { diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index 8a2b8cf3e..f2225728a 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -353,11 +353,14 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Scatter Plot Matrix") - card$append_text("Scatter Plot Matrix", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Scatter Plot Matrix", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = pws$dim()) if (!comment == "") { diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 475dad2fd..5c2d0727c 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -1200,12 +1200,15 @@ srv_missing_data <- function(id, data, reporter, filter_panel_api, dataname, par ### REPORTER if (with_reporter) { - card_fun <- function(comment) { + card_fun <- function(comment, label) { card <- teal::TealReportCard$new() sum_type <- input$summary_type title <- if (sum_type == "By Variable Levels") paste0(sum_type, " Table") else paste0(sum_type, " Plot") title_dataname <- paste(title, dataname, sep = " - ") - card$set_name(paste("Missing Data", sum_type, dataname, sep = " - ")) + label <- if (label == "") { + paste("Missing Data", sum_type, dataname, sep = " - ") + } else { label } + card$set_name(label) card$append_text(title_dataname, "header2") if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) if (sum_type == "Summary") { diff --git a/R/tm_outliers.R b/R/tm_outliers.R index fba0c5ceb..8a0e43911 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -1147,12 +1147,14 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, ### REPORTER if (with_reporter) { card_fun <- function(comment) { - card <- teal::TealReportCard$new() tab_type <- input$tabs - card$set_name(paste0("Outliers - ", tab_type)) - card$append_text(tab_type, "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) - + card <- card_template( + title = paste0("Outliers - ", tab_type), + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var) if (length(categorical_var) > 0) { summary_table <- common_code_q()[["summary_table"]] diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 0d864c293..328707185 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -352,10 +352,13 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y, ### REPORTER if (with_reporter) { card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Cross Table") - card$append_text("Cross Table", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card <- card_template( + title = "Cross Table", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Table", "header3") card$append_table(table_r()) if (!comment == "") { diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 24eea5744..43922760d 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -501,10 +501,13 @@ srv_variable_browser <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Variable Browser Plot") - card$append_text("Variable Browser Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card <- card_template( + title = "Variable Browser Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Plot", "header3") card$append_plot(variable_plot_r(), dim = pws$dim()) if (!comment == "") { diff --git a/R/utils.R b/R/utils.R index 07db56a98..ac86375a9 100644 --- a/R/utils.R +++ b/R/utils.R @@ -350,3 +350,28 @@ is_tab_active_js <- function(id, name) { id, name ) } + +#' Template function to generate reporter card for `teal.modules.general` +#' @param title (`character(1)`) title of the card (unless overwritten by label) +#' @param label (`character(1)`) label provided by the user when adding the card +#' @param description (`character(1)`) optional additional description +#' @param with_filter (`logical(1)`) flag indicating to add filter state +#' @param filter_panel_api (`FilterPanelAPI`) object with API that allows the generation +#' of the filter state in the report +#' +#' @return (`TealReportCard`) populated with a title, description and filter state +#' +#' @keywords internal +card_template <- function(title, label, description = NULL, with_filter = FALSE, filter_panel_api = NULL) { + card <- teal::TealReportCard$new() + title <- if (label == "") title else label + card$set_name(title) + card$append_text(title, "header2") + if (!is.null(description)) { + card$append_text(description, "header3") + } + if (with_filter) { + card$append_fs(filter_panel_api$get_filter_state()) + } + card +} diff --git a/man/card_template.Rd b/man/card_template.Rd new file mode 100644 index 000000000..cbf6efddd --- /dev/null +++ b/man/card_template.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{card_template} +\alias{card_template} +\title{Template function to generate reporter card for \code{teal.modules.general}} +\usage{ +card_template( + title, + label, + description = NULL, + with_filter = FALSE, + filter_panel_api = NULL +) +} +\arguments{ +\item{title}{(\code{character(1)}) title of the card (unless overwritten by label)} + +\item{label}{(\code{character(1)}) label provided by the user when adding the card} + +\item{description}{(\code{character(1)}) optional additional description} + +\item{with_filter}{(\code{logical(1)}) flag indicating to add filter state} + +\item{filter_panel_api}{(\code{FilterPanelAPI}) object with API that allows the generation +of the filter state in the report} +} +\value{ +(\code{TealReportCard}) populated with a title, description and filter state +} +\description{ +Template function to generate reporter card for \code{teal.modules.general} +} +\keyword{internal} From e65cfff5ebfce7161cec8a6516ab9cdcbd995aee Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 08:54:39 +0000 Subject: [PATCH 02/15] [skip actions] Restyle files --- R/tm_missing_data.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 5c2d0727c..205cf3a03 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -1205,9 +1205,11 @@ srv_missing_data <- function(id, data, reporter, filter_panel_api, dataname, par sum_type <- input$summary_type title <- if (sum_type == "By Variable Levels") paste0(sum_type, " Table") else paste0(sum_type, " Plot") title_dataname <- paste(title, dataname, sep = " - ") - label <- if (label == "") { + label <- if (label == "") { paste("Missing Data", sum_type, dataname, sep = " - ") - } else { label } + } else { + label + } card$set_name(label) card$append_text(title_dataname, "header2") if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) From 31096750b705dc92648191951cf6fdde338fcfcd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Oct 2023 18:13:11 +0530 Subject: [PATCH 03/15] reverting default paramters --- R/utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index ac86375a9..7eb5b07e6 100644 --- a/R/utils.R +++ b/R/utils.R @@ -362,7 +362,7 @@ is_tab_active_js <- function(id, name) { #' @return (`TealReportCard`) populated with a title, description and filter state #' #' @keywords internal -card_template <- function(title, label, description = NULL, with_filter = FALSE, filter_panel_api = NULL) { +card_template <- function(title, label, description = NULL, with_filter, filter_panel_api) { card <- teal::TealReportCard$new() title <- if (label == "") title else label card$set_name(title) From 6f21a8926b25f549a5a332327a56e15a98818cd0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Oct 2023 15:04:27 +0530 Subject: [PATCH 04/15] removing description parameter. --- R/tm_a_pca.R | 3 +-- R/tm_a_regression.R | 1 - R/tm_g_association.R | 2 -- R/tm_g_bivariate.R | 1 - R/tm_g_distribution.R | 1 - R/tm_g_response.R | 1 - R/tm_g_scatterplot.R | 1 - R/tm_g_scatterplotmatrix.R | 1 - R/tm_outliers.R | 1 - R/tm_t_crosstable.R | 1 - R/tm_variable_browser.R | 1 - R/utils.R | 7 ++----- man/card_template.Rd | 10 +--------- 13 files changed, 4 insertions(+), 27 deletions(-) diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index c3d974db4..7842a7d55 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -1001,9 +1001,8 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl if (with_reporter) { card_fun <- function(comment, label) { card <- card_template( - title = "PCA Plot", + title = "Principal Component Analysis Plot", label = label, - description = "Principal Component Analysis Plot", with_filter = with_filter, filter_panel_api = filter_panel_api ) diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index 7580187c1..d6f9c54fc 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -873,7 +873,6 @@ srv_a_regression <- function(id, card <- card_template( title = "Linear Regression Plot", label = label, - description = NULL, with_filter = with_filter, filter_panel_api = filter_panel_api ) diff --git a/R/tm_g_association.R b/R/tm_g_association.R index 1958f900f..c883a52c8 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -462,11 +462,9 @@ srv_tm_g_association <- function(id, card <- card_template( title = "Association Plot", label = label, - description = NULL, with_filter = with_filter, filter_panel_api = filter_panel_api ) - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = pws$dim()) if (!comment == "") { diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index 04a4c7d1e..8d70cfb0b 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -624,7 +624,6 @@ srv_g_bivariate <- function(id, card <- card_template( title = "Bivariate Plot", label = label, - description = NULL, with_filter = with_filter, filter_panel_api = filter_panel_api ) diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 65af8cd6a..11100edda 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -1229,7 +1229,6 @@ srv_distribution <- function(id, card <- card_template( title = "Distribution Plot", label = label, - description = NULL, with_filter = with_filter, filter_panel_api = filter_panel_api ) diff --git a/R/tm_g_response.R b/R/tm_g_response.R index 670e3adfd..0c0872ce0 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -480,7 +480,6 @@ srv_g_response <- function(id, card <- card_template( title = "Response Plot", label = label, - description = NULL, with_filter = with_filter, filter_panel_api = filter_panel_api ) diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index caa489f9a..a96ae3e13 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -952,7 +952,6 @@ srv_g_scatterplot <- function(id, card <- card_template( title = "Scatter Plot", label = label, - description = NULL, with_filter = with_filter, filter_panel_api = filter_panel_api ) diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index f2225728a..3758bd272 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -357,7 +357,6 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab card <- card_template( title = "Scatter Plot Matrix", label = label, - description = NULL, with_filter = with_filter, filter_panel_api = filter_panel_api ) diff --git a/R/tm_outliers.R b/R/tm_outliers.R index 8a0e43911..7aa0bff25 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -1151,7 +1151,6 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, card <- card_template( title = paste0("Outliers - ", tab_type), label = label, - description = NULL, with_filter = with_filter, filter_panel_api = filter_panel_api ) diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 328707185..95c0d3347 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -355,7 +355,6 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y, card <- card_template( title = "Cross Table", label = label, - description = NULL, with_filter = with_filter, filter_panel_api = filter_panel_api ) diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 43922760d..97745314b 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -504,7 +504,6 @@ srv_variable_browser <- function(id, card <- card_template( title = "Variable Browser Plot", label = label, - description = NULL, with_filter = with_filter, filter_panel_api = filter_panel_api ) diff --git a/R/utils.R b/R/utils.R index 7eb5b07e6..17a911cf2 100644 --- a/R/utils.R +++ b/R/utils.R @@ -354,7 +354,6 @@ is_tab_active_js <- function(id, name) { #' Template function to generate reporter card for `teal.modules.general` #' @param title (`character(1)`) title of the card (unless overwritten by label) #' @param label (`character(1)`) label provided by the user when adding the card -#' @param description (`character(1)`) optional additional description #' @param with_filter (`logical(1)`) flag indicating to add filter state #' @param filter_panel_api (`FilterPanelAPI`) object with API that allows the generation #' of the filter state in the report @@ -362,14 +361,12 @@ is_tab_active_js <- function(id, name) { #' @return (`TealReportCard`) populated with a title, description and filter state #' #' @keywords internal -card_template <- function(title, label, description = NULL, with_filter, filter_panel_api) { +card_template <- function(title, label, with_filter, filter_panel_api) { card <- teal::TealReportCard$new() title <- if (label == "") title else label card$set_name(title) card$append_text(title, "header2") - if (!is.null(description)) { - card$append_text(description, "header3") - } + if (with_filter) { card$append_fs(filter_panel_api$get_filter_state()) } diff --git a/man/card_template.Rd b/man/card_template.Rd index cbf6efddd..7d165ff99 100644 --- a/man/card_template.Rd +++ b/man/card_template.Rd @@ -4,21 +4,13 @@ \alias{card_template} \title{Template function to generate reporter card for \code{teal.modules.general}} \usage{ -card_template( - title, - label, - description = NULL, - with_filter = FALSE, - filter_panel_api = NULL -) +card_template(title, label, with_filter, filter_panel_api) } \arguments{ \item{title}{(\code{character(1)}) title of the card (unless overwritten by label)} \item{label}{(\code{character(1)}) label provided by the user when adding the card} -\item{description}{(\code{character(1)}) optional additional description} - \item{with_filter}{(\code{logical(1)}) flag indicating to add filter state} \item{filter_panel_api}{(\code{FilterPanelAPI}) object with API that allows the generation From e26313cdb9a93baffca4e02dd76ec6ca82ccec5c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Oct 2023 16:04:04 +0530 Subject: [PATCH 05/15] adding unit-test --- tests/testthat/test-utils.R | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/testthat/test-utils.R diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R new file mode 100644 index 000000000..bcc3ca619 --- /dev/null +++ b/tests/testthat/test-utils.R @@ -0,0 +1,15 @@ +testthat::test_that("card_template function returns TealReportCard object with appropriate content and labels", { + + fd <- teal.slice::init_filtered_data(list(iris = list(dataset = iris))) + filter_panel_api <- teal.slice::FilterPanelAPI$new(fd) + + card <- shiny::isolate(card_template("Card title", "Card label", TRUE, filter_panel_api)) + testthat::expect_s3_class(card, c("TealReportCard")) + testthat::expect_equal(card$get_name(), "Card label") + testthat::expect_length(card$get_content(), 3) + + card <- shiny::isolate(card_template("Card title", "", FALSE, filter_panel_api)) + testthat::expect_s3_class(card, c("TealReportCard")) + testthat::expect_equal(card$get_name(), "Card title") + testthat::expect_length(card$get_content(), 1) +}) From 91bf21e1dea5ab31974f714588ffbdba0fa92cc8 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:40:37 +0000 Subject: [PATCH 06/15] [skip actions] Restyle files --- tests/testthat/test-utils.R | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index bcc3ca619..4597d5d45 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -1,5 +1,4 @@ testthat::test_that("card_template function returns TealReportCard object with appropriate content and labels", { - fd <- teal.slice::init_filtered_data(list(iris = list(dataset = iris))) filter_panel_api <- teal.slice::FilterPanelAPI$new(fd) From 9b9595307a7f297efdb3e5cc3b68c975f4944df4 Mon Sep 17 00:00:00 2001 From: kartikeyakirar Date: Thu, 5 Oct 2023 16:32:18 +0530 Subject: [PATCH 07/15] 'Empty-Commit' From db9110699ecdcb6bf16e84698fb033be938634fc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Oct 2023 17:07:49 +0530 Subject: [PATCH 08/15] adding assertion --- R/utils.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/utils.R b/R/utils.R index 17a911cf2..97878aa71 100644 --- a/R/utils.R +++ b/R/utils.R @@ -362,6 +362,11 @@ is_tab_active_js <- function(id, name) { #' #' @keywords internal card_template <- function(title, label, with_filter, filter_panel_api) { + checkmate::assert_string(title) + checkmate::assert_string(label) + checkmate::assert_flag(with_filter) + checkmate::assert_class(filter_panel_api, classes = "FilterPanelAPI") + card <- teal::TealReportCard$new() title <- if (label == "") title else label card$set_name(title) From 062f7af5b53d7dfbf5018e9aa0a64e9b79fbae60 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 11:41:23 +0000 Subject: [PATCH 09/15] [skip actions] Restyle files --- R/utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index 97878aa71..a457ffe0f 100644 --- a/R/utils.R +++ b/R/utils.R @@ -365,7 +365,7 @@ card_template <- function(title, label, with_filter, filter_panel_api) { checkmate::assert_string(title) checkmate::assert_string(label) checkmate::assert_flag(with_filter) - checkmate::assert_class(filter_panel_api, classes = "FilterPanelAPI") + checkmate::assert_class(filter_panel_api, classes = "FilterPanelAPI") card <- teal::TealReportCard$new() title <- if (label == "") title else label From 9461dfc3500d0976e4893559578e9b5e2f3e5525 Mon Sep 17 00:00:00 2001 From: kartikeyakirar Date: Thu, 5 Oct 2023 17:15:57 +0530 Subject: [PATCH 10/15] 'Empty-Commit' From f7659d7090effcd19658edd537db7c1b32396867 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Oct 2023 18:00:42 +0530 Subject: [PATCH 11/15] fixing cmd checks --- R/tm_outliers.R | 2 +- R/tm_t_crosstable.R | 2 +- R/tm_variable_browser.R | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/tm_outliers.R b/R/tm_outliers.R index 7aa0bff25..cd5d4f552 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -1146,7 +1146,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { + card_fun <- function(comment, label) { tab_type <- input$tabs card <- card_template( title = paste0("Outliers - ", tab_type), diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 95c0d3347..3ffd782e2 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -351,7 +351,7 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { + card_fun <- function(comment, label) { card <- card_template( title = "Cross Table", label = label, diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 97745314b..e972f3027 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -500,7 +500,7 @@ srv_variable_browser <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { + card_fun <- function(comment, label) { card <- card_template( title = "Variable Browser Plot", label = label, From 4f0284fdd94c2f2cf2ff5465b86b8a59890a7535 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Oct 2023 02:47:00 +0530 Subject: [PATCH 12/15] fixing linter --- .lintr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.lintr b/.lintr index 34473d273..0a0bb22f3 100644 --- a/.lintr +++ b/.lintr @@ -1,5 +1,6 @@ linters: linters_with_defaults( line_length_linter = line_length_linter(120), cyclocomp_linter = NULL, - object_usage_linter = NULL + object_usage_linter = NULL, + indentation_linter = NULL ) From 47d50509932028d4650dac4efc97fabffef675f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Oct 2023 17:48:30 +0530 Subject: [PATCH 13/15] removing internal card_template function() and unit-test --- R/tm_a_pca.R | 2 +- R/tm_a_regression.R | 2 +- R/tm_g_association.R | 2 +- R/tm_g_bivariate.R | 2 +- R/tm_g_distribution.R | 2 +- R/tm_g_response.R | 2 +- R/tm_g_scatterplot.R | 2 +- R/tm_g_scatterplotmatrix.R | 2 +- R/tm_outliers.R | 2 +- R/tm_t_crosstable.R | 2 +- R/tm_variable_browser.R | 2 +- R/utils.R | 27 --------------------------- man/card_template.Rd | 25 ------------------------- tests/testthat/test-utils.R | 14 -------------- 14 files changed, 11 insertions(+), 77 deletions(-) delete mode 100644 man/card_template.Rd delete mode 100644 tests/testthat/test-utils.R diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index 7842a7d55..6c7394d99 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -1000,7 +1000,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- teal.reporter::card_template( title = "Principal Component Analysis Plot", label = label, with_filter = with_filter, diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index d6f9c54fc..90a25004b 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -870,7 +870,7 @@ srv_a_regression <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- teal.reporter::card_template( title = "Linear Regression Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_association.R b/R/tm_g_association.R index c883a52c8..a19f7f04f 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -459,7 +459,7 @@ srv_tm_g_association <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- teal.reporter::card_template( title = "Association Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index 8d70cfb0b..b2359d071 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -621,7 +621,7 @@ srv_g_bivariate <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- teal.reporter::card_template( title = "Bivariate Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 11100edda..977d9111f 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -1226,7 +1226,7 @@ srv_distribution <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- teal.reporter::card_template( title = "Distribution Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_response.R b/R/tm_g_response.R index 0c0872ce0..93730528f 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -477,7 +477,7 @@ srv_g_response <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- teal.reporter::card_template( title = "Response Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index a96ae3e13..2d4aad212 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -949,7 +949,7 @@ srv_g_scatterplot <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- teal.reporter::card_template( title = "Scatter Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index 3758bd272..aceb6fd17 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -354,7 +354,7 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- teal.reporter::card_template( title = "Scatter Plot Matrix", label = label, with_filter = with_filter, diff --git a/R/tm_outliers.R b/R/tm_outliers.R index cd5d4f552..fb2ed7557 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -1148,7 +1148,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, if (with_reporter) { card_fun <- function(comment, label) { tab_type <- input$tabs - card <- card_template( + card <- teal.reporter::card_template( title = paste0("Outliers - ", tab_type), label = label, with_filter = with_filter, diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 3ffd782e2..3f068f2fe 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -352,7 +352,7 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- teal.reporter::card_template( title = "Cross Table", label = label, with_filter = with_filter, diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index e972f3027..6811fbb1e 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -501,7 +501,7 @@ srv_variable_browser <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- teal.reporter::card_template( title = "Variable Browser Plot", label = label, with_filter = with_filter, diff --git a/R/utils.R b/R/utils.R index a457ffe0f..07db56a98 100644 --- a/R/utils.R +++ b/R/utils.R @@ -350,30 +350,3 @@ is_tab_active_js <- function(id, name) { id, name ) } - -#' Template function to generate reporter card for `teal.modules.general` -#' @param title (`character(1)`) title of the card (unless overwritten by label) -#' @param label (`character(1)`) label provided by the user when adding the card -#' @param with_filter (`logical(1)`) flag indicating to add filter state -#' @param filter_panel_api (`FilterPanelAPI`) object with API that allows the generation -#' of the filter state in the report -#' -#' @return (`TealReportCard`) populated with a title, description and filter state -#' -#' @keywords internal -card_template <- function(title, label, with_filter, filter_panel_api) { - checkmate::assert_string(title) - checkmate::assert_string(label) - checkmate::assert_flag(with_filter) - checkmate::assert_class(filter_panel_api, classes = "FilterPanelAPI") - - card <- teal::TealReportCard$new() - title <- if (label == "") title else label - card$set_name(title) - card$append_text(title, "header2") - - if (with_filter) { - card$append_fs(filter_panel_api$get_filter_state()) - } - card -} diff --git a/man/card_template.Rd b/man/card_template.Rd deleted file mode 100644 index 7d165ff99..000000000 --- a/man/card_template.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R -\name{card_template} -\alias{card_template} -\title{Template function to generate reporter card for \code{teal.modules.general}} -\usage{ -card_template(title, label, with_filter, filter_panel_api) -} -\arguments{ -\item{title}{(\code{character(1)}) title of the card (unless overwritten by label)} - -\item{label}{(\code{character(1)}) label provided by the user when adding the card} - -\item{with_filter}{(\code{logical(1)}) flag indicating to add filter state} - -\item{filter_panel_api}{(\code{FilterPanelAPI}) object with API that allows the generation -of the filter state in the report} -} -\value{ -(\code{TealReportCard}) populated with a title, description and filter state -} -\description{ -Template function to generate reporter card for \code{teal.modules.general} -} -\keyword{internal} diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R deleted file mode 100644 index 4597d5d45..000000000 --- a/tests/testthat/test-utils.R +++ /dev/null @@ -1,14 +0,0 @@ -testthat::test_that("card_template function returns TealReportCard object with appropriate content and labels", { - fd <- teal.slice::init_filtered_data(list(iris = list(dataset = iris))) - filter_panel_api <- teal.slice::FilterPanelAPI$new(fd) - - card <- shiny::isolate(card_template("Card title", "Card label", TRUE, filter_panel_api)) - testthat::expect_s3_class(card, c("TealReportCard")) - testthat::expect_equal(card$get_name(), "Card label") - testthat::expect_length(card$get_content(), 3) - - card <- shiny::isolate(card_template("Card title", "", FALSE, filter_panel_api)) - testthat::expect_s3_class(card, c("TealReportCard")) - testthat::expect_equal(card$get_name(), "Card title") - testthat::expect_length(card$get_content(), 1) -}) From 3d645d149ddef003e738f0b83dffa3bf6ca78802 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Oct 2023 14:08:54 +0530 Subject: [PATCH 14/15] change namespace call from teal.reporter to teal for card_template --- R/tm_a_pca.R | 2 +- R/tm_a_regression.R | 2 +- R/tm_g_association.R | 2 +- R/tm_g_bivariate.R | 2 +- R/tm_g_distribution.R | 2 +- R/tm_g_response.R | 2 +- R/tm_g_scatterplot.R | 2 +- R/tm_g_scatterplotmatrix.R | 2 +- R/tm_outliers.R | 2 +- R/tm_t_crosstable.R | 2 +- R/tm_variable_browser.R | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index 6c7394d99..5ed43be94 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -1000,7 +1000,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal.reporter::card_template( + card <- teal::card_template( title = "Principal Component Analysis Plot", label = label, with_filter = with_filter, diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index 90a25004b..52bdcda9e 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -870,7 +870,7 @@ srv_a_regression <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal.reporter::card_template( + card <- teal::card_template( title = "Linear Regression Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_association.R b/R/tm_g_association.R index a19f7f04f..5ab1e915d 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -459,7 +459,7 @@ srv_tm_g_association <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal.reporter::card_template( + card <- teal::card_template( title = "Association Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index b2359d071..13b5a8687 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -621,7 +621,7 @@ srv_g_bivariate <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal.reporter::card_template( + card <- teal::card_template( title = "Bivariate Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 977d9111f..6d246f886 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -1226,7 +1226,7 @@ srv_distribution <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal.reporter::card_template( + card <- teal::card_template( title = "Distribution Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_response.R b/R/tm_g_response.R index 93730528f..e6e5affe7 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -477,7 +477,7 @@ srv_g_response <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal.reporter::card_template( + card <- teal::card_template( title = "Response Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index 2d4aad212..43f6c6ce2 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -949,7 +949,7 @@ srv_g_scatterplot <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal.reporter::card_template( + card <- teal::card_template( title = "Scatter Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index aceb6fd17..1e71dd55f 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -354,7 +354,7 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal.reporter::card_template( + card <- teal::card_template( title = "Scatter Plot Matrix", label = label, with_filter = with_filter, diff --git a/R/tm_outliers.R b/R/tm_outliers.R index fb2ed7557..c8b4c4546 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -1148,7 +1148,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, if (with_reporter) { card_fun <- function(comment, label) { tab_type <- input$tabs - card <- teal.reporter::card_template( + card <- teal::card_template( title = paste0("Outliers - ", tab_type), label = label, with_filter = with_filter, diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 3f068f2fe..946a9d7ca 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -352,7 +352,7 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal.reporter::card_template( + card <- teal::card_template( title = "Cross Table", label = label, with_filter = with_filter, diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index 6811fbb1e..b534e2ade 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -501,7 +501,7 @@ srv_variable_browser <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal.reporter::card_template( + card <- teal::card_template( title = "Variable Browser Plot", label = label, with_filter = with_filter, From 73d5539698ae2dc22769f0d9c993db622ff8926f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Oct 2023 15:20:43 +0530 Subject: [PATCH 15/15] renaming to report_card_template --- R/tm_a_pca.R | 2 +- R/tm_a_regression.R | 2 +- R/tm_g_association.R | 2 +- R/tm_g_bivariate.R | 2 +- R/tm_g_distribution.R | 2 +- R/tm_g_response.R | 2 +- R/tm_g_scatterplot.R | 2 +- R/tm_g_scatterplotmatrix.R | 2 +- R/tm_outliers.R | 2 +- R/tm_t_crosstable.R | 2 +- R/tm_variable_browser.R | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index 5ed43be94..cc4f5ebd8 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -1000,7 +1000,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal::card_template( + card <- teal::report_card_template( title = "Principal Component Analysis Plot", label = label, with_filter = with_filter, diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index 52bdcda9e..8ddaaf523 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -870,7 +870,7 @@ srv_a_regression <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal::card_template( + card <- teal::report_card_template( title = "Linear Regression Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_association.R b/R/tm_g_association.R index 5ab1e915d..36ee84d82 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -459,7 +459,7 @@ srv_tm_g_association <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal::card_template( + card <- teal::report_card_template( title = "Association Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index 13b5a8687..2acd0b487 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -621,7 +621,7 @@ srv_g_bivariate <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal::card_template( + card <- teal::report_card_template( title = "Bivariate Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 6d246f886..9a055e955 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -1226,7 +1226,7 @@ srv_distribution <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal::card_template( + card <- teal::report_card_template( title = "Distribution Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_response.R b/R/tm_g_response.R index e6e5affe7..57e1a9856 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -477,7 +477,7 @@ srv_g_response <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal::card_template( + card <- teal::report_card_template( title = "Response Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index 43f6c6ce2..d728d4628 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -949,7 +949,7 @@ srv_g_scatterplot <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal::card_template( + card <- teal::report_card_template( title = "Scatter Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index 1e71dd55f..80184fba8 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -354,7 +354,7 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal::card_template( + card <- teal::report_card_template( title = "Scatter Plot Matrix", label = label, with_filter = with_filter, diff --git a/R/tm_outliers.R b/R/tm_outliers.R index c8b4c4546..f30ac883f 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -1148,7 +1148,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, if (with_reporter) { card_fun <- function(comment, label) { tab_type <- input$tabs - card <- teal::card_template( + card <- teal::report_card_template( title = paste0("Outliers - ", tab_type), label = label, with_filter = with_filter, diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 946a9d7ca..a31d68f3e 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -352,7 +352,7 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal::card_template( + card <- teal::report_card_template( title = "Cross Table", label = label, with_filter = with_filter, diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index b534e2ade..1e4400a40 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -501,7 +501,7 @@ srv_variable_browser <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- teal::card_template( + card <- teal::report_card_template( title = "Variable Browser Plot", label = label, with_filter = with_filter,