Hello,
I am running the above-mentioned error. I am rather new to plotly, so any help would be appreciated.
I am trying to create a dashboard in plotly.
Here is the code
@app.callback(Output(component_id ='TS_Graph_1', component_property = 'figure'),
[Input(component_id = 'btn_TS_confirmed', component_property = 'n_clicks')],
[Input(component_id = 'btn_TS_active', component_property = 'n_clicks')],
[Input(component_id = 'btn_TS_recovered', component_property = 'n_clicks')],
[Input(component_id = 'btn_TS_death', component_property = 'n_clicks')]
)
def displayClick(btn1, btn2, btn3, btn4):
changed_id = [p['prop_id'] for p in dash.callback_context.triggered][0]
print(changed_id)
if 'btn_TS_confirmed-1' in changed_id:
fig = TS_Complete_Figures[0]
elif 'btn_TS_active' in changed_id:
fig = TS_Complete_Figures[1]
elif 'btn_TS_recovered' in changed_id:
fig = TS_Complete_Figures[2]
elif 'btn_TS_death' in changed_id:
fig = TS_Complete_Figures[3]
else:
fig = TS_Complete_Figures[0]
return fig
I am trying to update a graph div once a specific button is pressed.
I have a list of figure objects and once a button is pressed a relevant image should be displayed in the graph div
Here is the SS of my application and div structure.
Thank you