mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 04:27:30 +02:00
feat: added option to choose color palettes for all available plots. this includes a custom function to generate colors from several palettes as well as a select function to include color previews.
This commit is contained in:
parent
2d062e0ac5
commit
6c850847b7
21 changed files with 1110 additions and 251 deletions
72
man/colorSelectInput.Rd
Normal file
72
man/colorSelectInput.Rd
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/custom_SelectInput.R
|
||||
\name{colorSelectInput}
|
||||
\alias{colorSelectInput}
|
||||
\title{A selectizeInput customized for named vectors of color names supported by
|
||||
\code{\link{generate_colors}}}
|
||||
\usage{
|
||||
colorSelectInput(
|
||||
inputId,
|
||||
label,
|
||||
choices,
|
||||
selected = "",
|
||||
previews = 4,
|
||||
...,
|
||||
placeholder = ""
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{inputId}{passed to \code{\link[shiny]{selectizeInput}}}
|
||||
|
||||
\item{label}{passed to \code{\link[shiny]{selectizeInput}}}
|
||||
|
||||
\item{choices}{A named \code{vector} from which fields should be populated}
|
||||
|
||||
\item{selected}{default selection}
|
||||
|
||||
\item{previews}{number of preview colors. Default is 4.}
|
||||
|
||||
\item{...}{passed to \code{\link[shiny]{selectizeInput}}}
|
||||
|
||||
\item{placeholder}{passed to \code{\link[shiny]{selectizeInput}} options}
|
||||
|
||||
\item{onInitialize}{passed to \code{\link[shiny]{selectizeInput}} options}
|
||||
}
|
||||
\value{
|
||||
a \code{\link[shiny]{selectizeInput}} dropdown element
|
||||
}
|
||||
\description{
|
||||
A selectizeInput customized for named vectors of color names supported by
|
||||
\code{\link{generate_colors}}
|
||||
}
|
||||
\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)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue