$(window).on("load",(function(){var t=d3.select("#treemap"),e=20,n=20,l=30,i=50,o=t.node().getBoundingClientRect().width-i-n,s=500-e-l,a=d3.scale.ordinal().range(["#99B898","#FECEA8","#FF847C","#E84A5F","#F8B195","#F67280","#C06C84"]),r=d3.layout.treemap().size([o,s]).sticky(!0).value((function(t){return t.size})),d=t.append("div").style("position","relative").style("width",o+i+n+"px").style("height",s+e+l+"px").style("left",i+"px").style("top",e+"px");function u(){this.style("left",(function(t){return t.x+"px"})).style("top",(function(t){return t.y+"px"})).style("width",(function(t){return Math.max(0,t.dx-1)+"px"})).style("height",(function(t){return Math.max(0,t.dy-1)+"px"}))}d3.json("../../../app-assets/data/d3/other/treemap.json",(function(t,e){if(t)throw t;var n=d.datum(e).selectAll(".node").data(r.nodes).enter().append("div").attr("class","node").call(u).style("background",(function(t){return t.children?a(t.name):null})).style("border","solid 1px white").style("font-size","10px").style("line-height","12px").style("overflow","hidden").style("position","absolute").style("text-indent","2px").style("color","#000").text((function(t){return t.children?null:t.name}));d3.selectAll("input").on("change",(function(){var t="count"===this.value?function(){return 1}:function(t){return t.size};n.data(r.value(t).nodes).transition().duration(1500).call(u)}))}))}));