From fe7fad62aa64226dfc52196ef718d30d156d7582 Mon Sep 17 00:00:00 2001 From: kartikeya kirar Date: Fri, 15 Mar 2024 15:21:35 +0530 Subject: [PATCH] 445 unify html tags (#268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit part of https://github.com/insightsengineering/teal.slice/issues/445 for teal.goshawk package --------- Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com> --- R/tm_g_gh_boxplot.R | 12 ++++++------ R/tm_g_gh_correlationplot.R | 2 +- R/tm_g_gh_density_distribution_plot.R | 8 ++++---- R/tm_g_gh_lineplot.R | 14 +++++++------- R/tm_g_gh_scatterplot.R | 2 +- R/tm_g_gh_spaghettiplot.R | 4 ++-- R/toggleable_slider.R | 8 ++++---- R/utils-arbitrary_lines.r | 6 +++--- R/utils-data_constraints.r | 10 +++++----- R/utils-templ_ui.r | 6 +++--- man/tm_g_gh_boxplot.Rd | 4 ++-- man/tm_g_gh_correlationplot.Rd | 4 ++-- man/tm_g_gh_density_distribution_plot.Rd | 4 ++-- man/tm_g_gh_lineplot.Rd | 4 ++-- man/tm_g_gh_scatterplot.Rd | 4 ++-- man/tm_g_gh_spaghettiplot.Rd | 4 ++-- man/toggle_slider_ui.Rd | 2 +- 17 files changed, 49 insertions(+), 49 deletions(-) diff --git a/R/tm_g_gh_boxplot.R b/R/tm_g_gh_boxplot.R index 3063779f..c1e37558 100644 --- a/R/tm_g_gh_boxplot.R +++ b/R/tm_g_gh_boxplot.R @@ -223,24 +223,24 @@ ui_g_boxplot <- function(id, ...) { a <- list(...) teal.widgets::standard_layout( - output = div( + output = tags$div( fluidRow( teal.widgets::plot_with_settings_ui(id = ns("boxplot")) ), fluidRow(column( width = 12, - br(), hr(), - h4("Selected Data Points"), + tags$br(), tags$hr(), + tags$h4("Selected Data Points"), DT::dataTableOutput(ns("brush_data")) )), fluidRow(column( width = 12, - br(), hr(), - h4("Descriptive Statistics"), + tags$br(), tags$hr(), + tags$h4("Descriptive Statistics"), DT::dataTableOutput(ns("table_ui")) )) ), - encoding = div( + encoding = tags$div( ### Reporter teal.reporter::simple_reporter_ui(ns("simple_reporter")), ### diff --git a/R/tm_g_gh_correlationplot.R b/R/tm_g_gh_correlationplot.R index 6b1dfe24..e99bee10 100644 --- a/R/tm_g_gh_correlationplot.R +++ b/R/tm_g_gh_correlationplot.R @@ -273,7 +273,7 @@ ui_g_correlationplot <- function(id, ...) { teal.widgets::standard_layout( output = templ_ui_output_datatable(ns), - encoding = div( + encoding = tags$div( ### Reporter teal.reporter::simple_reporter_ui(ns("simple_reporter")), ### diff --git a/R/tm_g_gh_density_distribution_plot.R b/R/tm_g_gh_density_distribution_plot.R index ca5da653..a3f50e0b 100644 --- a/R/tm_g_gh_density_distribution_plot.R +++ b/R/tm_g_gh_density_distribution_plot.R @@ -179,18 +179,18 @@ ui_g_density_distribution_plot <- function(id, ...) { a <- list(...) teal.widgets::standard_layout( - output = div( + output = tags$div( fluidRow( teal.widgets::plot_with_settings_ui(id = ns("plot")) ), fluidRow(column( width = 12, - br(), hr(), - h4("Descriptive Statistics"), + tags$br(), tags$hr(), + tags$h4("Descriptive Statistics"), DT::dataTableOutput(ns("table_ui")) )) ), - encoding = div( + encoding = tags$div( ### Reporter teal.reporter::simple_reporter_ui(ns("simple_reporter")), ### diff --git a/R/tm_g_gh_lineplot.R b/R/tm_g_gh_lineplot.R index b5ca9648..639c754f 100644 --- a/R/tm_g_gh_lineplot.R +++ b/R/tm_g_gh_lineplot.R @@ -215,7 +215,7 @@ ui_lineplot <- function(id, ...) { include_css_files("custom"), teal.widgets::standard_layout( output = teal.widgets::plot_with_settings_ui(id = ns("plot")), - encoding = div( + encoding = tags$div( ### Reporter teal.reporter::simple_reporter_ui(ns("simple_reporter")), ### @@ -231,10 +231,10 @@ ui_lineplot <- function(id, ...) { uiOutput(ns("shape_ui")), radioButtons(ns("stat"), "Select a Statistic:", c("mean", "median"), a$stat), checkboxInput(ns("include_stat"), "Include Statistic Table", value = TRUE), - div( + tags$div( sliderInput( ns("relative_height"), - div( + tags$div( "Relative height of plot to table(s)", title = paste( @@ -566,15 +566,15 @@ srv_lineplot <- function(id, ), selected = x_type ) - div( + tags$div( tags$label("Line configuration for:", tags$code(x)), - div( + tags$div( class = "flex", - div( + tags$div( class = "flex-grow-1", color_input ), - div( + tags$div( class = "flex-grow-1", type_input ) diff --git a/R/tm_g_gh_scatterplot.R b/R/tm_g_gh_scatterplot.R index 07b62898..8893d33e 100644 --- a/R/tm_g_gh_scatterplot.R +++ b/R/tm_g_gh_scatterplot.R @@ -189,7 +189,7 @@ ui_g_scatterplot <- function(id, ...) { teal.widgets::standard_layout( output = templ_ui_output_datatable(ns), - encoding = div( + encoding = tags$div( ### Reporter teal.reporter::simple_reporter_ui(ns("simple_reporter")), ### diff --git a/R/tm_g_gh_spaghettiplot.R b/R/tm_g_gh_spaghettiplot.R index 899729a1..ee210005 100644 --- a/R/tm_g_gh_spaghettiplot.R +++ b/R/tm_g_gh_spaghettiplot.R @@ -239,7 +239,7 @@ g_ui_spaghettiplot <- function(id, ...) { include_css_files("custom"), teal.widgets::standard_layout( output = templ_ui_output_datatable(ns), - encoding = div( + encoding = tags$div( ### Reporter teal.reporter::simple_reporter_ui(ns("simple_reporter")), ### @@ -272,7 +272,7 @@ g_ui_spaghettiplot <- function(id, ...) { teal.widgets::panel_group( teal.widgets::panel_item( title = "Plot Aesthetic Settings", - div( + tags$div( toggle_slider_ui( ns("yrange_scale"), label = "Y-Axis Range Zoom", diff --git a/R/toggleable_slider.R b/R/toggleable_slider.R index 9983d47a..a68081f4 100644 --- a/R/toggleable_slider.R +++ b/R/toggleable_slider.R @@ -29,7 +29,7 @@ #' value <- c(20.3, 81.5) # dichotomous slider #' # value <- c(50.1) # normal slider #' app <- shinyApp( -#' ui = div( +#' ui = tags$div( #' teal.goshawk:::toggle_slider_ui( #' "toggle_slider", "Select value", #' min = 0.2, max = 100.1, value = value, @@ -91,10 +91,10 @@ toggle_slider_ui <- function(id, show_or_not <- function(show) if (show) identity else shinyjs::hidden ns <- NS(id) - div( + tags$div( include_css_files("custom"), shinyjs::useShinyjs(), - div( + tags$div( class = "flex justify-between mb-1", tags$span(tags$strong(label)), actionButton(ns("toggle"), "Toggle", class = "btn-xs") @@ -124,7 +124,7 @@ toggle_slider_ui <- function(id, width = width ) } else { - div( + tags$div( numericInput( ns("value_low"), "From:", diff --git a/R/utils-arbitrary_lines.r b/R/utils-arbitrary_lines.r index 9d83b5bc..82e4f882 100644 --- a/R/utils-arbitrary_lines.r +++ b/R/utils-arbitrary_lines.r @@ -17,16 +17,16 @@ #' @keywords internal ui_arbitrary_lines <- function(id, line_arb, line_arb_label, line_arb_color, title = "Arbitrary Horizontal Lines:") { ns <- NS(id) - div( + tags$div( tags$b(title), textInput( ns("line_arb"), - div( + tags$div( class = "teal-tooltip", tagList( "Value:", icon("circle-info"), - span( + tags$span( class = "tooltiptext", "For multiple lines, supply a comma separated list of values." ) diff --git a/R/utils-data_constraints.r b/R/utils-data_constraints.r index f8efe57a..0c561adc 100644 --- a/R/utils-data_constraints.r +++ b/R/utils-data_constraints.r @@ -1,19 +1,19 @@ templ_ui_constraint <- function(ns, label = "Data Constraint") { - div( + tags$div( id = ns("constraint_var_whole"), # give an id to hide it radioButtons(ns("constraint_var"), label, choices = "NONE"), - shinyjs::hidden(div( + shinyjs::hidden(tags$div( id = ns("constraint_range"), - div( + tags$div( class = "inline-block;", numericInput(ns("constraint_range_min"), label = "Min", value = 0, min = 0, max = 0) ), - div( + tags$div( class = "inline-block;", numericInput(ns("constraint_range_max"), label = "Min", value = 0, min = 0, max = 0) ) )), - shinyjs::hidden(div( + shinyjs::hidden(tags$div( id = ns("all_na"), helpText("All values are missing (NA)") )) diff --git a/R/utils-templ_ui.r b/R/utils-templ_ui.r index dc151300..6d3ca49a 100644 --- a/R/utils-templ_ui.r +++ b/R/utils-templ_ui.r @@ -1,8 +1,8 @@ templ_ui_output_datatable <- function(ns) { - div( + tags$div( teal.widgets::plot_with_settings_ui(id = ns("plot")), - br(), hr(), - h4("Selected Data Points"), + tags$br(), tags$hr(), + tags$h4("Selected Data Points"), DT::dataTableOutput(ns("brush_data")) ) } diff --git a/man/tm_g_gh_boxplot.Rd b/man/tm_g_gh_boxplot.Rd index be5fb770..63a64f2c 100644 --- a/man/tm_g_gh_boxplot.Rd +++ b/man/tm_g_gh_boxplot.Rd @@ -90,10 +90,10 @@ in the legend.} \item{alpha}{numeric vector to define transparency of plotted points.} -\item{pre_output}{(\code{shiny.tag}, optional)\cr +\item{pre_output}{(\code{shiny.tag}) optional,\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} } \value{ diff --git a/man/tm_g_gh_correlationplot.Rd b/man/tm_g_gh_correlationplot.Rd index 9afecf84..f426fa13 100644 --- a/man/tm_g_gh_correlationplot.Rd +++ b/man/tm_g_gh_correlationplot.Rd @@ -116,10 +116,10 @@ naming the label for the arbitrary horizontal lines.} \item{reg_text_size}{font size control for regression line annotations.} -\item{pre_output}{(\code{shiny.tag}, optional)\cr +\item{pre_output}{(\code{shiny.tag}) optional,\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} } \description{ diff --git a/man/tm_g_gh_density_distribution_plot.Rd b/man/tm_g_gh_density_distribution_plot.Rd index a81ed9e8..f3a78212 100644 --- a/man/tm_g_gh_density_distribution_plot.Rd +++ b/man/tm_g_gh_density_distribution_plot.Rd @@ -68,10 +68,10 @@ naming the label for the arbitrary horizontal lines.} \item{rotate_xlab}{45 degree rotation of \code{x-axis} values.} -\item{pre_output}{(\code{shiny.tag}, optional)\cr +\item{pre_output}{(\code{shiny.tag}) optional,\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} } \description{ diff --git a/man/tm_g_gh_lineplot.Rd b/man/tm_g_gh_lineplot.Rd index 1c151288..17a65e88 100644 --- a/man/tm_g_gh_lineplot.Rd +++ b/man/tm_g_gh_lineplot.Rd @@ -99,10 +99,10 @@ Default value is waive().} \item{dodge}{controls the position dodge of error bar} -\item{pre_output}{(\code{shiny.tag}, optional)\cr +\item{pre_output}{(\code{shiny.tag}) optional,\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} \item{count_threshold}{minimum count of observations (as listed in the output table) to plot diff --git a/man/tm_g_gh_scatterplot.Rd b/man/tm_g_gh_scatterplot.Rd index 19770aa5..3812aaac 100644 --- a/man/tm_g_gh_scatterplot.Rd +++ b/man/tm_g_gh_scatterplot.Rd @@ -73,10 +73,10 @@ TRUE.} \item{reg_text_size}{font size control for regression line annotations.} -\item{pre_output}{(\code{shiny.tag}, optional)\cr +\item{pre_output}{(\code{shiny.tag}) optional,\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} } \description{ diff --git a/man/tm_g_gh_spaghettiplot.Rd b/man/tm_g_gh_spaghettiplot.Rd index 8549cd93..be48b465 100644 --- a/man/tm_g_gh_spaghettiplot.Rd +++ b/man/tm_g_gh_spaghettiplot.Rd @@ -110,10 +110,10 @@ naming the label for the arbitrary horizontal lines.} \item{hline_vars_labels}{a character vector naming the labels for the additional horizontal lines that will appear in the legend.} -\item{pre_output}{(\code{shiny.tag}, optional)\cr +\item{pre_output}{(\code{shiny.tag}) optional,\cr with text placed before the output to put the output into context. For example a title.} -\item{post_output}{(\code{shiny.tag}, optional) with text placed after the output to put the output +\item{post_output}{(\code{shiny.tag}) optional, with text placed after the output to put the output into context. For example the \code{\link[shiny:helpText]{shiny::helpText()}} elements are useful.} } \value{ diff --git a/man/toggle_slider_ui.Rd b/man/toggle_slider_ui.Rd index ef05c41d..614e7275 100644 --- a/man/toggle_slider_ui.Rd +++ b/man/toggle_slider_ui.Rd @@ -57,7 +57,7 @@ Value is not checked to be within minmax range value <- c(20.3, 81.5) # dichotomous slider # value <- c(50.1) # normal slider app <- shinyApp( - ui = div( + ui = tags$div( teal.goshawk:::toggle_slider_ui( "toggle_slider", "Select value", min = 0.2, max = 100.1, value = value,