You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letaspect: number=1;// aspect resizes the component map container to accommodate large node trees on complex sites
41
+
letaspect: number=1;
42
42
letnodeCoordTier=0;
43
43
letnodeOneLeft=0;
44
44
letnodeTwoLeft=2;
@@ -54,6 +54,8 @@ export default function ComponentMap({
54
54
const[linkType,setLinkType]=useState('step');// We create a local state "linkType" and set it to a string 'step'.
55
55
const[stepPercent,setStepPercent]=useState(0.0);// We create a local state "stepPercent" and set it to a number '0.0'. This will be used to scale the Map component's link: Step to 0%
56
56
const[selectedNode,setSelectedNode]=useState('root');// We create a local state "selectedNode" and set it to a string 'root'.
consttoolTipTimeoutID=useRef(null);//useRef stores stateful data that’s not needed for rendering.
@@ -62,6 +64,14 @@ export default function ComponentMap({
62
64
dispatch(setCurrentTabInApp('map'));// dispatch sent at initial page load allowing changing "immer's" draft.currentTabInApp to 'map' to facilitate render.
63
65
},[dispatch]);
64
66
67
+
// force app to re-render to accurately calculate aspect ratio upon initial load
68
+
useEffect(()=>{
69
+
consttimer=setTimeout(()=>{
70
+
setForceUpdate((prev)=>!prev);
71
+
},100);
72
+
return()=>clearTimeout(timer);
73
+
},[]);
74
+
65
75
// setting the margins for the Map to render in the tab window.
0 commit comments