Filter Plotly Gantt Chart based on columns

I’m using plotly express to generate a Gantt Chart that has quite a bit of information.

Let’s say I want to add some additional descriptors for each task such as “Type” or “Rank”

import as px
import pandas as pd

df = pd.DataFrame([
    dict(Task="Job A", Start='2009-01-01', Finish='2009-02-28', Resource="Alex", Type="A", Rank="A"),
    dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15', Resource="Steve", Type="A", Rank="A"),
    dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30', Resource="Max", Type="B", Rank="A"),
    dict(Task="Job A", Start='2010-01-01', Finish='2010-02-28', Resource="Alex", Type="A", Rank="B"),
    dict(Task="Job B", Start='2010-03-05', Finish='2010-04-15', Resource="Steve", Type="A", Rank="B"),
    dict(Task="Job C", Start='2010-02-20', Finish='2010-05-30', Resource="Max", Type="B", Rank="A")

fig = px.timeline(df, x_start="Start", x_end="Finish", y="Task", color="Resource")

Plotly Express will group by resource name and allow me to select/deselect what appears on the chart using the legend but what if I want to do additional filtering using the extra columns? For example, If I only want to show Type “B” tasks with a Rank of “A”. Is there a way to do so with a sort of “filter” that has similar functionality to the filter/slicer in say Microsoft Excel?

Another example is if I have 40 tasks assigned to 20 resources. Let’s say half are full time employees and half are contractors. How can I quickly filter down to view “All”, “Employees Only”, and “Contractors” only?

I want to point out I’m also open to using the legacy figure factory instead of the plotly express timeline wrapper.