From cf459dc4e8a73f9317d493a0cd3e6ef053bffeb0 Mon Sep 17 00:00:00 2001 From: Kia Lam Date: Fri, 4 Feb 2022 07:58:52 -0800 Subject: [PATCH] Remove placeholder label text. --- awx/ui/src/screens/TopologyView/MeshGraph.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/awx/ui/src/screens/TopologyView/MeshGraph.js b/awx/ui/src/screens/TopologyView/MeshGraph.js index 15d4f70b7f..f971807121 100644 --- a/awx/ui/src/screens/TopologyView/MeshGraph.js +++ b/awx/ui/src/screens/TopologyView/MeshGraph.js @@ -19,8 +19,8 @@ function MeshGraph({ showLegend }) { max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; } - let nodes = []; - let links = []; + const nodes = []; + const links = []; const generateLinks = (n, r) => { for (let i = 0; i < r; i++) { const link = { @@ -175,6 +175,7 @@ function MeshGraph({ showLegend }) { hostNames .append('text') .text((d) => renderLabelText(d.node_state, d.hostname)) + .attr('class', 'placeholder') .attr('fill', defaultNodeLabelColor) .attr('text-anchor', 'middle') .attr('y', 40) @@ -192,7 +193,7 @@ function MeshGraph({ showLegend }) { .attr('ry', 8) .style('fill', (d) => renderStateColor(d.node_state)); }); - + svg.selectAll('text.placeholder').remove(); hostNames .append('text') .text((d) => renderLabelText(d.node_state, d.hostname))