diff --git a/R/tm_g_pp_adverse_events.R b/R/tm_g_pp_adverse_events.R index 25f264c9c..aa4896de7 100644 --- a/R/tm_g_pp_adverse_events.R +++ b/R/tm_g_pp_adverse_events.R @@ -428,14 +428,16 @@ ui_g_adverse_events <- function(id, ...) { ) ), ui_decorate_teal_data(ns("d_plot"), decorators = select_decorators(ui_args$decorators, "plot")), - bslib::accordion_panel( - title = "Plot settings", + bslib::accordion( open = TRUE, - teal.widgets::optionalSliderInputValMinMax( - ns("font_size"), - "Font Size", - ui_args$font_size, - ticks = FALSE, step = 1 + bslib::accordion_panel( + title = "Plot settings", + teal.widgets::optionalSliderInputValMinMax( + ns("font_size"), + "Font Size", + ui_args$font_size, + ticks = FALSE, step = 1 + ) ) ) ), @@ -631,7 +633,7 @@ srv_g_adverse_events <- function(id, output$table <- DT::renderDataTable(table_r()[["html"]]) decorated_all_q <- reactive( -# warning because of https://github.com/insightsengineering/teal.modules.clinical/issues/1427 # nolint: line_length_linter. + suppressWarnings(c(table_q(), decorated_all_q_plot())) # warning because of https://github.com/insightsengineering/teal.modules.clinical/issues/1427 # nolint: line_length_linter. ) set_chunk_dims(pws, decorated_all_q) diff --git a/R/tm_g_pp_patient_timeline.R b/R/tm_g_pp_patient_timeline.R index 80df82f61..86678f3ae 100644 --- a/R/tm_g_pp_patient_timeline.R +++ b/R/tm_g_pp_patient_timeline.R @@ -701,15 +701,17 @@ ui_g_patient_timeline <- function(id, ...) { ) ), ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(ui_args$decorators, "plot")), - bslib::accordion_panel( - title = "Plot settings", + bslib::accordion( open = TRUE, - teal.widgets::optionalSliderInputValMinMax( - ns("font_size"), - "Font Size", - ui_args$font_size, - ticks = FALSE, - step = 1 + bslib::accordion_panel( + title = "Plot settings", + teal.widgets::optionalSliderInputValMinMax( + ns("font_size"), + "Font Size", + ui_args$font_size, + ticks = FALSE, + step = 1 + ) ) ) ), diff --git a/R/tm_g_pp_therapy.R b/R/tm_g_pp_therapy.R index 7faff1c2f..2fd74fc80 100644 --- a/R/tm_g_pp_therapy.R +++ b/R/tm_g_pp_therapy.R @@ -530,15 +530,17 @@ ui_g_therapy <- function(id, ...) { is_single_dataset = is_single_dataset_value ), ui_decorate_teal_data(ns("d_plot"), decorators = select_decorators(ui_args$decorators, "plot")), - bslib::accordion_panel( - title = "Plot settings", + bslib::accordion( open = TRUE, - teal.widgets::optionalSliderInputValMinMax( - ns("font_size"), - "Font Size", - ui_args$font_size, - ticks = FALSE, - step = 1 + bslib::accordion_panel( + title = "Plot settings", + teal.widgets::optionalSliderInputValMinMax( + ns("font_size"), + "Font Size", + ui_args$font_size, + ticks = FALSE, + step = 1 + ) ) ) ), diff --git a/R/tm_g_pp_vitals.R b/R/tm_g_pp_vitals.R index 80bbb88e4..4ea6279f1 100644 --- a/R/tm_g_pp_vitals.R +++ b/R/tm_g_pp_vitals.R @@ -394,12 +394,14 @@ ui_g_vitals <- function(id, ...) { is_single_dataset = is_single_dataset_value ), ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(ui_args$decorators, "plot")), - bslib::accordion_panel( - title = "Plot settings", + bslib::accordion( open = TRUE, - teal.widgets::optionalSliderInputValMinMax( - ns("font_size"), "Font Size", ui_args$font_size, - ticks = FALSE, step = 1 + bslib::accordion_panel( + title = "Plot settings", + teal.widgets::optionalSliderInputValMinMax( + ns("font_size"), "Font Size", ui_args$font_size, + ticks = FALSE, step = 1 + ) ) ) ), diff --git a/R/tm_t_binary_outcome.R b/R/tm_t_binary_outcome.R index 9499f877c..ff9448a61 100644 --- a/R/tm_t_binary_outcome.R +++ b/R/tm_t_binary_outcome.R @@ -721,44 +721,46 @@ ui_t_binary_outcome <- function(id, ...) { checkboxInput(ns("add_total"), "Add All Patients column", value = a$add_total) ), ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(a$decorators, "table")), - bslib::accordion_panel( - "Additional table settings", + bslib::accordion( open = TRUE, - teal.widgets::optionalSelectInput( - inputId = ns("prop_ci_method"), - label = "Method for Proportion CI", - choices = c( - "Wald, without correction" = "wald", - "Wald, with correction" = "waldcc", - "Clopper-Pearson" = "clopper-pearson", - "Wilson" = "wilson", - "Wilson, with correction" = "wilsonc", - "Jeffreys" = "jeffreys", - "Agresti-Coull" = "agresti-coull" + bslib::accordion_panel( + "Additional table settings", + teal.widgets::optionalSelectInput( + inputId = ns("prop_ci_method"), + label = "Method for Proportion CI", + choices = c( + "Wald, without correction" = "wald", + "Wald, with correction" = "waldcc", + "Clopper-Pearson" = "clopper-pearson", + "Wilson" = "wilson", + "Wilson, with correction" = "wilsonc", + "Jeffreys" = "jeffreys", + "Agresti-Coull" = "agresti-coull" + ), + selected = a$control$global$method, + multiple = FALSE, + fixed = FALSE ), - selected = a$control$global$method, - multiple = FALSE, - fixed = FALSE - ), - teal.widgets::optionalSelectInput( - inputId = ns("conf_level"), - label = "Confidence Level", - a$conf_level$choices, - a$conf_level$selected, - multiple = FALSE, - fixed = a$conf_level$fixed + teal.widgets::optionalSelectInput( + inputId = ns("conf_level"), + label = "Confidence Level", + a$conf_level$choices, + a$conf_level$selected, + multiple = FALSE, + fixed = a$conf_level$fixed + ), + bslib::input_switch( + id = ns("show_rsp_cat"), + label = "Show All Response Categories", + value = ifelse(a$rsp_table, TRUE, FALSE) + ) ), - bslib::input_switch( - id = ns("show_rsp_cat"), - label = "Show All Response Categories", - value = ifelse(a$rsp_table, TRUE, FALSE) + teal.transform::data_extract_ui( + id = ns("aval_var"), + label = "Analysis Variable", + data_extract_spec = a$aval_var, + is_single_dataset = is_single_dataset_value ) - ), - teal.transform::data_extract_ui( - id = ns("aval_var"), - label = "Analysis Variable", - data_extract_spec = a$aval_var, - is_single_dataset = is_single_dataset_value ) ), pre_output = a$pre_output, diff --git a/R/tm_t_events.R b/R/tm_t_events.R index 623e9766c..ec591664c 100644 --- a/R/tm_t_events.R +++ b/R/tm_t_events.R @@ -636,42 +636,44 @@ ui_t_events_byterm <- function(id, ...) { ), checkboxInput(ns("add_total"), "Add All Patients columns", value = a$add_total), ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(a$decorators, "table")), - bslib::accordion_panel( - "Additional table settings", + bslib::accordion( open = TRUE, - checkboxInput( - ns("drop_arm_levels"), - label = "Drop columns not in filtered analysis dataset", - value = a$drop_arm_levels - ), - selectInput( - inputId = ns("sort_criteria"), - label = "Sort Criteria", - choices = c( - "Decreasing frequency" = "freq_desc", - "Alphabetically" = "alpha" + bslib::accordion_panel( + "Additional table settings", + checkboxInput( + ns("drop_arm_levels"), + label = "Drop columns not in filtered analysis dataset", + value = a$drop_arm_levels ), - selected = a$sort_criteria, - multiple = FALSE - ), - helpText(tags$strong("Pruning Options:")), - numericInput( - inputId = ns("prune_freq"), - label = "Minimum Incidence Rate(%) in any of the treatment groups", - value = a$prune_freq, - min = 0, - max = 100, - step = 1, - width = "100%" - ), - numericInput( - inputId = ns("prune_diff"), - label = "Minimum Difference Rate(%) between any of the treatment groups", - value = a$prune_diff, - min = 0, - max = 100, - step = 1, - width = "100%" + selectInput( + inputId = ns("sort_criteria"), + label = "Sort Criteria", + choices = c( + "Decreasing frequency" = "freq_desc", + "Alphabetically" = "alpha" + ), + selected = a$sort_criteria, + multiple = FALSE + ), + helpText(tags$strong("Pruning Options:")), + numericInput( + inputId = ns("prune_freq"), + label = "Minimum Incidence Rate(%) in any of the treatment groups", + value = a$prune_freq, + min = 0, + max = 100, + step = 1, + width = "100%" + ), + numericInput( + inputId = ns("prune_diff"), + label = "Minimum Difference Rate(%) between any of the treatment groups", + value = a$prune_diff, + min = 0, + max = 100, + step = 1, + width = "100%" + ) ) ) ), diff --git a/R/tm_t_glm_counts.R b/R/tm_t_glm_counts.R index 2ba3af009..7364436af 100644 --- a/R/tm_t_glm_counts.R +++ b/R/tm_t_glm_counts.R @@ -211,17 +211,21 @@ ui_t_glm_counts <- function(id, ...) { ) ) - table_settings <- bslib::accordion_panel( - "Additional table settings", - teal.widgets::optionalSelectInput( - inputId = ns("conf_level"), - label = "Confidence Level", - choices = c(0.8, 0.9, 0.95), - selected = 0.95, - multiple = FALSE, - fixed = FALSE - ), + table_settings <- shiny::tagList( ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(a$decorators, "table")), + bslib::accordion( + bslib::accordion_panel( + "Additional table settings", + teal.widgets::optionalSelectInput( + inputId = ns("conf_level"), + label = "Confidence Level", + choices = c(0.8, 0.9, 0.95), + selected = 0.95, + multiple = FALSE, + fixed = FALSE + ), + ) + ) ) teal.widgets::standard_layout( @@ -269,7 +273,7 @@ ui_t_glm_counts <- function(id, ...) { "Rate method", choices = a$rate_mean_method ), - table_settings, + table_settings ), pre_output = a$pre_output, post_output = a$post_output diff --git a/R/tm_t_tte.R b/R/tm_t_tte.R index 6b9d71f17..2ebfb4d85 100644 --- a/R/tm_t_tte.R +++ b/R/tm_t_tte.R @@ -11,20 +11,21 @@ #' #' @keywords internal control_tte <- function( - surv_time = list( - conf_level = 0.95, - conf_type = "plain", - quantiles = c(0.25, 0.75) - ), - coxph = list( - pval_method = "log-rank", - ties = "efron", - conf_level = 0.95 - ), - surv_timepoint = tern::control_surv_timepoint( - conf_level = 0.95, - conf_type = c("plain", "none", "log", "log-log") - )) { + surv_time = list( + conf_level = 0.95, + conf_type = "plain", + quantiles = c(0.25, 0.75) + ), + coxph = list( + pval_method = "log-rank", + ties = "efron", + conf_level = 0.95 + ), + surv_timepoint = tern::control_surv_timepoint( + conf_level = 0.95, + conf_type = c("plain", "none", "log", "log-log") + ) +) { list( surv_time = do.call("control_surv_time", surv_time, envir = getNamespace("tern")), coxph = do.call("control_coxph", coxph, envir = getNamespace("tern")), @@ -714,43 +715,45 @@ ui_t_tte <- function(id, ...) { ) ) ), - bslib::accordion_panel( - "Additional table settings", + bslib::accordion( open = TRUE, - teal.widgets::optionalSelectInput( - inputId = ns("conf_level_survfit"), - label = HTML( - paste( - "Confidence Level for ", - tags$span(class = "text-primary", "Survfit"), - " (KM Median Estimate & Event Free Rate)", - sep = "" - ) + bslib::accordion_panel( + "Additional table settings", + teal.widgets::optionalSelectInput( + inputId = ns("conf_level_survfit"), + label = HTML( + paste( + "Confidence Level for ", + tags$span(class = "text-primary", "Survfit"), + " (KM Median Estimate & Event Free Rate)", + sep = "" + ) + ), + a$conf_level_survfit$choices, + a$conf_level_survfit$selected, + multiple = FALSE, + fixed = a$conf_level_survfit$fixed ), - a$conf_level_survfit$choices, - a$conf_level_survfit$selected, - multiple = FALSE, - fixed = a$conf_level_survfit$fixed - ), - radioButtons( - ns("conf_type_survfit"), - "Confidence Level Type for Survfit", - choices = c("plain", "log", "log-log"), - selected = "plain" - ), - sliderInput( - inputId = ns("probs_survfit"), - label = "KM Estimate Percentiles", - min = 0.01, - max = 0.99, - value = c(0.25, 0.75), - width = "100%" - ), - teal.transform::data_extract_ui( - id = ns("time_unit_var"), - label = "Time Unit Variable", - data_extract_spec = a$time_unit_var, - is_single_dataset = is_single_dataset_value + radioButtons( + ns("conf_type_survfit"), + "Confidence Level Type for Survfit", + choices = c("plain", "log", "log-log"), + selected = "plain" + ), + sliderInput( + inputId = ns("probs_survfit"), + label = "KM Estimate Percentiles", + min = 0.01, + max = 0.99, + value = c(0.25, 0.75), + width = "100%" + ), + teal.transform::data_extract_ui( + id = ns("time_unit_var"), + label = "Time Unit Variable", + data_extract_spec = a$time_unit_var, + is_single_dataset = is_single_dataset_value + ) ) ), ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(a$decorators, "table")),