Skip to content

Commit

Permalink
fix: show tooltip above the pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
mxposed committed Feb 3, 2025
1 parent 4418654 commit d0f2814
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,11 @@ class FunkyHeatmap {
.html(text)
.style("top", mouse[1] + 2 * offset + "px")
.style("left", mouse[0] + offset + "px")
.style("display", "block");
.style("display", "block")
.style("visibility", "none");
const { height } = this.tooltip.node().getBoundingClientRect();
this.tooltip.style("top", mouse[1] - height + "px")
.style("visibility", "visible");
}

onMouseMove(e) {
Expand Down

0 comments on commit d0f2814

Please sign in to comment.