WayneGitShell / GWSDAT

GroundWater Spatiotemporal Data Analysis Tool (GWSDAT) R-Shiny implementation.
https://stats-glasgow.shinyapps.io/GWSDAT
31 stars 7 forks source link

Timepoint sliderValues: Need delayed reactivity for the slider or plot function trigger too often. #171

Closed andrejadd closed 7 years ago

andrejadd commented 7 years ago

see inputs timepoint_sp and timepoint_tt, both need to be slightly delayed.

andrejadd commented 7 years ago

Put in a debounce on input$timepoint_sp and input$timepoint_tt. Inside server():

 timepoint_sp_d <- debounce(reactive({input$timepoint_sp}) , 500)
 timepoint_tt_d <- debounce(reactive({input$timepoint_tt}) , 500)

# use timepoint_sp_d() and timepoint_tt_d() inside renderPlot() to delay rendering

Works not bad, but not 100% satisfied:

  1. Code is inside server(), but I would preferable have it inside sliderValues()
  2. debounced value is a function not a variable

Putting this into backlog, maybe there will be some time to improve sliderValues() and make input$timepoint_* directly debounce (see source of sliderInput(), e.g.).

andrejadd commented 7 years ago

I put in a debounce on timepoint_sp and timepoint_tt.