fig={
const svg = d3.select(document.getElementById("simpleTree"))
svg.selectAll("g").remove();
svg.selectAll("rect").remove();
svg
.append("rect")
.attr("id","reset-catcher")
.attr("width",width)
.attr("height",400)
const fig = new ft.FigTree(document.getElementById("simpleTree"),margins, tree)
const figureGroup = d3.select(`.${fig.id}`)
fig.layout(ft.rectangularZoomedLayout(tree.rootNode))
.nodes(ft.roughCircle()
.radius(20)
.fillAttr("stroke","steelblue")
.fillAttr("stroke-width",2)
.strokeAttr("stroke-width",2)
.strokeAttr("stroke","grey")
)
.branches(ft.roughBranch()
.attr("stroke-width",2)
.attr("stroke","grey")
.attr("cursor","pointer")
.on("click",(edge,n,i)=>{
fig.layout(ft.rectangularZoomedLayout(tree.getNode(edge.v1.id)))
}))
svg
.select("#reset-catcher")
.on("click",()=>{
console.log("click")
fig.layout(ft.rectangularZoomedLayout(tree.rootNode))
})
return fig;
}