@@ -15,6 +15,7 @@ import { Input } from '@/components/ui/input'
1515import { Skeleton , TreemapSkeleton } from '@/components/ui/skeleton'
1616import { ToggleGroup , ToggleGroupItem } from '@/components/ui/toggle-group'
1717import { AnalyzeData , ModulesData } from '@/lib/analyze-data'
18+ import { computeActiveEntries , computeModuleDepthMap } from '@/lib/module-graph'
1819import { SpecialModule } from '@/lib/types'
1920import { getSpecialModuleType , fetchStrict } from '@/lib/utils'
2021
@@ -100,6 +101,14 @@ export default function Home() {
100101 return ( ) => window . removeEventListener ( 'keydown' , handleKeyDown )
101102 } , [ ] )
102103
104+ // Compute module depth map from active entries
105+ const moduleDepthMap = useMemo ( ( ) => {
106+ if ( ! modulesData || ! analyzeData ) return new Map ( )
107+
108+ const activeEntries = computeActiveEntries ( modulesData , analyzeData )
109+ return computeModuleDepthMap ( modulesData , activeEntries )
110+ } , [ modulesData , analyzeData ] )
111+
103112 const filterSource = useMemo ( ( ) => {
104113 if ( ! analyzeData ) return undefined
105114
@@ -332,6 +341,7 @@ export default function Home() {
332341 startFileId = { selectedSourceIndex }
333342 analyzeData = { analyzeData }
334343 modulesData = { modulesData }
344+ depthMap = { moduleDepthMap }
335345 filterSource = { filterSource }
336346 />
337347 ) }
0 commit comments