Skip to content

Commit

Permalink
198 Include user's card labels when generating the report (#336)
Browse files Browse the repository at this point in the history
this PR fixes
#335

this is follow-up after
insightsengineering/teal.reporter#219

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
kartikeyakirar and github-actions[bot] authored Oct 13, 2023
1 parent 3d16439 commit d71a227
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 41 deletions.
12 changes: 7 additions & 5 deletions R/barplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
Expand Down
12 changes: 7 additions & 5 deletions R/boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
Expand Down
12 changes: 7 additions & 5 deletions R/forestplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
Expand Down
12 changes: 7 additions & 5 deletions R/km.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
Expand Down
12 changes: 7 additions & 5 deletions R/pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
14 changes: 8 additions & 6 deletions R/quality.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
Expand Down
12 changes: 7 additions & 5 deletions R/scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
Expand Down
12 changes: 7 additions & 5 deletions R/volcanoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
Expand Down

0 comments on commit d71a227

Please sign in to comment.