Skip to content

Commit

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

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 523ea6b commit 15b751c
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 46 deletions.
3 changes: 2 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
@@ -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
)
12 changes: 7 additions & 5 deletions R/tm_g_ae_oview.R
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,13 @@ srv_g_ae_oview <- function(id,
)
### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card <- teal::TealReportCard$new()
card$set_name("AE Overview")
card$append_text("AE Overview", "header2")
if (with_filter) card$append_fs(filter_panel_api$get_filter_state())
card_fun <- function(comment, label) {
card <- teal::report_card_template(
title = "AE Overview",
label = label,
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 == "") {
Expand Down
12 changes: 7 additions & 5 deletions R/tm_g_ae_sub.R
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,13 @@ srv_g_ae_sub <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card <- teal::TealReportCard$new()
card$set_name("AE Subgroups")
card$append_text("AE Subgroups", "header2")
if (with_filter) card$append_fs(filter_panel_api$get_filter_state())
card_fun <- function(comment, label) {
card <- teal::report_card_template(
title = "AE Subgroups",
label = label,
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 == "") {
Expand Down
12 changes: 7 additions & 5 deletions R/tm_g_butterfly.R
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,13 @@ srv_g_butterfly <- function(id, data, filter_panel_api, reporter, dataname, labe

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card <- teal::TealReportCard$new()
card$set_name("Butterfly")
card$append_text("Butterfly Plot", "header2")
if (with_filter) card$append_fs(filter_panel_api$get_filter_state())
card_fun <- function(comment, label) {
card <- teal::report_card_template(
title = "Butterfly Plot",
label = label,
with_filter = with_filter,
filter_panel_api = filter_panel_api
)
if (!is.null(input$filter_var) || !is.null(input$facet_var) || !is.null(input$sort_by_var)) {
card$append_text("Selected Options", "header3")
}
Expand Down
12 changes: 7 additions & 5 deletions R/tm_g_events_term_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,13 @@ srv_g_events_term_id <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card <- teal::TealReportCard$new()
card$set_name("Events by Term")
card$append_text("Events by Term", "header2")
if (with_filter) card$append_fs(filter_panel_api$get_filter_state())
card_fun <- function(comment, label) {
card <- teal::report_card_template(
title = "Events by Term",
label = label,
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 == "") {
Expand Down
12 changes: 7 additions & 5 deletions R/tm_g_heat_bygrade.R
Original file line number Diff line number Diff line change
Expand Up @@ -495,11 +495,13 @@ srv_g_heatmap_bygrade <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card <- teal::TealReportCard$new()
card$set_name("Heatmap by Grade")
card$append_text("Heatmap by Grade", "header2")
if (with_filter) card$append_fs(filter_panel_api$get_filter_state())
card_fun <- function(comment, label) {
card <- teal::report_card_template(
title = "Heatmap by Grade",
label = label,
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 == "") {
Expand Down
12 changes: 7 additions & 5 deletions R/tm_g_patient_profile.R
Original file line number Diff line number Diff line change
Expand Up @@ -951,11 +951,13 @@ srv_g_patient_profile <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card <- teal::TealReportCard$new()
card$set_name("Patient Profile")
card$append_text("Patient Profile", "header2")
if (with_filter) card$append_fs(filter_panel_api$get_filter_state())
card_fun <- function(comment, label) {
card <- teal::report_card_template(
title = "Patient Profile",
label = label,
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 == "") {
Expand Down
12 changes: 7 additions & 5 deletions R/tm_g_spiderplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,13 @@ srv_g_spider <- function(id, data, filter_panel_api, reporter, dataname, label,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card <- teal::TealReportCard$new()
card$set_name("Spider Plot")
card$append_text("Spider Plot", "header2")
if (with_filter) card$append_fs(filter_panel_api$get_filter_state())
card_fun <- function(comment, label) {
card <- teal::report_card_template(
title = "Spider Plot",
label = label,
with_filter = with_filter,
filter_panel_api = filter_panel_api
)
if (!is.null(input$paramcd) || !is.null(input$xfacet_var) || !is.null(input$yfacet_var)) {
card$append_text("Selected Options", "header3")
}
Expand Down
12 changes: 7 additions & 5 deletions R/tm_g_swimlane.R
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,13 @@ srv_g_swimlane <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card <- teal::TealReportCard$new()
card$set_name("Swimlane")
card$append_text("Swimlane Plot", "header2")
if (with_filter) card$append_fs(filter_panel_api$get_filter_state())
card_fun <- function(comment, label) {
card <- teal::report_card_template(
title = "Swimlane Plot",
label = label,
with_filter = with_filter,
filter_panel_api = filter_panel_api
)
if (!is.null(input$sort_var)) {
card$append_text("Selected Options", "header3")
card$append_text(paste("Sorted by:", input$sort_var))
Expand Down
12 changes: 7 additions & 5 deletions R/tm_g_waterfall.R
Original file line number Diff line number Diff line change
Expand Up @@ -559,11 +559,13 @@ srv_g_waterfall <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card <- teal::TealReportCard$new()
card$set_name("Waterfall")
card$append_text("Waterfall Plot", "header2")
if (with_filter) card$append_fs(filter_panel_api$get_filter_state())
card_fun <- function(comment, label) {
card <- teal::report_card_template(
title = "Waterfall Plot",
label = label,
with_filter = with_filter,
filter_panel_api = filter_panel_api
)
card$append_text("Selected Options", "header3")
card$append_text(paste0("Tumor Burden Parameter: ", input$bar_paramcd, "."))
if (!is.null(input$sort_var)) {
Expand Down

0 comments on commit 15b751c

Please sign in to comment.