Skip to contents

Leaflet only works with e_scatter and e_effect_scatter.

Scatter

url <- "https://echarts.apache.org/examples/data-gl/asset/data/population.json"
data <- jsonlite::fromJSON(url)
data <- as.data.frame(data)
names(data) <- c("lon", "lat", "value")
data$value <- log(data$value)

data |> 
  e_charts(lon) |> 
  e_leaflet() |>
  e_leaflet_tile() |>  
  e_scatter(lat, size = value, coord_system = "leaflet")

Mapbox

You will need mapbox token.

data |> 
  e_charts(lon) |> 
  e_mapbox(
    token = "YOUR_TOKEN",
    style = "mapbox://styles/mapbox/dark-v9"
  ) |> 
  e_bar_3d(lat, value, coord_system = "mapbox") |> 
  e_visual_map(value)