(node, nodeCount, nodeIndex, orbitSize)
| 20 | } from 'lodash'; |
| 21 | |
| 22 | function updatePosition (node, nodeCount, nodeIndex, orbitSize) { |
| 23 | const rotationAdjustment = nodeCount % 2 === 0 ? Math.PI / 4 : (5 / 6) * Math.PI; |
| 24 | const adjustment = (((2 * Math.PI) * nodeIndex) / nodeCount) + rotationAdjustment; |
| 25 | node.updatePosition({ |
| 26 | x: ((orbitSize / 2) * Math.cos(adjustment)), |
| 27 | y: ((orbitSize / 2) * Math.sin(adjustment)) |
| 28 | }); |
| 29 | } |
| 30 | |
| 31 | function positionNodes (nodes, orbitSize) { |
| 32 | let nodeIndex = 0; |
no test coverage detected