emap_lines: Add map lines

Description Usage Arguments Details See Also Examples

View source: R/add.R

Description

Add lines on map.

Usage

1
2
3
4
5
6
7
8
9
emap_lines(p, edges, source, target, name = NULL, clickable = TRUE,
  symbol = "arrow", symbolSize = 2, symbolRotate = NULL, large = FALSE,
  smooth = TRUE, z = 2, zlevel = 0, smoothness = 0.2, precision = 2,
  bundling = list(enable = FALSE, maxTurningAngle = 45), ...)

emap_lines_(p, edges, source, target, name = NULL, clickable = TRUE,
  symbol = "arrow", symbolSize = 2, symbolRotate = NULL, large = FALSE,
  smooth = TRUE, z = 2, zlevel = 0, smoothness = 0.2, precision = 2,
  bundling = list(enable = FALSE, maxTurningAngle = 45), ...)

Arguments

p

an echart object.

edges

edges data.frame.

source, target

source and target columns in edges data.frame.

name

name of serie.

clickable

whether lines are clikable.

symbol

symbol, see valid details for valid values.

symbolSize

of symbol.

symbolRotate

angle by which symbol is rotated, i.e.: 30.

large

optimises for 2'000 data points and over.

smooth

whether to smooth lines.

z, zlevel

first and second grade cascading control, the higher z the closer to the top.

smoothness

line smoothness

precision

for 'average'.

bundling

edge bundling settings, see usage.

...

any other options to pass to line.

Details

Valid values for symbol:

See Also

emap_coords official map line docs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
## Not run: 
coords <- data.frame(city = c("London", "New York", "Beijing", "Sydney"),
  lon = c(-0.1167218, -73.98002, 116.3883, 151.18518),
  lat = c(51.49999, 40.74998, 39.92889, -33.92001))

edges <- data.frame(source = c("Beijing", "Beijing", "New York"),
  target = c("Sydney", "London", "London"))

coords %>%
  echart_("city") %>%
  emap() %>%
  emap_coords_("lon", "lat") %>%
  emap_lines_(edges, "source", "target")

edges2 <- data.frame(source = "London", target = "Sydney")

coords %>%
  echart_("city") %>%
  emap() %>%
  emap_coords_("lon", "lat") %>%
  emap_lines_(edges, "source", "target") %>%
  emap() %>%
  emap_coords_("lon", "lat") %>%
  emap_lines_(edges2, "source", "target", effect = emap_line_effect()) %>%
  etheme("helianthus")

coords2 <- data.frame(city = "Sydney", lon = 151.18518, lat = -33.92001, value = 20)

coords %>%
  echart_("city") %>%
  emap() %>%
  emap_coords_("lon", "lat") %>%
  emap_lines_(edges, "source", "target") %>%
  edata_(coords2, "city") %>%
  emap() %>%
  emap_coords_("lon", "lat") %>%
  emap_lines_(edges2, "source", "target", effect = emap_line_effect(scaleSize = 2)) %>%
  emap_coords_("lon", "lat") %>%
  emap_points_("value", symbol = "emptyCircle", effect = list(show = TRUE, shadowBlur = 10)) %>%
  etheme("dark")

## End(Not run)

JohnCoene/echarts documentation built on May 22, 2021, 6:18 p.m.