Description Usage Arguments Value Server value See Also Examples
View source: R/input-colorfilters.R
The brush used in this filter snaps to evenly divided steps based on the number of colors passed as argument. With minValue = 0, maxValue = 100 and n = 5, it will snap at the edges (0 and 100) and 20, 40, 60, and 80.
1 | discreteColorFilter(inputId, ...)
|
inputId |
The |
... |
Arguments passed on to
|
A visual filter input control that can be added to a UI definition.
start
and end
bounds of a selection. The input value is NULL
for empty selections.
start
and end
bounds of a selection. The default value is null.
Other visual filters:
categoricalColorFilter()
,
continuousColorFilter()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Only run examples in interactive R sessions
if (interactive()) {
ui <- fluidPage(
discreteColorFilter("filter", minValue = 0, maxValue = 200, n = 5,
palette = scales::viridis_pal()),
verbatimTextOutput("value")
)
server <- function(input, output) {
output$value <- output$selection <- renderPrint({
if (!is.null(input$filter)) {
paste0(input$filter$start, ",", input$filter$end)
}
})
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.