My shiny app has a sliderInput
, but want to replace values as character labels. How could I implement it? Thanks for any suggestions.
This is my example
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("foo","Animation Duration" ,
choices = c("Label 1", "Label 3", "Label 3"),
selected = c("Label 1", "Label 3", "Label 3"), #incase you want all values by default
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)