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 #537

Merged
merged 5 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
14 changes: 2 additions & 12 deletions R/tm_a_mmrm.R
Original file line number Diff line number Diff line change
Expand Up @@ -595,12 +595,7 @@ ui_mmrm <- function(id, ...) {
),
encoding = shiny::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")),
###
shiny::tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(a[c("arm_var", "paramcd", "id_var", "visit_var", "cov_var", "aval_var")]),
Expand Down Expand Up @@ -1424,7 +1419,6 @@ srv_mmrm <- function(id,
),
"header3"
)
card$append_text("Filter State", "header3")
card$append_fs(datasets$get_filter_state())
if (!is.null(table_r())) {
card$append_text("Table", "header3")
Expand All @@ -1438,7 +1432,6 @@ srv_mmrm <- 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),
nikolas-burkoff marked this conversation as resolved.
Show resolved Hide resolved
datasets = datasets,
Expand All @@ -1447,10 +1440,7 @@ srv_mmrm <- function(id,
), 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_barchart_simple.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,7 @@ ui_g_barchart_simple <- function(id, ...) {
),
encoding = shiny::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")),
###
shiny::tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("x", "fill", "x_facet", "y_facet")]),
Expand Down Expand Up @@ -535,27 +530,22 @@ srv_g_barchart_simple <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Barchart Plot")
card$append_text("Barchart 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_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,7 @@ ui_g_ci <- function(id, ...) { # nolint
output = teal.widgets::plot_with_settings_ui(id = ns("myplot")),
encoding = shiny::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")),
###
shiny::tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("x_var", "y_var", "color")]),
Expand Down Expand Up @@ -453,27 +448,22 @@ srv_g_ci <- function(id, # nolint
card$set_name("CI Plot")
card$append_text("CI Plot", "header2")
card$append_text("Confidence Interval Plot", "header3")
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_forest_rsp.R
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,7 @@ ui_g_forest_rsp <- function(id, ...) {
output = teal.widgets::plot_with_settings_ui(id = ns("myplot")),
encoding = shiny::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")),
###
shiny::tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(a[c("arm_var", "paramcd", "aval_var", "subgroup_var", "strata_var")]),
Expand Down Expand Up @@ -714,27 +709,22 @@ srv_g_forest_rsp <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Forest Response Plot")
card$append_text("Forest 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_forest_tte.R
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,7 @@ ui_g_forest_tte <- function(id, ...) {
output = teal.widgets::plot_with_settings_ui(id = ns("myplot")),
encoding = shiny::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")),
###
shiny::tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(a[c("arm_var", "paramcd", "subgroup_var", "strata_var", "aval_var", "cnsr_var")]),
Expand Down Expand Up @@ -647,27 +642,22 @@ srv_g_forest_tte <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Forest Survival Plot")
card$append_text("Forest Survival 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_ipp.R
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,7 @@ ui_g_ipp <- function(id, ...) {
output = teal.widgets::plot_with_settings_ui(id = ns("myplot")),
encoding = shiny::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")),
###
shiny::tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(
Expand Down Expand Up @@ -616,27 +611,22 @@ srv_g_ipp <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Individual Patient Plot")
card$append_text("Individual Patient 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_km.R
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,7 @@ ui_g_km <- function(id, ...) {
),
encoding = shiny::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")),
###
shiny::tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(a[c("arm_var", "paramcd", "strata_var", "facet_var", "aval_var", "cnsr_var")]),
Expand Down Expand Up @@ -780,27 +775,22 @@ srv_g_km <- function(id,
card$set_name("Kaplan Meier Plot")
card$append_text("Kaplan Meier Plot", "header2")
card$append_text("Non-parametric method used to estimate the survival function from lifetime data", "header3")
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_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,7 @@ ui_g_lineplot <- function(id, ...) {
),
encoding = shiny::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")),
###
shiny::tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(a[c("strata", "paramcd", "x", "y", "y_unit", "param")]),
Expand Down Expand Up @@ -634,27 +629,22 @@ srv_g_lineplot <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Line Plot")
card$append_text("Line 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_pp_adverse_events.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,7 @@ ui_g_adverse_events <- function(id, ...) {
),
encoding = shiny::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")),
###
shiny::tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(ui_args[c(
Expand Down Expand Up @@ -575,27 +570,22 @@ srv_g_adverse_events <- function(id,
card <- teal.reporter::TealReportCard$new()
card$set_name("Patient Profile Adverse Events Plot")
card$append_text("Patient Profile Adverse Events 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
Loading