Skip to content

Commit

Permalink
refactor: 툴팁 mouseout 변수 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
yunchaehyun committed Dec 13, 2023
1 parent 852dfbc commit ad45371
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/frontend/src/components/graph/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,10 @@ function renderD3(svgRef: RefObject<SVGGElement>, data: InitialDataProps[]) {
);

svg.select("#node").on("mouseout", (event) => {
const nodeNotHovered = !(
const hoverTooltip =
event.relatedTarget.nodeName === "rect" ||
event.relatedTarget.nodeName === "tspan"
);

if (nodeNotHovered) {
event.relatedTarget.nodeName === "tspan";
if (!hoverTooltip) {
svg.select("#tooltip").remove();
}
});
Expand Down

0 comments on commit ad45371

Please sign in to comment.