How can I apply the filter feature on my graph

I am trying to apply ‘Advanced Filter Usage’ from the dash documentation, Filtering Syntax | Dash for Python Documentation | Plotly, on a graph.

What is a good way of going about it?

In the example, it doesn’t look like they change the data frame.

My reasoning is that I am going to have different headers for each data frame that I upload, and I want to be able to filter on them and have my graph change accordingly.

I was thinking about parsing out the writing and applying the filters to the data frame, but this seems complicated and unnecessary, any ideas would be great.

Thank you