# NOT RUN {
choropleth <- data.frame(
countries = c("France", "Brazil", "China", "Russia", "Canada", "India", "United States",
"Argentina", "Australia"),
values = round(runif(9, 10, 25))
)
choropleth %>%
e_charts(countries) %>%
e_map(values) %>%
e_visual_map(min = 10, max = 25)
choropleth %>%
e_charts(countries) %>%
e_map_3d(values, shading = "lambert") %>%
e_visual_map(min = 10, max = 30)
buildings <- jsonlite::read_json(
paste0(
"https://ecomfe.github.io/echarts-examples/",
"public/data-gl/asset/data/buildings.json"
)
)
heights <- purrr::map(buildings$features, "properties") %>%
purrr::map("height") %>%
unlist()
names <- purrr::map(buildings$features, "properties") %>%
purrr::map("name") %>%
unlist()
data <- dplyr::tibble(
name = names,
value = round(runif(length(names), 0, 1), 6),
height = heights / 10
)
data %>%
e_charts() %>%
e_map_register("buildings", buildings) %>%
e_map_3d_custom(name, value, height) %>%
e_visual_map(
show = FALSE,
min = 0.4,
max = 1
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab