Black Lives Matter. Please consider donating to Black Girls Code today.

Loop over slider vaues

Does anyone how to loop over values from a slider?

In detail:

I am having a map with an overlay that is time dependent. I build up a dashboard with a rangeSlider where you can define the timestamp of the shown overlay. Now I want to have the option to loop over all the values in the range slider automatically.

Is there a feature for this purpose?

Otherwise I could take a Interval component that will change the latest value of the slider in the required interval. But this might be a bit hacky and I am sure there could be a more accurate way to handle this.

If interpret your question correctly, coupled by the fact that you are displaying weather info, I consider the interval option ideal. You could have a play button that sets the interval and then increment the value of the slider as desired, thereby utilizing the callbacks already in place for when the user manually selects a value on the slider.

1 Like

Thx @flyingcujo
But to have this as a component would be very useful and would push this mapbox feature closer to solutions like leaflet.

Hi @meteoDan, you can control this directly from the plotly figure, using animations. Maybe this would be closer to what you need than a callback? See, and also discussions here about changing the animation speed.

1 Like

@Emmanuelle thanks for this nice hint. I guess this is doing everything I need. I will give it a try.