Add arcs to a globe.

globe_arcs(globe, ..., data = NULL, inherit_coords = TRUE,
  on_click = NULL, on_right_click = NULL, on_hover = NULL)

Arguments

globe

An object of class globe as returned by create_globe, or an object of class globeProxy as returned by globeProxy.

...

Coordinates, as specified by coords.

data

A data.frame of points to draw.

inherit_coords

Whether to inherit the coordinates (coords) from create_globe. Only applies to method applied to object of class globe4r not on objects of class globeProxy.

on_click

JavaScript functions as JS or TRUE to pick up the event from Shiny server side, see example.

on_right_click

JavaScript functions as JS or TRUE to pick up the event from Shiny server side, see example.

on_hover

JavaScript functions as JS or TRUE to pick up the event from Shiny server side, see example.

Coordinates

Valid coordinates.

  • start_lat, start_lon

  • end_lat, end_lon

  • altitude

  • color

  • label

  • transition

  • altitude_scale

  • stroke

  • curve_resolution

  • circular_resolution

  • dash_length

  • dash_gap

  • dash_initial_gap

  • dash_animate_time

Examples

# basic create_globe() %>% globe_arcs( data= usflights, coords( start_lat = start_lat, start_lon = start_lon, end_lat = end_lat, end_lon = end_lon, color = cnt ) ) %>% scale_arc_color() # in shiny library(shiny) ui <- fluidPage( actionButton("add", "Add arcs"), globeOutput("globe") ) server <- function(input, output){ output$globe <- renderGlobe({ create_globe() }) observeEvent(input$add, { globeProxy("globe") %>% globe_arcs( coords(start_lat, start_lon, end_lat, end_lon), data = usflights ) }) }
# NOT RUN { shinyApp(ui, server) # }