chartRadial = {
const h=800;
const weightFilter = 5;
const radiusRadial = 350;
const links = dataNet.links.map(d => Object.create(d))
.filter(f => (f.value > weightFilter));
const nodes = dataNet.nodes.map(d => Object.create(d));
const r = d3.scaleSqrt()
.domain([0, d3.max(nodes, d => d.value)])
.range([0, 30]);
const e = d3.scaleLinear()
.domain([0, d3.max(links, d => d.value)])
.range([0, 10]);
const simulation = d3.forceSimulation(nodes)
.force("center", d3.forceCenter(width / 2, h / 2))
.force("collide", d3.forceCollide().radius(d=> r(d.value) + 1).iterations(2))
.force('radial', d3.forceRadial(radiusRadial, width/2, h/2))
.force("link", d3.forceLink(links).id(d => d.id).strength(0))
const svg = d3.select(DOM.svg(width, h))
.style('max-width', '1920')
.style('max-height', '1000');
const link = svg.append("g")
.attr("stroke", "#999")
.attr("stroke-opacity", 0.6)
.selectAll("line")
.data(links)
.join("line")
.attr("stroke-width", d => e(d.value));
const node = svg.append("g")
.attr("stroke", "#fff")
.attr("stroke-width", 1.5)
.selectAll("circle")
.data(nodes)
.join("circle")
.attr("r", d => r(d.value))
.attr("fill", d => d.id)
.call(drag(simulation));
node.append("title")
.text(d => d.id);
simulation.on("tick", () => {
link
.attr("x1", d => d.source.x)
.attr("y1", d => d.source.y)
.attr("x2", d => d.target.x)
.attr("y2", d => d.target.y);
node
.attr("cx", d => d.x)
.attr("cy", d => d.y);
});
invalidation.then(() => simulation.stop());
return svg.node();
}