mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-21 05:19:07 +02:00
Deploying to gh-pages from @ agdamsbo/FreesearchR@8961bc6a5d 🚀
This commit is contained in:
parent
66780fc453
commit
c2c2302f90
59 changed files with 1557 additions and 210 deletions
100
reference/colorSelectInput.md
Normal file
100
reference/colorSelectInput.md
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
# A selectizeInput customized for named vectors of color names supported by [`generate_colors`](https://agdamsbo.github.io/FreesearchR/reference/generate_colors.md)
|
||||
|
||||
A selectizeInput customized for named vectors of color names supported
|
||||
by
|
||||
[`generate_colors`](https://agdamsbo.github.io/FreesearchR/reference/generate_colors.md)
|
||||
|
||||
## Usage
|
||||
|
||||
``` r
|
||||
colorSelectInput(
|
||||
inputId,
|
||||
label,
|
||||
choices,
|
||||
selected = "",
|
||||
previews = 4,
|
||||
...,
|
||||
placeholder = ""
|
||||
)
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
- inputId:
|
||||
|
||||
passed to
|
||||
[`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
|
||||
- label:
|
||||
|
||||
passed to
|
||||
[`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
|
||||
- choices:
|
||||
|
||||
A named `vector` from which fields should be populated
|
||||
|
||||
- selected:
|
||||
|
||||
default selection
|
||||
|
||||
- previews:
|
||||
|
||||
number of preview colors. Default is 4.
|
||||
|
||||
- ...:
|
||||
|
||||
passed to
|
||||
[`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
|
||||
- placeholder:
|
||||
|
||||
passed to
|
||||
[`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
options
|
||||
|
||||
- onInitialize:
|
||||
|
||||
passed to
|
||||
[`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
options
|
||||
|
||||
## Value
|
||||
|
||||
a [`selectizeInput`](https://rdrr.io/pkg/shiny/man/selectInput.html)
|
||||
dropdown element
|
||||
|
||||
## Examples
|
||||
|
||||
``` r
|
||||
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'
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue