I have built an app with multiple dropdowns and a button, the output being a chart which depends on the dropdown values.
spline_rc_app = dash.Dash(__name__, external_stylesheets=[dbc.themes.LITERA])
spline_rc_app.layout = html.Div([
dcc.Dropdown(id = 'country'....)
dbc.Button("Run",id='run_spline'...)
html.Div(id='output', children =[])
])
@spline_rc_app.callback(Output('output', 'children', allow_duplicate=True),
Input('run_spline', 'n_clicks'),
State('country', 'value'),
State('output', 'children'),
prevent_initial_call=True
)
def add_chart(n_clicks, children, country):
if not n_clicks:
raise PreventUpdate
data_cmt_country = eur_cmt_curves[country] ## this is giving an error on country, but if I replace by 'belgium', it is working well...
....
Any idea how to access the dropdown value to filter a dataframe in the callback function..?
Thanks