Create a color legend based on given data and palette or colors. Also passes on data- attributes for optional JS interaction.
categoricalLegend(
inputId,
label = NULL,
class = "",
values = NULL,
data = NULL,
colors = NULL,
palette = NULL,
orient = "bottom",
size = 220,
multiple = TRUE
)The input slot that will be used to access the value.
Display label for the control, or NULL for no label.
The CSS class of the input div element to match with any filter toggling functions. Default class is "categorical-color-filter".
List of character vectors that will match with the colors or palette in the order provided by both.
Alternative vector to extract values with "unique()" function.
Colours to match with values; 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().
A function that outputs a list of colors.
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).
Absolute length in pixels of the color bar; becomes width or height depending on value of orient. Default is 220.
Is selection of multiple items allowed? Default is TRUE. With FALSE, selecting one item will de-select the others.
A categorical color legend control that can be added to a UI definition
discreteColorFilter() continuousColorFilter() categoricalColorFilter()
Other base legend:
numericLegend()