knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) library(echarts4r.maps)
Includes:
Install echarts4r
.
install.packages("echarts4r")
Then install echarts4r.maps
install.packages("remotes") remotes::install_github('JohnCoene/echarts4r.maps')
Use in echarts4r
library(echarts4r) library(echarts4r.maps) df <- data.frame( x = c( "Rajasthan", "Gujarat", "Odisha" ), y = 1:3 ) df %>% e_charts(x) %>% em_map("India") %>% e_map(y, map = "India") %>% e_visual_map(y) # cities library(dplyr) data("cities") cities %>% filter(country == "US") %>% mutate(val = runif(n(), 1, 2)) %>% e_charts(lon) %>% em_map("USA") %>% e_geo(map = "USA") %>% e_scatter(lat, val, coord_system = "geo", scale = NULL) %>% e_visual_map(min = 1, max = 2)
Another great resource for detailed maps is here (use with e_map_register
).
em_bank()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.