@@ -15,17 +15,17 @@ export const fitBranchIntoView = async (view: LineageView) => {
1515 let result = 1 ;
1616
1717 const parents = Array . from (
18- view . containerEl . querySelectorAll ( '.active-parent' ) ,
18+ view . container . querySelectorAll ( '.active-parent' ) ,
1919 ) as HTMLElement [ ] ;
2020
21- const activeNode = view . containerEl . querySelector (
21+ const activeNode = view . container . querySelector (
2222 '.active-node' ,
2323 ) as HTMLElement ;
2424 const children = Array . from (
25- view . containerEl . querySelectorAll ( '.active-child' ) ,
25+ view . container . querySelectorAll ( '.active-child' ) ,
2626 ) as HTMLElement [ ] ;
2727 const siblings = Array . from (
28- view . containerEl . querySelectorAll ( '.active-sibling' ) ,
28+ view . container . querySelectorAll ( '.active-sibling' ) ,
2929 ) as HTMLElement [ ] ;
3030
3131 const combinedRect = getCombinedBoundingClientRect ( [
@@ -35,12 +35,9 @@ export const fitBranchIntoView = async (view: LineageView) => {
3535 ...children ,
3636 ] ) ;
3737
38- const heightScale =
39- view . container . getBoundingClientRect ( ) . height /
40- ( combinedRect . height + 100 ) ;
41- const widthScale =
42- view . container . getBoundingClientRect ( ) . width /
43- ( combinedRect . width + 100 ) ;
38+ const boundingClientRect = view . container . getBoundingClientRect ( ) ;
39+ const heightScale = boundingClientRect . height / ( combinedRect . height + 100 ) ;
40+ const widthScale = boundingClientRect . width / ( combinedRect . width + 100 ) ;
4441
4542 result = Math . min ( heightScale , widthScale ) ;
4643
0 commit comments