Hello dear community,
I am looking for a clever/interactive way to modify the wrong values in a database by clicking on the plotly graph showing them. In other words, I want to add a sort of data modification zone, preferably on top of my plotly graphs (maybe a form with submit button or so … ? )
For now, I am able to access the data point informations when clicking on it using the clickData property of the graph.
Here is a simplified version of the callback function I used.
@app.callback(
Output('output', 'children'),
[Input('graph_interaction', 'clickData')])
def update_output(clickData):
if clickData:
point_index = clickData['points'][0]['pointIndex']
point_value = clickData['points'][0]['y']
print(clickData)
# update the point value in the database using SQLAlchemy
# ...
return 'You clicked on data point {} with value {}'.format(point_index, point_value)
return ''
Any insights on how to add a modification area (form ?) to interact with the database and modify wrong values ?
Thank you