From 6d6b781eab79e7eddb09b95578a4457fb76ef368 Mon Sep 17 00:00:00 2001 From: CHAE Date: Wed, 13 Dec 2023 17:54:54 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EA=B8=B0=EC=A1=B4=20=EC=BB=A4?= =?UTF-8?q?=EB=B0=8B=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=95=88=EB=82=B4=20?= =?UTF-8?q?=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=9A=94=EC=86=8C=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [#254] --- .../frontend/src/components/graph/Graph.tsx | 20 ------------------- .../src/components/graph/renderTooltip.ts | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/packages/frontend/src/components/graph/Graph.tsx b/packages/frontend/src/components/graph/Graph.tsx index 7ade370f..337a00a9 100644 --- a/packages/frontend/src/components/graph/Graph.tsx +++ b/packages/frontend/src/components/graph/Graph.tsx @@ -24,7 +24,6 @@ function renderD3(svgRef: RefObject, data: InitialDataProps[]) { const svg = d3.select(svgRef.current); if (!parsedData.length) { - svg.select("#text").selectAll("*").remove(); svg.select("#link").selectAll("*").remove(); svg.select("#node").selectAll("*").remove(); return; @@ -45,24 +44,6 @@ function renderD3(svgRef: RefObject, data: InitialDataProps[]) { const treeData = treeLayout(rootNode); fillColor(treeData); - // Add text next to each node - svg - .select("#text") - .selectAll("text") - .data(treeData.descendants()) - .join( - (enter) => enter.append("text").style("opacity", 0), - (update) => update, - (exit) => - exit.transition().duration(DURATION).style("opacity", 0).remove(), - ) - .text((d) => d.data.message) - .attr("x", (d) => d.x + 20) - .attr("y", (d) => d.y + 5) - .transition() - .duration(DURATION) - .style("opacity", 1); - additionalLinks.forEach(({ id, parentId }) => { const sourceNode = treeData.descendants().filter((d) => d.id === id)[0]; const targetNode = treeData @@ -138,7 +119,6 @@ export function Graph({ data, className = "" }: GraphProps) { - diff --git a/packages/frontend/src/components/graph/renderTooltip.ts b/packages/frontend/src/components/graph/renderTooltip.ts index 3bbe1a9e..5b5a859b 100644 --- a/packages/frontend/src/components/graph/renderTooltip.ts +++ b/packages/frontend/src/components/graph/renderTooltip.ts @@ -11,7 +11,7 @@ interface TooltipProps { } export default function renderTooltip( - svg, + svg: d3.Selection, d: d3.HierarchyPointNode, ) { const tooltipStyle = {