How can you hide plotly graph objects that are not relevant between a certain time interval?

How can you hide plotly graph objects that are not relevant between a certain time interval?
Was thinking something like this…

def test_range_for_relevant_view_frame(n):
#for each Entity ID in the Entity Table
for Entity_ID in Entity
#if the Start_Time is +/- 30s of the Entity_ID
if -30seconds <= Start_Time <= 30seconds:
#configure to display entity
config = {‘displayentity’: true}
#else, if the Start_Time is outside the above parameters
else:
#configure to not display the Entity_ID
config = {‘displayentity’: false}

Not sure if that’s any good though.

Thank you in advance for your time and attention!

Cheers,
Nichole