The applyUnifiedFilter method in OverlayFilterService:
Copy
Input: - selectedNodeIds: Set of explicitly selected node IDs - hiddenEdgeTypes: Set of edge types to exclude - selectionDepth: Number of hops to expandAlgorithm: 1. Build adjacency list from all edges (respecting hiddenEdgeTypes) 2. Initialize visibleNodes = copy of selectedNodeIds 3. Initialize frontier = selectedNodeIds 4. For depth = 1 to selectionDepth: a. newFrontier = empty set b. For each node in frontier: - Get neighbors from adjacency list - Add unvisited neighbors to newFrontier and visibleNodes c. frontier = newFrontier 5. Filter edges: both endpoints must be in visibleNodes 6. Update Three.js graphData with filtered nodes/edges 7. Sync instanced renderer visibility maskOutput: - Only nodes within selectionDepth hops are visible - Edges only shown if both endpoints visible