function setupSVG(svg){
svg.selectAll("g").remove()
svg.selectAll("defs").remove()
svg.selectAll("rect").remove()
svg.append("rect")
.attr("x",0)
.attr("y",0)
.attr("width",width)
.attr("height",height)
.attr("fill","white")
const defs = svg
.append("defs");
const nodeGrad = defs
.append("linearGradient")
.attr("id","nodeGrad")
nodeGrad.append('stop')
.attr('offset', '0')
.style("stop-color",swooshColor)
.style("stop-opacity", "100%")
nodeGrad.append('stop')
.attr('offset', '0.25')
.style("stop-color",swooshColor)
.style("stop-opacity", "0%")
nodeGrad.append('stop')
.attr('offset', '0.5')
.style("stop-color",swooshColor)
.style("stop-opacity", "0%")
nodeGrad.append('stop')
.attr('offset', '1')
.style("stop-color",swooshColor)
.style("stop-opacity", "0%")
const branchGrad=defs
.append("linearGradient")
.attr("id",`strokegrad-internal`);
branchGrad.append("stop")
.style("stop-opacity","0%")
.style("stop-color",branchColor)
.attr("offset","0");
branchGrad.append("stop")
.style("stop-opacity","0%")
.style("stop-color",branchColor)
.attr("offset","0.5");
branchGrad.append("stop")
.style("stop-opacity","100%")
.style("stop-color",branchColor)
.attr("offset","1");
}