Skip to content

Commit f8231c4

Browse files
committed
vis: TreeDisplay: fix regression causing monoliths to appear twice
1 parent 3d17b24 commit f8231c4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/ott-vis-panel/src/components/TreeDisplay.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
buildMonolithTrees,
1313
} from "treeutils";
1414
import { useD3Zoom } from "chartutils";
15+
import { dedupeMonoliths } from "aggregate";
1516

1617
interface TreeDisplayProps extends TreeDisplayStyleProps {
1718
systemState: SystemState;
@@ -147,9 +148,9 @@ const TreeDisplay: React.FC<TreeDisplayProps> = ({
147148
balancerGroupStyle = "stacked",
148149
}) => {
149150
const svgRef = useRef<SVGSVGElement | null>(null);
150-
const monolithTrees = buildMonolithTrees(systemState.flatMap(b => b.monoliths)).sort(
151-
(a, b) => d3.ascending(a.region, b.region) || d3.ascending(a.id, b.id)
152-
);
151+
const monolithTrees = buildMonolithTrees(
152+
dedupeMonoliths(systemState.flatMap(b => b.monoliths))
153+
).sort((a, b) => d3.ascending(a.region, b.region) || d3.ascending(a.id, b.id));
153154

154155
const getRadius = useCallback(
155156
(group: string): number => {

0 commit comments

Comments
 (0)