地震
library(echarts4r)
quakes |>
e_charts(long) |>
e_geo(
roam = TRUE,
boundingCoords = list(
c(185, - 10),
c(165, -40)
)
) |>
e_scatter_gl(lat, depth) |>
e_visual_map()
使用WebGL绘制更大的图
#Use graphGL for larger networks
nodes <- data.frame(
name = paste0(LETTERS, 1:300),
value = rnorm(300, 10, 2),
size = rnorm(300, 10, 2),
grp = rep(c("grp1", "grp2", "grp3"), 100),
stringsAsFactors = FALSE
)
edges <- data.frame(
source = sample(nodes$name, 400, replace = TRUE),
target = sample(nodes$name, 400, replace = TRUE),
stringsAsFactors = FALSE
)
e_charts() |>
e_graph_gl() |>
e_graph_nodes(nodes, name, value, size, grp) |>
e_graph_edges(edges, source, target)
参考资料:
https://echarts4r.john-coene.com/articles/gl.html