shinyWidgets icon indicating copy to clipboard operation
shinyWidgets copied to clipboard

Add sliderLabel input widget

Open metanoid opened this issue 6 years ago • 2 comments

I had a project where I needed the choices displayed to the user to be character, but the underlying data should remain numeric.

This has been implemented as assuming that choices is a named numeric vector.

Can probably be improved.

metanoid avatar Dec 12 '18 10:12 metanoid

Hi! Interesting idea! In your version this doesn't return the choices passed by the user : image January should return 1 and not 0.

I think that's possible to do something like you want directly in sliderTextInput using a named list or by adding choicesNames and choiceValues arguments (like in radioButtons, checkboxGroupInput...) But it will require to change the JavaScript bindings.

Victor

pvictor avatar Dec 18 '18 17:12 pvictor

Hi! Interesting idea! In your version this doesn't return the choices passed by the user : image January should return 1 and not 0.

I think that's possible to do something like you want directly in sliderTextInput using a named list or by adding choicesNames and choiceValues arguments (like in radioButtons, checkboxGroupInput...) But it will require to change the JavaScript bindings.

Victor

Agreed, this is an off-by-one bug in my hastily written code - having it as a form of sliderTextInput would be much better but I don't have the skills to do that.

metanoid avatar Dec 25 '18 18:12 metanoid