po_geomap {d3po}R Documentation

Geomap

Description

Plot a geomap

Usage

po_geomap(d3po, ..., data = NULL, map = NULL, inherit_daes = TRUE)

Arguments

d3po

Either the output of d3po() or d3po_proxy().

...

Aesthetics, see daes().

data

Any dataset to use for plot, overrides data passed to d3po().

map

map to use (i.e., any valid list or topojson file such as maps$south_america or jsonlite::fromJSON("south_america.topojson", simplifyVector = F))

inherit_daes

Whether to inherit aesthetics previous specified.

Value

an 'htmlwidgets' object with the desired interactive plot

Examples

dout <- map_ids(d3po::maps$asia$japan)
dout$value <- ifelse(dout$id == "TK", 1L, NA)
dout$color <- ifelse(dout$id == "TK", "#bd0029", NA)

d3po(dout) %>%
  po_geomap(
    daes(
      group = id, color = color, size = value,
      tooltip = name
    ),
    map = d3po::maps$asia$japan
  ) %>%
  po_title("Pokemon was created in the Japanese city of Tokyo")

[Package d3po version 0.5.5 Index]