$(window).on("load",(function(){var t=d3.select("#tree-chart"),e={top:20,right:20,bottom:30,left:50},n=t.node().getBoundingClientRect().width-e.left-e.right,r=600-e.top-e.bottom,a=t.append("svg"),l=a.attr("width",n+e.left+e.right).attr("height",r+e.top+e.bottom).append("g").attr("transform","translate("+e.left+","+e.top+")"),o=d3.layout.tree().size([r,n-180]),d=d3.svg.diagonal().projection((function(t){return[t.y,t.x]}));d3.json("../../../app-assets/data/d3/tree/tree.json",(function(s,i){var c=o.nodes(i),p=o.links(c),f=(l.append("g").attr("class","d3-tree-link-group").selectAll(".d3-tree-link").data(p).enter().append("path").attr("class","d3-tree-link").attr("d",d).style("fill","none").style("stroke","#e3e3e3").style("stroke-width",1.5),l.append("g").attr("class","d3-tree-node-group").selectAll(".d3-tree-node").data(c).enter().append("g").attr("class","d3-tree-node").attr("transform",(function(t){return"translate("+t.y+","+t.x+")"})));function g(){n=t.node().getBoundingClientRect().width-e.left-e.right,c=o.nodes(i),p=o.links(c),a.attr("width",n+e.left+e.right),l.attr("width",n+e.left+e.right),o.size([r,n-180]),l.selectAll(".d3-tree-link").attr("d",d),l.selectAll(".d3-tree-node").attr("transform",(function(t){return"translate("+t.y+","+t.x+")"}))}f.append("circle").attr("r",4.5).attr("class","d3-tree-circle").style("fill","#fff").style("stroke","#E84A5F").style("stroke-width",1.5),f.append("text").attr("dx",(function(t){return t.children?-12:12})).attr("dy",4).style("text-anchor",(function(t){return t.children?"end":"start"})).style("font-size",12).text((function(t){return t.name})),$(window).on("resize",g),$(".menu-toggle").on("click",g)}))}));