Cannot disable hover without killing mouse click events

Plotly 5.14.0, Python 3.10.6, Ubuntu 22.04, running in Jupyter Notebook

I am following the example described here:

When I click on the image, I need to capture the coordinates of the click and use them in the app. I have .on_click(self.click_handler) set on the figure, it gets the mouse click events. That works well. But the hover pop-up follows the mouse, I do not need it, and it’s quite annoying because it covers the part of the image I need to see (right under the mouse). I’ve tried to disable it but nothing seems to work.

Here’s an example that’s equivalent to my code:

import plotly.graph_objects as go
import plotly.express as px

zzz = go.FigureWidget()
zzz_trace = px.imshow(np.zeros((100, 100), dtype=np.uint8)).data[0]
zzz.add_trace(zzz_trace)
zzz.update_traces(hoverinfo="none")
# zzz.update_traces(hovertemplate=[])
zzz

hoverinfo="none" or hoverinfo="skip" do not disable the pop-up.

hovertemplate=[] disables the pop-up, but also kills the mouse click event capturing. The widget does not react to mouse clicks anymore.

This is how the pop-up looks like:

How do I kill the popup without disabling click event tracing?

hi @FlorinAndrei
Welcome back to the forum.

What if you replace zzz.update_traces(hoverinfo="none")

with zzz.update_layout(hovermode=False) .

Does that also kill the mouse click event capturing?

@adamschroeder Yes, unfortunately that also kills the mouse click event capturing.

It’s like the control I have over this thing is not fine-grained enough, if that makes sense.