I think this is what you’re looking for: Interactive Visualizations
The
dcc.Graphcomponent has four attributes that can change through user-interaction:hoverData,clickData,selectedData,relayoutData. These properties update when you hover over points, click on points, or select regions of points in a graph.
This is what click data returns when you click on the point:
{
"points": [
{
"curveNumber": 1,
"pointNumber": 0,
"pointIndex": 0,
"x": 1,
"y": 3,
"bbox": {
"x0": 189.35,
"x1": 209.35,
"y0": 888.72,
"y1": 908.72
},
"customdata": [
3
]
}
]
}
This works only if you click on the point/object. I am not aware of methods that can allow to get data from clicks anywhere on the graph.