RangeSlider js_link with a Range object

Is there a way to link the value of a RangeSlider (Tuple[Float, Float]) with a Range1D object’s start/end using js_link?

This would work with a standard Slider

slider.js_link('value', figure.x_range, "start")

And I was hoping I could do something like (but it errors):

slider.js_link('value[0]', figure.x_range, "start")

And the same but for value[1] and end respectively.


There is not, you would need to write the one-line CustomJS callback to pick out the appropriate single value from the slider tuple and set start or end as appropriate.

1 Like

Ok sounds good. Any future plans out of curiousity?

Not offhand. I suppose something like this might increase the utility of js_link:

slider.js_link('value', figure.x_range, "start", selector=0) # value[0]

I’d suggest you open a GitHub issue to discuss it (especially if you’d be interested to work on it, it would be a great first issue).

Setting up my dev environment and then will do! :slight_smile: