{
const height = 300;
const svgNode = DOM.svg(width, height);
const svg = d3.select(svgNode);
mutable feedBack = [];
const simulation = d3
.forceSimulation()
.force("center", d3.forceCenter(width / 2, height / 2))
.force("charge", d3.forceManyBody().strength(-100))
.force("link", d3.forceLink().id(d => d.name));
simulation.nodes(sampleForceGraph.nodes).on("tick", function() {
svg
.selectAll("circle")
.data(sampleForceGraph.nodes)
.join("circle")
.attr("transform", d => `translate(${d.x},${d.y})`)
.attr("r", 4)
.style("stroke", "lightgrey");
svg
.selectAll("line")
.data(sampleForceGraph.links)
.join("line")
.attr("x1", d => d.source.x)
.attr("y1", d => d.source.y)
.attr("x2", d => d.target.x)
.attr("y2", d => d.target.y)
.style("stroke", "lightgrey");
});
simulation.force("link").links(sampleForceGraph.links);
return svgNode;
}