Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(view): #540 Total Commit 그래프에 마우스 over, move 시 깜빡임 #550

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading