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