From fd9baaa4095657173006a03a1f72a9c25e2e93f0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Oct 2023 19:13:34 +0530 Subject: [PATCH 01/21] add card_template function and allow to pass label to reporter card content --- R/tm_g_gh_boxplot.R | 13 ++++++++----- R/tm_g_gh_correlationplot.R | 13 ++++++++----- R/tm_g_gh_density_distribution_plot.R | 13 ++++++++----- R/tm_g_gh_lineplot.R | 13 ++++++++----- R/tm_g_gh_scatterplot.R | 13 ++++++++----- R/tm_g_gh_spaghettiplot.R | 13 ++++++++----- R/utils.R | 25 +++++++++++++++++++++++++ man/card_template.Rd | 27 +++++++++++++++++++++++++++ 8 files changed, 100 insertions(+), 30 deletions(-) create mode 100644 man/card_template.Rd diff --git a/R/tm_g_gh_boxplot.R b/R/tm_g_gh_boxplot.R index 08187005..f3d83e84 100644 --- a/R/tm_g_gh_boxplot.R +++ b/R/tm_g_gh_boxplot.R @@ -548,11 +548,14 @@ srv_g_boxplot <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Box Plot") - card$append_text("Box Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Box Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") card$append_text( paste( diff --git a/R/tm_g_gh_correlationplot.R b/R/tm_g_gh_correlationplot.R index 4d7d267d..6638fafb 100644 --- a/R/tm_g_gh_correlationplot.R +++ b/R/tm_g_gh_correlationplot.R @@ -875,11 +875,14 @@ srv_g_correlationplot <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Correlation Plot") - card$append_text("Correlation Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Correlation Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") card$append_text( paste( diff --git a/R/tm_g_gh_density_distribution_plot.R b/R/tm_g_gh_density_distribution_plot.R index 8ec4e5c0..32c81dbc 100644 --- a/R/tm_g_gh_density_distribution_plot.R +++ b/R/tm_g_gh_density_distribution_plot.R @@ -449,11 +449,14 @@ srv_g_density_distribution_plot <- function(id, # nolint ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Density Distribution Plot") - card$append_text("Density Distribution Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Density Distribution Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") card$append_text( formatted_data_constraint(input$constraint_var, input$constraint_range_min, input$constraint_range_max) diff --git a/R/tm_g_gh_lineplot.R b/R/tm_g_gh_lineplot.R index e3c8e07e..36b8fb54 100644 --- a/R/tm_g_gh_lineplot.R +++ b/R/tm_g_gh_lineplot.R @@ -793,11 +793,14 @@ srv_lineplot <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Line Plot") - card$append_text("Line Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Line Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") card$append_text( paste( diff --git a/R/tm_g_gh_scatterplot.R b/R/tm_g_gh_scatterplot.R index b2d94b1c..03cfed2e 100644 --- a/R/tm_g_gh_scatterplot.R +++ b/R/tm_g_gh_scatterplot.R @@ -382,11 +382,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("Selected Options", "header3") card$append_text( paste( diff --git a/R/tm_g_gh_spaghettiplot.R b/R/tm_g_gh_spaghettiplot.R index 8361f542..c801e29b 100644 --- a/R/tm_g_gh_spaghettiplot.R +++ b/R/tm_g_gh_spaghettiplot.R @@ -521,11 +521,14 @@ srv_g_spaghettiplot <- function(id, ### REPORTER if (with_reporter) { - card_fun <- function(comment) { - card <- teal::TealReportCard$new() - card$set_name("Spaghetti Plot") - card$append_text("Spaghetti Plot", "header2") - if (with_filter) card$append_fs(filter_panel_api$get_filter_state()) + card_fun <- function(comment, label) { + card <- card_template( + title = "Spaghetti Plot", + label = label, + description = NULL, + with_filter = with_filter, + filter_panel_api = filter_panel_api + ) card$append_text("Selected Options", "header3") card$append_text( formatted_data_constraint(input$constraint_var, input$constraint_range_min, input$constraint_range_max) diff --git a/R/utils.R b/R/utils.R index 644f7132..a05a7943 100644 --- a/R/utils.R +++ b/R/utils.R @@ -31,3 +31,28 @@ plots_per_row_validate_rules <- function(required = TRUE) { shinyvalidate::sv_gt(0, message_fmt = msg) ) } + +#' Template function to generate reporter card for `teal.goshawk` +#' @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, 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()) + } + card +} \ No newline at end of file diff --git a/man/card_template.Rd b/man/card_template.Rd new file mode 100644 index 00000000..4c647874 --- /dev/null +++ b/man/card_template.Rd @@ -0,0 +1,27 @@ +% 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.goshawk}} +\usage{ +card_template(title, label, description = NULL, 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 +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.goshawk} +} +\keyword{internal} From aae88744f8aa7c905ec79a260d4a0d08c3d5f724 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:47:34 +0000 Subject: [PATCH 02/21] [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 a05a7943..ee66581d 100644 --- a/R/utils.R +++ b/R/utils.R @@ -55,4 +55,4 @@ card_template <- function(title, label, description = NULL, with_filter, filter_ card$append_fs(filter_panel_api$get_filter_state()) } card -} \ No newline at end of file +} From b71ed51fb9d983d5c4033567f8277aa235d8c434 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Oct 2023 02:23:28 +0530 Subject: [PATCH 03/21] adding option selection section in card_template. --- R/tm_g_gh_boxplot.R | 23 ++++++++---------- R/tm_g_gh_correlationplot.R | 25 +++++++++---------- R/tm_g_gh_density_distribution_plot.R | 10 +++----- R/tm_g_gh_lineplot.R | 25 +++++++++---------- R/tm_g_gh_scatterplot.R | 25 +++++++++---------- R/tm_g_gh_spaghettiplot.R | 10 +++----- R/utils-data_constraints.r | 2 +- R/utils.R | 35 +++++++++++++++++++++------ man/card_template.Rd | 27 +++++++++++++++++---- 9 files changed, 104 insertions(+), 78 deletions(-) diff --git a/R/tm_g_gh_boxplot.R b/R/tm_g_gh_boxplot.R index f3d83e84..5b3ab364 100644 --- a/R/tm_g_gh_boxplot.R +++ b/R/tm_g_gh_boxplot.R @@ -549,23 +549,20 @@ srv_g_boxplot <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { + constraint_description <- paste("\nFacet By:", + if (length(input$facet_var) != 0) input$facet_var else "None", + "\nSelect an X-axis Variable:", + input$xaxis_var) card <- card_template( title = "Box Plot", label = label, - description = NULL, with_filter = with_filter, - filter_panel_api = filter_panel_api - ) - card$append_text("Selected Options", "header3") - card$append_text( - paste( - formatted_data_constraint(input$constraint_var, input$constraint_range_min, input$constraint_range_max), - "\nFacet By:", - if (length(input$facet_var) != 0) input$facet_var else "None", - "\nSelect an X-axis Variable:", - input$xaxis_var - ), - style = "verbatim" + filter_panel_api = filter_panel_api, + constraint_list= list(constraint_var = input$constraint_var , + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max), + constraint_description = constraint_description, + style = "verbatim" ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = boxplot_data$dim()) diff --git a/R/tm_g_gh_correlationplot.R b/R/tm_g_gh_correlationplot.R index 6638fafb..b0b5d5cd 100644 --- a/R/tm_g_gh_correlationplot.R +++ b/R/tm_g_gh_correlationplot.R @@ -876,23 +876,22 @@ srv_g_correlationplot <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { + constraint_description <- paste( + "\nTreatment Variable Faceting:", + input$trt_facet, + "\nRegression Line:", + input$reg_line + ) card <- card_template( title = "Correlation Plot", label = label, - description = NULL, with_filter = with_filter, - filter_panel_api = filter_panel_api - ) - card$append_text("Selected Options", "header3") - card$append_text( - paste( - formatted_data_constraint(input$constraint_var, input$constraint_range_min, input$constraint_range_max), - "\nTreatment Variable Faceting:", - input$trt_facet, - "\nRegression Line:", - input$reg_line - ), - style = "verbatim" + filter_panel_api = filter_panel_api, + constraint_list= list(constraint_var = input$constraint_var , + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max), + constraint_description = constraint_description, + style = "verbatim" ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = plot_data$dim()) diff --git a/R/tm_g_gh_density_distribution_plot.R b/R/tm_g_gh_density_distribution_plot.R index 32c81dbc..ee090918 100644 --- a/R/tm_g_gh_density_distribution_plot.R +++ b/R/tm_g_gh_density_distribution_plot.R @@ -453,13 +453,11 @@ srv_g_density_distribution_plot <- function(id, # nolint card <- card_template( title = "Density Distribution Plot", label = label, - description = NULL, with_filter = with_filter, - filter_panel_api = filter_panel_api - ) - card$append_text("Selected Options", "header3") - card$append_text( - formatted_data_constraint(input$constraint_var, input$constraint_range_min, input$constraint_range_max) + filter_panel_api = filter_panel_api, + constraint_list= list(constraint_var = input$constraint_var , + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max) ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = plot_data$dim()) diff --git a/R/tm_g_gh_lineplot.R b/R/tm_g_gh_lineplot.R index 36b8fb54..3bc7ab52 100644 --- a/R/tm_g_gh_lineplot.R +++ b/R/tm_g_gh_lineplot.R @@ -794,23 +794,22 @@ srv_lineplot <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { + constraint_description <- paste( + "\nSelect Line Splitting Variable:", + if (!is.null(input$shape)) input$shape else "None", + "\nContributing Observations Threshold:", + input$count_threshold + ) card <- card_template( title = "Line Plot", label = label, - description = NULL, with_filter = with_filter, - filter_panel_api = filter_panel_api - ) - card$append_text("Selected Options", "header3") - card$append_text( - paste( - formatted_data_constraint(input$constraint_var, input$constraint_range_min, input$constraint_range_max), - "\nSelect Line Splitting Variable:", - if (!is.null(input$shape)) input$shape else "None", - "\nContributing Observations Threshold:", - input$count_threshold - ), - style = "verbatim" + filter_panel_api = filter_panel_api, + constraint_list= list(constraint_var = input$constraint_var , + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max), + constraint_description = constraint_description, + style = "verbatim" ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = plot_data$dim()) diff --git a/R/tm_g_gh_scatterplot.R b/R/tm_g_gh_scatterplot.R index 03cfed2e..e8ea5452 100644 --- a/R/tm_g_gh_scatterplot.R +++ b/R/tm_g_gh_scatterplot.R @@ -383,23 +383,22 @@ srv_g_scatterplot <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { + constraint_description <- paste( + "\nTreatment Variable Faceting:", + input$trt_facet, + "\nRegression Line:", + input$reg_line + ) card <- card_template( title = "Scatter Plot", label = label, - description = NULL, with_filter = with_filter, - filter_panel_api = filter_panel_api - ) - card$append_text("Selected Options", "header3") - card$append_text( - paste( - formatted_data_constraint(input$constraint_var, input$constraint_range_min, input$constraint_range_max), - "\nTreatment Variable Faceting:", - input$trt_facet, - "\nRegression Line:", - input$reg_line - ), - style = "verbatim" + filter_panel_api = filter_panel_api, + constraint_list= list(constraint_var = input$constraint_var , + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max), + constraint_description = constraint_description, + style = "verbatim" ) card$append_text("Scatter Plot", "header3") card$append_plot(plot_r(), dim = plot_data$dim()) diff --git a/R/tm_g_gh_spaghettiplot.R b/R/tm_g_gh_spaghettiplot.R index c801e29b..51e37945 100644 --- a/R/tm_g_gh_spaghettiplot.R +++ b/R/tm_g_gh_spaghettiplot.R @@ -525,13 +525,11 @@ srv_g_spaghettiplot <- function(id, card <- card_template( title = "Spaghetti Plot", label = label, - description = NULL, with_filter = with_filter, - filter_panel_api = filter_panel_api - ) - card$append_text("Selected Options", "header3") - card$append_text( - formatted_data_constraint(input$constraint_var, input$constraint_range_min, input$constraint_range_max) + filter_panel_api = filter_panel_api, + constraint_list= list(constraint_var = input$constraint_var , + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max) ) card$append_text("Spaghetti Plot", "header3") card$append_plot(plot_r(), dim = plot_data$dim()) diff --git a/R/utils-data_constraints.r b/R/utils-data_constraints.r index ae521c11..5df85821 100644 --- a/R/utils-data_constraints.r +++ b/R/utils-data_constraints.r @@ -236,7 +236,7 @@ create_anl_constraint_reactive <- function(anl_param, input, param_id, min_rows) ) } -# for outputting the constaint in the report +# for outputting the constraint in the report formatted_data_constraint <- function(constraint_var, constraint_range_min, constraint_range_max) { constraint_var_label <- switch(constraint_var, "BASE2" = "Screening", diff --git a/R/utils.R b/R/utils.R index a05a7943..8aad3fb0 100644 --- a/R/utils.R +++ b/R/utils.R @@ -35,24 +35,43 @@ plots_per_row_validate_rules <- function(required = TRUE) { #' Template function to generate reporter card for `teal.goshawk` #' @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 +#' of the filter state in the report +#' @param constraint_list (`list`) a list containing constraint variables, including: +#' - constraint_var (`character(1)`) the constraint variable name. +#' - constraint_range_min (`numeric(1)`) the minimum constraint range value. +#' - constraint_range_max (`numeric(1)`) the maximum constraint range value. +#' @param constraint_description (`character(1)`) description of the constraints. +#' @param style (`character(1)`) style of the constraint text block. options: `default`, `verbatim` (default is `default`). #' -#' @return (`TealReportCard`) populated with a title, description and filter state +#' @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, constraint_list, constraint_description = NULL, style = "default") { + checkmate::assert_string(title) + checkmate::assert_string(label) + checkmate::assert_flag(with_filter) + checkmate::assert_class(filter_panel_api, classes = "FilterPanelAPI") + checkmate::assert_subset(names(constraint_list), c("constraint_var" ,"constraint_range_min", "constraint_range_max")) + checkmate::assert_string(constraint_description,null.ok = TRUE) + checkmate::assert_choice(style, c("default", "verbatim")) + 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$append_text("Selected Options", "header3") + card$append_text( + paste( + formatted_data_constraint(constraint_list$constraint_var, constraint_list$constraint_range_min, constraint_list$constraint_range_max), + constraint_description + ), + style = style + ) card -} \ No newline at end of file +} diff --git a/man/card_template.Rd b/man/card_template.Rd index 4c647874..4faf8aec 100644 --- a/man/card_template.Rd +++ b/man/card_template.Rd @@ -4,22 +4,39 @@ \alias{card_template} \title{Template function to generate reporter card for \code{teal.goshawk}} \usage{ -card_template(title, label, description = NULL, with_filter, filter_panel_api) +card_template( + title, + label, + with_filter, + filter_panel_api, + constraint_list, + constraint_description, + style = "default" +) } \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{with_filter}{(\code{logical(1)}) flag indicating whether to add filter state} \item{filter_panel_api}{(\code{FilterPanelAPI}) object with API that allows the generation of the filter state in the report} + +\item{constraint_list}{(\code{list}) a list containing constraint variables, including: +\itemize{ +\item constraint_var (\code{character}) the constraint variable name. +\item constraint_range_min (\code{numeric}) the minimum constraint range value. +\item constraint_range_max (\code{numeric}) the maximum constraint range value. +}} + +\item{constraint_description}{(\code{character(1)}) description of the constraints.} + +\item{style}{(\code{character(1)}) style of the constraint text block. options: \code{default}, \code{verbatim} (default is \code{default}).} } \value{ -(\code{TealReportCard}) populated with a title, description and filter state +(\code{TealReportCard}) populated with a title, description, and filter state } \description{ Template function to generate reporter card for \code{teal.goshawk} From 1a2642790f3b83ba6515d6ff85b350cce516d554 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Oct 2023 02:31:27 +0530 Subject: [PATCH 04/21] fixing indentation. --- R/tm_g_gh_boxplot.R | 2 +- R/tm_g_gh_correlationplot.R | 2 +- R/tm_g_gh_density_distribution_plot.R | 2 +- R/tm_g_gh_lineplot.R | 2 +- R/tm_g_gh_scatterplot.R | 2 +- R/tm_g_gh_spaghettiplot.R | 2 +- R/utils.R | 19 ++++++++++++++----- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/R/tm_g_gh_boxplot.R b/R/tm_g_gh_boxplot.R index 5b3ab364..c7439a32 100644 --- a/R/tm_g_gh_boxplot.R +++ b/R/tm_g_gh_boxplot.R @@ -558,7 +558,7 @@ srv_g_boxplot <- function(id, label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list= list(constraint_var = input$constraint_var , + constraint_list = list(constraint_var = input$constraint_var, constraint_range_min = input$constraint_range_min, constraint_range_max = input$constraint_range_max), constraint_description = constraint_description, diff --git a/R/tm_g_gh_correlationplot.R b/R/tm_g_gh_correlationplot.R index b0b5d5cd..130a3e44 100644 --- a/R/tm_g_gh_correlationplot.R +++ b/R/tm_g_gh_correlationplot.R @@ -887,7 +887,7 @@ srv_g_correlationplot <- function(id, label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list= list(constraint_var = input$constraint_var , + constraint_list = list(constraint_var = input$constraint_var, constraint_range_min = input$constraint_range_min, constraint_range_max = input$constraint_range_max), constraint_description = constraint_description, diff --git a/R/tm_g_gh_density_distribution_plot.R b/R/tm_g_gh_density_distribution_plot.R index ee090918..323899b8 100644 --- a/R/tm_g_gh_density_distribution_plot.R +++ b/R/tm_g_gh_density_distribution_plot.R @@ -455,7 +455,7 @@ srv_g_density_distribution_plot <- function(id, # nolint label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list= list(constraint_var = input$constraint_var , + constraint_list = list(constraint_var = input$constraint_var, constraint_range_min = input$constraint_range_min, constraint_range_max = input$constraint_range_max) ) diff --git a/R/tm_g_gh_lineplot.R b/R/tm_g_gh_lineplot.R index 3bc7ab52..c448b7ce 100644 --- a/R/tm_g_gh_lineplot.R +++ b/R/tm_g_gh_lineplot.R @@ -805,7 +805,7 @@ srv_lineplot <- function(id, label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list= list(constraint_var = input$constraint_var , + constraint_list = list(constraint_var = input$constraint_var, constraint_range_min = input$constraint_range_min, constraint_range_max = input$constraint_range_max), constraint_description = constraint_description, diff --git a/R/tm_g_gh_scatterplot.R b/R/tm_g_gh_scatterplot.R index e8ea5452..3a2b4e4a 100644 --- a/R/tm_g_gh_scatterplot.R +++ b/R/tm_g_gh_scatterplot.R @@ -394,7 +394,7 @@ srv_g_scatterplot <- function(id, label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list= list(constraint_var = input$constraint_var , + constraint_list = list(constraint_var = input$constraint_var, constraint_range_min = input$constraint_range_min, constraint_range_max = input$constraint_range_max), constraint_description = constraint_description, diff --git a/R/tm_g_gh_spaghettiplot.R b/R/tm_g_gh_spaghettiplot.R index 51e37945..65279a4d 100644 --- a/R/tm_g_gh_spaghettiplot.R +++ b/R/tm_g_gh_spaghettiplot.R @@ -527,7 +527,7 @@ srv_g_spaghettiplot <- function(id, label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list= list(constraint_var = input$constraint_var , + constraint_list = list(constraint_var = input$constraint_var, constraint_range_min = input$constraint_range_min, constraint_range_max = input$constraint_range_max) ) diff --git a/R/utils.R b/R/utils.R index 8aad3fb0..f4193f1a 100644 --- a/R/utils.R +++ b/R/utils.R @@ -43,18 +43,25 @@ plots_per_row_validate_rules <- function(required = TRUE) { #' - constraint_range_min (`numeric(1)`) the minimum constraint range value. #' - constraint_range_max (`numeric(1)`) the maximum constraint range value. #' @param constraint_description (`character(1)`) description of the constraints. -#' @param style (`character(1)`) style of the constraint text block. options: `default`, `verbatim` (default is `default`). +#' @param style (`character(1)`) style of the constraint text block. +#' options: `default`, `verbatim` (default is `default`). #' #' @return (`TealReportCard`) populated with a title, description, and filter state #' #' @keywords internal -card_template <- function(title, label, with_filter, filter_panel_api, constraint_list, constraint_description = NULL, style = "default") { +card_template <- function(title, + label, + with_filter, + filter_panel_api, + constraint_list, + constraint_description = NULL, + style = "default") { checkmate::assert_string(title) checkmate::assert_string(label) checkmate::assert_flag(with_filter) checkmate::assert_class(filter_panel_api, classes = "FilterPanelAPI") - checkmate::assert_subset(names(constraint_list), c("constraint_var" ,"constraint_range_min", "constraint_range_max")) - checkmate::assert_string(constraint_description,null.ok = TRUE) + checkmate::assert_subset(names(constraint_list), c("constraint_var", "constraint_range_min", "constraint_range_max")) + checkmate::assert_string(constraint_description, null.ok = TRUE) checkmate::assert_choice(style, c("default", "verbatim")) card <- teal::TealReportCard$new() @@ -68,7 +75,9 @@ card_template <- function(title, label, with_filter, filter_panel_api, constrain card$append_text("Selected Options", "header3") card$append_text( paste( - formatted_data_constraint(constraint_list$constraint_var, constraint_list$constraint_range_min, constraint_list$constraint_range_max), + formatted_data_constraint(constraint_list$constraint_var, + constraint_list$constraint_range_min, + constraint_list$constraint_range_max), constraint_description ), style = style From 9e19c70219db1305f75efed3f4e7a278d4525f05 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 21:05:52 +0000 Subject: [PATCH 05/21] [skip actions] Restyle files --- R/tm_g_gh_boxplot.R | 20 ++++++++++++-------- R/tm_g_gh_correlationplot.R | 10 ++++++---- R/tm_g_gh_density_distribution_plot.R | 8 +++++--- R/tm_g_gh_lineplot.R | 10 ++++++---- R/tm_g_gh_scatterplot.R | 10 ++++++---- R/tm_g_gh_spaghettiplot.R | 8 +++++--- R/utils.R | 8 +++++--- 7 files changed, 45 insertions(+), 29 deletions(-) diff --git a/R/tm_g_gh_boxplot.R b/R/tm_g_gh_boxplot.R index c7439a32..7c7c401b 100644 --- a/R/tm_g_gh_boxplot.R +++ b/R/tm_g_gh_boxplot.R @@ -549,20 +549,24 @@ srv_g_boxplot <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - constraint_description <- paste("\nFacet By:", - if (length(input$facet_var) != 0) input$facet_var else "None", - "\nSelect an X-axis Variable:", - input$xaxis_var) + constraint_description <- paste( + "\nFacet By:", + if (length(input$facet_var) != 0) input$facet_var else "None", + "\nSelect an X-axis Variable:", + input$xaxis_var + ) card <- card_template( title = "Box Plot", label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list = list(constraint_var = input$constraint_var, - constraint_range_min = input$constraint_range_min, - constraint_range_max = input$constraint_range_max), + constraint_list = list( + constraint_var = input$constraint_var, + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max + ), constraint_description = constraint_description, - style = "verbatim" + style = "verbatim" ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = boxplot_data$dim()) diff --git a/R/tm_g_gh_correlationplot.R b/R/tm_g_gh_correlationplot.R index 130a3e44..a6e0c439 100644 --- a/R/tm_g_gh_correlationplot.R +++ b/R/tm_g_gh_correlationplot.R @@ -887,11 +887,13 @@ srv_g_correlationplot <- function(id, label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list = list(constraint_var = input$constraint_var, - constraint_range_min = input$constraint_range_min, - constraint_range_max = input$constraint_range_max), + constraint_list = list( + constraint_var = input$constraint_var, + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max + ), constraint_description = constraint_description, - style = "verbatim" + style = "verbatim" ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = plot_data$dim()) diff --git a/R/tm_g_gh_density_distribution_plot.R b/R/tm_g_gh_density_distribution_plot.R index 323899b8..1f6c836a 100644 --- a/R/tm_g_gh_density_distribution_plot.R +++ b/R/tm_g_gh_density_distribution_plot.R @@ -455,9 +455,11 @@ srv_g_density_distribution_plot <- function(id, # nolint label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list = list(constraint_var = input$constraint_var, - constraint_range_min = input$constraint_range_min, - constraint_range_max = input$constraint_range_max) + constraint_list = list( + constraint_var = input$constraint_var, + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max + ) ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = plot_data$dim()) diff --git a/R/tm_g_gh_lineplot.R b/R/tm_g_gh_lineplot.R index c448b7ce..3dfcf911 100644 --- a/R/tm_g_gh_lineplot.R +++ b/R/tm_g_gh_lineplot.R @@ -805,11 +805,13 @@ srv_lineplot <- function(id, label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list = list(constraint_var = input$constraint_var, - constraint_range_min = input$constraint_range_min, - constraint_range_max = input$constraint_range_max), + constraint_list = list( + constraint_var = input$constraint_var, + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max + ), constraint_description = constraint_description, - style = "verbatim" + style = "verbatim" ) card$append_text("Plot", "header3") card$append_plot(plot_r(), dim = plot_data$dim()) diff --git a/R/tm_g_gh_scatterplot.R b/R/tm_g_gh_scatterplot.R index 3a2b4e4a..7a901abc 100644 --- a/R/tm_g_gh_scatterplot.R +++ b/R/tm_g_gh_scatterplot.R @@ -394,11 +394,13 @@ srv_g_scatterplot <- function(id, label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list = list(constraint_var = input$constraint_var, - constraint_range_min = input$constraint_range_min, - constraint_range_max = input$constraint_range_max), + constraint_list = list( + constraint_var = input$constraint_var, + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max + ), constraint_description = constraint_description, - style = "verbatim" + style = "verbatim" ) card$append_text("Scatter Plot", "header3") card$append_plot(plot_r(), dim = plot_data$dim()) diff --git a/R/tm_g_gh_spaghettiplot.R b/R/tm_g_gh_spaghettiplot.R index 65279a4d..7d865e61 100644 --- a/R/tm_g_gh_spaghettiplot.R +++ b/R/tm_g_gh_spaghettiplot.R @@ -527,9 +527,11 @@ srv_g_spaghettiplot <- function(id, label = label, with_filter = with_filter, filter_panel_api = filter_panel_api, - constraint_list = list(constraint_var = input$constraint_var, - constraint_range_min = input$constraint_range_min, - constraint_range_max = input$constraint_range_max) + constraint_list = list( + constraint_var = input$constraint_var, + constraint_range_min = input$constraint_range_min, + constraint_range_max = input$constraint_range_max + ) ) card$append_text("Spaghetti Plot", "header3") card$append_plot(plot_r(), dim = plot_data$dim()) diff --git a/R/utils.R b/R/utils.R index f4193f1a..ee5d18ff 100644 --- a/R/utils.R +++ b/R/utils.R @@ -75,9 +75,11 @@ card_template <- function(title, card$append_text("Selected Options", "header3") card$append_text( paste( - formatted_data_constraint(constraint_list$constraint_var, - constraint_list$constraint_range_min, - constraint_list$constraint_range_max), + formatted_data_constraint( + constraint_list$constraint_var, + constraint_list$constraint_range_min, + constraint_list$constraint_range_max + ), constraint_description ), style = style From e0795288b9f34a23c21a4f6806125605d29e5be5 Mon Sep 17 00:00:00 2001 From: kartikeyakirar Date: Fri, 6 Oct 2023 02:48:42 +0530 Subject: [PATCH 06/21] 'Empty-Commit' From 2118b41d400afa89aa96f21df1219de9e50e0d89 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Oct 2023 14:32:23 +0530 Subject: [PATCH 07/21] wrapper function for teal.reporter card_template --- R/utils.R | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/R/utils.R b/R/utils.R index ee5d18ff..94146203 100644 --- a/R/utils.R +++ b/R/utils.R @@ -33,11 +33,7 @@ plots_per_row_validate_rules <- function(required = TRUE) { } #' Template function to generate reporter card for `teal.goshawk` -#' @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 +#' @inheritParams teal.reporter::card_template #' @param constraint_list (`list`) a list containing constraint variables, including: #' - constraint_var (`character(1)`) the constraint variable name. #' - constraint_range_min (`numeric(1)`) the minimum constraint range value. @@ -56,22 +52,17 @@ card_template <- function(title, constraint_list, constraint_description = NULL, style = "default") { - checkmate::assert_string(title) - checkmate::assert_string(label) - checkmate::assert_flag(with_filter) - checkmate::assert_class(filter_panel_api, classes = "FilterPanelAPI") checkmate::assert_subset(names(constraint_list), c("constraint_var", "constraint_range_min", "constraint_range_max")) checkmate::assert_string(constraint_description, null.ok = TRUE) checkmate::assert_choice(style, c("default", "verbatim")) - card <- teal::TealReportCard$new() - title <- if (label == "") title else label - card$set_name(title) - card$append_text(title, "header2") + card <- teal.reporter::card_template( + title = title, + label = label, + 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("Selected Options", "header3") card$append_text( paste( From 2a4c5a7a9cb709e2288461e002478cc4c9c62de8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Oct 2023 15:24:31 +0530 Subject: [PATCH 08/21] renaming to report_card_template --- R/tm_g_gh_boxplot.R | 2 +- R/tm_g_gh_correlationplot.R | 2 +- R/tm_g_gh_density_distribution_plot.R | 2 +- R/tm_g_gh_lineplot.R | 2 +- R/tm_g_gh_scatterplot.R | 2 +- R/tm_g_gh_spaghettiplot.R | 2 +- R/utils.R | 4 ++-- ...rd_template.Rd => report_card_template.Rd} | 19 ++++++++++--------- 8 files changed, 18 insertions(+), 17 deletions(-) rename man/{card_template.Rd => report_card_template.Rd} (66%) diff --git a/R/tm_g_gh_boxplot.R b/R/tm_g_gh_boxplot.R index 7c7c401b..b6f5cd0a 100644 --- a/R/tm_g_gh_boxplot.R +++ b/R/tm_g_gh_boxplot.R @@ -555,7 +555,7 @@ srv_g_boxplot <- function(id, "\nSelect an X-axis Variable:", input$xaxis_var ) - card <- card_template( + card <- report_card_template( title = "Box Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_gh_correlationplot.R b/R/tm_g_gh_correlationplot.R index a6e0c439..3189c6ec 100644 --- a/R/tm_g_gh_correlationplot.R +++ b/R/tm_g_gh_correlationplot.R @@ -882,7 +882,7 @@ srv_g_correlationplot <- function(id, "\nRegression Line:", input$reg_line ) - card <- card_template( + card <- report_card_template( title = "Correlation Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_gh_density_distribution_plot.R b/R/tm_g_gh_density_distribution_plot.R index 1f6c836a..dee1ea92 100644 --- a/R/tm_g_gh_density_distribution_plot.R +++ b/R/tm_g_gh_density_distribution_plot.R @@ -450,7 +450,7 @@ srv_g_density_distribution_plot <- function(id, # nolint ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- report_card_template( title = "Density Distribution Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_gh_lineplot.R b/R/tm_g_gh_lineplot.R index 3dfcf911..f6c77d5b 100644 --- a/R/tm_g_gh_lineplot.R +++ b/R/tm_g_gh_lineplot.R @@ -800,7 +800,7 @@ srv_lineplot <- function(id, "\nContributing Observations Threshold:", input$count_threshold ) - card <- card_template( + card <- report_card_template( title = "Line Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_gh_scatterplot.R b/R/tm_g_gh_scatterplot.R index 7a901abc..f977ba09 100644 --- a/R/tm_g_gh_scatterplot.R +++ b/R/tm_g_gh_scatterplot.R @@ -389,7 +389,7 @@ srv_g_scatterplot <- function(id, "\nRegression Line:", input$reg_line ) - card <- card_template( + card <- report_card_template( title = "Scatter Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_gh_spaghettiplot.R b/R/tm_g_gh_spaghettiplot.R index 7d865e61..abf8a79d 100644 --- a/R/tm_g_gh_spaghettiplot.R +++ b/R/tm_g_gh_spaghettiplot.R @@ -522,7 +522,7 @@ srv_g_spaghettiplot <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- card_template( + card <- report_card_template( title = "Spaghetti Plot", label = label, with_filter = with_filter, diff --git a/R/utils.R b/R/utils.R index 94146203..e47f6cf8 100644 --- a/R/utils.R +++ b/R/utils.R @@ -45,7 +45,7 @@ plots_per_row_validate_rules <- function(required = TRUE) { #' @return (`TealReportCard`) populated with a title, description, and filter state #' #' @keywords internal -card_template <- function(title, +report_card_template <- function(title, label, with_filter, filter_panel_api, @@ -56,7 +56,7 @@ card_template <- function(title, checkmate::assert_string(constraint_description, null.ok = TRUE) checkmate::assert_choice(style, c("default", "verbatim")) - card <- teal.reporter::card_template( + card <- teal::report_card_template( title = title, label = label, with_filter = with_filter, diff --git a/man/card_template.Rd b/man/report_card_template.Rd similarity index 66% rename from man/card_template.Rd rename to man/report_card_template.Rd index 4faf8aec..491a8135 100644 --- a/man/card_template.Rd +++ b/man/report_card_template.Rd @@ -1,16 +1,16 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R -\name{card_template} -\alias{card_template} +\name{report_card_template} +\alias{report_card_template} \title{Template function to generate reporter card for \code{teal.goshawk}} \usage{ -card_template( +report_card_template( title, label, with_filter, filter_panel_api, constraint_list, - constraint_description, + constraint_description = NULL, style = "default" ) } @@ -19,21 +19,22 @@ card_template( \item{label}{(\code{character(1)}) label provided by the user when adding the card} -\item{with_filter}{(\code{logical(1)}) flag indicating whether to add filter state} +\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} \item{constraint_list}{(\code{list}) a list containing constraint variables, including: \itemize{ -\item constraint_var (\code{character}) the constraint variable name. -\item constraint_range_min (\code{numeric}) the minimum constraint range value. -\item constraint_range_max (\code{numeric}) the maximum constraint range value. +\item constraint_var (\code{character(1)}) the constraint variable name. +\item constraint_range_min (\code{numeric(1)}) the minimum constraint range value. +\item constraint_range_max (\code{numeric(1)}) the maximum constraint range value. }} \item{constraint_description}{(\code{character(1)}) description of the constraints.} -\item{style}{(\code{character(1)}) style of the constraint text block. options: \code{default}, \code{verbatim} (default is \code{default}).} +\item{style}{(\code{character(1)}) style of the constraint text block. +options: \code{default}, \code{verbatim} (default is \code{default}).} } \value{ (\code{TealReportCard}) populated with a title, description, and filter state From fe35a27b660932820944d27c22e89241fc63e474 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:57:59 +0000 Subject: [PATCH 09/21] [skip actions] Restyle files --- R/utils.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/R/utils.R b/R/utils.R index e47f6cf8..505dad49 100644 --- a/R/utils.R +++ b/R/utils.R @@ -46,12 +46,12 @@ plots_per_row_validate_rules <- function(required = TRUE) { #' #' @keywords internal report_card_template <- function(title, - label, - with_filter, - filter_panel_api, - constraint_list, - constraint_description = NULL, - style = "default") { + label, + with_filter, + filter_panel_api, + constraint_list, + constraint_description = NULL, + style = "default") { checkmate::assert_subset(names(constraint_list), c("constraint_var", "constraint_range_min", "constraint_range_max")) checkmate::assert_string(constraint_description, null.ok = TRUE) checkmate::assert_choice(style, c("default", "verbatim")) From e7f44bef373bde21490e9df504ddda2ddd5a4d1d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Oct 2023 15:49:05 +0530 Subject: [PATCH 10/21] renaming to report_card_template_goshawk --- R/tm_g_gh_boxplot.R | 2 +- R/tm_g_gh_correlationplot.R | 2 +- R/tm_g_gh_density_distribution_plot.R | 2 +- R/tm_g_gh_lineplot.R | 2 +- R/tm_g_gh_scatterplot.R | 2 +- R/tm_g_gh_spaghettiplot.R | 2 +- R/utils.R | 14 +++++++------- man/report_card_template.Rd | 6 +++--- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/R/tm_g_gh_boxplot.R b/R/tm_g_gh_boxplot.R index b6f5cd0a..0ab843d3 100644 --- a/R/tm_g_gh_boxplot.R +++ b/R/tm_g_gh_boxplot.R @@ -555,7 +555,7 @@ srv_g_boxplot <- function(id, "\nSelect an X-axis Variable:", input$xaxis_var ) - card <- report_card_template( + card <- report_card_template_goshawk( title = "Box Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_gh_correlationplot.R b/R/tm_g_gh_correlationplot.R index 3189c6ec..0c99a31e 100644 --- a/R/tm_g_gh_correlationplot.R +++ b/R/tm_g_gh_correlationplot.R @@ -882,7 +882,7 @@ srv_g_correlationplot <- function(id, "\nRegression Line:", input$reg_line ) - card <- report_card_template( + card <- report_card_template_goshawk( title = "Correlation Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_gh_density_distribution_plot.R b/R/tm_g_gh_density_distribution_plot.R index dee1ea92..bdd062b8 100644 --- a/R/tm_g_gh_density_distribution_plot.R +++ b/R/tm_g_gh_density_distribution_plot.R @@ -450,7 +450,7 @@ srv_g_density_distribution_plot <- function(id, # nolint ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- report_card_template( + card <- report_card_template_goshawk( title = "Density Distribution Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_gh_lineplot.R b/R/tm_g_gh_lineplot.R index f6c77d5b..564afcf0 100644 --- a/R/tm_g_gh_lineplot.R +++ b/R/tm_g_gh_lineplot.R @@ -800,7 +800,7 @@ srv_lineplot <- function(id, "\nContributing Observations Threshold:", input$count_threshold ) - card <- report_card_template( + card <- report_card_template_goshawk( title = "Line Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_gh_scatterplot.R b/R/tm_g_gh_scatterplot.R index f977ba09..752dae0e 100644 --- a/R/tm_g_gh_scatterplot.R +++ b/R/tm_g_gh_scatterplot.R @@ -389,7 +389,7 @@ srv_g_scatterplot <- function(id, "\nRegression Line:", input$reg_line ) - card <- report_card_template( + card <- report_card_template_goshawk( title = "Scatter Plot", label = label, with_filter = with_filter, diff --git a/R/tm_g_gh_spaghettiplot.R b/R/tm_g_gh_spaghettiplot.R index abf8a79d..0add074f 100644 --- a/R/tm_g_gh_spaghettiplot.R +++ b/R/tm_g_gh_spaghettiplot.R @@ -522,7 +522,7 @@ srv_g_spaghettiplot <- function(id, ### REPORTER if (with_reporter) { card_fun <- function(comment, label) { - card <- report_card_template( + card <- report_card_template_goshawk( title = "Spaghetti Plot", label = label, with_filter = with_filter, diff --git a/R/utils.R b/R/utils.R index e47f6cf8..b5add1a7 100644 --- a/R/utils.R +++ b/R/utils.R @@ -45,13 +45,13 @@ plots_per_row_validate_rules <- function(required = TRUE) { #' @return (`TealReportCard`) populated with a title, description, and filter state #' #' @keywords internal -report_card_template <- function(title, - label, - with_filter, - filter_panel_api, - constraint_list, - constraint_description = NULL, - style = "default") { +report_card_template_goshawk <- function(title, + label, + with_filter, + filter_panel_api, + constraint_list, + constraint_description = NULL, + style = "default") { checkmate::assert_subset(names(constraint_list), c("constraint_var", "constraint_range_min", "constraint_range_max")) checkmate::assert_string(constraint_description, null.ok = TRUE) checkmate::assert_choice(style, c("default", "verbatim")) diff --git a/man/report_card_template.Rd b/man/report_card_template.Rd index 491a8135..83f10769 100644 --- a/man/report_card_template.Rd +++ b/man/report_card_template.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R -\name{report_card_template} -\alias{report_card_template} +\name{report_card_template_goshawk} +\alias{report_card_template_goshawk} \title{Template function to generate reporter card for \code{teal.goshawk}} \usage{ -report_card_template( +report_card_template_goshawk( title, label, with_filter, From 407720312981fa3f1a7d5fa1e12e902fb488df46 Mon Sep 17 00:00:00 2001 From: "27856297+dependabot-preview[bot]@users.noreply.github.com" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:28:22 +0000 Subject: [PATCH 11/21] [skip actions] Roxygen Man Pages Auto Update --- man/report_card_template_goshawk.Rd | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 man/report_card_template_goshawk.Rd diff --git a/man/report_card_template_goshawk.Rd b/man/report_card_template_goshawk.Rd new file mode 100644 index 00000000..61327193 --- /dev/null +++ b/man/report_card_template_goshawk.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{report_card_template_goshawk} +\alias{report_card_template_goshawk} +\title{Template function to generate reporter card for \code{teal.goshawk}} +\usage{ +report_card_template_goshawk( + title, + label, + with_filter, + filter_panel_api, + constraint_list, + constraint_description = NULL, + style = "default" +) +} +\arguments{ +\item{constraint_list}{(\code{list}) a list containing constraint variables, including: +\itemize{ +\item constraint_var (\code{character(1)}) the constraint variable name. +\item constraint_range_min (\code{numeric(1)}) the minimum constraint range value. +\item constraint_range_max (\code{numeric(1)}) the maximum constraint range value. +}} + +\item{constraint_description}{(\code{character(1)}) description of the constraints.} + +\item{style}{(\code{character(1)}) style of the constraint text block. +options: \code{default}, \code{verbatim} (default is \code{default}).} +} +\value{ +(\code{TealReportCard}) populated with a title, description, and filter state +} +\description{ +Template function to generate reporter card for \code{teal.goshawk} +} +\keyword{internal} From d5fc23bf2376f0d21bf2d79006bc0dfda0c383d5 Mon Sep 17 00:00:00 2001 From: kartikeyakirar Date: Thu, 12 Oct 2023 16:00:22 +0530 Subject: [PATCH 12/21] 'Empty-Commit' From 90fa05d1a0815f06db64b1c5fd043d7e1ea1db22 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Oct 2023 16:26:50 +0530 Subject: [PATCH 13/21] replacing Rd file --- man/report_card_template.Rd | 45 ----------------------------- man/report_card_template_goshawk.Rd | 9 ++++++ 2 files changed, 9 insertions(+), 45 deletions(-) delete mode 100644 man/report_card_template.Rd diff --git a/man/report_card_template.Rd b/man/report_card_template.Rd deleted file mode 100644 index 83f10769..00000000 --- a/man/report_card_template.Rd +++ /dev/null @@ -1,45 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R -\name{report_card_template_goshawk} -\alias{report_card_template_goshawk} -\title{Template function to generate reporter card for \code{teal.goshawk}} -\usage{ -report_card_template_goshawk( - title, - label, - with_filter, - filter_panel_api, - constraint_list, - constraint_description = NULL, - style = "default" -) -} -\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} - -\item{constraint_list}{(\code{list}) a list containing constraint variables, including: -\itemize{ -\item constraint_var (\code{character(1)}) the constraint variable name. -\item constraint_range_min (\code{numeric(1)}) the minimum constraint range value. -\item constraint_range_max (\code{numeric(1)}) the maximum constraint range value. -}} - -\item{constraint_description}{(\code{character(1)}) description of the constraints.} - -\item{style}{(\code{character(1)}) style of the constraint text block. -options: \code{default}, \code{verbatim} (default is \code{default}).} -} -\value{ -(\code{TealReportCard}) populated with a title, description, and filter state -} -\description{ -Template function to generate reporter card for \code{teal.goshawk} -} -\keyword{internal} diff --git a/man/report_card_template_goshawk.Rd b/man/report_card_template_goshawk.Rd index 61327193..83f10769 100644 --- a/man/report_card_template_goshawk.Rd +++ b/man/report_card_template_goshawk.Rd @@ -15,6 +15,15 @@ report_card_template_goshawk( ) } \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} + \item{constraint_list}{(\code{list}) a list containing constraint variables, including: \itemize{ \item constraint_var (\code{character(1)}) the constraint variable name. From e8ad09a4c41f937438f9dd32b868c1a7c62189aa Mon Sep 17 00:00:00 2001 From: "27856297+dependabot-preview[bot]@users.noreply.github.com" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 11:03:43 +0000 Subject: [PATCH 14/21] [skip actions] Roxygen Man Pages Auto Update --- man/report_card_template_goshawk.Rd | 9 --------- 1 file changed, 9 deletions(-) diff --git a/man/report_card_template_goshawk.Rd b/man/report_card_template_goshawk.Rd index 83f10769..61327193 100644 --- a/man/report_card_template_goshawk.Rd +++ b/man/report_card_template_goshawk.Rd @@ -15,15 +15,6 @@ report_card_template_goshawk( ) } \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} - \item{constraint_list}{(\code{list}) a list containing constraint variables, including: \itemize{ \item constraint_var (\code{character(1)}) the constraint variable name. From 1daee0c5bbf6495f9bac4b58b92294215179a731 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Oct 2023 19:10:16 +0530 Subject: [PATCH 15/21] Adding description and changing case. --- R/utils.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index b5add1a7..6a881b39 100644 --- a/R/utils.R +++ b/R/utils.R @@ -32,7 +32,12 @@ plots_per_row_validate_rules <- function(required = TRUE) { ) } -#' Template function to generate reporter card for `teal.goshawk` +#' Template Function for `TealReportCard` Creation and Customization in `teal.goshawk` +#' +#' This function generates a report card with a title, +#' an optional description, and the option to append the filter state list. +#' Additionally, it display selected constraint options. +#' #' @inheritParams teal.reporter::card_template #' @param constraint_list (`list`) a list containing constraint variables, including: #' - constraint_var (`character(1)`) the constraint variable name. From 5481ed8e4aff5636a8ab2fed305995a2a55ad628 Mon Sep 17 00:00:00 2001 From: "27856297+dependabot-preview[bot]@users.noreply.github.com" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:47:09 +0000 Subject: [PATCH 16/21] [skip actions] Roxygen Man Pages Auto Update --- man/report_card_template_goshawk.Rd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/man/report_card_template_goshawk.Rd b/man/report_card_template_goshawk.Rd index 61327193..c5101303 100644 --- a/man/report_card_template_goshawk.Rd +++ b/man/report_card_template_goshawk.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/utils.R \name{report_card_template_goshawk} \alias{report_card_template_goshawk} -\title{Template function to generate reporter card for \code{teal.goshawk}} +\title{Template Function for \code{TealReportCard} Creation and Customization in \code{teal.goshawk}} \usage{ report_card_template_goshawk( title, @@ -31,6 +31,8 @@ options: \code{default}, \code{verbatim} (default is \code{default}).} (\code{TealReportCard}) populated with a title, description, and filter state } \description{ -Template function to generate reporter card for \code{teal.goshawk} +This function generates a report card with a title, +an optional description, and the option to append the filter state list. +Additionally, it display selected constraint options. } \keyword{internal} From 11108d42e47a22e33a693924532fcb22e5e8aa57 Mon Sep 17 00:00:00 2001 From: kartikeyakirar Date: Thu, 12 Oct 2023 23:05:59 +0530 Subject: [PATCH 17/21] 'Empty-Commit' From 28a101a3902ab22a7f54dc5ddd0e5a26499e0fee Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Oct 2023 23:07:40 +0530 Subject: [PATCH 18/21] updating rd --- man/report_card_template_goshawk.Rd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/man/report_card_template_goshawk.Rd b/man/report_card_template_goshawk.Rd index c5101303..7172a59e 100644 --- a/man/report_card_template_goshawk.Rd +++ b/man/report_card_template_goshawk.Rd @@ -15,6 +15,15 @@ report_card_template_goshawk( ) } \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} + \item{constraint_list}{(\code{list}) a list containing constraint variables, including: \itemize{ \item constraint_var (\code{character(1)}) the constraint variable name. From aecdef4310793e756e8ca4fcd8e8bf6496d924bb Mon Sep 17 00:00:00 2001 From: "27856297+dependabot-preview[bot]@users.noreply.github.com" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 17:45:37 +0000 Subject: [PATCH 19/21] [skip actions] Roxygen Man Pages Auto Update --- man/report_card_template_goshawk.Rd | 9 --------- 1 file changed, 9 deletions(-) diff --git a/man/report_card_template_goshawk.Rd b/man/report_card_template_goshawk.Rd index 7172a59e..c5101303 100644 --- a/man/report_card_template_goshawk.Rd +++ b/man/report_card_template_goshawk.Rd @@ -15,15 +15,6 @@ report_card_template_goshawk( ) } \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} - \item{constraint_list}{(\code{list}) a list containing constraint variables, including: \itemize{ \item constraint_var (\code{character(1)}) the constraint variable name. From 97042baa38573a075d121976c8fe5b7248364572 Mon Sep 17 00:00:00 2001 From: kartikeyakirar Date: Thu, 12 Oct 2023 23:35:49 +0530 Subject: [PATCH 20/21] 'Empty-Commit' From b10f68768e7d3429d27daff2d88b65410a897f32 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Oct 2023 15:19:31 +0530 Subject: [PATCH 21/21] fixing linter issue. --- .lintr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.lintr b/.lintr index 34473d27..0a0bb22f 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 )