{
let elem = html`<div id="3d-graph" style='height:800px; width:800px' >test</div>`
const N = 300;
const gData = {
nodes: [...Array(N).keys()].map(i => ({ id: i })),
links: [...Array(N).keys()]
.filter(id => id)
.map(id => ({
source: id,
target: Math.round(Math.random() * (id-1))
}))
};
const distance = 1000;
const Graph = ForceGraph3D()
(elem)
.enableNodeDrag(false)
.enableNavigationControls(false)
.showNavInfo(false)
.cameraPosition({ z: distance })
.graphData(gData);
let angle = 0;
setInterval(() => {
Graph.cameraPosition({
x: distance * Math.sin(angle),
z: distance * Math.cos(angle)
});
angle += Math.PI / 300;
}, 10);
return elem
}