statgen / locuszoom

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

Let tooltip content flow around close button (x) #93

Closed pjvandehaar closed 7 years ago

pjvandehaar commented 7 years ago

PR https://github.com/statgen/locuszoom/pull/94

Frencil commented 7 years ago

This may be a bit harder than it seems - tool tip close buttons are absolutely positioned along with the tool tip itself as an overlay after the tool tip is rendered. This approach was taken instead of floating the close button because the button is a part of the tool tip body, not its content. To accommodate this, when a tool tip is closeable the right padding is upped to provide space.

I'd be hesitant to rework the button to be a floated element because it would then have to work with any arbitrary tool tip content, and that can lead to breaking the button display much easier. As is, you can hand just about any HTML to a tool tip and the close button will appear where it should.

An alternative, if the extra width on tool tips for the close button is undesirable, the close button could hang off the edge of the tool tip? Can you provide a use case where close buttons as-is present a problem?