diff --git a/packages/ott-vis-panel/src/components/TreeDisplay.tsx b/packages/ott-vis-panel/src/components/TreeDisplay.tsx index 4cbe8e213..24498ac5f 100644 --- a/packages/ott-vis-panel/src/components/TreeDisplay.tsx +++ b/packages/ott-vis-panel/src/components/TreeDisplay.tsx @@ -12,6 +12,7 @@ import { buildMonolithTrees, } from "treeutils"; import { useD3Zoom } from "chartutils"; +import { dedupeMonoliths } from "aggregate"; interface TreeDisplayProps extends TreeDisplayStyleProps { systemState: SystemState; @@ -147,9 +148,9 @@ const TreeDisplay: React.FC = ({ balancerGroupStyle = "stacked", }) => { const svgRef = useRef(null); - const monolithTrees = buildMonolithTrees(systemState.flatMap(b => b.monoliths)).sort( - (a, b) => d3.ascending(a.region, b.region) || d3.ascending(a.id, b.id) - ); + const monolithTrees = buildMonolithTrees( + dedupeMonoliths(systemState.flatMap(b => b.monoliths)) + ).sort((a, b) => d3.ascending(a.region, b.region) || d3.ascending(a.id, b.id)); const getRadius = useCallback( (group: string): number => {