ForceGraph3D() .cooldownTicks(300) .forceEngine('ngraph') .graphData(getFabricData()) (document.getElementById("3d-graph")); // function getFabricData() { const perimeter = 12, length = 30; const getId = (col, row) => `${col},${row}`; let nodes = [], links = []; for (let colIdx=0; colIdx0) { links.push({ source: getId(colIdx, rowIdx-1), target: id }); } // Link horizontally links.push({ source: getId((colIdx || perimeter) - 1, rowIdx), target: id }); } } return { nodes, links }; }