continuousColorFilter {vfinputs} | R Documentation |
Add a visual filter input for continuous values
Description
The brush used in this filter allows a free selection over the whole input range.
Usage
continuousColorFilter(inputId, ...)
Arguments
inputId |
The input slot that will be used to access the value.
|
... |
Arguments passed on to numericLegend
label Display label for the control, or NULL for no label.
class The CSS class of the input div element to match with any brush-defining functions. Default classes for brushes are either "continuous-color-filter" or "discrete-color-filter" .
n Number of color strips in the legend. Default is 100 .
minValue Minimum numeric value in the legend (can be higher the maximum for inverted scale).
maxValue Maximum numeric value in the legend (can be lower the minimum for inverted scale).
data Alternative vector to extract numeric minimum and maximum values.
colors Colours to interpolate; must be a valid argument to
grDevices::col2rgb() . This can be a character vector of
"#RRGGBB" or "#RRGGBBAA" , colour names from
grDevices::colors() , or a positive integer that indexes into
grDevices::palette() .
palette A function that outputs a list of colors
options Configuration options for brush and scale. Use ticks to specify number of ticks or a list of specific tick values
, format to a d3-format-compatible formatting string (see https://github.com/d3/d3-format for valid formats) and
hide_brush_labels as TRUE to hide the brush interval.
orient Orientation of the legend. Can be "bottom" (default, horizontal with labels below), "top" (horizontal with labels above), "left" (vertical with labels on the left)
and "right" (vertical with labels on the right).
size Absolute length in pixels of the color bar; becomes width or height depending on value of orient . Default is 200 .
thickness Absolute thickness in pixels of the color bar; opposite of size depending on value of orient . Default is 20 .
offset Left offset for scale to allow long labels. Default is 0 .
|
Value
A visual filter input control that can be added to a UI definition.
Server value
start
and end
bounds of a selection. The input value is NULL
for empty selections.
See Also
discreteColorFilter()
categoricalColorFilter()
Other visual filters:
categoricalColorFilter()
,
discreteColorFilter()
Examples
## 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)
}
[Package
vfinputs version 0.1.0
Index]