@@ -204,7 +204,7 @@ export default function ComponentMap({
204
204
setSelectedNode = { setSelectedNode }
205
205
/>
206
206
207
- < svg ref = { containerRef } width = { totalWidth } height = { totalHeight } >
207
+ < svg ref = { containerRef } width = { totalWidth } height = { totalHeight + 200 } >
208
208
{ /* <LinearGradient id='root-gradient' from='#e75e62' to='#f00008' /> */ }
209
209
< LinearGradient id = 'root-gradient' from = '#488689' to = '#3c6e71' />
210
210
< LinearGradient id = 'parent-gradient' from = '#488689' to = '#3c6e71' />
@@ -214,17 +214,17 @@ export default function ComponentMap({
214
214
hideTooltip ( ) ;
215
215
} }
216
216
width = { sizeWidth / aspect }
217
- height = { sizeHeight / aspect }
217
+ height = { sizeHeight / aspect + 200 }
218
218
rx = { 14 }
219
219
/>
220
220
< Group transform = { `scale(${ aspect } )` } top = { margin . top } left = { margin . left } >
221
221
< Tree
222
222
root = { hierarchy ( startNode , ( d ) => ( d . isExpanded ? d . children : null ) ) }
223
- size = { [ sizeWidth / aspect , sizeHeight / aspect ] }
223
+ size = { [ sizeWidth / aspect , sizeHeight / aspect + 50 ] }
224
224
separation = { ( a , b ) => ( a . parent === b . parent ? 0.5 : 0.5 ) / a . depth }
225
225
>
226
226
{ ( tree ) => (
227
- < Group top = { origin . y + 25 } left = { origin . x } >
227
+ < Group top = { origin . y + 35 } left = { origin . x + 50 / aspect } >
228
228
{ tree . links ( ) . map ( ( link , i ) => (
229
229
< LinkComponent
230
230
className = 'compMapLink'
@@ -327,7 +327,7 @@ export default function ComponentMap({
327
327
}
328
328
}
329
329
} else {
330
- null ;
330
+ aspect = Math . max ( aspect , 0.2 ) ;
331
331
}
332
332
333
333
// mousing controls & Tooltip display logic
@@ -425,8 +425,8 @@ export default function ComponentMap({
425
425
node . depth === 0
426
426
? 'compMapRootText'
427
427
: node . children
428
- ? 'compMapParentText'
429
- : 'compMapChildText'
428
+ ? 'compMapParentText'
429
+ : 'compMapChildText'
430
430
}
431
431
dy = '.33em'
432
432
fontSize = '20px'
@@ -440,6 +440,7 @@ export default function ComponentMap({
440
440
</ Group >
441
441
) ;
442
442
} ) }
443
+ { console . log ( aspect ) }
443
444
</ Group >
444
445
) }
445
446
</ Tree >
0 commit comments