globe_bars.Rd
Add bars to a globe.
globe_bars( globe, ..., data = NULL, inherit_coords = TRUE, on_click = NULL, on_right_click = NULL, on_hover = NULL )
globe | An object of class |
---|---|
... | Coordinates, as specified by |
data | A data.frame of points to draw. |
inherit_coords | Whether to inherit the coordinates ( |
on_click, on_right_click, on_hover | JavaScript functions as JS
or |
Valid coordinates (depending on layer).
lat
, lon
,
altitude
radius
color
label
resolution
merge
transition
# basic create_globe() %>% globe_pov(-21, 179) %>% globe_bars(coords(lat, long, altitude = mag), data = quakes) # use in shiny library(shiny) ui <- fluidPage( actionButton("add", "Add points"), globeOutput("globe"), verbatimTextOutput("clicked") ) server <- function(input, output){ output$globe <- renderGlobe({ create_globe() %>% globe_img_url() }) observeEvent(input$add, { globeProxy("globe") %>% globe_bars(coords(lat, long), data = quakes, on_click = TRUE) %>% globe_pov(-21, 179) }) output$clicked <- renderPrint({ input$globe_click_bar }) }# NOT RUN { shinyApp(ui, server) # }