legend_element: Legend Element

Description Usage Arguments See Also Examples

View source: R/legend.R

Description

Creates a mapdeck legend element for when you want to manually specify a legend (using mapdeck_legend)

Usage

1
2
3
4
5
6
7
8
legend_element(
  variables,
  colours,
  colour_type = c("fill", "stroke"),
  variable_type = c("category", "gradient"),
  title = "",
  css = ""
)

Arguments

variables

variables assigned to colours

colours

vector of hex colours assigned to variables

colour_type

one of "fill" or "stroke"

variable_type

one of category (discrete) or gradient (continuous)

title

string used as the legend title

css

string of css to control appearance.

See Also

mapdeck_legend

Examples

1
2
3
4
5
6
7
l1 <- legend_element(
	variables = c("a","b")
	, colours = c("#00FF00","#FF0000")
	, colour_type = "fill"
	, variable_type = "category"
	, title = "my title"
)

mapdeck documentation built on Sept. 4, 2020, 9:07 a.m.