Shiny Slider Customized Values

前端 未结 4 1682
一向
一向 2020-12-19 12:53

I am trying to set custom values for shiny slider (1,5,10,15,20,25 and 30). I tried step but then the results either (0,5,10,15,20,25,30) or (1,6,11,16,21,26,31

4条回答
  •  隐瞒了意图╮
    2020-12-19 13:32

    This can be easily done using sliderTextInput function in shiny. No need to add all this complex js function. Just a few lines of code will do the trick.Install the shinywidgets package which contains the sliderTextInput function. Do the following :

      sliderTextInput("decade","Time (decade):, 
                      choices = c(1,5,10,15,20,25,30), 
                      selected = c(1,5,10,15,20,25,30), 
                      animate = FALSE, grid = FALSE, 
                      hide_min_max = FALSE, from_fixed = FALSE,
                      to_fixed = FALSE, from_min = NULL, from_max = NULL, to_min = NULL,
                      to_max = NULL, force_edges = FALSE, width = NULL, pre = NULL,
                      post = NULL, dragRange = TRUE)
    

提交回复
热议问题