d3-flame-graph icon indicating copy to clipboard operation
d3-flame-graph copied to clipboard

Tooltip outside of screen

Open LinqLover opened this issue 10 months ago • 1 comments

Describe the bug When hovering a node of the flamegraph in the bottom right corner of my screen, the tooltip will be outside of the screen so the user cannot view it and the document's size will grow and scrollbars will be added to the window.

Reproduced on Desktop, but should occur on mobile as well (Chrome).

Expected behavior Position the tooltip above the node instead of below it when hovering. Clamp the x coordinate to keep it inside the screen.

Additional context The relevant logic seems to be here:

https://github.com/spiermar/d3-flame-graph/blob/ba6b2d0f226720e717073f67f58ebeffc051d32c/src/tooltip.js#L35-L36

A solution as proposed here could be implemented:

https://stackoverflow.com/a/28540519/13994294

Are you accepting PRs?

LinqLover avatar Aug 24 '23 13:08 LinqLover