Hi all, I am new in Dash (and Python for that matter) and was wondering about the following: Is it possible to have a dropdown menu with a group of strings as a list or something, instead of having to add all of them as label-values pairs. As an example, say that in a slightly different version of the plotly example we have the following:
dcc.Dropdown(
options=[
{'label': 'New York City', 'value': 'NYC'},
{'label': 'San Francisco', 'value': 'SF'},
{'label': 'Montreal', 'value': 'MTL'},
{'label': 'Toronto', 'value': 'TR'}
],
value=['MTL', 'NYC'],
multi=True)
Is there a way of grouping together cities from the two countries (US and Canada) and call them in single label-value pairs from the dataframe they come from, e.g.:
{‘label’: [‘Canada’], ‘value’: [‘MLT’, ‘NYC’]}
or something similar?
I hope that makes sense.