From 563212c98e87091b1ebc36cf80d85e5d4367e02f Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Mon, 16 Feb 2026 17:09:22 +0000 Subject: [PATCH] perf(frontend): add filter for low interaction graphs & deleted users --- frontend/src/components/InteractionStats.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/InteractionStats.tsx b/frontend/src/components/InteractionStats.tsx index 1eb8faa..06d4f68 100644 --- a/frontend/src/components/InteractionStats.tsx +++ b/frontend/src/components/InteractionStats.tsx @@ -19,7 +19,18 @@ function ApiToGraphData(apiData: InteractionGraph) { } } - return { nodes, links }; + // drop low-value and deleted interactions to reduce clutter + const filteredLinks = links.filter(link => + link.value >= 2 && + link.source !== "[deleted]" && + link.target !== "[deleted]" + ); + + // also filter out nodes that are no longer connected after link filtering + const connectedNodeIds = new Set(filteredLinks.flatMap(link => [link.source, link.target])); + const filteredNodes = nodes.filter(node => connectedNodeIds.has(node.id)); + + return { nodes: filteredNodes, links: filteredLinks}; }