config_bubbles: Configure bubbles

Description Usage Arguments Examples

View source: R/opts.R

Description

Define options of the bubbles.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
config_bubbles(
  p,
  popup.on.hover = TRUE,
  highlight.on.hover = TRUE,
  fill.opacity = 0.75,
  animate = TRUE,
  border.width = 1,
  border.opacity = 1,
  border.color = "#FDFDFD",
  highlight.fill.color = "#FC8D59",
  highlight.border.opacity = 1,
  highlight.border.color = "rgba(250, 15, 160, 0.2)",
  highlight.fill.opacity = 0.85,
  highlight.border.width = 2,
  exit.delay = 100,
  ...
)

Arguments

p

a datamaps object.

popup.on.hover

whether to show popover.

highlight.on.hover

whether to enable popover.

fill.opacity

opacity of bubbles.

animate

Wether to animate bubbles.

border.width

width of bubbles.

border.opacity

opacity of bubbles' border.

border.color

color of bubbles' border.

highlight.fill.color

bubbles fill color on hover.

highlight.border.opacity

bubbles opacity on hover.

highlight.border.color

bubble's border opacity on hover.

highlight.fill.opacity

bubble's opacity on hover.

highlight.border.width

bubble's width on hover.

exit.delay

highlight delay.

...

any other parameter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
coords <- data.frame(city = c("London", "New York", "Beijing", "Sydney"),
                     lon = c(-0.1167218, -73.98002, 116.3883, 151.18518),
                     lat = c(51.49999, 40.74998, 39.92889, -33.92001),
                     values = runif(4, 3, 20))

coords %>%
    datamaps(default = "lightgray") %>%
    add_bubbles(lon, lat, values * 2, values, city) %>%
    config_bubbles(highlight.border.color = "rgba(0, 0, 0, 0.2)",
                   fill.opacity = 0.6,
                   border.width = 0.7,
                   highlight.border.width = 5,
                   highlight.fill.color = "green")

JohnCoene/datamaps documentation built on Aug. 30, 2020, 7:20 a.m.