MCPcopy
hub / github.com/Netflix/vizceral / updatePosition

Function updatePosition

src/layouts/ringCenterLayout.js:22–29  ·  view source on GitHub ↗
(node, nodeCount, nodeIndex, orbitSize)

Source from the content-addressed store, hash-verified

20} from 'lodash';
21
22function 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
31function positionNodes (nodes, orbitSize) {
32 let nodeIndex = 0;

Callers 1

positionNodesFunction · 0.85

Calls 1

updatePositionMethod · 0.45

Tested by

no test coverage detected