'Plotly: How to filter a pandas dataframe using a dropdown menu?

I have a dataframe and using plotly I want to visualise the data. I have the following code

fig = px.line(df, x="row_num", y="audienceWatchRatio", color='vid_id')
fig.show() 

enter image description here

It's really messy, so I want a drop-down menu where the user can just select the vid_id and it only shows the 1 graph.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source