Description Usage Arguments Value Server value See Also Examples
View source: R/input-colorfilters.R
The brush used in this filter allows a free selection over the whole input range.
1 | continuousColorFilter(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.
discreteColorFilter()
categoricalColorFilter()
Other visual filters:
categoricalColorFilter()
,
discreteColorFilter()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Only run examples in interactive R sessions
if (interactive()) {
ui <- fluidPage(
continuousColorFilter("filter", minValue = 0, maxValue = 200, 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)
ui <- fluidPage(
continuousColorFilter("filter", data = mtcars$mpg, colors = c("#FF0000", "#0000FF")),
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.