rreusser / controls-state

⚙️ An object for managing state
https://observablehq.com/@rreusser/control-panel-2-prototype-test
21 stars 2 forks source link

Mapped slider #12

Closed rreusser closed 4 years ago

rreusser commented 4 years ago

@marcofugaro This is a bit weird and confusing to implement, so I took a stab at it. Here's my rationale:

My goal was primarly not to modify how the state object works all all, to the extent possible. The only change I made was in the step size selection logic. Otherwise it works as an object on which you can get and set values (even mapped) without modification.

The trick then (see followup PR: https://github.com/rreusser/controls-gui/pull/10) is strictly how to use the mapping to interpret the corresponding UI control.

marcofugaro commented 4 years ago

That's way more straightforward than my attempt, good job! Thanks @rreusser