@@ -198,40 +198,9 @@ export default function ComponentMap({
198
198
199
199
return newNode ;
200
200
} ;
201
-
201
+ // filter out Conext Providers
202
202
let filtered = processTreeData ( currentSnapshot ) ;
203
- collectNodes ( currentSnapshot ) ;
204
-
205
- const keepContextAndProviderNodes = ( node ) => {
206
- if ( ! node ) return null ;
207
-
208
- // Check if this node should be kept
209
- const hasContext =
210
- node ?. componentData ?. context && Object . keys ( node . componentData . context ) . length > 0 ;
211
- const isProvider = node ?. name && node . name . endsWith ( 'Provider' ) ;
212
- const shouldKeepNode = hasContext || isProvider ;
213
-
214
- // Process children first
215
- let processedChildren = [ ] ;
216
- if ( node . children ) {
217
- processedChildren = node . children
218
- . map ( ( child ) => keepContextAndProviderNodes ( child ) )
219
- . filter ( Boolean ) ; // Remove null results
220
- }
221
-
222
- // If this node should be kept or has kept children, return it
223
- if ( shouldKeepNode || processedChildren . length > 0 ) {
224
- return {
225
- ...node ,
226
- children : processedChildren ,
227
- } ;
228
- }
229
-
230
- // If neither the node should be kept nor it has kept children, filter it out
231
- return null ;
232
- } ;
233
-
234
- const contextProvidersOnly = keepContextAndProviderNodes ( currentSnapshot ) ;
203
+ collectNodes ( filtered ) ;
235
204
236
205
// @ts
237
206
// find the node that has been selected and use it as the root
@@ -247,7 +216,7 @@ export default function ComponentMap({
247
216
if ( startNode === null ) startNode = rootNode ;
248
217
} ;
249
218
250
- findSelectedNode ( ) ; // locates the rootNode... do we really need this? This function is only used once... it's here.
219
+ findSelectedNode ( ) ; // locates the rootNode
251
220
252
221
// controls for the map
253
222
const LinkComponent : React . ComponentType < unknown > = getLinkComponent ( {
@@ -323,7 +292,6 @@ export default function ComponentMap({
323
292
} else {
324
293
stroke = plum ;
325
294
}
326
- // stroke = '#df6f37'
327
295
}
328
296
329
297
return (
@@ -448,9 +416,8 @@ export default function ComponentMap({
448
416
{ node . depth === 0 && (
449
417
< circle
450
418
className = 'compMapRoot'
451
- r = { 25 } // increase from 12 to 25 to improve visibility
419
+ r = { 25 }
452
420
fill = "url('#root-gradient')"
453
- //stroke={rootStroke}
454
421
onClick = { ( ) => {
455
422
dispatch ( toggleExpanded ( node . data ) ) ;
456
423
hideTooltip ( ) ;
@@ -468,13 +435,6 @@ export default function ComponentMap({
468
435
y = { - height / 2 }
469
436
x = { - width / 2 }
470
437
fill = "url('#parent-gradient')"
471
- //color={'#ff0000'}
472
- //fill={node.children ? nodeParentFill : nodeChildFill}
473
- //stroke={
474
- // node.data.isExpanded && node.data.children.length > 0
475
- // ? nodeParentStroke
476
- // : nodeChildStroke
477
- // }
478
438
strokeWidth = { 1.5 }
479
439
strokeOpacity = '1'
480
440
rx = { node . children ? 4 : 10 }
0 commit comments