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 = {