@@ -467,7 +467,9 @@ const TreeDisplay: React.FC<TreeDisplayProps> = ({ systemState, width, height })
467
467
} ) ;
468
468
const balancerMonolithLinks = gb2mLinks
469
469
. selectAll ( ".b2m-link" )
470
- . data ( b2mLinkData , ( d : any ) => d . source ?. data ?. id + d . target ?. data ?. id ) ;
470
+ // TODO: add key function to data join when balancer ids are stable
471
+ // .data(b2mLinkData, (d: any) => d.source?.data?.id + d.target?.data?.id);
472
+ . data ( b2mLinkData ) ;
471
473
balancerMonolithLinks
472
474
. join (
473
475
create =>
@@ -487,19 +489,22 @@ const TreeDisplay: React.FC<TreeDisplayProps> = ({ systemState, width, height })
487
489
488
490
const zoom = d3 . zoom < SVGSVGElement , TreeNode > ( ) . on ( "zoom" , handleZoom ) ;
489
491
function handleZoom ( e : any ) {
492
+ svg . select ( "g.chart" ) . attr ( "transform" , e . transform ) ;
490
493
setChartTransform ( e . transform ) ;
491
494
}
492
495
svg . call ( zoom ) ;
493
496
}
494
- } , [ systemState , monolithTrees , width , height ] ) ;
497
+ } , [ systemState , monolithTrees ] ) ;
495
498
499
+ // run this only once after the first render
496
500
useEffect ( ( ) => {
497
501
if ( ! svgRef . current ) {
498
502
return ;
499
503
}
500
504
const svg = d3 . select < SVGSVGElement , TreeNode > ( svgRef . current ) ;
501
505
svg . select ( "g.chart" ) . attr ( "transform" , chartTransform ) ;
502
- } , [ chartTransform ] ) ;
506
+ // eslint-disable-next-line react-hooks/exhaustive-deps
507
+ } , [ ] ) ;
503
508
504
509
const eventBus = useEventBus ( ) ;
505
510
useEffect ( ( ) => {
0 commit comments