define("echarts/chart/treemap",["require","./base","zrender/tool/area","zrender/shape/Rectangle","zrender/shape/Text","../layout/TreeMap","../config","../util/ecData","zrender/tool/util","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/tool/area"),a=e("zrender/shape/Rectangle"),o=(e("zrender/shape/Text"),e("../layout/TreeMap")),r=e("../config");r.treemap={zlevel:0,z:1,calculable:!1,clickable:!0};var s=e("../util/ecData"),l=e("zrender/tool/util");return t.prototype={type:r.CHART_TYPE_TREEMAP,_buildShape:function(){var e=this.series;this.data=e[0].data,this.x0=100,this.y0=50,this.width0=500,this.height0=300,this._buildTreemap(this.data),this.addShapeList()},_buildTreemap:function(e){for(var t=this.width0*this.height0,i=0,n=[],a=0;ai||s+U>a)return{};var d=this.data[r],p={zlevel:this.getZlevelBase()+1,z:this.getZBase()+1,hoverable:!1,style:{x:e+l,y:t+s,text:o,textColor:"#777",textFont:m},highlightStyle:{text:o}};return p={style:{text:o},highlightStyle:{text:o}},p=this.addLabel(p,this.series[0],d,o),p.style.textPosition="specific",p.style.textX=e+l,p.style.textY=t+s,p.style.textColor=p.style.textColor||"#000",p.highlightStyle.textPosition="specific",p.highlightStyle.textX=e+l,p.highlightStyle.textY=t+s,p.highlightStyle.textColor=p.highlightStyle.textColor||"#000",p},refresh:function(e){e&&(this.option=e,this.series=e.series),this._buildShape()}},l.inherits(t,i),e("../chart").define("treemap",t),t}),define("echarts/layout/TreeMap",["require"],function(){function e(e){this.rectangleList=[];var t={x:e.x0,y:e.y0,width:e.width0,height:e.height0};this.squarify(e.areas,t)}return e.prototype.squarify=function(e,t){var i="VERTICAL",n=t.width,a=t.height;t.widths;s++)o[r].y+=o[s].height}var l={};if("VERTICAL"==i){for(var h=0;hl;l++){var h=i*e[l]/o;a.push({width:s,height:h})}return a},e.prototype.isFirstBetter=function(e,t){var i=e[0].height/e[0].width;i=i>1?1/i:i;var n=t[0].height/t[0].width;return n=n>1?1/n:n,Math.abs(i-1)<=Math.abs(n-1)?!0:!1},e});