Hide the hoverlabel while retaining hoverData and clickData in callback?

I can’t figure out how to hide the hoverlabel while retaining access to hover activity and clicks via the hoverData and clickData triggers in my callback. Is this possible?

More Details (not necessary to read):
I’ve got a choropleth map of the U.S. in a plotly express dash app using python. I’m setting it up so when a user clicks on a state it will ideally put an outline around that state and “freeze” its hoverlabel so they can move their cursor across other states (without seeing other states’ hoverlabels) and then onto another chart, a simple bar chart, where they can explore further details about that state. The first step is to stop other (or even all) hoverlabels from showing after a click but still receive hoverData and clickData so that when they click again somewhere on the map it will “unfreeze”.

@nicolaskruchten 's suggestion to set hovertemplate=None alongside hoverinfo='skip' in your .update_traces() works but disables input as well. And setting staticPlot:Truein config also works but also disables both hoverData and clickData.

Hi @russmcb, hoverinfo='skip' completely removes the hover interaction, if you want to access the hoverData while not showing a tooltip you need to set hoverinfo='none'. If you created the trace with plotly.express you’ll also need to set hovertemplate=None.

1 Like