Create a color legend based on given data and palette or colors. Also passes on data- attributes for optional JS interaction.
numericLegend(
inputId,
label = NULL,
class = "",
n = 100,
minValue = NULL,
maxValue = NULL,
data = NULL,
colors = NULL,
palette = NULL,
options = NULL,
orient = "bottom",
size = 200,
thickness = 20,
offset = 0
)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 brush-defining functions. Default classes for brushes are either "continuous-color-filter" or "discrete-color-filter".
Number of color strips in the legend. Default is 100.
Minimum numeric value in the legend (can be higher the maximum for inverted scale).
Maximum numeric value in the legend (can be lower the minimum for inverted scale).
Alternative vector to extract numeric minimum and maximum values.
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().
A function that outputs a list of colors
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.
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 200.
Absolute thickness in pixels of the color bar; opposite of size depending on value of orient. Default is 20.
Left offset for scale to allow long labels. Default is 0.
A numeric color legend control that can be added to a UI definition
discreteColorFilter() continuousColorFilter() categoricalColorFilter()
Other base legend:
categoricalLegend()