inst/examples/deckgl-api-reference/arc-layer.R

data("bart_segments")

properties <- list(
  getWidth = 12,
  getSourcePosition = ~from_lng + from_lat,
  getTargetPosition = ~to_lng + to_lat,
  getSourceColor = "@=[Math.sqrt(inbound), 140, 0]",
  getTargetColor = "@=[Math.sqrt(outbound), 140, 0]",
  tooltip = use_tooltip(
    html = "{{from_name}} to {{to_name}}",
    style = "background: steelBlue; border-radius: 5px;"
  )
)

deck <- deckgl(zoom = 10, pitch = 35) %>%
  add_arc_layer(data = bart_segments, properties = properties) %>%
  add_control("Arc Layer", "top-left") %>%
  add_basemap()

if (interactive()) deck
crazycapivara/deckgl documentation built on March 29, 2023, 4:10 a.m.