Just starting to use plotly with Python and trying to figure out how to receive mouse events. So far all the docs I’ve seen seem to imply that the code needs to run on a Jupyter notebook.
Is there no way to receive mouse events with Python alone (I am using VSCode if this matters)? I get it that the plotting is done in a browser. Is there perhaps an alternative non-browser way to plot it that will allow mouse events to be sent back to the python code?
To follow up on this, I implemented that in Dash but now encounter another problem.
My app includes a dcc.Graph with a figure containing a 3D surface plot. A click on the plot is received and processed in a callback with Input(‘opt-graph’,‘clickData’).
My issue is that the callback can’t differentiate between clicks meant to merely rotate to surface around and a clicks on a specific point on the plot that meant to fire the callback. The intention is to allow the user to first rotate the plot as they please (and perhaps zoom in and out in the process), and then have them actually select a specific point on the plot and process this choice in the callback.
Is there a way to generate another kind of click to solve that? for example, a double-click, or a right-click? Alternatively, is it possible not to have a “click and drag plot” kind of event not get registered as clickdata event? Or any other way to distinguish between the two?