statgen / locuszoom

A Javascript/d3 embeddable plugin for interactively visualizing statistical genetic data from customizable sources.
https://statgen.github.io/locuszoom/
MIT License
156 stars 29 forks source link

Make tooltips not-interactable until `selected` #100

Closed pjvandehaar closed 4 years ago

pjvandehaar commented 7 years ago

(Problem first tracked at https://github.com/statgen/pheweb/issues/39 and solved for PheWeb but not LZ in general)

Unless a tooltip is selected, it should not be interactable. This is important when a label drifts behind where its tooltip will spawn, so that when you hover the label, the tooltip pops up under the mouse, removing the hover of the label, destroying the tooltip, repeat each time the mouse moves by a pixel.

I would like for LZ to apply this style to all non-selected tooltips:

.lz-data_layer-tooltip { pointer-events: none !important; }

(as recommended here and tested in Chrome/Safari/Firefox)

Currently PheWeb just applies that style to all tooltips, because none are ever interactable.

abought commented 4 years ago

We've made some positioning changes slated for 0.11. Rather than change how tooltips respond to mouse behaviors, the end goal is to reduce the number of scenarios where a tooltip can appear under the mouse at all.

Closing this issue but feel free to reopen if we identify a pathological case where collisions are unavoidable.