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
// Declared this variable and assigned it to the useForceUpdate function that forces a state to change causing that component to re-render and display on the map
74
76
constforceUpdate=useForceUpdate();
@@ -131,6 +133,36 @@ export default function ComponentMap({
131
133
return`${time} ms `;
132
134
};
133
135
136
+
//put all nodes into an array
137
+
constnodeList=[];
138
+
139
+
constcollectNodes=(node)=>{
140
+
nodeList.splice(0,nodeList.length);
141
+
nodeList.push(node);
142
+
for(leti=0;i<nodeList.length;i++){
143
+
constcur=nodeList[i];
144
+
if(cur.children&&cur.children.length>0){
145
+
for(letchildofcur.children){
146
+
nodeList.push(child);
147
+
}
148
+
}
149
+
}
150
+
console.log('NODELIST in ComponentMap: ',nodeList);
151
+
}
152
+
collectNodes(snapshots[lastNode]);
153
+
154
+
//find the node that has been selected and use it as the root
0 commit comments