Skip to content

Commit 6957918

Browse files
optimized readiability of code and psuedocode, to help onboarding of future devs
Co-authored-by: Alexander Landeros <[email protected]>
1 parent 28faab7 commit 6957918

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app/components/legend.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ export default function LegendKey(props: snapHierarchy) {
3636
}
3737
}
3838
// now we convert the object to an array, each index being a string of the range of the branch
39+
// initializing array and new array with the values from resultRangeColor
3940
const branchesArr = [];
4041
const arrValues = Object.values(resultRangeColor);
41-
42+
//iterate through and values and combine them into a string of range for each branch
4243
for (let i = 0; i < arrValues.length; i += 1) {
4344
const len = arrValues[i].length;
4445
const tempVal = `${arrValues[i][0]} - ${arrValues[i][len - 1]}`;
@@ -47,6 +48,7 @@ export default function LegendKey(props: snapHierarchy) {
4748
return branchesArr;
4849
}
4950

51+
// this is where we invoke the function to return an array of range of branches for legendKey
5052
const getSnapshotIds = (obj, snapshotIds = []) => {
5153
snapshotIds.push(`${obj.name}.${obj.branch}`);
5254
if (obj.children) {

0 commit comments

Comments
 (0)