Comments (5)
Absolutely. I think I'd rather make this LogSlider
than Slider({type: 'log'})
. These things tend to bring in lots of corner cases and make other things (like default ranges) subtly incorrect or logic-branchy when it'd really be easier and more concise to just separate them. (In fact, I don't use control-panel's log slider because I think my implementation has a couple annoying bugs I just haven't bothered to fix 😬) What's your opinion, @marcofugaro?
from controls-state.
Alternatively, I maybe wouldn't mind a shorthand of type: 'log' with a more explicit way to specify it:
mapping: Math.log, inverseMapping: Math.exp` so that you can just be explicit about exactly how it's mapped and perform your own mapping.
from controls-state.
That's a great idea! Way more flexible, so the default would be something like:
mappingFunction: x => x
Or just mapping like you said.
Also what do you mean by inverseMapping
? For when the slider goes the inverse way?
from controls-state.
If you don't have a mapping that defines both directions, you can move a slider and convert that to a mapped value, but you won't be able to assign a value and set the slider position. In that sense it needs to be an invertible mapping. You might be able to solve that with Newton-Raphson or something, but it seems safest to just allow the user to specify the inverse mapping directly rather than guessing.
from controls-state.
Closed in #12 actually
from controls-state.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from controls-state.