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
Copy file name to clipboardExpand all lines: src/app/components/StateRoute/ComponentMap/ComponentMap.tsx
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -239,12 +239,12 @@ export default function ComponentMap({
239
239
240
240
{tree.descendants().map((node,key)=>{
241
241
constwidthFunc: number=(name)=>{
242
-
// function that takes in a node's name and returns a number that is related to the length of the name. Used for determining the node width.
242
+
//returns a number that is related to the length of the name. Used for determining the node width.
243
243
constnodeLength=name.length;
244
-
returnnodeLength*7+20;
245
-
if(nodeLength<=5)returnnodeLength+80;// returns a number between 80-85
246
-
if(nodeLength<=10)returnnodeLength+120;// returns a number between 125-130
247
-
returnnodeLength+140;// returns a number greater than 150
244
+
//return nodeLength * 7 + 20; //uncomment this line if we want each node to be directly proportional to the name.length (instead of nodes of similar sizes to snap to the same width)
245
+
if(nodeLength<=5)returnnodeLength+50;
246
+
if(nodeLength<=10)returnnodeLength+120;
247
+
returnnodeLength+140;
248
248
};
249
249
250
250
constwidth: number=widthFunc(node.data.name);// the width is determined by the length of the node.name
0 commit comments