How to use datetime slider to slide in terms of fixed time frames

Is there a widget in bokeh with that I can achieve the requirement shown in figure below ?. I want the plot to always display 15 minutes data and I also want to dynamically change the slider windows size (from present 15 min size)
How can add a play button for the same?.

Thank you


The DateRangeSlider is probably the best premade widget given your requirements. See its description here

Its value property is a tuple of (Datetime, Datetime), where the first element would correspond to Time P and the second element would correspond to Time Q in your drawing.

These values are independently moveable, so if you want them to do something different like constrained to move together when dragging the lefthand side and stretch/shrink when dragging the righthand side, you would have to make that happen in your callbacks, I believe.

Regarding a play button, its a matter of writing the logic in your callbacks to simply make the button stream data to the plot. If you want to make it move the sliders, I think that should also just be a matter of writing the callbacks and interactions do what you want.