@@ -14,6 +14,7 @@ import { Input } from '@/components/ui/input'
1414import { Skeleton , TreemapSkeleton } from '@/components/ui/skeleton'
1515import { ToggleGroup , ToggleGroupItem } from '@/components/ui/toggle-group'
1616import { AnalyzeData , ModulesData } from '@/lib/analyze-data'
17+ import { computeActiveEntries , computeModuleDepthMap } from '@/lib/module-graph'
1718import { SpecialModule } from '@/lib/types'
1819import { getSpecialModuleType } from '@/lib/utils'
1920
@@ -99,6 +100,14 @@ export default function Home() {
99100 return ( ) => window . removeEventListener ( 'keydown' , handleKeyDown )
100101 } , [ ] )
101102
103+ // Compute module depth map from active entries
104+ const moduleDepthMap = useMemo ( ( ) => {
105+ if ( ! modulesData || ! analyzeData ) return new Map ( )
106+
107+ const activeEntries = computeActiveEntries ( modulesData , analyzeData )
108+ return computeModuleDepthMap ( modulesData , activeEntries )
109+ } , [ modulesData , analyzeData ] )
110+
102111 const filterSource = useMemo ( ( ) => {
103112 if ( ! analyzeData ) return undefined
104113
@@ -335,6 +344,7 @@ export default function Home() {
335344 startFileId = { selectedSourceIndex }
336345 analyzeData = { analyzeData }
337346 modulesData = { modulesData }
347+ depthMap = { moduleDepthMap }
338348 filterSource = { filterSource }
339349 />
340350 ) }
0 commit comments