chart = {
const transitionDuration = 700
const radiusScale = d3.scaleSqrt().domain([1, 50]).range([3, 25])
const colorScale = d3.scaleOrdinal()
.range(["#7EB852", "#3465A8", "#7F378D"])
.domain(["root", "parent", "children"])
const radiusAccessor = (d) => radiusScale(d.value)
const nodeColorAccessor = (d) => colorScale(d.type)
const defaultGraphElements = {
transitionDuration,
radiusAccessor,
nodeColorAccessor
}
const forceCharge = d3.forceManyBody().strength(-10)
const forceCollide = d3.forceCollide(function (d) { return d.radius * 2})
const simulation = d3.forceSimulation().force(
"link",
d3.forceLink()
.strength(function (d) {
return d.strength
})
)
.force("charge", forceCharge)
.force("collide", forceCollide)
.force(
"center",
d3.forceCenter(width/2, width/2)
)
d3Network.network(simulation)
.selector(".Network")
.width(width)
.height(width)
.start(1583070000000)
.end(1583107180000)
.style(defaultGraphElements)
.animation({ mode: "auto", step: "hour", show_time: true })(dataNew)
}