Skip to content

Commit

Permalink
Merge pull request #550 from seungineer/#540-seungineer
Browse files Browse the repository at this point in the history
fix(view): #540 Total Commit 그래프에 마우스 over, move 시 깜빡임
  • Loading branch information
seungineer authored Jul 23, 2024
2 parents d05dd61 + cedb077 commit 18d2a9f
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,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 @@ -96,6 +94,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 18d2a9f

Please sign in to comment.