I have a list of buttons that should individually update the same graph, and instead of writing them all as individual inputs to the same callback I have created a for loop to create the callbacks for each button, but i get the following error:
Multi output …ButtonGraph.figure… contains an Output
object that was already assigned.
Duplicates: {‘ButtonGraph.figure’}
Is there any way to allow duplicates or do i have to create one callback with one ouput for all inputs for all buttons?
Example code:
def create_button_plot(df,button):
fig = somefunc(df,button)
return fig
Button_list=[1,2,3,4,5,6,7,8,9,10,11,12,13]
for button in Button_list:
app.callback([Output('ButtonGraph','figure')],
[Input('button_{}'.format(tool),'n_clicks')]
)(create_button_plot(df,button)