StatisticsNZ / simplevis

Simple visualisation with ggplot2 and leaflet wrappers
https://StatisticsNZ.github.io/simplevis
Other
86 stars 11 forks source link

Documentation on how to use leaf_sf_col in Shiny #454

Open filipwastberg opened 2 years ago

filipwastberg commented 2 years ago

Hi there!

Thanks for this wonderful package.

When trying to use leaf_sf* in Shiny no map appears. I'm not sure why that is and I haven't been able to find a solution in the documentation. So this issue is 1) how do you solve this 2) where should documentation for this go?

library(shiny)
library(leaflet)
library(simplevis)
library(stars)

ui <- fluidPage(
  leafletOutput("mymap"),
  p()
)

server <- function(input, output, session) {

  output$mymap <- renderLeaflet({
    leaf_sf_col(example_point, 
                col_var = trend_category)
  })
}

shinyApp(ui, server)