diff --git a/DESCRIPTION b/DESCRIPTION index 9135fe524..eb8039913 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: teal.slice Title: Filter Module for 'teal' Applications -Version: 0.5.0.9004 -Date: 2024-02-29 +Version: 0.5.0.9007 +Date: 2024-03-18 Authors@R: c( person("Dawid", "Kaledkowski", , "dawid.kaledkowski@roche.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-9533-457X")), diff --git a/NEWS.md b/NEWS.md index 1c7630131..492bfde6f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# teal.slice 0.5.0.9004 +# teal.slice 0.5.0.9007 # teal.slice 0.5.0 diff --git a/R/FilterState.R b/R/FilterState.R index 972c260b4..6e1e0d486 100644 --- a/R/FilterState.R +++ b/R/FilterState.R @@ -296,16 +296,16 @@ FilterState <- R6::R6Class( # nolint ### Title consists of conditional icon, varname, conditional varlabel, and controls, arranged in a row. ### Summary consists of value and controls, arranged in a row. - div( + tags$div( id = id, class = "panel filter-card", include_js_files("count-bar-labels.js"), - div( + tags$div( class = "filter-card-header", `data-toggle` = "collapse", `data-bs-toggle` = "collapse", href = paste0("#", ns("body")), - div( + tags$div( class = "filter-card-title", if (private$is_anchored() && private$is_fixed()) { icon("anchor-lock", class = "filter-card-icon") @@ -314,9 +314,9 @@ FilterState <- R6::R6Class( # nolint } else if (!private$is_anchored() && private$is_fixed()) { icon("lock", class = "filter-card-icon") }, - div(class = "filter-card-varname", strong(private$get_varname())), - div(class = "filter-card-varlabel", private$get_varlabel()), - div( + tags$div(class = "filter-card-varname", tags$strong(private$get_varname())), + tags$div(class = "filter-card-varlabel", private$get_varlabel()), + tags$div( class = "filter-card-controls", # Suppress toggling body when clicking on this div. # This is for bootstrap 3 and 4. Causes page to scroll to top, prevented by setting href on buttons. @@ -354,14 +354,14 @@ FilterState <- R6::R6Class( # nolint } ) ), - div(class = "filter-card-summary", private$ui_summary(ns("summary"))) + tags$div(class = "filter-card-summary", private$ui_summary(ns("summary"))) ), - div( + tags$div( id = ns("body"), class = "collapse out", `data-parent` = paste0("#", parent_id), `data-bs-parent` = paste0("#", parent_id), - div( + tags$div( class = "filter-card-body", if (private$is_fixed()) { private$ui_inputs_fixed(ns("inputs")) @@ -692,7 +692,7 @@ FilterState <- R6::R6Class( # nolint # @param id (`character(1)`) `shiny` module instance id. ui_inputs_fixed = function(id) { ns <- NS(id) - div( + tags$div( class = "choices_state", uiOutput(ns("selection")) ) @@ -717,7 +717,7 @@ FilterState <- R6::R6Class( # nolint countnow <- private$filtered_na_count() ui_input <- checkboxInput( inputId = ns("value"), - label = span( + label = tags$span( id = ns("count_label"), make_count_text( label = "Keep NA", @@ -727,7 +727,7 @@ FilterState <- R6::R6Class( # nolint ), value = private$get_keep_na() ) - div( + tags$div( uiOutput(ns("trigger_visible"), inline = TRUE), ui_input ) diff --git a/R/FilterStateChoices.R b/R/FilterStateChoices.R index 963ce93b8..246d70e3a 100644 --- a/R/FilterStateChoices.R +++ b/R/FilterStateChoices.R @@ -46,25 +46,25 @@ #' useShinyjs(), #' include_css_files(pattern = "filter-panel"), #' include_js_files(pattern = "count-bar-labels"), -#' column(4, div( -#' h4("ChoicesFilterState"), +#' column(4, tags$div( +#' tags$h4("ChoicesFilterState"), #' fs$ui("fs") #' )), -#' column(4, div( -#' h4("Condition (i.e. call)"), # display the condition call generated by this FilterState -#' textOutput("condition_choices"), br(), -#' h4("Unformatted state"), # display raw filter state -#' textOutput("unformatted_choices"), br(), -#' h4("Formatted state"), # display human readable filter state -#' textOutput("formatted_choices"), br() +#' column(4, tags$div( +#' tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState +#' textOutput("condition_choices"), tags$br(), +#' tags$h4("Unformatted state"), # display raw filter state +#' textOutput("unformatted_choices"), tags$br(), +#' tags$h4("Formatted state"), # display human readable filter state +#' textOutput("formatted_choices"), tags$br() #' )), -#' column(4, div( -#' h4("Programmatic filter control"), -#' actionButton("button1_choices", "set drop NA", width = "100%"), br(), -#' actionButton("button2_choices", "set keep NA", width = "100%"), br(), -#' actionButton("button3_choices", "set selection: a, b", width = "100%"), br(), -#' actionButton("button4_choices", "deselect all", width = "100%"), br(), -#' actionButton("button0_choices", "set initial state", width = "100%"), br() +#' column(4, tags$div( +#' tags$h4("Programmatic filter control"), +#' actionButton("button1_choices", "set drop NA", width = "100%"), tags$br(), +#' actionButton("button2_choices", "set keep NA", width = "100%"), tags$br(), +#' actionButton("button3_choices", "set selection: a, b", width = "100%"), tags$br(), +#' actionButton("button4_choices", "deselect all", width = "100%"), tags$br(), +#' actionButton("button0_choices", "set initial state", width = "100%"), tags$br() #' )) #' ) #' @@ -374,7 +374,7 @@ ChoicesFilterState <- R6::R6Class( # nolint countsnow = countsnow, countsmax = countsmax ) - div( + tags$div( class = "choices_state", if (private$is_multiple()) { checkboxGroupInput( @@ -416,7 +416,7 @@ ChoicesFilterState <- R6::R6Class( # nolint ) ) } - div( + tags$div( uiOutput(ns("trigger_visible")), ui_input, private$keep_na_ui(ns("keep_na")) diff --git a/R/FilterStateDate.R b/R/FilterStateDate.R index 05e9b7b93..d6d7b7b53 100644 --- a/R/FilterStateDate.R +++ b/R/FilterStateDate.R @@ -47,26 +47,26 @@ #' useShinyjs(), #' include_css_files(pattern = "filter-panel"), #' include_js_files(pattern = "count-bar-labels"), -#' column(4, div( -#' h4("DateFilterState"), +#' column(4, tags$div( +#' tags$h4("DateFilterState"), #' fs$ui("fs") #' )), -#' column(4, div( +#' column(4, tags$div( #' id = "outputs", # div id is needed for toggling the element -#' h4("Condition (i.e. call)"), # display the condition call generated by this FilterState -#' textOutput("condition_date"), br(), -#' h4("Unformatted state"), # display raw filter state -#' textOutput("unformatted_date"), br(), -#' h4("Formatted state"), # display human readable filter state -#' textOutput("formatted_date"), br() +#' tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState +#' textOutput("condition_date"), tags$br(), +#' tags$h4("Unformatted state"), # display raw filter state +#' textOutput("unformatted_date"), tags$br(), +#' tags$h4("Formatted state"), # display human readable filter state +#' textOutput("formatted_date"), tags$br() #' )), -#' column(4, div( -#' h4("Programmatic filter control"), -#' actionButton("button1_date", "set drop NA", width = "100%"), br(), -#' actionButton("button2_date", "set keep NA", width = "100%"), br(), -#' actionButton("button3_date", "set a range", width = "100%"), br(), -#' actionButton("button4_date", "set full range", width = "100%"), br(), -#' actionButton("button0_date", "set initial state", width = "100%"), br() +#' column(4, tags$div( +#' tags$h4("Programmatic filter control"), +#' actionButton("button1_date", "set drop NA", width = "100%"), tags$br(), +#' actionButton("button2_date", "set keep NA", width = "100%"), tags$br(), +#' actionButton("button3_date", "set a range", width = "100%"), tags$br(), +#' actionButton("button4_date", "set full range", width = "100%"), tags$br(), +#' actionButton("button0_date", "set initial state", width = "100%"), tags$br() #' )) #' ) #' @@ -278,8 +278,8 @@ DateFilterState <- R6::R6Class( # nolint ui_inputs = function(id) { ns <- NS(id) isolate({ - div( - div( + tags$div( + tags$div( class = "flex", actionButton( class = "date_reset_button", @@ -287,7 +287,7 @@ DateFilterState <- R6::R6Class( # nolint label = NULL, icon = icon("fas fa-undo") ), - div( + tags$div( class = "w-80 filter_datelike_input", dateRangeInput( inputId = ns("selection"), @@ -402,9 +402,9 @@ DateFilterState <- R6::R6Class( # nolint output$selection <- renderUI({ vals <- format(private$get_selected(), nsmall = 3) - div( - div(icon("calendar-days"), vals[1]), - div(span(" - "), icon("calendar-days"), vals[2]) + tags$div( + tags$div(icon("calendar-days"), vals[1]), + tags$div(span(" - "), icon("calendar-days"), vals[2]) ) }) diff --git a/R/FilterStateDatettime.R b/R/FilterStateDatettime.R index eb29379d2..f035dfe79 100644 --- a/R/FilterStateDatettime.R +++ b/R/FilterStateDatettime.R @@ -47,26 +47,26 @@ #' useShinyjs(), #' include_css_files(pattern = "filter-panel"), #' include_js_files(pattern = "count-bar-labels"), -#' column(4, div( -#' h4("DatetimeFilterState"), +#' column(4, tags$div( +#' tags$h4("DatetimeFilterState"), #' fs$ui("fs") #' )), -#' column(4, div( +#' column(4, tags$div( #' id = "outputs", # div id is needed for toggling the element -#' h4("Condition (i.e. call)"), # display the condition call generated by this FilterState -#' textOutput("condition_datetime"), br(), -#' h4("Unformatted state"), # display raw filter state -#' textOutput("unformatted_datetime"), br(), -#' h4("Formatted state"), # display human readable filter state -#' textOutput("formatted_datetime"), br() +#' tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState +#' textOutput("condition_datetime"), tags$br(), +#' tags$h4("Unformatted state"), # display raw filter state +#' textOutput("unformatted_datetime"), tags$br(), +#' tags$h4("Formatted state"), # display human readable filter state +#' textOutput("formatted_datetime"), tags$br() #' )), -#' column(4, div( -#' h4("Programmatic filter control"), -#' actionButton("button1_datetime", "set drop NA", width = "100%"), br(), -#' actionButton("button2_datetime", "set keep NA", width = "100%"), br(), -#' actionButton("button3_datetime", "set a range", width = "100%"), br(), -#' actionButton("button4_datetime", "set full range", width = "100%"), br(), -#' actionButton("button0_datetime", "set initial state", width = "100%"), br() +#' column(4, tags$div( +#' tags$h4("Programmatic filter control"), +#' actionButton("button1_datetime", "set drop NA", width = "100%"), tags$br(), +#' actionButton("button2_datetime", "set keep NA", width = "100%"), tags$br(), +#' actionButton("button3_datetime", "set a range", width = "100%"), tags$br(), +#' actionButton("button4_datetime", "set full range", width = "100%"), tags$br(), +#' actionButton("button0_datetime", "set initial state", width = "100%"), tags$br() #' )) #' ) #' @@ -355,19 +355,19 @@ DatetimeFilterState <- R6::R6Class( # nolint ui_input_1$children[[2]]$attribs <- c(ui_input_1$children[[2]]$attribs, list(class = "input-sm")) ui_input_2$children[[2]]$attribs <- c(ui_input_2$children[[2]]$attribs, list(class = "input-sm")) - div( - div( + tags$div( + tags$div( class = "flex", ui_reset_1, - div( + tags$div( class = "flex w-80 filter_datelike_input", - div(class = "w-45 text-center", ui_input_1), - span( + tags$div(class = "w-45 text-center", ui_input_1), + tags$span( class = "input-group-addon w-10", - span(class = "input-group-text w-100 justify-content-center", "to"), + tags$span(class = "input-group-text w-100 justify-content-center", "to"), title = "Times are displayed in the local timezone and are converted to UTC in the analysis" ), - div(class = "w-45 text-center", ui_input_2) + tags$div(class = "w-45 text-center", ui_input_2) ), ui_reset_2 ), @@ -515,9 +515,9 @@ DatetimeFilterState <- R6::R6Class( # nolint output$selection <- renderUI({ vals <- format(private$get_selected(), usetz = TRUE, nsmall = 3) - div( - div(icon("clock"), vals[1]), - div(span(" - "), icon("clock"), vals[2]) + tags$div( + tags$div(icon("clock"), vals[1]), + tags$div(span(" - "), icon("clock"), vals[2]) ) }) diff --git a/R/FilterStateEmpty.R b/R/FilterStateEmpty.R index e7d7118dd..841b14add 100644 --- a/R/FilterStateEmpty.R +++ b/R/FilterStateEmpty.R @@ -128,7 +128,7 @@ EmptyFilterState <- R6::R6Class( # nolint ui_inputs = function(id) { ns <- NS(id) isolate({ - div( + tags$div( tags$span("Variable contains missing values only"), private$keep_na_ui(ns("keep_na")) ) diff --git a/R/FilterStateExpr.R b/R/FilterStateExpr.R index d591ce5b1..0a77a5662 100644 --- a/R/FilterStateExpr.R +++ b/R/FilterStateExpr.R @@ -36,17 +36,17 @@ #' useShinyjs(), #' include_css_files(pattern = "filter-panel"), #' include_js_files(pattern = "count-bar-labels"), -#' column(4, div( -#' h4("ChoicesFilterState"), +#' column(4, tags$div( +#' tags$h4("ChoicesFilterState"), #' filter_state$ui("fs") #' )), -#' column(8, div( -#' h4("Condition (i.e. call)"), # display the condition call generated by this FilterState -#' textOutput("condition_choices"), br(), -#' h4("Unformatted state"), # display raw filter state -#' textOutput("unformatted_choices"), br(), -#' h4("Formatted state"), # display human readable filter state -#' textOutput("formatted_choices"), br() +#' column(8, tags$div( +#' tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState +#' textOutput("condition_choices"), tags$br(), +#' tags$h4("Unformatted state"), # display raw filter state +#' textOutput("unformatted_choices"), tags$br(), +#' tags$h4("Formatted state"), # display human readable filter state +#' textOutput("formatted_choices"), tags$br() #' )) #' ) #' @@ -204,9 +204,9 @@ FilterStateExpr <- R6::R6Class( # nolint } else { icon("lock", class = "filter-card-icon") }, - div(class = "filter-card-varname", tags$strong(private$teal_slice$id)), - div(class = "filter-card-varlabel", private$teal_slice$title), - div( + tags$div(class = "filter-card-varname", tags$strong(private$teal_slice$id)), + tags$div(class = "filter-card-varlabel", private$teal_slice$title), + tags$div( class = "filter-card-controls", if (isFALSE(private$is_anchored())) { actionLink( diff --git a/R/FilterStateLogical.R b/R/FilterStateLogical.R index 00bd9be26..c22888ce7 100644 --- a/R/FilterStateLogical.R +++ b/R/FilterStateLogical.R @@ -38,25 +38,25 @@ #' useShinyjs(), #' include_css_files(pattern = "filter-panel"), #' include_js_files(pattern = "count-bar-labels"), -#' column(4, div( -#' h4("LogicalFilterState"), +#' column(4, tags$div( +#' tags$h4("LogicalFilterState"), #' fs$ui("fs") #' )), -#' column(4, div( +#' column(4, tags$div( #' id = "outputs", # div id is needed for toggling the element -#' h4("Condition (i.e. call)"), # display the condition call generated by this FilterState -#' textOutput("condition_logical"), br(), -#' h4("Unformatted state"), # display raw filter state -#' textOutput("unformatted_logical"), br(), -#' h4("Formatted state"), # display human readable filter state -#' textOutput("formatted_logical"), br() +#' tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState +#' textOutput("condition_logical"), tags$br(), +#' tags$h4("Unformatted state"), # display raw filter state +#' textOutput("unformatted_logical"), tags$br(), +#' tags$h4("Formatted state"), # display human readable filter state +#' textOutput("formatted_logical"), tags$br() #' )), -#' column(4, div( -#' h4("Programmatic filter control"), -#' actionButton("button1_logical", "set drop NA", width = "100%"), br(), -#' actionButton("button2_logical", "set keep NA", width = "100%"), br(), -#' actionButton("button3_logical", "set a selection", width = "100%"), br(), -#' actionButton("button0_logical", "set initial state", width = "100%"), br() +#' column(4, tags$div( +#' tags$h4("Programmatic filter control"), +#' actionButton("button1_logical", "set drop NA", width = "100%"), tags$br(), +#' actionButton("button2_logical", "set keep NA", width = "100%"), tags$br(), +#' actionButton("button3_logical", "set a selection", width = "100%"), tags$br(), +#' actionButton("button0_logical", "set initial state", width = "100%"), tags$br() #' )) #' ) #' @@ -272,8 +272,8 @@ LogicalFilterState <- R6::R6Class( # nolint width = "100%" ) } - div( - div( + tags$div( + tags$div( class = "choices_state", uiOutput(ns("trigger_visible"), inline = TRUE), ui_input diff --git a/R/FilterStateRange.R b/R/FilterStateRange.R index 456917e06..7b1256ae5 100644 --- a/R/FilterStateRange.R +++ b/R/FilterStateRange.R @@ -50,28 +50,28 @@ #' useShinyjs(), #' include_css_files(pattern = "filter-panel"), #' include_js_files(pattern = "count-bar-labels"), -#' column(4, div( -#' h4("RangeFilterState"), +#' column(4, tags$div( +#' tags$h4("RangeFilterState"), #' fs$ui("fs") #' )), -#' column(4, div( +#' column(4, tags$div( #' id = "outputs", # div id is needed for toggling the element -#' h4("Condition (i.e. call)"), # display the condition call generated by this FilterState -#' textOutput("condition_range"), br(), -#' h4("Unformatted state"), # display raw filter state -#' textOutput("unformatted_range"), br(), -#' h4("Formatted state"), # display human readable filter state -#' textOutput("formatted_range"), br() +#' tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState +#' textOutput("condition_range"), tags$br(), +#' tags$h4("Unformatted state"), # display raw filter state +#' textOutput("unformatted_range"), tags$br(), +#' tags$h4("Formatted state"), # display human readable filter state +#' textOutput("formatted_range"), tags$br() #' )), -#' column(4, div( -#' h4("Programmatic filter control"), -#' actionButton("button1_range", "set drop NA", width = "100%"), br(), -#' actionButton("button2_range", "set keep NA", width = "100%"), br(), -#' actionButton("button3_range", "set drop Inf", width = "100%"), br(), -#' actionButton("button4_range", "set keep Inf", width = "100%"), br(), -#' actionButton("button5_range", "set a range", width = "100%"), br(), -#' actionButton("button6_range", "set full range", width = "100%"), br(), -#' actionButton("button0_range", "set initial state", width = "100%"), br() +#' column(4, tags$div( +#' tags$h4("Programmatic filter control"), +#' actionButton("button1_range", "set drop NA", width = "100%"), tags$br(), +#' actionButton("button2_range", "set keep NA", width = "100%"), tags$br(), +#' actionButton("button3_range", "set drop Inf", width = "100%"), tags$br(), +#' actionButton("button4_range", "set keep Inf", width = "100%"), tags$br(), +#' actionButton("button5_range", "set a range", width = "100%"), tags$br(), +#' actionButton("button6_range", "set full range", width = "100%"), tags$br(), +#' actionButton("button0_range", "set initial state", width = "100%"), tags$br() #' )) #' ) #' @@ -417,7 +417,7 @@ RangeFilterState <- R6::R6Class( # nolint width = "100%" ) tagList( - div( + tags$div( class = "choices_state", tags$head(tags$script( # Inline JS code for popover functionality. @@ -437,7 +437,7 @@ RangeFilterState <- R6::R6Class( # nolint });' ) )), - div( + tags$div( actionLink( ns("plotly_info"), label = NULL, @@ -463,7 +463,7 @@ RangeFilterState <- R6::R6Class( # nolint ), ui_input ), - div( + tags$div( class = "filter-card-body-keep-na-inf", private$keep_inf_ui(ns("keep_inf")), private$keep_na_ui(ns("keep_na")) @@ -675,7 +675,7 @@ RangeFilterState <- R6::R6Class( # nolint ), value = isolate(private$get_keep_inf()) ) - div( + tags$div( uiOutput(ns("trigger_visible"), inline = TRUE), ui_input ) diff --git a/R/FilterStates-utils.R b/R/FilterStates-utils.R index 4ac58dbbc..bf77df0cb 100644 --- a/R/FilterStates-utils.R +++ b/R/FilterStates-utils.R @@ -10,9 +10,9 @@ #' @param dataname (`character(1)`) #' name of the data used in the subset expression, #' passed to the function argument attached to this `FilterStates`. -#' @param datalabel (`character(1)`) -#' optional text label. -#' @param ... (optional) +#' @param datalabel (`character(1)`) optional +#' text label. +#' @param ... optional, #' additional arguments for specific classes: keys. #' #' @return Object of class `FilterStates`. @@ -35,7 +35,7 @@ #' #' library(shiny) #' ui <- fluidPage( -#' actionButton("clear", span(icon("xmark"), "Remove all filters")), +#' actionButton("clear", tags$span(icon("xmark"), "Remove all filters")), #' rf$ui_add(id = "add"), #' rf$ui_active("states"), #' verbatimTextOutput("expr"), diff --git a/R/FilterStates.R b/R/FilterStates.R index bdd6ec418..2c88188ef 100644 --- a/R/FilterStates.R +++ b/R/FilterStates.R @@ -40,8 +40,8 @@ FilterStates <- R6::R6Class( # nolint #' @param dataname (`character(1)`) #' name of the dataset, used in the subset expression. #' Passed to the function argument attached to this `FilterStates`. - #' @param datalabel (`character(1)`) - #' optional text label. + #' @param datalabel (`character(1)`) optional + #' text label. #' #' @return #' Object of class `FilterStates`, invisibly. @@ -407,9 +407,9 @@ FilterStates <- R6::R6Class( # nolint ns <- NS(id) if (ncol(data) == 0) { - div("no sample variables available") + tags$div("no sample variables available") } else if (nrow(data) == 0) { - div("no samples available") + tags$div("no samples available") } else { uiOutput(ns("add_filter")) } @@ -454,9 +454,9 @@ FilterStates <- R6::R6Class( # nolint "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }" ) if (length(avail_column_choices()) == 0) { - span("No available columns to add.") + tags$span("No available columns to add.") } else { - div( + tags$div( teal.widgets::optionalSelectInput( session$ns("var_to_add"), choices = avail_column_choices(), diff --git a/R/FilterStatesDF.R b/R/FilterStatesDF.R index ba4579651..0410463c9 100644 --- a/R/FilterStatesDF.R +++ b/R/FilterStatesDF.R @@ -46,35 +46,35 @@ #' useShinyjs(), #' include_css_files(pattern = "filter-panel"), #' include_js_files(pattern = "count-bar-labels"), -#' column(4, div( -#' h4("Active filters"), +#' column(4, tags$div( +#' tags$h4("Active filters"), #' filter_states_df$ui_active("fsdf") #' )), -#' column(4, div( -#' h4("Manual filter control"), -#' filter_states_df$ui_add("add_filters"), br(), -#' h4("Condition (i.e. call)"), # display the subset expression generated by this FilterStates -#' textOutput("call_df"), br(), -#' h4("Formatted state"), # display human readable filter state -#' textOutput("formatted_df"), br() +#' column(4, tags$div( +#' tags$h4("Manual filter control"), +#' filter_states_df$ui_add("add_filters"), tags$br(), +#' tags$h4("Condition (i.e. call)"), # display the subset expression generated by this FilterStates +#' textOutput("call_df"), tags$br(), +#' tags$h4("Formatted state"), # display human readable filter state +#' textOutput("formatted_df"), tags$br() #' )), -#' column(4, div( -#' h4("Programmatic filter control"), -#' actionButton("button1_df", "set NUM1 < 30", width = "100%"), br(), -#' actionButton("button2_df", "set NUM2 %in% c(20, 21)", width = "100%"), br(), -#' actionButton("button3_df", "set CHAR1 %in% c(\"B\", \"C\", \"D\")", width = "100%"), br(), -#' actionButton("button4_df", "set CHAR2 == \"F\"", width = "100%"), br(), -#' actionButton("button5_df", "set DATE <= 2020-02-02", width = "100%"), br(), -#' actionButton("button6_df", "set DATETIME <= 2020-02-02", width = "100%"), br(), -#' hr(), -#' actionButton("button7_df", "remove NUM1", width = "100%"), br(), -#' actionButton("button8_df", "remove NUM2", width = "100%"), br(), -#' actionButton("button9_df", "remove CHAR1", width = "100%"), br(), -#' actionButton("button10_df", "remove CHAR2", width = "100%"), br(), -#' actionButton("button11_df", "remove DATE", width = "100%"), br(), -#' actionButton("button12_df", "remove DATETIME", width = "100%"), br(), -#' hr(), -#' actionButton("button0_df", "clear all filters", width = "100%"), br() +#' column(4, tags$div( +#' tags$h4("Programmatic filter control"), +#' actionButton("button1_df", "set NUM1 < 30", width = "100%"), tags$br(), +#' actionButton("button2_df", "set NUM2 %in% c(20, 21)", width = "100%"), tags$br(), +#' actionButton("button3_df", "set CHAR1 %in% c(\"B\", \"C\", \"D\")", width = "100%"), tags$br(), +#' actionButton("button4_df", "set CHAR2 == \"F\"", width = "100%"), tags$br(), +#' actionButton("button5_df", "set DATE <= 2020-02-02", width = "100%"), tags$br(), +#' actionButton("button6_df", "set DATETIME <= 2020-02-02", width = "100%"), tags$br(), +#' tags$hr(), +#' actionButton("button7_df", "remove NUM1", width = "100%"), tags$br(), +#' actionButton("button8_df", "remove NUM2", width = "100%"), tags$br(), +#' actionButton("button9_df", "remove CHAR1", width = "100%"), tags$br(), +#' actionButton("button10_df", "remove CHAR2", width = "100%"), tags$br(), +#' actionButton("button11_df", "remove DATE", width = "100%"), tags$br(), +#' actionButton("button12_df", "remove DATETIME", width = "100%"), tags$br(), +#' tags$hr(), +#' actionButton("button0_df", "clear all filters", width = "100%"), tags$br() #' )) #' ) #' @@ -174,8 +174,8 @@ DFFilterStates <- R6::R6Class( # nolint #' @param dataname (`character`) #' name of the data used in the *subset expression*. #' Passed to the function argument attached to this `FilterStates`. - #' @param datalabel (`character(1)`) - #' optional text label. + #' @param datalabel (`character(1)`) optional + #' text label. #' @param keys (`character`) #' key column names. #' diff --git a/R/FilterStatesMAE.R b/R/FilterStatesMAE.R index 63106182e..a408c0b60 100644 --- a/R/FilterStatesMAE.R +++ b/R/FilterStatesMAE.R @@ -24,8 +24,8 @@ MAEFilterStates <- R6::R6Class( # nolint #' @param dataname (`character(1)`) #' name of the data used in the subset expression. #' Passed to the function argument attached to this `FilterStates`. - #' @param datalabel (`character(1)`) - #' optional text label. + #' @param datalabel (`character(1)`) optional + #' text label. #' @param varlabels (`character`) #' labels of the variables used in this object. #' @param keys (`character`) diff --git a/R/FilterStatesMatrix.R b/R/FilterStatesMatrix.R index 4392d8d2e..776c1bbc9 100644 --- a/R/FilterStatesMatrix.R +++ b/R/FilterStatesMatrix.R @@ -25,8 +25,8 @@ MatrixFilterStates <- R6::R6Class( # nolint #' @param dataname (`character(1)`) #' name of the data used in the subset expression. #' Passed to the function argument attached to this `FilterStates`. - #' @param datalabel (`character(1)`) - #' Optional text label. Should be a name of experiment. + #' @param datalabel (`character(1)`) optional + #' text label. Should be a name of experiment. #' initialize = function(data, data_reactive = function(sid = "") NULL, diff --git a/R/FilterStatesSE.R b/R/FilterStatesSE.R index a860c1747..6038ff8bc 100644 --- a/R/FilterStatesSE.R +++ b/R/FilterStatesSE.R @@ -25,8 +25,8 @@ SEFilterStates <- R6::R6Class( # nolint #' @param dataname (`character(1)`) #' name of the data used in the expression #' specified to the function argument attached to this `FilterStates`. - #' @param datalabel (`character(1)`) - #' optional text label. Should be the name of experiment. + #' @param datalabel (`character(1)`) optional + #' text label. Should be the name of experiment. #' initialize = function(data, data_reactive = function(sid = "") NULL, @@ -102,9 +102,9 @@ SEFilterStates <- R6::R6Class( # nolint checkmate::assert_string(id) ns <- NS(id) row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) { - div("no sample variables available") + tags$div("no sample variables available") } else if (nrow(SummarizedExperiment::rowData(data)) == 0) { - div("no samples available") + tags$div("no samples available") } else { teal.widgets::optionalSelectInput( ns("row_to_add"), @@ -117,9 +117,9 @@ SEFilterStates <- R6::R6Class( # nolint } col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) { - div("no sample variables available") + tags$div("no sample variables available") } else if (nrow(SummarizedExperiment::colData(data)) == 0) { - div("no samples available") + tags$div("no samples available") } else { teal.widgets::optionalSelectInput( ns("col_to_add"), @@ -131,7 +131,7 @@ SEFilterStates <- R6::R6Class( # nolint ) } - div( + tags$div( row_input, col_input ) diff --git a/R/FilteredData-utils.R b/R/FilteredData-utils.R index bb3212dad..b44f5232b 100644 --- a/R/FilteredData-utils.R +++ b/R/FilteredData-utils.R @@ -95,8 +95,8 @@ eval_expr_with_msg <- function(expr, env) { #' actionButton("hide_content", label = "hide", icon = icon("xmark")), #' actionButton("show_content", label = "show", icon = icon("check")), #' actionButton("toggle_content", label = "toggle", icon = icon("angle-down")), -#' br(), -#' div( +#' tags$br(), +#' tags$div( #' id = "content", #' verbatimTextOutput("printout") #' ) diff --git a/R/FilteredData.R b/R/FilteredData.R index 0197c6cf8..1fe43dfdc 100644 --- a/R/FilteredData.R +++ b/R/FilteredData.R @@ -499,7 +499,7 @@ FilteredData <- R6::R6Class( # nolint #' @return `shiny.tag` ui_filter_panel = function(id) { ns <- NS(id) - div( + tags$div( id = ns(NULL), # used for hiding / showing include_css_files(pattern = "filter-panel"), self$ui_overview(ns("overview")), @@ -552,7 +552,7 @@ FilteredData <- R6::R6Class( # nolint #' @return `shiny.tag` ui_active = function(id) { ns <- NS(id) - div( + tags$div( id = id, # not used, can be used to customize CSS behavior class = "well", tags$div( @@ -574,7 +574,7 @@ FilteredData <- R6::R6Class( # nolint class = "remove_all pull-right" ) ), - div( + tags$div( id = ns("filter_active_vars_contents"), tagList( lapply( @@ -587,7 +587,7 @@ FilteredData <- R6::R6Class( # nolint ) ), shinyjs::hidden( - div( + tags$div( id = ns("filters_active_count"), textOutput(ns("teal_filters_count")) ) @@ -671,7 +671,7 @@ FilteredData <- R6::R6Class( # nolint #' @return `shiny.tag` ui_add = function(id) { ns <- NS(id) - div( + tags$div( id = id, # not used, can be used to customize CSS behavior class = "well", tags$div( @@ -691,14 +691,14 @@ FilteredData <- R6::R6Class( # nolint ) ) ), - div( + tags$div( id = ns("filter_add_vars_contents"), tagList( lapply( self$datanames(), function(dataname) { fdataset <- private$get_filtered_dataset(dataname) - span(id = ns(dataname), fdataset$ui_add(ns(dataname))) + tags$span(id = ns(dataname), fdataset$ui_add(ns(dataname))) } ) ) @@ -760,7 +760,7 @@ FilteredData <- R6::R6Class( # nolint #' ui_overview = function(id) { ns <- NS(id) - div( + tags$div( id = id, # not used, can be used to customize CSS behavior class = "well", tags$div( @@ -780,9 +780,9 @@ FilteredData <- R6::R6Class( # nolint ) ) ), - div( + tags$div( id = ns("filters_overview_contents"), - div( + tags$div( class = "teal_active_summary_filter_panel", tableOutput(ns("table")) ) @@ -962,7 +962,7 @@ FilteredData <- R6::R6Class( # nolint ns <- NS(id) active_slices_id <- isolate(vapply(self$get_filter_state(), `[[`, character(1), "id")) - div( + tags$div( id = ns("available_menu"), shinyWidgets::dropMenu( actionLink( @@ -972,7 +972,7 @@ FilteredData <- R6::R6Class( # nolint title = "Available filters", class = "remove pull-right" ), - div( + tags$div( class = "menu-content", shinycssloaders::withSpinner( uiOutput(ns("checkbox")), @@ -1053,7 +1053,7 @@ FilteredData <- R6::R6Class( # nolint htmltools::tagInsertChildren( checkbox, - br(), + tags$br(), if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"), non_interactive_choice_mock, if (length(interactive_choice_mock)) tags$strong("Interactive filters"), diff --git a/R/FilteredDataset-utils.R b/R/FilteredDataset-utils.R index 87ab2f61a..2f0e419d6 100644 --- a/R/FilteredDataset-utils.R +++ b/R/FilteredDataset-utils.R @@ -4,9 +4,9 @@ #' #' @param dataset any object #' @param dataname (`character(1)`) -#' syntactically valid name given to the dataset. -#' @param keys (`character`) -#' optional vector of primary key column names. +#' syntactically valid name given to the dataset. +#' @param keys (`character`) optional +#' vector of primary key column names. #' @param parent_name (`character(1)`) #' name of the parent dataset. #' @param parent (`reactive`) diff --git a/R/FilteredDataset.R b/R/FilteredDataset.R index 0b2e37748..13d961f60 100644 --- a/R/FilteredDataset.R +++ b/R/FilteredDataset.R @@ -22,8 +22,8 @@ FilteredDataset <- R6::R6Class( # nolint #' @param dataset any object #' @param dataname (`character(1)`) #' syntactically valid name given to the dataset. - #' @param keys (`character`) - #' optional vector of primary key column names. + #' @param keys (`character`) optional + #' vector of primary key column names. #' @param label (`character(1)`) #' label to describe the dataset. #' @@ -218,10 +218,10 @@ FilteredDataset <- R6::R6Class( # nolint ns <- NS(id) if_multiple_filter_states <- length(private$get_filter_states()) > 1 - span( + tags$span( id = id, include_css_files("filter-panel"), - div( + tags$div( id = ns("whole_ui"), # to hide it entirely fluidRow( column( @@ -247,15 +247,15 @@ FilteredDataset <- R6::R6Class( # nolint ) ), shinyjs::hidden( - div( + tags$div( id = ns("filter_count_ui"), tagList( textOutput(ns("filter_count")), - br() + tags$br() ) ) ), - div( + tags$div( # id needed to insert and remove UI to filter single variable as needed # it is currently also used by the above module to entirely hide this panel id = ns("filters"), diff --git a/R/FilteredDatasetDataframe.R b/R/FilteredDatasetDataframe.R index 7046b9e78..bf4a8e4a8 100644 --- a/R/FilteredDatasetDataframe.R +++ b/R/FilteredDatasetDataframe.R @@ -45,8 +45,8 @@ DataframeFilteredDataset <- R6::R6Class( # nolint #' single `data.frame` for which filters are rendered. #' @param dataname (`character(1)`) #' syntactically valid name given to the dataset. - #' @param keys (`character`) - #' optional vector of primary key column names. + #' @param keys (`character`) optional + #' vector of primary key column names. #' @param parent_name (`character(1)`) #' name of the parent dataset. #' @param parent (`reactive`) diff --git a/R/FilteredDatasetDefault.R b/R/FilteredDatasetDefault.R index c26ba8b07..9e489705c 100644 --- a/R/FilteredDatasetDefault.R +++ b/R/FilteredDatasetDefault.R @@ -101,7 +101,7 @@ DefaultFilteredDataset <- R6::R6Class( # nolint #' @return An empty `div`. ui_active = function(id) { ns <- NS(id) - div() + tags$div() }, #' @description @@ -113,7 +113,7 @@ DefaultFilteredDataset <- R6::R6Class( # nolint #' @return An empty `div`. ui_add = function(id) { ns <- NS(id) - div() + tags$div() } ), private = list( diff --git a/R/FilteredDatasetMAE.R b/R/FilteredDatasetMAE.R index 348e5e2f0..e9ea22c63 100644 --- a/R/FilteredDatasetMAE.R +++ b/R/FilteredDatasetMAE.R @@ -44,8 +44,8 @@ MAEFilteredDataset <- R6::R6Class( # nolint #' single `MulitiAssayExperiment` for which filters are rendered. #' @param dataname (`character(1)`) #' syntactically valid name given to the dataset. - #' @param keys (`character`) - #' optional vector of primary key column names. + #' @param keys (`character`) optional + #' vector of primary key column names. #' @param label (`character(1)`) #' label to describe the dataset. #' @@ -190,9 +190,9 @@ MAEFilteredDataset <- R6::R6Class( # nolint data <- self$get_dataset() experiment_names <- names(data) - div( + tags$div( tags$label("Add", tags$code(self$get_dataname()), "filter"), - br(), + tags$br(), HTML("►"), tags$label("Add subjects filter"), private$get_filter_states()[["subjects"]]$ui_add(id = ns("subjects")), diff --git a/R/count_labels.R b/R/count_labels.R index 6fc3d9a40..faf13f06a 100644 --- a/R/count_labels.R +++ b/R/count_labels.R @@ -39,7 +39,7 @@ #' ) #' #' ui <- fluidPage( -#' div( +#' tags$div( #' class = "choices_state", #' include_js_files("count-bar-labels.js"), #' include_css_files(pattern = "filter-panel"), diff --git a/R/teal_slice.R b/R/teal_slice.R index 1c65284eb..08201fc4e 100644 --- a/R/teal_slice.R +++ b/R/teal_slice.R @@ -55,18 +55,18 @@ #' Must be a valid `R` expression which can be evaluated in the context of the data set. #' For a `data.frame` `var == "x"` is sufficient, but `MultiAssayExperiment::subsetByColData` #' requires `dataname` prefix, *e.g.* `data$var == "x"`. -#' @param choices (optional `vector`) specifying allowed choices; +#' @param choices (`vector`) optional, specifies allowed choices; #' When specified it should be a subset of values in variable denoted by `varname`; #' Type and size depends on variable type. Factors are coerced to character. -#' @param selected (optional `vector`) of selected values from `choices`; +#' @param selected (`vector`) optional, specifies selected values from `choices`; #' Type and size depends on variable type. Factors are coerced to character. -#' @param multiple (optional `logical(1)`) flag specifying whether more than one value can be selected; +#' @param multiple (`logical(1)`) optional flag specifying whether more than one value can be selected; #' only applicable to `ChoicesFilterState` and `LogicalFilterState` -#' @param keep_na (optional `logical(1)`) flag specifying whether to keep missing values -#' @param keep_inf (optional `logical(1)`) flag specifying whether to keep infinite values +#' @param keep_na (`logical(1)`) optional flag specifying whether to keep missing values +#' @param keep_inf (`logical(1)`) optional flag specifying whether to keep infinite values #' @param fixed (`logical(1)`) flag specifying whether to fix this filter state (forbid setting state) #' @param anchored (`logical(1)`) flag specifying whether to lock this filter state (forbid removing and inactivating) -#' @param title (optional `character(1)`) title of the filter. Ignored when `varname` is set. +#' @param title (`character(1)`) optional title of the filter. Ignored when `varname` is set. #' @param ... in `teal_slice` method these are additional arguments which can be handled by extensions #' of `teal.slice` classes. In other methods these are further arguments passed to or from other methods. #' @param x (`teal.slice`) diff --git a/inst/css/filter-panel.css b/inst/css/filter-panel.css index e5f83b8d5..7e2f27d87 100644 --- a/inst/css/filter-panel.css +++ b/inst/css/filter-panel.css @@ -252,6 +252,18 @@ a.remove_all:hover { margin: 0em; } +.filter-card:has(> .filter-card-header[aria-expanded="true"]) { + transition-property: background-color; + transition-duration: 150ms; + background-color: var(--bs-gray-100, #f8f9fa); +} + +.filter-card:has(> .filter-card-header[aria-expanded="true"]):hover { + transition-property: box-shadow; + transition-duration: 150ms; + box-shadow: 0 0 5px 2px var(--bs-gray-800, #343a40); +} + .filter-card-header { color: var(--bs-body-color, #333333); padding: 5px 10px; @@ -267,11 +279,16 @@ a.remove_all:hover { border-bottom-right-radius: 0; } -.filter-card-header:hover, -.filter-card-body:hover { +.filter-card-header:hover { background-color: var(--bs-gray-200, #e9ecef); } +.filter-card-header[aria-expanded="true"]:hover { + transition-property: background-color; + transition-duration: 150ms; + background-color: var(--bs-gray-100, #f8f9fa); +} + .filter-card-title { display: flex; flex-direction: row; diff --git a/man/ChoicesFilterState.Rd b/man/ChoicesFilterState.Rd index cd804ca75..0aa4f28cc 100644 --- a/man/ChoicesFilterState.Rd +++ b/man/ChoicesFilterState.Rd @@ -46,25 +46,25 @@ ui <- fluidPage( useShinyjs(), include_css_files(pattern = "filter-panel"), include_js_files(pattern = "count-bar-labels"), - column(4, div( - h4("ChoicesFilterState"), + column(4, tags$div( + tags$h4("ChoicesFilterState"), fs$ui("fs") )), - column(4, div( - h4("Condition (i.e. call)"), # display the condition call generated by this FilterState - textOutput("condition_choices"), br(), - h4("Unformatted state"), # display raw filter state - textOutput("unformatted_choices"), br(), - h4("Formatted state"), # display human readable filter state - textOutput("formatted_choices"), br() + column(4, tags$div( + tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState + textOutput("condition_choices"), tags$br(), + tags$h4("Unformatted state"), # display raw filter state + textOutput("unformatted_choices"), tags$br(), + tags$h4("Formatted state"), # display human readable filter state + textOutput("formatted_choices"), tags$br() )), - column(4, div( - h4("Programmatic filter control"), - actionButton("button1_choices", "set drop NA", width = "100\%"), br(), - actionButton("button2_choices", "set keep NA", width = "100\%"), br(), - actionButton("button3_choices", "set selection: a, b", width = "100\%"), br(), - actionButton("button4_choices", "deselect all", width = "100\%"), br(), - actionButton("button0_choices", "set initial state", width = "100\%"), br() + column(4, tags$div( + tags$h4("Programmatic filter control"), + actionButton("button1_choices", "set drop NA", width = "100\%"), tags$br(), + actionButton("button2_choices", "set keep NA", width = "100\%"), tags$br(), + actionButton("button3_choices", "set selection: a, b", width = "100\%"), tags$br(), + actionButton("button4_choices", "deselect all", width = "100\%"), tags$br(), + actionButton("button0_choices", "set initial state", width = "100\%"), tags$br() )) ) diff --git a/man/DFFilterStates.Rd b/man/DFFilterStates.Rd index 74d189bd1..2d0ab3e47 100644 --- a/man/DFFilterStates.Rd +++ b/man/DFFilterStates.Rd @@ -46,35 +46,35 @@ ui <- fluidPage( useShinyjs(), include_css_files(pattern = "filter-panel"), include_js_files(pattern = "count-bar-labels"), - column(4, div( - h4("Active filters"), + column(4, tags$div( + tags$h4("Active filters"), filter_states_df$ui_active("fsdf") )), - column(4, div( - h4("Manual filter control"), - filter_states_df$ui_add("add_filters"), br(), - h4("Condition (i.e. call)"), # display the subset expression generated by this FilterStates - textOutput("call_df"), br(), - h4("Formatted state"), # display human readable filter state - textOutput("formatted_df"), br() + column(4, tags$div( + tags$h4("Manual filter control"), + filter_states_df$ui_add("add_filters"), tags$br(), + tags$h4("Condition (i.e. call)"), # display the subset expression generated by this FilterStates + textOutput("call_df"), tags$br(), + tags$h4("Formatted state"), # display human readable filter state + textOutput("formatted_df"), tags$br() )), - column(4, div( - h4("Programmatic filter control"), - actionButton("button1_df", "set NUM1 < 30", width = "100\%"), br(), - actionButton("button2_df", "set NUM2 \%in\% c(20, 21)", width = "100\%"), br(), - actionButton("button3_df", "set CHAR1 \%in\% c(\"B\", \"C\", \"D\")", width = "100\%"), br(), - actionButton("button4_df", "set CHAR2 == \"F\"", width = "100\%"), br(), - actionButton("button5_df", "set DATE <= 2020-02-02", width = "100\%"), br(), - actionButton("button6_df", "set DATETIME <= 2020-02-02", width = "100\%"), br(), - hr(), - actionButton("button7_df", "remove NUM1", width = "100\%"), br(), - actionButton("button8_df", "remove NUM2", width = "100\%"), br(), - actionButton("button9_df", "remove CHAR1", width = "100\%"), br(), - actionButton("button10_df", "remove CHAR2", width = "100\%"), br(), - actionButton("button11_df", "remove DATE", width = "100\%"), br(), - actionButton("button12_df", "remove DATETIME", width = "100\%"), br(), - hr(), - actionButton("button0_df", "clear all filters", width = "100\%"), br() + column(4, tags$div( + tags$h4("Programmatic filter control"), + actionButton("button1_df", "set NUM1 < 30", width = "100\%"), tags$br(), + actionButton("button2_df", "set NUM2 \%in\% c(20, 21)", width = "100\%"), tags$br(), + actionButton("button3_df", "set CHAR1 \%in\% c(\"B\", \"C\", \"D\")", width = "100\%"), tags$br(), + actionButton("button4_df", "set CHAR2 == \"F\"", width = "100\%"), tags$br(), + actionButton("button5_df", "set DATE <= 2020-02-02", width = "100\%"), tags$br(), + actionButton("button6_df", "set DATETIME <= 2020-02-02", width = "100\%"), tags$br(), + tags$hr(), + actionButton("button7_df", "remove NUM1", width = "100\%"), tags$br(), + actionButton("button8_df", "remove NUM2", width = "100\%"), tags$br(), + actionButton("button9_df", "remove CHAR1", width = "100\%"), tags$br(), + actionButton("button10_df", "remove CHAR2", width = "100\%"), tags$br(), + actionButton("button11_df", "remove DATE", width = "100\%"), tags$br(), + actionButton("button12_df", "remove DATETIME", width = "100\%"), tags$br(), + tags$hr(), + actionButton("button0_df", "clear all filters", width = "100\%"), tags$br() )) ) @@ -213,8 +213,8 @@ Function has to have \code{sid} argument being a character.} name of the data used in the \emph{subset expression}. Passed to the function argument attached to this \code{FilterStates}.} -\item{\code{datalabel}}{(\code{character(1)}) -optional text label.} +\item{\code{datalabel}}{(\code{character(1)}) optional +text label.} \item{\code{keys}}{(\code{character}) key column names.} diff --git a/man/DataframeFilteredDataset.Rd b/man/DataframeFilteredDataset.Rd index 8799d6685..9dbbd9d38 100644 --- a/man/DataframeFilteredDataset.Rd +++ b/man/DataframeFilteredDataset.Rd @@ -95,8 +95,8 @@ single \code{data.frame} for which filters are rendered.} \item{\code{dataname}}{(\code{character(1)}) syntactically valid name given to the dataset.} -\item{\code{keys}}{(\code{character}) -optional vector of primary key column names.} +\item{\code{keys}}{(\code{character}) optional +vector of primary key column names.} \item{\code{parent_name}}{(\code{character(1)}) name of the parent dataset.} diff --git a/man/DateFilterState.Rd b/man/DateFilterState.Rd index 3143c55ef..4f10b664a 100644 --- a/man/DateFilterState.Rd +++ b/man/DateFilterState.Rd @@ -47,26 +47,26 @@ ui <- fluidPage( useShinyjs(), include_css_files(pattern = "filter-panel"), include_js_files(pattern = "count-bar-labels"), - column(4, div( - h4("DateFilterState"), + column(4, tags$div( + tags$h4("DateFilterState"), fs$ui("fs") )), - column(4, div( + column(4, tags$div( id = "outputs", # div id is needed for toggling the element - h4("Condition (i.e. call)"), # display the condition call generated by this FilterState - textOutput("condition_date"), br(), - h4("Unformatted state"), # display raw filter state - textOutput("unformatted_date"), br(), - h4("Formatted state"), # display human readable filter state - textOutput("formatted_date"), br() + tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState + textOutput("condition_date"), tags$br(), + tags$h4("Unformatted state"), # display raw filter state + textOutput("unformatted_date"), tags$br(), + tags$h4("Formatted state"), # display human readable filter state + textOutput("formatted_date"), tags$br() )), - column(4, div( - h4("Programmatic filter control"), - actionButton("button1_date", "set drop NA", width = "100\%"), br(), - actionButton("button2_date", "set keep NA", width = "100\%"), br(), - actionButton("button3_date", "set a range", width = "100\%"), br(), - actionButton("button4_date", "set full range", width = "100\%"), br(), - actionButton("button0_date", "set initial state", width = "100\%"), br() + column(4, tags$div( + tags$h4("Programmatic filter control"), + actionButton("button1_date", "set drop NA", width = "100\%"), tags$br(), + actionButton("button2_date", "set keep NA", width = "100\%"), tags$br(), + actionButton("button3_date", "set a range", width = "100\%"), tags$br(), + actionButton("button4_date", "set full range", width = "100\%"), tags$br(), + actionButton("button0_date", "set initial state", width = "100\%"), tags$br() )) ) diff --git a/man/DatetimeFilterState.Rd b/man/DatetimeFilterState.Rd index 686caf6df..b9053a4fd 100644 --- a/man/DatetimeFilterState.Rd +++ b/man/DatetimeFilterState.Rd @@ -47,26 +47,26 @@ ui <- fluidPage( useShinyjs(), include_css_files(pattern = "filter-panel"), include_js_files(pattern = "count-bar-labels"), - column(4, div( - h4("DatetimeFilterState"), + column(4, tags$div( + tags$h4("DatetimeFilterState"), fs$ui("fs") )), - column(4, div( + column(4, tags$div( id = "outputs", # div id is needed for toggling the element - h4("Condition (i.e. call)"), # display the condition call generated by this FilterState - textOutput("condition_datetime"), br(), - h4("Unformatted state"), # display raw filter state - textOutput("unformatted_datetime"), br(), - h4("Formatted state"), # display human readable filter state - textOutput("formatted_datetime"), br() + tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState + textOutput("condition_datetime"), tags$br(), + tags$h4("Unformatted state"), # display raw filter state + textOutput("unformatted_datetime"), tags$br(), + tags$h4("Formatted state"), # display human readable filter state + textOutput("formatted_datetime"), tags$br() )), - column(4, div( - h4("Programmatic filter control"), - actionButton("button1_datetime", "set drop NA", width = "100\%"), br(), - actionButton("button2_datetime", "set keep NA", width = "100\%"), br(), - actionButton("button3_datetime", "set a range", width = "100\%"), br(), - actionButton("button4_datetime", "set full range", width = "100\%"), br(), - actionButton("button0_datetime", "set initial state", width = "100\%"), br() + column(4, tags$div( + tags$h4("Programmatic filter control"), + actionButton("button1_datetime", "set drop NA", width = "100\%"), tags$br(), + actionButton("button2_datetime", "set keep NA", width = "100\%"), tags$br(), + actionButton("button3_datetime", "set a range", width = "100\%"), tags$br(), + actionButton("button4_datetime", "set full range", width = "100\%"), tags$br(), + actionButton("button0_datetime", "set initial state", width = "100\%"), tags$br() )) ) diff --git a/man/FilterStateExpr.Rd b/man/FilterStateExpr.Rd index 23c7a46fe..bd1ede71f 100644 --- a/man/FilterStateExpr.Rd +++ b/man/FilterStateExpr.Rd @@ -36,17 +36,17 @@ ui <- fluidPage( useShinyjs(), include_css_files(pattern = "filter-panel"), include_js_files(pattern = "count-bar-labels"), - column(4, div( - h4("ChoicesFilterState"), + column(4, tags$div( + tags$h4("ChoicesFilterState"), filter_state$ui("fs") )), - column(8, div( - h4("Condition (i.e. call)"), # display the condition call generated by this FilterState - textOutput("condition_choices"), br(), - h4("Unformatted state"), # display raw filter state - textOutput("unformatted_choices"), br(), - h4("Formatted state"), # display human readable filter state - textOutput("formatted_choices"), br() + column(8, tags$div( + tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState + textOutput("condition_choices"), tags$br(), + tags$h4("Unformatted state"), # display raw filter state + textOutput("unformatted_choices"), tags$br(), + tags$h4("Formatted state"), # display human readable filter state + textOutput("formatted_choices"), tags$br() )) ) diff --git a/man/FilterStates.Rd b/man/FilterStates.Rd index 75f51923b..82c72f05d 100644 --- a/man/FilterStates.Rd +++ b/man/FilterStates.Rd @@ -69,8 +69,8 @@ Function has to have \code{sid} argument being a character.} name of the dataset, used in the subset expression. Passed to the function argument attached to this \code{FilterStates}.} -\item{\code{datalabel}}{(\code{character(1)}) -optional text label.} +\item{\code{datalabel}}{(\code{character(1)}) optional +text label.} } \if{html}{\out{}} } diff --git a/man/FilteredDataset.Rd b/man/FilteredDataset.Rd index 124477067..c8fec55eb 100644 --- a/man/FilteredDataset.Rd +++ b/man/FilteredDataset.Rd @@ -57,8 +57,8 @@ Initializes this \code{FilteredDataset} object. \item{\code{dataname}}{(\code{character(1)}) syntactically valid name given to the dataset.} -\item{\code{keys}}{(\code{character}) -optional vector of primary key column names.} +\item{\code{keys}}{(\code{character}) optional +vector of primary key column names.} \item{\code{label}}{(\code{character(1)}) label to describe the dataset.} diff --git a/man/LogicalFilterState.Rd b/man/LogicalFilterState.Rd index 5d9f09778..7cd2158e8 100644 --- a/man/LogicalFilterState.Rd +++ b/man/LogicalFilterState.Rd @@ -38,25 +38,25 @@ ui <- fluidPage( useShinyjs(), include_css_files(pattern = "filter-panel"), include_js_files(pattern = "count-bar-labels"), - column(4, div( - h4("LogicalFilterState"), + column(4, tags$div( + tags$h4("LogicalFilterState"), fs$ui("fs") )), - column(4, div( + column(4, tags$div( id = "outputs", # div id is needed for toggling the element - h4("Condition (i.e. call)"), # display the condition call generated by this FilterState - textOutput("condition_logical"), br(), - h4("Unformatted state"), # display raw filter state - textOutput("unformatted_logical"), br(), - h4("Formatted state"), # display human readable filter state - textOutput("formatted_logical"), br() + tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState + textOutput("condition_logical"), tags$br(), + tags$h4("Unformatted state"), # display raw filter state + textOutput("unformatted_logical"), tags$br(), + tags$h4("Formatted state"), # display human readable filter state + textOutput("formatted_logical"), tags$br() )), - column(4, div( - h4("Programmatic filter control"), - actionButton("button1_logical", "set drop NA", width = "100\%"), br(), - actionButton("button2_logical", "set keep NA", width = "100\%"), br(), - actionButton("button3_logical", "set a selection", width = "100\%"), br(), - actionButton("button0_logical", "set initial state", width = "100\%"), br() + column(4, tags$div( + tags$h4("Programmatic filter control"), + actionButton("button1_logical", "set drop NA", width = "100\%"), tags$br(), + actionButton("button2_logical", "set keep NA", width = "100\%"), tags$br(), + actionButton("button3_logical", "set a selection", width = "100\%"), tags$br(), + actionButton("button0_logical", "set initial state", width = "100\%"), tags$br() )) ) diff --git a/man/MAEFilterStates.Rd b/man/MAEFilterStates.Rd index 73f79cbed..eebe89bbe 100644 --- a/man/MAEFilterStates.Rd +++ b/man/MAEFilterStates.Rd @@ -66,8 +66,8 @@ Function has to have \code{sid} argument being a character.} name of the data used in the subset expression. Passed to the function argument attached to this \code{FilterStates}.} -\item{\code{datalabel}}{(\code{character(1)}) -optional text label.} +\item{\code{datalabel}}{(\code{character(1)}) optional +text label.} \item{\code{keys}}{(\code{character}) key column names.} diff --git a/man/MAEFilteredDataset.Rd b/man/MAEFilteredDataset.Rd index 7a81b9619..2f1fc0391 100644 --- a/man/MAEFilteredDataset.Rd +++ b/man/MAEFilteredDataset.Rd @@ -93,8 +93,8 @@ single \code{MulitiAssayExperiment} for which filters are rendered.} \item{\code{dataname}}{(\code{character(1)}) syntactically valid name given to the dataset.} -\item{\code{keys}}{(\code{character}) -optional vector of primary key column names.} +\item{\code{keys}}{(\code{character}) optional +vector of primary key column names.} \item{\code{label}}{(\code{character(1)}) label to describe the dataset.} diff --git a/man/MatrixFilterStates.Rd b/man/MatrixFilterStates.Rd index 0c7eb254a..82e0f60fb 100644 --- a/man/MatrixFilterStates.Rd +++ b/man/MatrixFilterStates.Rd @@ -65,8 +65,8 @@ Function has to have \code{sid} argument being a character.} name of the data used in the subset expression. Passed to the function argument attached to this \code{FilterStates}.} -\item{\code{datalabel}}{(\code{character(1)}) -Optional text label. Should be a name of experiment.} +\item{\code{datalabel}}{(\code{character(1)}) optional +text label. Should be a name of experiment.} } \if{html}{\out{}} } diff --git a/man/RangeFilterState.Rd b/man/RangeFilterState.Rd index 1851d6890..2db5834ac 100644 --- a/man/RangeFilterState.Rd +++ b/man/RangeFilterState.Rd @@ -50,28 +50,28 @@ ui <- fluidPage( useShinyjs(), include_css_files(pattern = "filter-panel"), include_js_files(pattern = "count-bar-labels"), - column(4, div( - h4("RangeFilterState"), + column(4, tags$div( + tags$h4("RangeFilterState"), fs$ui("fs") )), - column(4, div( + column(4, tags$div( id = "outputs", # div id is needed for toggling the element - h4("Condition (i.e. call)"), # display the condition call generated by this FilterState - textOutput("condition_range"), br(), - h4("Unformatted state"), # display raw filter state - textOutput("unformatted_range"), br(), - h4("Formatted state"), # display human readable filter state - textOutput("formatted_range"), br() + tags$h4("Condition (i.e. call)"), # display the condition call generated by this FilterState + textOutput("condition_range"), tags$br(), + tags$h4("Unformatted state"), # display raw filter state + textOutput("unformatted_range"), tags$br(), + tags$h4("Formatted state"), # display human readable filter state + textOutput("formatted_range"), tags$br() )), - column(4, div( - h4("Programmatic filter control"), - actionButton("button1_range", "set drop NA", width = "100\%"), br(), - actionButton("button2_range", "set keep NA", width = "100\%"), br(), - actionButton("button3_range", "set drop Inf", width = "100\%"), br(), - actionButton("button4_range", "set keep Inf", width = "100\%"), br(), - actionButton("button5_range", "set a range", width = "100\%"), br(), - actionButton("button6_range", "set full range", width = "100\%"), br(), - actionButton("button0_range", "set initial state", width = "100\%"), br() + column(4, tags$div( + tags$h4("Programmatic filter control"), + actionButton("button1_range", "set drop NA", width = "100\%"), tags$br(), + actionButton("button2_range", "set keep NA", width = "100\%"), tags$br(), + actionButton("button3_range", "set drop Inf", width = "100\%"), tags$br(), + actionButton("button4_range", "set keep Inf", width = "100\%"), tags$br(), + actionButton("button5_range", "set a range", width = "100\%"), tags$br(), + actionButton("button6_range", "set full range", width = "100\%"), tags$br(), + actionButton("button0_range", "set initial state", width = "100\%"), tags$br() )) ) diff --git a/man/SEFilterStates.Rd b/man/SEFilterStates.Rd index 1f9e79a3f..cf893ed22 100644 --- a/man/SEFilterStates.Rd +++ b/man/SEFilterStates.Rd @@ -65,8 +65,8 @@ Function has to have \code{sid} argument being a character.} name of the data used in the expression specified to the function argument attached to this \code{FilterStates}.} -\item{\code{datalabel}}{(\code{character(1)}) -optional text label. Should be the name of experiment.} +\item{\code{datalabel}}{(\code{character(1)}) optional +text label. Should be the name of experiment.} } \if{html}{\out{}} } diff --git a/man/countBars.Rd b/man/countBars.Rd index 2b71cf87e..bfc88fd7b 100644 --- a/man/countBars.Rd +++ b/man/countBars.Rd @@ -61,7 +61,7 @@ labels <- countBars( ) ui <- fluidPage( - div( + tags$div( class = "choices_state", include_js_files("count-bar-labels.js"), include_css_files(pattern = "filter-panel"), diff --git a/man/init_filter_states.Rd b/man/init_filter_states.Rd index 9cd7b4792..8493447c3 100644 --- a/man/init_filter_states.Rd +++ b/man/init_filter_states.Rd @@ -26,10 +26,10 @@ Function has to have \code{sid} argument being a character which is related to \ name of the data used in the subset expression, passed to the function argument attached to this \code{FilterStates}.} -\item{datalabel}{(\code{character(1)}) -optional text label.} +\item{datalabel}{(\code{character(1)}) optional +text label.} -\item{...}{(optional) +\item{...}{optional, additional arguments for specific classes: keys.} } \value{ @@ -55,7 +55,7 @@ rf <- init_filter_states( library(shiny) ui <- fluidPage( - actionButton("clear", span(icon("xmark"), "Remove all filters")), + actionButton("clear", tags$span(icon("xmark"), "Remove all filters")), rf$ui_add(id = "add"), rf$ui_active("states"), verbatimTextOutput("expr"), diff --git a/man/init_filtered_dataset.Rd b/man/init_filtered_dataset.Rd index 36f1e3118..07a1a6901 100644 --- a/man/init_filtered_dataset.Rd +++ b/man/init_filtered_dataset.Rd @@ -20,8 +20,8 @@ init_filtered_dataset( \item{dataname}{(\code{character(1)}) syntactically valid name given to the dataset.} -\item{keys}{(\code{character}) -optional vector of primary key column names.} +\item{keys}{(\code{character}) optional +vector of primary key column names.} \item{parent_name}{(\code{character(1)}) name of the parent dataset.} diff --git a/man/teal_slice.Rd b/man/teal_slice.Rd index 36fcb0196..937bac65b 100644 --- a/man/teal_slice.Rd +++ b/man/teal_slice.Rd @@ -48,25 +48,25 @@ Must be a valid \code{R} expression which can be evaluated in the context of the For a \code{data.frame} \code{var == "x"} is sufficient, but \code{MultiAssayExperiment::subsetByColData} requires \code{dataname} prefix, \emph{e.g.} \code{data$var == "x"}.} -\item{choices}{(optional \code{vector}) specifying allowed choices; +\item{choices}{(\code{vector}) optional, specifies allowed choices; When specified it should be a subset of values in variable denoted by \code{varname}; Type and size depends on variable type. Factors are coerced to character.} -\item{selected}{(optional \code{vector}) of selected values from \code{choices}; +\item{selected}{(\code{vector}) optional, specifies selected values from \code{choices}; Type and size depends on variable type. Factors are coerced to character.} -\item{keep_na}{(optional \code{logical(1)}) flag specifying whether to keep missing values} +\item{keep_na}{(\code{logical(1)}) optional flag specifying whether to keep missing values} -\item{keep_inf}{(optional \code{logical(1)}) flag specifying whether to keep infinite values} +\item{keep_inf}{(\code{logical(1)}) optional flag specifying whether to keep infinite values} \item{fixed}{(\code{logical(1)}) flag specifying whether to fix this filter state (forbid setting state)} \item{anchored}{(\code{logical(1)}) flag specifying whether to lock this filter state (forbid removing and inactivating)} -\item{multiple}{(optional \code{logical(1)}) flag specifying whether more than one value can be selected; +\item{multiple}{(\code{logical(1)}) optional flag specifying whether more than one value can be selected; only applicable to \code{ChoicesFilterState} and \code{LogicalFilterState}} -\item{title}{(optional \code{character(1)}) title of the filter. Ignored when \code{varname} is set.} +\item{title}{(\code{character(1)}) optional title of the filter. Ignored when \code{varname} is set.} \item{...}{in \code{teal_slice} method these are additional arguments which can be handled by extensions of \code{teal.slice} classes. In other methods these are further arguments passed to or from other methods.} diff --git a/man/toggle_button.Rd b/man/toggle_button.Rd index dcd44c5c3..86b4daf2f 100644 --- a/man/toggle_button.Rd +++ b/man/toggle_button.Rd @@ -46,8 +46,8 @@ ui <- fluidPage( actionButton("hide_content", label = "hide", icon = icon("xmark")), actionButton("show_content", label = "show", icon = icon("check")), actionButton("toggle_content", label = "toggle", icon = icon("angle-down")), - br(), - div( + tags$br(), + tags$div( id = "content", verbatimTextOutput("printout") )