Hello,
I want to update a graph from dropdown and interval component. when i try as a callback multiple imputs the graph doesn’t work. here the code i wrote.
Please help!!!
first tip: when you have a callback with multiple Inputs, the function should have the same number of variables.
I will comment your code… hope it helps a bit!
@app.callback(
Output(“graph”, “figure”),
[Input(“UC-memory-1”, “data”), #is this one the dropdown? If it is, the parameter should be "value" instead of "data".
Input(“data-update”, “n_intervals”)]) #what kind of element is this?
def update_graph(variable1, variable2): #the value of the variables will be assign in the same order of the inputs.
df=pd.DataFrame.from_dict(data[‘Table1’])
df = UC1.get_riskhover_data(df)
[trace, layout] = UC1.create_callback_layout(df)
#I don't really find how you're using your variable to change the data and layout.
return {‘data’: trace, ‘layout’: layout}
I think you should go over DASH documentation and look for some examples!
It will help you a lot!