Hi! I have this code and it works fine
@app.callback([Output('SELL_vs_BUY_graph', 'figure'),
Output("button_calculate_SELL_vs_BUY", 'n_clicks'),
Output("text_SELL_vs_BUY", "children")],
[Input("button_calculate_SELL_vs_BUY", 'n_clicks')],
[State('input_database_name_SELL_vs_BUY', 'value'),
State('input_day_SELL_vs_BUY', 'value'),
State('partial_time_SELL_vs_BUY', 'value'),
State('number_of_levels_SELL_vs_BUY', 'value'),
State('step_size_of_level_SELL_vs_BUY', 'value'),
State('time_SELL_vs_BUY', 'value'),
State('save_SELL_vs_BUY', 'value'),
State('partials', 'children')]
)
def sell_vs_buy_graph(button_calculate, database_name, input_day, user_partial_time,
number_of_levels, step_size_of_level, time_depth_om, save, partials):
pass
But I would like use long_callback, unfortunately, documentation is poor in this regard (1, 2)
I would like use something like this:
@app.long_callback(
output=[Output('SELL_vs_BUY_graph', 'figure'),
Output("button_calculate_SELL_vs_BUY", 'n_clicks'),
Output("text_SELL_vs_BUY", "children")],
args=(Input("button_calculate_SELL_vs_BUY", 'n_clicks'),
[State('input_database_name_SELL_vs_BUY', 'value'),
State('input_day_SELL_vs_BUY', 'value'),
State('partial_time_SELL_vs_BUY', 'value'),
State('number_of_levels_SELL_vs_BUY', 'value'),
State('step_size_of_level_SELL_vs_BUY', 'value'),
State('time_SELL_vs_BUY', 'value'),
State('save_SELL_vs_BUY', 'value'),
State('partials', 'children')]),
running=[
(Output("button_calculate_SELL_vs_BUY", "disabled"), True, False),
],
progress=[Output("progress_bar", "value"), Output("progress_bar", "max")],
)
But i get errors: dash.exceptions.CallbackException: Inputs do not match callback definition
Or TypeError: sell_vs_buy_graph() missing 9 required positional arguments: 'button_calculate', 'database_name', 'input_day', 'user_partial_time', 'number_of_levels', 'step_size_of_level', 'time_depth_om', 'save', and 'partials'
. I have tried a lot of different options, because i can’t find documentation how to write code in my case. Can anybody help me, please?