-
Notifications
You must be signed in to change notification settings - Fork 97
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
Specify algorithm or a hard coded list of slider values #29
Comments
It would be nice to have an option to use an alternative scale like log10 or exponential.
Not a big fan of this. It would make the API and code somewhat messy. Also, if you are not using a consistent scale across all values, it might make sense to use a different UI, maybe a group of radio inputs? Otherwise, having a single slider with different intervals / steps seems confusing. |
Maybe "hard coded" isn't the best descriptor. A "custom function"? Rheostat for example says "Feel free to write your own as long as it conforms to the shape". It serves the same purpose as log10 or exponential, but can be tailored to ones data set better. (I assume log10 & geometric are just pre-defined functions.) To clarify the benefit, for many use cases and data sets (such as mine, somewhat represented by the examples above), changes in the lower values are much more significant to end users (i.e. a change of value from 16 to 24 or 28, etc is very important), but changes in higher values are not very significant (300 or 310 or 320 all give basically the same results), hence the steps to 10. But since I intimately know the data, I know that a scale with steps of 1 from 1-100 are very useful to the user and steps of 5 are most useful 100-195, etc. It improves the UX when this scale really fits the data well because the slider uses space most efficiently to distribute significant values, consequently it makes it easier for users to select the desired value, instead of wasting a lot of length with wasted precision on high values and reducing the slider length used for small values where changes are very significant to the user. In short, it makes it easier for the user to accurately select the desired value. |
Example of this behavior: https://refreshless.com/nouislider/slider-values/#section-non-linear-step |
good example! |
@websocket98765 I think I would side with @tajo that it shouldn't be a part of the api, it's probably something not many people will use and might make the api more complicated. But i did find myself needing increasing step values along the range for a price range (1 - thousands). I tried a logarithmic function, but it doesn't really provide a good experience (way too much precision on lower ends, and rapidly increases too quickly). I found a great SO post here: https://stackoverflow.com/a/56557377/2325766 My implementation values looked something like the following, where anything prefixed with
There are also snippets in the SO page if logarithmic transform functions are desired. |
I'm upvoting this thread. It would be great to have a logarithmic scale. |
Snap, so this is not available. :( Any pricing scheme or similar requires this, since most prices are decided by volume. |
AirBnB's rheostat, allows specifying an algorithm (deafult is linear, but others include
log10
orgeometric
). This is useful if you have a wide range of values (e.g. 1 to 1,000), but the small values are much more significant. At the small end, each value can be adjusted one by one, at the large end, it follows the algorithm and adjusts in larger increments.Alternatively, a hard coded list of values would be a good option too:
For example:
Is this possible in some way already? I may have missed it. Nice job building this slider!
The text was updated successfully, but these errors were encountered: