@@ -232,12 +232,11 @@ export const TopologyView: React.FC<TopologyViewProps> = ({
232
232
233
233
let balancerYs = 0 ;
234
234
for ( const tree of region . balancerTrees ) {
235
- const shouldPack = tree . leaves ( ) . length > 6 ;
236
- const radius = calcGoodTreeRadius (
237
- tree ,
238
- shouldPack ? clientNodeRadius / 2 : clientNodeRadius ,
239
- shouldPack ? 0 : 4
240
- ) ;
235
+ let radius = calcGoodTreeRadius ( tree , clientNodeRadius , 4 ) ;
236
+ const shouldPack = radius > 200 ;
237
+ if ( shouldPack ) {
238
+ radius = calcGoodTreeRadius ( tree , clientNodeRadius / 2 , 0 ) ;
239
+ }
241
240
const layout = d3 . tree < TreeNode > ( ) . size ( [ - Math . PI , radius ] ) ;
242
241
layout ( tree ) ;
243
242
// precompute radial coordinates
@@ -266,11 +265,11 @@ export const TopologyView: React.FC<TopologyViewProps> = ({
266
265
}
267
266
let monolithYs = 0 ;
268
267
for ( const tree of region . monolithTrees ) {
269
- const shouldPack = tree . leaves ( ) . length > 6 ;
270
- const radius = calcGoodTreeRadius (
271
- tree ,
272
- shouldPack ? baseNodeRadius / 2 : baseNodeRadius
273
- ) ;
268
+ let radius = calcGoodTreeRadius ( tree , baseNodeRadius ) ;
269
+ const shouldPack = radius > 200 ;
270
+ if ( shouldPack ) {
271
+ radius = calcGoodTreeRadius ( tree , baseNodeRadius / 2 ) ;
272
+ }
274
273
const layout = d3 . tree < TreeNode > ( ) . size ( [ Math . PI , radius ] ) ;
275
274
layout ( tree ) ;
276
275
// precompute radial coordinates
0 commit comments