FreesearchR/reference/colorSelectInput.md

2.1 KiB

A selectizeInput customized for named vectors of color names supported by generate_colors

A selectizeInput customized for named vectors of color names supported by generate_colors

Usage

colorSelectInput(
  inputId,
  label,
  choices,
  selected = NULL,
  previews = 4,
  ...,
  placeholder = ""
)

Arguments

Value

a selectizeInput dropdown element

Examples

if (shiny::interactive()) {
top_palettes <- c(
"Perceptual (blue-yellow)"   = "viridis",
"Perceptual (fire)"          = "plasma",
"Colour-blind friendly"      = "Okabe-Ito",
"Qualitative (bold)"         = "Dark 2",
"Qualitative (paired)"       = "Paired",
"Sequential (blues)"         = "Blues",
"Diverging (red-blue)"       = "RdBu",
"Tableau style"              = "Tableau 10",
"Pastel"                     = "Pastel 1",
"Rainbow"                    = "rainbow"
)
  shinyApp(
    ui = fluidPage(
    titlePanel("Color Palette Select Test"),
    colorSelectInput(
      inputId  = "palette",
      label    = "Color palette",
      choices  = top_palettes,
      selected = "viridis"
    ),
    verbatimTextOutput("selected")
    ),
    server = function(input, output, session) {
    output$selected <- renderPrint(input$palette)
    }
  )
}
#> Error: 'interactive' is not an exported object from 'namespace:shiny'