For an application that I’m working on, I have plotted each datapoint as a separate trace, because then they show up in the bar on the right. When I move the curser around, Plotly ‘highlights’ these traces (all of them). I would like none of them. See picture (screen dump). It’s easy enough to disable the hoverinfo (=‘none’) but that’s not what I’m after. I have created an on-click event with a Heatmap and when I click anywhere on the chart, multiple points show up in the JSON container. I need only the pixel located at or very near my cursor - not any of the traces. Please note in the below chart, that everything that has ‘similar’ x-axis value shows up, which means my cursor can be far away from the trace and it still shows up (for example the BL2 at y = 0 in attached screen shot). I hope my problem is clear. Here’s bits and pieces of my code the way it looks now:
aligndict = {} # Initialize aligndict
aligndict = alignment.alignments(float(spk['qts'])) # Add alignments to aligndict
for plotlabel in aligndict:
output = aligndict[plotlabel]
alpha = float(output['alpha'])
h_p = float(output['h'])
plot_alignchart.append( # plot alignments
go.Scatter(
x=[alpha],
y=[h_p],
name=plotlabel,
mode='markers',
marker=dict(
size=12
),
text=plotlabel,
hovertemplate=None
# hovermode='closest' # this is the default ...
# hovermode=False # No solution: https://community.plotly.com/t/completely-excluding-a-trace-from-hover-info-snapping/35854/12
)
)
And the Heatmap:
plot_alignchart.append(
go.Heatmap(z=zmap, x=xmap, y=ymap,
connectgaps=True,
showscale=False,
opacity=0,
hoverinfo='none',
visible=True)
)
When I click the Align Chart in the application, the x and y coordinates of the pixel where I clicked indeed does show up, but so does all the traces that are near the same x-value (even quite far away, actually).
I know that I can combine all the alignments in ‘aligndict’ into a single trace, but then their individual bullets with their labels disappear, and I still have one too many x and y value.
Best regards,
Claus