e_map_register: Register map

View source: R/map.R

e_map_registerR Documentation

Register map

Description

Register a geojson map.

Usage

e_map_register(e, name, json, ...)

e_svg_register(e, name, svg)

e_map_register_p(
  name,
  json,
  async = FALSE,
  session = shiny::getDefaultReactiveDomain()
)

e_map_register_ui(name, json, async = FALSE)

Arguments

e

An echarts4r object as returned by e_charts.

name

Name of map, to use in e_map.

json, svg

Geojson, or SVG.

...

Additional options passed to registerMap.

async

Whether to read the file asynchronously.

session

A valid Shiny session.

Details

e_map_register_p is not truly a proxy as it does not require a chart to function. While the function e_map_register_ui is meant to register the map globally in the Shiny UI, not that then json must be accessible from the UI (generally www folder).

Examples

## Not run: 
json <- jsonlite::read_json("https://echarts.apache.org/examples/data/asset/geo/USA.json")

USArrests |>
  tibble::rownames_to_column("states") |> 
  e_charts(states) |>
  e_map_register("USA", json) |>
  e_map(Murder, map = "USA") |>
  e_visual_map(Murder)

## End(Not run)


JohnCoene/echarts4r documentation built on Feb. 23, 2024, 9:21 a.m.