R/mod_max_obs_interval_slider.R

Defines functions mod_max_obs_interval_slider_server mod_max_obs_interval_slider_ui

#' min_obs_interval_slider UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd 
#'
#' @importFrom shiny NS tagList 
mod_max_obs_interval_slider_ui <- function(id){
  ns <- NS(id)
  tagList(
    div(class = "time-slider",
        div(class = "ui horizontal divider", "max time interval in hours"),
        shiny::sliderInput(ns('time_slider'), value = 24, min = 0, max = 48, label = NULL)
    )
  )
}
    
#' min_obs_interval_slider Server Function
#'
#' @noRd 
mod_max_obs_interval_slider_server <- function(input, output, session){
  ns <- session$ns
  observeEvent(input$time_slider, {
    dataStore$setMaxTimeInterval(input$time_slider)
  })
}
    
## To be copied in the UI
# mod_max_obs_interval_slider_ui("max_obs_interval_slider_ui_1")
    
## To be copied in the server
# callModule(mod_max_obs_interval_slider_server, "max_obs_interval_slider_ui_1")
 
filpro/vessel_challenge documentation built on March 17, 2021, 4:53 p.m.