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

Showing only a window of time

I’m making a line graph out of CSV data and I’d to use a slider to control where in the data you’re looking.

I’m following this guide:
https://dash.plot.ly/getting-started-part-2

specifically the example where dcc.slider updates dcc.graph

I’m taking this example and attempting to modify it to my needs.

The slider min/max are equal to df[‘timestamp’].min()/max respectively

I’d like the value of the slider to be the input of my callback, and i’d like this callback to update the current window of time you’re viewing in the data, the slider location would be the center of the data and I’d like to be able to see lets say 20 entries, or 20 timestamps before and after the location of the slider.