Say I have a function that returns a chart. I want a user to be able to select from a drop down menu and their selections become the inputs to the function. Here is an MRE, but the actual charts and data I'm using are much more complicated so I don't want to use shortcuts or change which data is passed into the chart.
I've already read this documentation. https://plotly.com/python/dropdowns/
Here is the MRE:
import plotly.express as px
data_canada = px.data.gapminder().query("country == 'Canada'")
def charts(input):
if input == 'A':
fig = px.bar(data_canada, x='year', y='pop')
if input == 'B':
fig = px.bar(data_canada, x='year', y='lifeExp')
fig.show()
So what I need from here is how to create drop down menus that is an input to this function.

plotly_expressor can you also use the wholeplotlylibrary?