output_legend: Adds a legend to a website

View source: R/output_legend.R

output_legendR Documentation

Adds a legend to a website

Description

Adds a legend based on a specified color palette.

Usage

output_legend(palette = "", variable = NULL, dataview = NULL,
  id = NULL, click = NULL, subto = NULL, class = "", show_na = TRUE)

Arguments

palette

Name of an included color palette, or palette selection input; for discrete scales, one of "rdylbu7", "orrd7", "gnbu7", "brbg7", "puor7", "prgn6", "reds5", "greens5", "greys4", "paired4" (from colorbrewer); for continuous scales, one of "grey", "brown", "purple", "prgn", "puor", "rbbu", "prgn", "vik" (default), or "lajolla".

variable

Name of a variable or ID of a variable selector to display values of. Defaults to the y variable of dataview if one is specified.

dataview

The ID of an input_dataview component.

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 FALSE, does not add the separate section showing the color of missing values.

Value

A character vector of the contents to be added.

Examples

output_legend()

uva-bi-sdad/community documentation built on Oct. 12, 2023, 1:18 p.m.