I have multiple outputs in a callback that is triggered by a single “submit” click. I’m interested to know the most efficient and presentable way to add the outputs.
- Single callback - Current method. What I don’t like Is the amount of information I need to add to a single function. Is there a way around this?
- Multiple callbacks - I couldn’t get multiple callbacks with a single input to work
@app.callback(
Output('graph_1', 'figure'),
Output('card-first-value1','value'),
Output('card-first-value2','value'),
Output('card-first-value3','value'),
Output('card-sec-value1','value'),
Output('card-sec-value2','value'),
Output('card-sec-value3','value'),
Output('graph_1_fourth_row', 'figure'),
Output('card-first-value2-third-row', 'value'),
Output('card-first-value3-third-row', 'value'),
Input('submit_button','n_clicks'),
State('dropdown-a','value'),
State('dropdown-b','value'),
State('my-date-picker', 'date'))
def create_graph(n,a,b, date):
*pulling data from database and building graphs*
return *all outputs*
Appreciate the help!