lonboard.controls¶
lonboard.controls.MultiRangeSlider ¶
Bases: VBox
A widget for multiple ranged sliders.
This is designed to be used with the DataFilterExtension when you want to filter on 2 to 4 columns on the same time.
If you have only a single filter, use an ipywidgets FloatRangeSlider directly.
Example¶
from ipywidgets import FloatRangeSlider
slider1 = FloatRangeSlider(
value=(2, 5),
min=0,
max=10,
step=0.1,
description="First slider: "
)
slider2 = FloatRangeSlider(
value=(30, 40),
min=0,
max=50,
step=1,
description="Second slider: "
)
multi_slider = MultiRangeSlider([slider1, slider2])
multi_slider
Then to propagate updates to a rendered layer, call jsdlink to connect the two widgets.
from ipywidgets import jsdlink
jsdlink(
(multi_slider, "value"),
(layer, "filter_range")
)
As you change the slider, the filter_range
value on the layer class should be
updated.