Any exemple on how to set a range or a property of a range-slider input from a button ?
I cannot figure out how to use Synchronized inputs.
Here is a test
Any exemple on how to set a range or a property of a range-slider input from a button ?
I cannot figure out how to use Synchronized inputs.
Here is a test
The Synchronized Inputs technique depends on an input implementing a special getter-setter pattern documented here. Most of the official Observable Inputs implement it; most community inputs (or plain HTML inputs, like <input />
) donāt.
The range slider is from a community notebook by @mootari and doesnāt implement the same pattern. Maybe it could, although Iād have to think about how itād be different since the value is an array object.
Hereās an example of how you could accomplish the same sort of thing without using set
on the rangeSlider
directly:
Juice is designed to retrofit the get/set behaviour to components that did not include it, and has a good example of making range sliderās min and max backwritable. You could apply it to mootariās too
Or you could just import interval
instead, which is designed to match Observableās Inputs library:
import {interval} from '@mootari/range-slider'
viewof s1 = interval([0, 100], {
step: 1,
value: [0, 20],
label: "Range"
})
See the changelog for more details.
I adopt the use of a mutable value.
Seems the easier solution for me.
Thanks a lot.
Iāve sent you a suggestion: Comparing Synchronized Inputs with range-slider to Synchronized Inputs with range-slider / Observable
oh snap hadnt seen this, nice