Hi,
I was looking for some way to update my graph when I click in a button but not using Input. My current application updates a graph using the function “update_graph_scatter” (that is a callback for a dropdown box). And I have a button START which calls the function “sendCommand” (that is also a callback). This button starts a server remotely. When I do the sequence START > STOP > again START, my graph gets messy. So I was looking for some way to update it. I though to fire the call back of the graph update from the button function. Like this example (https://community.plotly.com/t/programmatically-firing-a-callback/7988). But it is not working. The graph continues messy.
Actually, I just want to clean the graph when I click on the START button.
@app.callback(
Output(component_id='data', component_property='figure'),
[Input(component_id='edgeNodeIds', component_property='value')],
events=[Event('graph-update', 'interval')])
def update_graph_scatter(value):
print(".............. update_graph_scatter function start ..............")
@app.callback(
Output(component_id='button-output', component_property='children'),
[Input(component_id='button-start', component_property='n_clicks'),
Input(component_id='button-stop', component_property='n_clicks')],
[State(component_id='edgeNodeIds', component_property='value')])
def sendCommand(clickStart, clickStop, value):
print('Button pressed. You\'ve selected: "{}"'.format(value))
# THIS DOES NOT WORK PROPERLY
# undecorated(update_graph_scatter)(value)
Thanks,
Felipe