-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
Re-implement getNodeLevel function at the root of main.js into the NodeSecureNetwork class (vis-network workspace).
Lines 176 to 192 in 72044e9
| function getNodeLevel(node) { | |
| const rootNode = secureDataSet.linker.get(0); | |
| if (node.id === rootNode.id) { | |
| return 0; | |
| } | |
| let level = 1; | |
| let currentNode = node; | |
| while (currentNode.usedBy[rootNode.name] === undefined) { | |
| currentNode = secureDataSet.linker.get( | |
| [...secureDataSet.linker].find(([_, { name }]) => Object.keys(currentNode.usedBy)[0] === name)[0] | |
| ); | |
| level++; | |
| } | |
| return level; | |
| } |
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers