Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sliderLabel input widget #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

metanoid
Copy link

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.

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

pvictor commented Dec 18, 2018

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

@metanoid
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants