View source: R/output_legend.R
output_legend | R Documentation |
Adds a legend based on a specified color palette.
output_legend(palette = "", variable = NULL, dataview = NULL,
id = NULL, click = NULL, subto = NULL, class = "", show_na = TRUE)
palette |
Name of an included color palette, or palette selection input;
for discrete scales, one of |
variable |
Name of a variable or ID of a variable selector to display values of. Defaults to
the |
dataview |
The ID of an |
id |
Unique ID of the legend element. |
click |
The ID of an input to set to an entity's ID near the current cursor location on the current scale. |
subto |
A vector of output IDs to receive hover events from. |
class |
Class names to add to the legend element. |
show_na |
Logical; if |
A character vector of the contents to be added.
output_legend()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.