Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stateInit: () => ({
d3ForceLayout: d3ForceSimulation()
.force('link', d3ForceLink())
.force('charge', d3ForceManyBody())
.force('center', d3ForceCenter())
.force('dagRadial', null)
.stop(),
engineRunning: false
}),
stateInit: () => ({
forceLayout: d3ForceSimulation()
.force('link', d3ForceLink())
.force('charge', d3ForceManyBody())
.force('center', d3ForceCenter())
.force('dagRadial', null)
.stop(),
engineRunning: false
}),
.enter()
.append("line")
.attr("material", d => {
return linkColors[d.chunkName];
})
.attr("geometry", () => {
const geometry = new THREE.Geometry();
geometry.vertices = [
new THREE.Vector3(0, 0, 0),
new THREE.Vector3(0, 0, 0)
];
return geometry;
});
forceSimulation()
.numDimensions(2)
.nodes(nodes)
.force("link", forceLink(links).distance(20).strength(1.25))
.force("charge", forceManyBody().strength(-50))
.force("center", forceCenter())
.on("end", ticked);
function vertex({ x = 0, y = 0 }) {
const l = x * Math.PI / 180;
const p = y * Math.PI / 180;
const c = Math.cos(p);
return {
x: radius * c * Math.cos(l),
y: radius * c * Math.sin(l),
z: radius * Math.sin(p)
stateInit: () => ({
d3ForceLayout: d3ForceSimulation()
.force('link', d3ForceLink())
.force('charge', d3ForceManyBody())
.force('center', d3ForceCenter())
.stop()
}),
.enter()
.append("line")
.attr("material", d => {
return linkColors[d.chunkName];
})
.attr("geometry", () => {
const geometry = new THREE.Geometry();
geometry.vertices = [
new THREE.Vector3(0, 0, 0),
new THREE.Vector3(0, 0, 0)
];
return geometry;
});
forceSimulation()
.numDimensions(3)
.nodes(nodes)
.force("link", forceLink(links).distance(20).strength(1.5))
.force("charge", forceManyBody().strength(-20))
.force("center", forceCenter())
.on("tick", ticked);
function ticked() {
node.attr("position", ({ x = 0, y = 0, z = 0 }) => {
return { x, y, z };
});
link.each(function({ source, target }) {
this.geometry.vertices = [
new THREE.Vector3(source.x, source.y || 0, source.z || 0),
new THREE.Vector3(target.x, target.y || 0, target.z || 0)