In a shiny app I am currently developing the server regularly updates the min/max values of a sliderInput using updateSliderInput. For follow up calculations on the server I need to know what the current min/max values of the slider are. Is there any possibility in shiny to access the current min/max values of a sliderInput object (as symbolized by input$slider$max in the example below)?
library(shiny)
ui <- fluidPage(
mainPanel(
sliderInput("slider","Slider:", min = 1, max = 50, value = 30),
selectInput("input","Input:",choices = c("a","b","c"))
)
)
server <- function(input, output, session) {
updateSliderInput(session,"slider",max=round(abs(rnorm(1)*100)))
observe(print(input$slider$max))
}
shinyApp(ui = ui, server = server)
I am aware that I could introduce a separate variable tracking the status of the min/max settings, but (if possible) would like to avoid that options as it bears the risk of getting out of sync between actual settings and settings stored in the tracking variable.
edit: I am looking for the min/max settings set in sliderInput or updateSliderInput, not for the min/max range a user might choose. Moving the slider to read min and max is (if possible) also not an option as I need to get this information without updating the slider.