giswqs / streamlit-timeline

Streamlit component for rendering vis.js timeline
https://timeline.streamlitapp.com
MIT License
90 stars 11 forks source link

Zoom timeline to current time #10

Open thebirdgr opened 4 months ago

thebirdgr commented 4 months ago

Is it possible to have an argument that when passed, will zoom the timeline to specified timestamp? I have historical dating back 6 months, however, I would like to focus on the data closer to the current time while still keeping history.

robert-kloepsch commented 2 months ago

By setting start and end argument in the options you can define the intial frame displayed by the timeline if that is what you are looking for. It could look like this:

from streamlit_timeline import st_timeline

st_timeline(items=[], groups=[], options={ "start": "2022-01-10", "end": "2023-01-10", } )