leafletOutput and recalculation opacity

146 views
Skip to first unread message

Rob Davidson

unread,
Feb 6, 2016, 4:26:40 PM2/6/16
to Shiny - Web Framework for R
I know there has been unresolved discussion before, is there a way to suppress the transparency change when slider is moved.  When using animation option the result is choppy and distracting.  Tried the 

          tags$style(type="text/css",
           "#mymap.recalculating { opacity: 1.0;"),

          leafletOutput("mymap"),

with no success.

You can see issue at https://robscottd.shinyapps.io/BikeApp/   



Joe Cheng

unread,
Feb 6, 2016, 9:03:03 PM2/6/16
to Rob Davidson, Shiny - Web Framework for R
I think you're missing a closing } in your CSS. Other than that it looks correct.
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/61cfde8f-4b5a-4bb9-9daf-ad150d876d7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob Davidson

unread,
Feb 7, 2016, 1:05:45 PM2/7/16
to Shiny - Web Framework for R, robs...@gmail.com

Actually that was edited wrongly by me in the original post.  The code running is:

                   
          title="Bikes and Weather!",
          tags$style(type="text/css",
           "#mymap.recalculating { opacity: 1.0 }"),
          leafletOutput("mymap"),

I tried it with the "!important" as well with no luck.  Still Blinking

Thanks for the quick response!

Joe Cheng

unread,
Feb 8, 2016, 1:33:21 PM2/8/16
to Rob Davidson, Shiny - Web Framework for R
This works for me:

library(leaflet)
library(shiny)

ui <- fluidPage(
  tags$style(type="text/css",
    "#mymap.recalculating { opacity: 1.0; }"),
  leafletOutput("mymap")
)

server <- function(input, output, session) {
  output$mymap <- renderLeaflet({
    Sys.sleep(4)
    invalidateLater(1000)
    leaflet() %>% addTiles()
  })
}

shinyApp(ui, server)

Reply all
Reply to author
Forward
0 new messages