Skip to content

Commit

Permalink
Merge branch 'githru:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HIITMEMARIO authored Jul 23, 2024
2 parents a6b6ff2 + 18d2a9f commit 544ac75
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,11 @@ const AuthorBarChart = () => {
.text(`${metric} # / Total ${metric} # (%)`);

// Event handler
const handleMouseOver = () => {
tooltip.style("display", "inline-block");
};
const handleMouseMove = (e: MouseEvent<SVGRectElement | SVGTextElement>, d: AuthorDataType) => {
const handleMouseOver = (e: MouseEvent<SVGRectElement | SVGTextElement>, d: AuthorDataType) => {
tooltip
.style("display", "inline-block")
.style("left", `${e.pageX - 70}px`)
.style("top", `${e.pageY - 70}px`)
.style("top", `${e.pageY - 90}px`)
.html(
`<p class="name">${d.name}</p>
<p>${metric}:
Expand All @@ -106,6 +104,10 @@ const AuthorBarChart = () => {
</p>`
);
};

const handleMouseMove = (e: MouseEvent<SVGRectElement | SVGTextElement>) => {
tooltip.style("left", `${e.pageX - 70}px`).style("top", `${e.pageY - 90}px`);
};
const handleMouseOut = () => {
tooltip.style("display", "none");
};
Expand Down

0 comments on commit 544ac75

Please sign in to comment.