diff --git a/R/barplot.R b/R/barplot.R index d1bd936f..02b92944 100644 --- a/R/barplot.R +++ b/R/barplot.R @@ -190,11 +190,13 @@ srv_g_barplot <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Barplot") - card$append_text("Barplot", "header2") - card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- report_card_template( + title = "Barplot", + label = label, + with_filter = TRUE, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") encodings_list <- list( "Experiment:", diff --git a/R/boxplot.R b/R/boxplot.R index 8ef19d36..cbc8e397 100644 --- a/R/boxplot.R +++ b/R/boxplot.R @@ -185,11 +185,13 @@ srv_g_boxplot <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Boxplot") - card$append_text("Boxplot", "header2") - card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- report_card_template( + title = "Boxplot", + label = label, + with_filter = TRUE, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") encodings_list <- list( "Experiment:", diff --git a/R/forestplot.R b/R/forestplot.R index 40fb4cca..d4cda342 100644 --- a/R/forestplot.R +++ b/R/forestplot.R @@ -230,11 +230,13 @@ srv_g_forest_tte <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Forest Plot") - card$append_text("Forest Plot", "header2") - card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- report_card_template( + title = "Forest Plot", + label = label, + with_filter = TRUE, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") encodings_list <- list( "Experiment:", diff --git a/R/km.R b/R/km.R index 87fce4c3..23de5f87 100644 --- a/R/km.R +++ b/R/km.R @@ -222,11 +222,13 @@ srv_g_km <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Kaplan-Meier Plot") - card$append_text("Kaplan-Meier Plot", "header2") - card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- report_card_template( + title = "Kaplan-Meier Plot", + label = label, + with_filter = TRUE, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") encodings_list <- list( "Experiment:", diff --git a/R/pca.R b/R/pca.R index 234537fd..fb1dbcfa 100644 --- a/R/pca.R +++ b/R/pca.R @@ -357,11 +357,13 @@ srv_g_pca <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("PCA") - card$append_text("PCA", "header2") - card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- report_card_template( + title = "PCA", + label = label, + with_filter = TRUE, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") if (input$tab_selected == "PCA") { encodings_list <- list( diff --git a/R/quality.R b/R/quality.R index 6dc6dda9..31c32624 100644 --- a/R/quality.R +++ b/R/quality.R @@ -353,12 +353,14 @@ srv_g_quality <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Quality Control Plot") - card$append_text("Quality Control Plot", "header2") - card$append_text(tools::toTitleCase(input$plot_type), "header3") - card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- report_card_template( + title = "Quality Control Plot", + label = label, + description = tools::toTitleCase(input$plot_type), + with_filter = TRUE, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") encodings_list <- list( "Experiment:", diff --git a/R/scatterplot.R b/R/scatterplot.R index 5a00914d..0ea51c93 100644 --- a/R/scatterplot.R +++ b/R/scatterplot.R @@ -185,11 +185,13 @@ 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") - card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- report_card_template( + title = "Scatter Plot", + label = label, + with_filter = TRUE, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") encodings_list <- list( "Experiment:", diff --git a/R/volcanoplot.R b/R/volcanoplot.R index db1a3842..6b316b4e 100644 --- a/R/volcanoplot.R +++ b/R/volcanoplot.R @@ -207,11 +207,13 @@ srv_g_volcanoplot <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Volcano Plot") - card$append_text("Volcano Plot", "header2") - card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- report_card_template( + title = "Volcano Plot", + label = label, + with_filter = TRUE, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") encodings_list <- list( "Experiment:",