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}; }