define("echarts/chart/map","require ./base zrender/shape/Text zrender/shape/Path zrender/shape/Circle zrender/shape/Rectangle zrender/shape/Line zrender/shape/Polygon zrender/shape/Ellipse ../component/dataRange ../component/roamController ../config ../util/ecData zrender/tool/util zrender/config zrender/tool/event ../util/mapData/params ../util/mapData/textFixed ../util/mapData/geoCoord ../util/projection/svg ../util/projection/normal ../chart".split(" "),function(f){function c(e,h,p,a,b){n.call(this,e,h,p,a,b);var k=this;k._onmousewheel=function(e){return k.__onmousewheel(e)};k._onmousedown=function(e){return k.__onmousedown(e)};k._onmousemove=function(e){return k.__onmousemove(e)};k._onmouseup=function(e){return k.__onmouseup(e)};k._onroamcontroller=function(e){return k.__onroamcontroller(e)};k._ondrhoverlink=function(e){return k.__ondrhoverlink(e)};this._isAlive=!0;this._selectedMode={};this._activeMapType={};this._clickable={};this._hoverable={};this._showLegendSymbol={};this._selected={};this._mapTypeMap={};this._mapDataMap={};this._nameMap={};this._specialArea={};this._refreshDelayTicket;this._mapDataRequireCounter;this._markAnimation=!1;this._hoverLinkMap={};this._roamMap={};this._scaleLimitMap={};this._mx;this._my;this._mousedown;this._justMove;this._curMapType;this.refresh(a);this.zr.on(d.EVENT.MOUSEWHEEL,this._onmousewheel);this.zr.on(d.EVENT.MOUSEDOWN,this._onmousedown);h.bind(m.EVENT.ROAMCONTROLLER,this._onroamcontroller);h.bind(m.EVENT.DATA_RANGE_HOVERLINK,this._ondrhoverlink)}var n=f("./base"),b=f("zrender/shape/Text"),a=f("zrender/shape/Path"),t=f("zrender/shape/Circle"),k=f("zrender/shape/Rectangle"),v=f("zrender/shape/Line"),l=f("zrender/shape/Polygon"),g=f("zrender/shape/Ellipse");f("../component/dataRange");f("../component/roamController");var m=f("../config");m.map={zlevel:0,z:2,mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,dataRangeHoverLink:!0,hoverable:!0,clickable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}};var e=f("../util/ecData"),h=f("zrender/tool/util"),d=f("zrender/config"),u=f("zrender/tool/event"),B=f("../util/mapData/params").params,q=f("../util/mapData/textFixed"),w=f("../util/mapData/geoCoord");return c.prototype={type:m.CHART_TYPE_MAP,_buildShape:function(){var e=this.series;this.selectedMap={};this._activeMapType={};for(var d,p,a,b,k=this.component.legend,r={},u={},t={},g={},c=0,v=e.length;v>c;c++)if(e[c].type==m.CHART_TYPE_MAP&&(e[c]=this.reformOption(e[c]),p=e[c].mapType,u[p]=u[p]||{},u[p][c]=!0,t[p]=t[p]||e[c].mapValuePrecision,this._scaleLimitMap[p]=this._scaleLimitMap[p]||{},e[c].scaleLimit&&h.merge(this._scaleLimitMap[p],e[c].scaleLimit,!0),this._roamMap[p]=e[c].roam||this._roamMap[p],this._hoverLinkMap[p]=e[c].dataRangeHoverLink||this._hoverLinkMap[p],this._nameMap[p]=this._nameMap[p]||{},e[c].nameMap&&h.merge(this._nameMap[p],e[c].nameMap,!0),this._activeMapType[p]=!0,e[c].textFixed&&h.merge(q,e[c].textFixed,!0),e[c].geoCoord&&h.merge(w,e[c].geoCoord,!0),this._selectedMode[p]=this._selectedMode[p]||e[c].selectedMode,(null==this._hoverable[p]||this._hoverable[p])&&(this._hoverable[p]=e[c].hoverable),(null==this._clickable[p]||this._clickable[p])&&(this._clickable[p]=e[c].clickable),(null==this._showLegendSymbol[p]||this._showLegendSymbol[p])&&(this._showLegendSymbol[p]=e[c].showLegendSymbol),g[p]=g[p]||e[c].mapValueCalculation,d=e[c].name,this.selectedMap[d]=k?k.isSelected(d):!0,this.selectedMap[d])){r[p]=r[p]||{};a=e[c].data;for(var f=0,l=a.length;l>f;f++){b=this._nameChange(p,a[f].name);r[p][b]=r[p][b]||{seriesIndex:[]};for(var A in a[f])"value"!=A?r[p][b][A]=a[f][A]:isNaN(a[f].value)||(null==r[p][b].value&&(r[p][b].value=0),r[p][b].value+=a[f].value);r[p][b].seriesIndex.push(c)}}this._mapDataRequireCounter=0;for(var n in r)this._mapDataRequireCounter++;this._clearSelected();0===this._mapDataRequireCounter&&(this.clear(),this.zr&&this.zr.delShape(this.lastShapeList),this.lastShapeList=[]);for(n in r){if(g[n]&&"average"==g[n])for(l in r[n])r[n][l].value=(r[n][l].value/r[n][l].seriesIndex.length).toFixed(t[n])-0;this._mapDataMap[n]=this._mapDataMap[n]||{};this._mapDataMap[n].mapData?this._mapDataCallback(n,r[n],u[n])(this._mapDataMap[n].mapData):B[n.replace(/\|.*/,"")].getGeoJson&&(this._specialArea[n]=B[n.replace(/\|.*/,"")].specialArea||this._specialArea[n],B[n.replace(/\|.*/,"")].getGeoJson(this._mapDataCallback(n,r[n],u[n])))}},_mapDataCallback:function(e,d,h){var a=this;return function(b){a._isAlive&&null!=a._activeMapType[e]&&(-1!=e.indexOf("|")&&(b=a._getSubMapData(e,b)),a._mapDataMap[e].mapData=b,b.firstChild?(a._mapDataMap[e].rate=1,a._mapDataMap[e].projection=f("../util/projection/svg")):(a._mapDataMap[e].rate=.75,a._mapDataMap[e].projection=f("../util/projection/normal")),a._buildMap(e,a._getProjectionData(e,b,h),d,h),a._buildMark(e,h),0>=--a._mapDataRequireCounter&&(a.addShapeList(),a.zr.refreshNextFrame()))}},_clearSelected:function(){for(var e in this._selected)this._activeMapType[this._mapTypeMap[e]]||(delete this._selected[e],delete this._mapTypeMap[e])},_getSubMapData:function(e,d){for(var h=e.replace(/^.*\|/,""),a=d.features,b=0,k=a.length;k>b;b++)if(a[b].properties&&a[b].properties.name==h){a=a[b];"United States of America"==h&&1m;m++)k.push(this._getSingleProvince(e,u[m],b));if(this._specialArea[e])for(var g in this._specialArea[e])k.push(this._getSpecialProjectionData(e,d,g,this._specialArea[e][g],b));"china"==e&&(d=this.geo2pos(e,w["\u5357\u6d77\u8bf8\u5c9b"]||B["\u5357\u6d77\u8bf8\u5c9b"].textCoord),a=a.scale.x/10.5,u=[32*a+d[0],83*a+d[1]],q["\u5357\u6d77\u8bf8\u5c9b"]&&(u[0]+=q["\u5357\u6d77\u8bf8\u5c9b"][0],u[1]+=q["\u5357\u6d77\u8bf8\u5c9b"][1]),k.push({name:this._nameChange(e,"\u5357\u6d77\u8bf8\u5c9b"),path:B["\u5357\u6d77\u8bf8\u5c9b"].getPath(d,a),position:b,textX:u[0],textY:u[1]}));return k},_getSpecialProjectionData:function(e,a,d,h,b){a=this._getSubMapData("x|"+d,a);d=f("../util/projection/normal");var k=d.getBbox(a),u=this.geo2pos(e,[h.left,h.top]),m=this.geo2pos(e,[h.left+h.width,h.top+h.height]);h=Math.abs(m[0]-u[0])/.75/k.width;k=Math.abs(m[1]-u[1])/k.height;h>k?h=.75*k:(k=h,h=.75*k);a=d.geoJson2Path(a,{OffsetLeft:u[0],OffsetTop:u[1],scale:{x:h,y:k}});return this._getSingleProvince(e,a[0],b)},_getSingleProvince:function(e,a,h){var d,b=a.properties.name,k=q[b]||[0,0];w[b]?d=this.geo2pos(e,w[b]):a.cp?d=[a.cp[0]+k[0],a.cp[1]+k[1]]:(d=this._mapDataMap[e].bbox,d=this.geo2pos(e,[d.left+d.width/2,d.top+d.height/2]),d[0]+=k[0],d[1]+=k[1]);return a.name=this._nameChange(e,b),a.position=h,a.textX=d[0],a.textY=d[1],a},_getTransform:function(e,a,d){var h,b,k,u,m,t;h=this.series;var B=this.zr.getWidth(),g=this.zr.getHeight(),q=Math.round(.02*Math.min(B,g));for(k in a)a=h[k].mapLocation||{},b=a.x||b,u=a.y||u,m=a.width||m,t=a.height||t;h=this.parsePercent(b,B);h=isNaN(h)?q:h;k=this.parsePercent(u,g);k=isNaN(k)?q:k;m=null==m?B-h-2*q:this.parsePercent(m,B);t=null==t?g-k-2*q:this.parsePercent(t,g);q=e.width;e=e.height;a=m/d/q;var c=t/e;if(a>c?(a=c*d,m=q*a):(c=a,a=c*d,t=e*c),isNaN(b))switch(b=b||"center",b+""){case "center":h=Math.floor((B-m)/2);break;case "right":h=B-m}if(isNaN(u))switch(u=u||"center",u+""){case "center":k=Math.floor((g-t)/2);break;case "bottom":k=g-t}return{left:h,top:k,width:m,height:t,baseScale:1,scale:{x:a,y:c}}},_buildMap:function(d,u,p,B){for(var q,c,r,w,f,n,H,y,E,z,A,I=this.series,K=this.component.legend,M=this.component.dataRange,L=0,N=u.length;N>L;L++){if(y=h.clone(u[L]),E={name:y.name,path:y.path,position:h.clone(y.position)},c=y.name,r=p[c]){f=[r];q="";w=0;for(var O=r.seriesIndex.length;O>w;w++)f.push(I[r.seriesIndex[w]]),q+=I[r.seriesIndex[w]].name+" ",K&&this._showLegendSymbol[d]&&K.hasColor(I[r.seriesIndex[w]].name)&&this.shapeList.push(new t({zlevel:this.getZlevelBase(),z:this.getZBase()+1,position:h.clone(y.position),_mapType:d,style:{x:y.textX+3+7*w,y:y.textY-10,r:3,color:K.getColor(I[r.seriesIndex[w]].name)},hoverable:!1}));w=r.value}else{r="-";q="";f=[];for(var P in B)f.push(I[P]);w="-"}switch(this.ecTheme.map&&f.push(this.ecTheme.map),f.push(m),n=M&&!isNaN(w)?M.getColor(w):null,y.color=y.color||n||this.getItemStyleColor(this.deepQuery(f,"itemStyle.normal.color"),r.seriesIndex,-1,r)||this.deepQuery(f,"itemStyle.normal.areaStyle.color"),y.strokeColor=y.strokeColor||this.deepQuery(f,"itemStyle.normal.borderColor"),y.lineWidth=y.lineWidth||this.deepQuery(f,"itemStyle.normal.borderWidth"),E.color=this.getItemStyleColor(this.deepQuery(f,"itemStyle.emphasis.color"),r.seriesIndex,-1,r)||this.deepQuery(f,"itemStyle.emphasis.areaStyle.color")||y.color,E.strokeColor=this.deepQuery(f,"itemStyle.emphasis.borderColor")||y.strokeColor,E.lineWidth=this.deepQuery(f,"itemStyle.emphasis.borderWidth")||y.lineWidth,y.brushType=E.brushType=y.brushType||"both",y.lineJoin=E.lineJoin="round",y._name=E._name=c,H=this.deepQuery(f,"itemStyle.normal.label.textStyle"),A={zlevel:this.getZlevelBase(),z:this.getZBase()+1,position:h.clone(y.position),_mapType:d,_geo:this.pos2geo(d,[y.textX,y.textY]),style:{brushType:"fill",x:y.textX,y:y.textY,text:this.getLabelText(c,w,f,"normal"),_name:c,textAlign:"center",color:this.deepQuery(f,"itemStyle.normal.label.show")?this.deepQuery(f,"itemStyle.normal.label.textStyle.color"):"rgba(0,0,0,0)",textFont:this.getFont(H)}},A._style=h.clone(A.style),A.highlightStyle=h.clone(A.style),this.deepQuery(f,"itemStyle.emphasis.label.show")?(A.highlightStyle.text=this.getLabelText(c,w,f,"emphasis"),A.highlightStyle.color=this.deepQuery(f,"itemStyle.emphasis.label.textStyle.color")||A.style.color,H=this.deepQuery(f,"itemStyle.emphasis.label.textStyle")||H,A.highlightStyle.textFont=this.getFont(H)):A.highlightStyle.color="rgba(0,0,0,0)",z={zlevel:this.getZlevelBase(),z:this.getZBase(),position:h.clone(y.position),style:y,highlightStyle:E,_style:h.clone(y),_mapType:d},null!=y.scale&&(z.scale=h.clone(y.scale)),A=new b(A),z.style.shapeType){case "rectangle":z=new k(z);break;case "line":z=new v(z);break;case "circle":z=new t(z);break;case "polygon":z=new l(z);break;case "ellipse":z=new g(z);break;default:z=new a(z),z.buildPathArray&&(z.style.pathArray=z.buildPathArray(z.style.path))}(this._selectedMode[d]&&this._selected[c]||r.selected&&!1!==this._selected[c])&&(A.style=A.highlightStyle,z.style=z.highlightStyle);A.clickable=z.clickable=this._clickable[d]&&(null==r.clickable||r.clickable);this._selectedMode[d]&&(this._selected[c]=null!=this._selected[c]?this._selected[c]:r.selected,this._mapTypeMap[c]=d,(null==r.selectable||r.selectable)&&(z.clickable=A.clickable=!0,z.onclick=A.onclick=this.shapeHandler.onclick));this._hoverable[d]&&(null==r.hoverable||r.hoverable)?(A.hoverable=z.hoverable=!0,z.hoverConnect=A.id,A.hoverConnect=z.id):A.hoverable=z.hoverable=!1;e.pack(A,{name:q,tooltip:this.deepQuery(f,"tooltip")},0,r,0,c);this.shapeList.push(A);e.pack(z,{name:q,tooltip:this.deepQuery(f,"tooltip")},0,r,0,c);this.shapeList.push(z)}},_buildMark:function(e,d){this._seriesIndexToMapType=this._seriesIndexToMapType||{};this.markAttachStyle=this.markAttachStyle||{};var a=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];"none"==e&&(a=[0,0]);for(var h in d)this._seriesIndexToMapType[h]=e,this.markAttachStyle[h]={position:a,_mapType:e},this.buildMark(h)},getMarkCoord:function(e,a){return a.geoCoord||w[a.name]?this.geo2pos(this._seriesIndexToMapType[e],a.geoCoord||w[a.name]):[0,0]},getMarkGeo:function(e){return e.geoCoord||w[e.name]},_nameChange:function(e,a){return this._nameMap[e][a]||a},getLabelText:function(e,a,d,h){return(d=this.deepQuery(d,"itemStyle."+h+".label.formatter"))?"function"==typeof d?d.call(this.myChart,e,a):"string"==typeof d?(d=d.replace("{a}","{a0}").replace("{b}","{b0}"),d.replace("{a0}",e).replace("{b0}",a)):void 0:e},_findMapTypeByPos:function(e,a){var d,h,b,k,u,m;for(m in this._mapDataMap)if(d=this._mapDataMap[m].transform,d&&this._roamMap[m]&&this._activeMapType[m]&&(h=d.left,b=d.top,k=d.width,u=d.height,e>=h&&h+k>=e&&a>=b&&b+u>=a))return m},__onmousewheel:function(e){if(!(0>=this.shapeList.length)){var d,a,h=e.event,b=u.getX(h),k=u.getY(h),t=u.getDelta(h),c=e.mapTypeControl;c||(c={},a=this._findMapTypeByPos(b,k),a&&this._roamMap[a]&&"move"!=this._roamMap[a]&&(c[a]=!0));var B=!1;for(a in c)if(c[a]){var B=!0,q=this._mapDataMap[a].transform,g=q.left,f=q.top,w=q.width,v=q.height,l=this.pos2geo(a,[b-g,k-f]);if(0=this._scaleLimitMap[a].max)continue}else if(d=1/1.2,null!=this._scaleLimitMap[a].min&&q.baseScale<=this._scaleLimitMap[a].min)continue;q.baseScale*=d;q.scale.x*=d;q.scale.y*=d;q.width=w*d;q.height=v*d;this._mapDataMap[a].hasRoam=!0;this._mapDataMap[a].transform=q;l=this.geo2pos(a,l);q.left-=l[0]-(b-g);q.top-=l[1]-(k-f);this._mapDataMap[a].transform=q;this.clearEffectShape(!0);g=0;for(f=this.shapeList.length;f>g;g++)this.shapeList[g]._mapType==a&&(this.shapeList[g].position[0]=q.left,this.shapeList[g].position[1]=q.top,"path"==this.shapeList[g].type||"symbol"==this.shapeList[g].type||"circle"==this.shapeList[g].type||"rectangle"==this.shapeList[g].type||"polygon"==this.shapeList[g].type||"line"==this.shapeList[g].type||"ellipse"==this.shapeList[g].type?(this.shapeList[g].scale[0]*=d,this.shapeList[g].scale[1]*=d):"mark-line"==this.shapeList[g].type?(this.shapeList[g].style.pointListLength=void 0,this.shapeList[g].style.pointList=!1,l=this.geo2pos(a,this.shapeList[g]._geo[0]),this.shapeList[g].style.xStart=l[0],this.shapeList[g].style.yStart=l[1],l=this.geo2pos(a,this.shapeList[g]._geo[1]),this.shapeList[g]._x=this.shapeList[g].style.xEnd=l[0],this.shapeList[g]._y=this.shapeList[g].style.yEnd=l[1]):"icon"==this.shapeList[g].type||"image"==this.shapeList[g].type?(l=this.geo2pos(a,this.shapeList[g]._geo),this.shapeList[g].style.x=this.shapeList[g].style._x=l[0]-this.shapeList[g].style.width/2,this.shapeList[g].style.y=this.shapeList[g].style._y=l[1]-this.shapeList[g].style.height/2):(l=this.geo2pos(a,this.shapeList[g]._geo),this.shapeList[g].style.x=l[0],this.shapeList[g].style.y=l[1],"text"==this.shapeList[g].type&&(this.shapeList[g]._style.x=this.shapeList[g].highlightStyle.x=l[0],this.shapeList[g]._style.y=this.shapeList[g].highlightStyle.y=l[1])),this.zr.modShape(this.shapeList[g].id))}if(B){u.stop(h);this.zr.refreshNextFrame();var n=this;clearTimeout(this._refreshDelayTicket);this._refreshDelayTicket=setTimeout(function(){n&&n.shapeList&&n.animationEffect()},100);this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"scale"},this.myChart)}}},__onmousedown:function(e){if(!(0>=this.shapeList.length)){var a=e.target;if(!a||!a.draggable){a=e.event;e=u.getX(a);var a=u.getY(a),h=this._findMapTypeByPos(e,a);if(h&&this._roamMap[h]&&"scale"!=this._roamMap[h]){this._mousedown=!0;this._mx=e;this._my=a;this._curMapType=h;this.zr.on(d.EVENT.MOUSEUP,this._onmouseup);var b=this;setTimeout(function(){b.zr.on(d.EVENT.MOUSEMOVE,b._onmousemove)},100)}}}},__onmousemove:function(e){if(this._mousedown&&this._isAlive){var a=e.event,d=u.getX(a),h=u.getY(a),b=this._mapDataMap[this._curMapType].transform;b.hasRoam=!0;b.left-=this._mx-d;b.top-=this._my-h;this._mx=d;this._my=h;this._mapDataMap[this._curMapType].transform=b;d=0;for(h=this.shapeList.length;h>d;d++)this.shapeList[d]._mapType==this._curMapType&&(this.shapeList[d].position[0]=b.left,this.shapeList[d].position[1]=b.top,this.zr.modShape(this.shapeList[d].id));this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"move"},this.myChart);this.clearEffectShape(!0);this.zr.refreshNextFrame();this._justMove=!0;u.stop(a)}},__onmouseup:function(e){e=e.event;this._mx=u.getX(e);this._my=u.getY(e);this._mousedown=!1;var a=this;setTimeout(function(){a._justMove&&a.animationEffect();a._justMove=!1;a.zr.un(d.EVENT.MOUSEMOVE,a._onmousemove);a.zr.un(d.EVENT.MOUSEUP,a._onmouseup)},120)},__onroamcontroller:function(e){var a=e.event;a.zrenderX=this.zr.getWidth()/2;a.zrenderY=this.zr.getHeight()/2;var d=e.mapTypeControl,h=0,b=0,k=e.step;switch(e.roamType){case "scaleUp":return a.zrenderDelta=1,void this.__onmousewheel({event:a,mapTypeControl:d});case "scaleDown":return a.zrenderDelta=-1,void this.__onmousewheel({event:a,mapTypeControl:d});case "up":h=-k;break;case "down":h=k;break;case "left":b=-k;break;case "right":b=k}var g,u;for(u in d)this._mapDataMap[u]&&this._activeMapType[u]&&(g=this._mapDataMap[u].transform,g.hasRoam=!0,g.left-=b,g.top-=h,this._mapDataMap[u].transform=g);a=0;for(h=this.shapeList.length;h>a;a++)u=this.shapeList[a]._mapType,d[u]&&this._activeMapType[u]&&(g=this._mapDataMap[u].transform,this.shapeList[a].position[0]=g.left,this.shapeList[a].position[1]=g.top,this.zr.modShape(this.shapeList[a].id));this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"move"},this.myChart);this.clearEffectShape(!0);this.zr.refreshNextFrame();clearTimeout(this.dircetionTimer);var q=this;this.dircetionTimer=setTimeout(function(){q.animationEffect()},150)},__ondrhoverlink:function(a){for(var d,h,b=0,k=this.shapeList.length;k>b;b++)d=this.shapeList[b]._mapType,this._hoverLinkMap[d]&&this._activeMapType[d]&&(h=e.get(this.shapeList[b],"value"),null!=h&&h>=a.valueMin&&h<=a.valueMax&&this.zr.addHoverShape(this.shapeList[b]))},onclick:function(e){if(this.isClick&&e.target&&!this._justMove&&"icon"!=e.target.type){this.isClick=!1;var a=e.target,h=a.style._name,b=this.shapeList.length,a=a._mapType||"";if("single"==this._selectedMode[a])for(var k in this._selected)if(this._selected[k]&&this._mapTypeMap[k]==a){for(var g=0;b>g;g++)this.shapeList[g].style._name==k&&this.shapeList[g]._mapType==a&&(this.shapeList[g].style=this.shapeList[g]._style,this.zr.modShape(this.shapeList[g].id));k!=h&&(this._selected[k]=!1)}this._selected[h]=!this._selected[h];for(g=0;b>g;g++)this.shapeList[g].style._name==h&&this.shapeList[g]._mapType==a&&(this.shapeList[g].style=this._selected[h]?this.shapeList[g].highlightStyle:this.shapeList[g]._style,this.zr.modShape(this.shapeList[g].id));this.messageCenter.dispatch(m.EVENT.MAP_SELECTED,e.event,{selected:this._selected,target:h},this.myChart);this.zr.refreshNextFrame();var u=this;setTimeout(function(){u.zr.trigger(d.EVENT.MOUSEMOVE,e.event)},100)}},refresh:function(e){e&&(this.option=e,this.series=e.series);0q;q+=2)x[q]+=b,x[q+1]+=t;g.push(new n(c||u,x))}"z"!==u&&"Z"!==u||g.push(new n("z",[]))}return g},_convertPoint:function(k,c,t,g,m,e,h,d,u){u*=Math.PI/180;var f=Math.cos(u)*(k-t)/2+Math.sin(u)*(c-g)/2,q=-1*Math.sin(u)*(k-t)/2+Math.cos(u)*(c-g)/2,w=f*f/(h*h)+q*q/(d*d);1=b(t,f)&&(q=Math.PI),1<=b(t,f)&&(q=0),0===e&&0q&&(q+=2*Math.PI),[k,c,h,d,g,q,u,e]},buildPath:function(a,b){var c=b.path,g=b.x||0,t=b.y||0;b.pathArray=b.pathArray||this.buildPathArray(c,g,t);for(var c=b.pathArray,e=b.pointList=[],h=[],g=0,t=c.length;t>g;g++){"M"==c[g].command.toUpperCase()&&(0u;u+=2)h.push([d[u],d[u+1]])}0g;g++)switch(e=c[g].command,d=c[g].points,e){case "L":a.lineTo(d[0],d[1]);break;case "M":a.moveTo(d[0],d[1]);break;case "C":a.bezierCurveTo(d[0],d[1],d[2],d[3],d[4],d[5]);break;case "Q":a.quadraticCurveTo(d[0],d[1],d[2],d[3]);break;case "A":var e=d[0],h=d[1],q=d[2],w=d[3],u=d[4],f=d[5],x=d[6],d=d[7],F=q>w?q:w,p=q>w?1:q/w,q=q>w?w/q:1;a.translate(e,h);a.rotate(x);a.scale(p,q);a.arc(0,0,F,u,u+f,1-d);a.scale(1/p,1/q);a.rotate(-x);a.translate(-e,-h);break;case "z":a.closePath()}},getRect:function(a){if(a.__rect)return a.__rect;var b;b="stroke"==a.brushType||"fill"==a.brushType?a.lineWidth||1:0;for(var c=Number.MAX_VALUE,g=Number.MIN_VALUE,t=Number.MAX_VALUE,e=Number.MIN_VALUE,h=a.x||0,d=a.y||0,u=a.pathArray||this.buildPathArray(a.path),f=0;fg&&(g=q[w])):(q[w]+de&&(e=q[w]));var x;return x=c===Number.MAX_VALUE||g===Number.MIN_VALUE||t===Number.MAX_VALUE||e===Number.MIN_VALUE?{x:0,y:0,width:0,height:0}:{x:Math.round(c-b/2),y:Math.round(t-b/2),width:g-c+b,height:e-t+b},a.__rect=x,x}},f("../tool/util").inherits(t,c),t});define("zrender/shape/Ellipse",["require","./Base","../tool/util"],function(f){var c=f("./Base"),n=function(b){c.call(this,b)};return n.prototype={type:"ellipse",buildPath:function(b,a){var c=a.x,k=a.y,f=a.a,l=a.b,g=.5522848*f,m=.5522848*l;b.moveTo(c-f,k);b.bezierCurveTo(c-f,k-m,c-g,k-l,c,k-l);b.bezierCurveTo(c+g,k-l,c+f,k-m,c+f,k);b.bezierCurveTo(c+f,k+m,c+g,k+l,c,k+l);b.bezierCurveTo(c-g,k+l,c-f,k+m,c-f,k);b.closePath()},getRect:function(b){if(b.__rect)return b.__rect;var a;return a="stroke"==b.brushType||"fill"==b.brushType?b.lineWidth||1:0,b.__rect={x:Math.round(b.x-b.a-a/2),y:Math.round(b.y-b.b-a/2),width:2*b.a+a,height:2*b.b+a},b.__rect}},f("../tool/util").inherits(n,c),n});define("echarts/component/dataRange","require ./base zrender/shape/Text zrender/shape/Rectangle ../util/shape/HandlePolygon ../config zrender/tool/util zrender/tool/event zrender/tool/area zrender/tool/color ../component".split(" "),function(f){function c(a,h,d,b,c){if("undefined"==typeof this.query(b,"dataRange.min")||"undefined"==typeof this.query(b,"dataRange.max"))return void console.error("option.dataRange.min or option.dataRange.max has not been defined.");n.call(this,a,h,d,b,c);var g=this;g._ondrift=function(a,e){return g.__ondrift(this,a,e)};g._ondragend=function(){return g.__ondragend()};g._dataRangeSelected=function(a){return g.__dataRangeSelected(a)};g._dispatchHoverLink=function(a){return g.__dispatchHoverLink(a)};g._onhoverlink=function(a){return g.__onhoverlink(a)};this._selectedMap={};this._range={};this.refresh(b);h.bind(k.EVENT.HOVER,this._onhoverlink)}var n=f("./base"),b=f("zrender/shape/Text"),a=f("zrender/shape/Rectangle"),t=f("../util/shape/HandlePolygon"),k=f("../config");k.dataRange={zlevel:0,z:4,show:!0,orient:"vertical",x:"left",y:"bottom",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:1,itemGap:15,itemWidth:25,itemHeight:25,precision:0,splitNumber:5,calculable:!1,selectedMode:!0,hoverLink:!0,realtime:!0,color:["#006edd","#e0ffff"],textStyle:{fontSize:18,color:"#333"}};var v=f("zrender/tool/util"),l=f("zrender/tool/event"),g=f("zrender/tool/area"),m=f("zrender/tool/color");return c.prototype={type:k.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){if(this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable?this._buildGradient():this._buildItem(),this.dataRangeOption.show)for(var a=0,h=this.shapeList.length;h>a;a++)this.zr.addShape(this.shapeList[a]);this._syncShapeFromRange()},_buildItem:function(){var e,h,d,c=this._valueTextList,k=c.length,f=this.getFont(this.dataRangeOption.textStyle),t=this._itemGroupLocation.x,m=this._itemGroupLocation.y,l=this.dataRangeOption.itemWidth,p=this.dataRangeOption.itemHeight,n=this.dataRangeOption.itemGap;e=g.getTextHeight("\u56fd",f);"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(t=this._itemGroupLocation.x+this._itemGroupLocation.width-l);var v=!0;this.dataRangeOption.text&&(v=!1,this.dataRangeOption.text[0]&&(d=this._getTextShape(t,m,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?t+=g.getTextWidth(this.dataRangeOption.text[0],f)+this._textGap:(m+=e+this._textGap,d.style.y+=e/2+this._textGap,d.style.textBaseline="bottom"),this.shapeList.push(new b(d))));for(var D=0;k>D;D++)e=c[D],h=this.getColorByIndex(D),h=this._getItemShape(t,m,l,p,this._selectedMap[D]?h:"#ccc"),h._idx=D,h.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(h.clickable=!0,h.onclick=this._dataRangeSelected),this.shapeList.push(new a(h)),v&&(d={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:t+l+5,y:m,color:this._selectedMap[D]?this.dataRangeOption.textStyle.color:"#ccc",text:c[D],textFont:f,textBaseline:"top"},highlightStyle:{brushType:"fill"}},"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(d.style.x-=l+10,d.style.textAlign="right"),d._idx=D,d.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(d.clickable=!0,d.onclick=this._dataRangeSelected),this.shapeList.push(new b(d))),"horizontal"==this.dataRangeOption.orient?t+=l+(v?5:0)+(v?g.getTextWidth(e,f):0)+n:m+=p+n;!v&&this.dataRangeOption.text[1]&&("horizontal"==this.dataRangeOption.orient?t=t-n+this._textGap:m=m-n+this._textGap,d=this._getTextShape(t,m,this.dataRangeOption.text[1]),"horizontal"!=this.dataRangeOption.orient&&(d.style.y-=5,d.style.textBaseline="top"),this.shapeList.push(new b(d)))},_buildGradient:function(){var e,h,d=this.getFont(this.dataRangeOption.textStyle),c=this._itemGroupLocation.x,k=this._itemGroupLocation.y,t=this.dataRangeOption.itemWidth,m=this.dataRangeOption.itemHeight,l=g.getTextHeight("\u56fd",d),n=!0;this.dataRangeOption.text&&(n=!1,this.dataRangeOption.text[0]&&(h=this._getTextShape(c,k,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?c+=g.getTextWidth(this.dataRangeOption.text[0],d)+this._textGap:(k+=l+this._textGap,h.style.y+=l/2+this._textGap,h.style.textBaseline="bottom"),this.shapeList.push(new b(h))));for(var d=f("zrender/tool/color"),l=1/(this.dataRangeOption.color.length-1),p=[],v=0,G=this.dataRangeOption.color.length;G>v;v++)p.push([v*l,this.dataRangeOption.color[v]]);"horizontal"==this.dataRangeOption.orient?(e={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:c,y:k,width:6*t,height:m,color:d.getLinearGradient(c,k,c+6*t,k,p)},hoverable:!1},c+=6*t+this._textGap):(e={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:c,y:k,width:t,height:6*m,color:d.getLinearGradient(c,k,c,k+6*m,p)},hoverable:!1},k+=6*m+this._textGap);this.shapeList.push(new a(e));this._calculableLocation=e.style;this.dataRangeOption.calculable&&(this._buildFiller(),this._bulidMask(),this._bulidHandle());this._buildIndicator();!n&&this.dataRangeOption.text[1]&&(h=this._getTextShape(c,k,this.dataRangeOption.text[1]),this.shapeList.push(new b(h)))},_buildIndicator:function(){var a,h,d=this._calculableLocation.x,b=this._calculableLocation.y,c=this._calculableLocation.width,g=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(a=[[d,b+g],[d-5,b+g+5],[d+5,b+g+5]],h="bottom"):(a=[[d,b],[d-5,b-5],[d+5,b-5]],h="top"):"right"!=this.dataRangeOption.x?(a=[[d+c,b],[d+c+5,b-5],[d+c+5,b+5]],h="right"):(a=[[d,b],[d-5,b-5],[d-5,b+5]],h="left");this._indicatorShape={style:{pointList:a,color:"#fff",__rect:{x:Math.min(a[0][0],a[1][0]),y:Math.min(a[0][1],a[1][1]),width:5*("horizontal"==this.dataRangeOption.orient?2:1),height:5*("horizontal"==this.dataRangeOption.orient?1:2)}},highlightStyle:{brushType:"fill",textPosition:h,textColor:this.dataRangeOption.textStyle.color},hoverable:!1};this._indicatorShape=new t(this._indicatorShape)},_buildFiller:function(){this._fillerShape={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._calculableLocation.x,y:this._calculableLocation.y,width:this._calculableLocation.width,height:this._calculableLocation.height,color:"rgba(255,255,255,0)"},highlightStyle:{strokeColor:"rgba(255,255,255,0.5)",lineWidth:1},draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,onmousemove:this._dispatchHoverLink,_type:"filler"};this._fillerShape=new a(this._fillerShape);this.shapeList.push(this._fillerShape)},_bulidHandle:function(){var a,h,d,b,c,k,f,m,l=this._calculableLocation.x,p=this._calculableLocation.y,n=this._calculableLocation.width,v=this._calculableLocation.height,D=this.getFont(this.dataRangeOption.textStyle),r=g.getTextHeight("\u56fd",D),C=Math.max(g.getTextWidth(this._textFormat(this.dataRangeOption.max),D),g.getTextWidth(this._textFormat(this.dataRangeOption.min),D))+2;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(a=[[l,p],[l,p+v+r],[l-r,p+v+r],[l-1,p+v],[l-1,p]],h=l-C/2-r,d=p+v+r/2+2,b={x:l-C-r,y:p+v,width:C+r,height:r},c=[[l+n,p],[l+n,p+v+r],[l+n+r,p+v+r],[l+n+1,p+v],[l+n+1,p]],k=l+n+C/2+r,f=d,m={x:l+n,y:p+v,width:C+r,height:r}):(a=[[l,p+v],[l,p-r],[l-r,p-r],[l-1,p],[l-1,p+v]],h=l-C/2-r,d=p-r/2-2,b={x:l-C-r,y:p-r,width:C+r,height:r},c=[[l+n,p+v],[l+n,p-r],[l+n+r,p-r],[l+n+1,p],[l+n+1,p+v]],k=l+n+C/2+r,f=d,m={x:l+n,y:p-r,width:C+r,height:r}):(C+=r,"right"!=this.dataRangeOption.x?(a=[[l,p],[l+n+r,p],[l+n+r,p-r],[l+n,p-1],[l,p-1]],h=l+n+C/2+r/2,d=p-r/2,b={x:l+n,y:p-r,width:C+r,height:r},c=[[l,p+v],[l+n+r,p+v],[l+n+r,p+r+v],[l+n,p+1+v],[l,p+v+1]],k=h,f=p+v+r/2,m={x:l+n,y:p+v,width:C+r,height:r}):(a=[[l+n,p],[l-r,p],[l-r,p-r],[l,p-1],[l+n,p-1]],h=l-C/2-r/2,d=p-r/2,b={x:l-C-r,y:p-r,width:C+r,height:r},c=[[l+n,p+v],[l-r,p+v],[l-r,p+r+v],[l,p+1+v],[l+n,p+v+1]],k=h,f=p+v+r/2,m={x:l-C-r,y:p+v,width:C+r,height:r}));this._startShape={style:{pointList:a,text:this._textFormat(this.dataRangeOption.max),textX:h,textY:d,textFont:D,color:this.getColor(this.dataRangeOption.max),rect:b,x:a[0][0],y:a[0][1],_x:a[0][0],_y:a[0][1]}};this._startShape.highlightStyle={strokeColor:this._startShape.style.color,lineWidth:1};this._endShape={style:{pointList:c,text:this._textFormat(this.dataRangeOption.min),textX:k,textY:f,textFont:D,color:this.getColor(this.dataRangeOption.min),rect:m,x:c[0][0],y:c[0][1],_x:c[0][0],_y:c[0][1]}};this._endShape.highlightStyle={strokeColor:this._endShape.style.color,lineWidth:1};this._startShape.zlevel=this._endShape.zlevel=this.getZlevelBase();this._startShape.z=this._endShape.z=this.getZBase()+1;this._startShape.draggable=this._endShape.draggable=!0;this._startShape.ondrift=this._endShape.ondrift=this._ondrift;this._startShape.ondragend=this._endShape.ondragend=this._ondragend;this._startShape.style.textColor=this._endShape.style.textColor=this.dataRangeOption.textStyle.color;this._startShape.style.textAlign=this._endShape.style.textAlign="center";this._startShape.style.textPosition=this._endShape.style.textPosition="specific";this._startShape.style.textBaseline=this._endShape.style.textBaseline="middle";this._startShape.style.width=this._endShape.style.width=0;this._startShape.style.height=this._endShape.style.height=0;this._startShape.style.textPosition=this._endShape.style.textPosition="specific";this._startShape=new t(this._startShape);this._endShape=new t(this._endShape);this.shapeList.push(this._startShape);this.shapeList.push(this._endShape)},_bulidMask:function(){var e=this._calculableLocation.x,h=this._calculableLocation.y,d=this._calculableLocation.width,b=this._calculableLocation.height;this._startMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:e,y:h,width:"horizontal"==this.dataRangeOption.orient?0:d,height:"horizontal"==this.dataRangeOption.orient?b:0,color:"#ccc"},hoverable:!1};this._endMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:"horizontal"==this.dataRangeOption.orient?e+d:e,y:"horizontal"==this.dataRangeOption.orient?h:h+b,width:"horizontal"==this.dataRangeOption.orient?0:d,height:"horizontal"==this.dataRangeOption.orient?b:0,color:"#ccc"},hoverable:!1};this._startMask=new a(this._startMask);this._endMask=new a(this._endMask);this.shapeList.push(this._startMask);this.shapeList.push(this._endMask)},_buildBackground:function(){var e=this.reformCssArray(this.dataRangeOption.padding);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.dataRangeOption.borderWidth?"fill":"both",color:this.dataRangeOption.backgroundColor,strokeColor:this.dataRangeOption.borderColor,lineWidth:this.dataRangeOption.borderWidth}}))},_getItemGroupLocation:function(){var a=this._valueTextList,h=a.length,d=this.dataRangeOption.itemGap,b=this.dataRangeOption.itemWidth,c=this.dataRangeOption.itemHeight,k=0,f=this.getFont(this.dataRangeOption.textStyle),t=g.getTextHeight("\u56fd",f);if("horizontal"==this.dataRangeOption.orient){if(this.dataRangeOption.text||0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable)k=(0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable?6*b+d:h*(b+d))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?g.getTextWidth(this.dataRangeOption.text[0],f)+this._textGap:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?g.getTextWidth(this.dataRangeOption.text[1],f)+this._textGap:0);else for(var b=b+5,m=0;h>m;m++)k+=b+g.getTextWidth(a[m],f)+d;k-=d;c=Math.max(t,c)}else{if(this.dataRangeOption.text||0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable)c=(0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable?6*c+d:h*(c+d))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?this._textGap+t:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?this._textGap+t:0),k=Math.max(g.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[0]||"",f),g.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[1]||"",f)),k=Math.max(b,k);else{c=(c+d)*h;b+=5;for(m=k=0;h>m;m++)k=Math.max(k,g.getTextWidth(a[m],f));k=b+k}c-=d}b=this.reformCssArray(this.dataRangeOption.padding);h=this.zr.getWidth();switch(this.dataRangeOption.x){case "center":a=Math.floor((h-k)/2);break;case "left":a=b[3]+this.dataRangeOption.borderWidth;break;case "right":a=h-k-b[1]-this.dataRangeOption.borderWidth;break;default:a=this.parsePercent(this.dataRangeOption.x,h),a=isNaN(a)?0:a}d=this.zr.getHeight();switch(this.dataRangeOption.y){case "top":b=b[0]+this.dataRangeOption.borderWidth;break;case "bottom":b=d-c-b[2]-this.dataRangeOption.borderWidth;break;case "center":b=Math.floor((d-c)/2);break;default:b=this.parsePercent(this.dataRangeOption.y,d),b=isNaN(b)?0:b}this.dataRangeOption.calculable&&(f=Math.max(g.getTextWidth(this.dataRangeOption.max,f),g.getTextWidth(this.dataRangeOption.min,f))+t,"horizontal"==this.dataRangeOption.orient?(f>a&&(a=f),a+k+f>h&&(a-=f)):(t>b&&(b=t),b+c+t>d&&(b-=t)));return{x:a,y:b,width:k,height:c}},_getTextShape:function(a,b,d){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:"horizontal"==this.dataRangeOption.orient?a:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:"horizontal"==this.dataRangeOption.orient?this._itemGroupLocation.y+this._itemGroupLocation.height/2:b,color:this.dataRangeOption.textStyle.color,text:d,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:"horizontal"==this.dataRangeOption.orient?"middle":"top",textAlign:"horizontal"==this.dataRangeOption.orient?"left":"center"},hoverable:!1}},_getItemShape:function(a,b,d,c,g){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:a,y:b+1,width:d,height:c-2,color:g},highlightStyle:{strokeColor:g,lineWidth:1}}},__ondrift:function(a,b,d){var c=this._calculableLocation.x,g=this._calculableLocation.y,k=this._calculableLocation.width,f=this._calculableLocation.height;return"horizontal"==this.dataRangeOption.orient?a.style.x+b<=c?a.style.x=c:a.style.x+b+a.style.width>=c+k?a.style.x=c+k-a.style.width:a.style.x+=b:a.style.y+d<=g?a.style.y=g:a.style.y+d+a.style.height>=g+f?a.style.y=g+f-a.style.height:a.style.y+=d,"filler"==a._type?this._syncHandleShape():this._syncFillerShape(a),this.dataRangeOption.realtime&&this._dispatchDataRange(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(a,b){this.isDragend&&a.target&&(b.dragOut=!0,b.dragIn=!0,this.dataRangeOption.realtime||this._dispatchDataRange(),b.needRefresh=!1,this.isDragend=!1)},_syncShapeFromRange:function(){var a=this.dataRangeOption.range||{};if(this._range.end="undefined"!=typeof this._range.end?this._range.end:"undefined"!=typeof a.start?a.start:0,this._range.start="undefined"!=typeof this._range.start?this._range.start:"undefined"!=typeof a.end?a.end:100,100!=this._range.start||0!==this._range.end)"horizontal"==this.dataRangeOption.orient?(a=this._fillerShape.style.width,this._fillerShape.style.x+=a*(100-this._range.start)/100,this._fillerShape.style.width=a*(this._range.start-this._range.end)/100):(a=this._fillerShape.style.height,this._fillerShape.style.y+=a*(100-this._range.start)/100,this._fillerShape.style.height=a*(this._range.start-this._range.end)/100),this.zr.modShape(this._fillerShape.id),this._syncHandleShape()},_syncHandleShape:function(){var a=this._calculableLocation.x,b=this._calculableLocation.y,d=this._calculableLocation.width,c=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(this._startShape.style.x=this._fillerShape.style.x,this._startMask.style.width=this._startShape.style.x-a,this._endShape.style.x=this._fillerShape.style.x+this._fillerShape.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=a+d-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-a)/d*100),this._range.end=Math.floor(100-(this._endShape.style.x-a)/d*100)):(this._startShape.style.y=this._fillerShape.style.y,this._startMask.style.height=this._startShape.style.y-b,this._endShape.style.y=this._fillerShape.style.y+this._fillerShape.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=b+c-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-b)/c*100),this._range.end=Math.floor(100-(this._endShape.style.y-b)/c*100));this._syncShape()},_syncFillerShape:function(a){var b,d,c=this._calculableLocation.x,g=this._calculableLocation.y,k=this._calculableLocation.width,f=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(b=this._startShape.style.x,d=this._endShape.style.x,a.id==this._startShape.id&&b>=d?(d=b,this._endShape.style.x=b):a.id==this._endShape.id&&b>=d&&(b=d,this._startShape.style.x=b),this._fillerShape.style.x=b,this._fillerShape.style.width=d-b,this._startMask.style.width=b-c,this._endMask.style.x=d,this._endMask.style.width=c+k-d,this._range.start=Math.ceil(100-(b-c)/k*100),this._range.end=Math.floor(100-(d-c)/k*100)):(b=this._startShape.style.y,d=this._endShape.style.y,a.id==this._startShape.id&&b>=d?(d=b,this._endShape.style.y=b):a.id==this._endShape.id&&b>=d&&(b=d,this._startShape.style.y=b),this._fillerShape.style.y=b,this._fillerShape.style.height=d-b,this._startMask.style.height=b-g,this._endMask.style.y=d,this._endMask.style.height=g+f-d,this._range.start=Math.ceil(100-(b-g)/f*100),this._range.end=Math.floor(100-(d-g)/f*100));this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y];this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min);this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min);this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y];this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min);this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min);this.zr.modShape(this._startShape.id);this.zr.modShape(this._endShape.id);this.zr.modShape(this._startMask.id);this.zr.modShape(this._endMask.id);this.zr.modShape(this._fillerShape.id);this.zr.refreshNextFrame()},_dispatchDataRange:function(){this.messageCenter.dispatch(k.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(a){if("single"===this.dataRangeOption.selectedMode)for(var b in this._selectedMap)this._selectedMap[b]=!1;b=a.target._idx;this._selectedMap[b]=!this._selectedMap[b];var d=(this._colorList.length-b)*this._gap+this.dataRangeOption.min;this.messageCenter.dispatch(k.EVENT.DATA_RANGE_SELECTED,a.event,{selected:this._selectedMap,target:b,valueMax:d,valueMin:d-this._gap},this.myChart);this.messageCenter.dispatch(k.EVENT.REFRESH,null,null,this.myChart)},__dispatchHoverLink:function(a){var b,d;if(this.dataRangeOption.calculable){var c=this.dataRangeOption.max-this.dataRangeOption.min;d="horizontal"==this.dataRangeOption.orient?(1-(l.getX(a.event)-this._calculableLocation.x)/this._calculableLocation.width)*c:(1-(l.getY(a.event)-this._calculableLocation.y)/this._calculableLocation.height)*c;b=d-.05*c;d+=.05*c}else d=(this._colorList.length-a.target._idx)*this._gap+this.dataRangeOption.min,b=d-this._gap;this.messageCenter.dispatch(k.EVENT.DATA_RANGE_HOVERLINK,a.event,{valueMin:b,valueMax:d},this.myChart)},__onhoverlink:function(a){if(this.dataRangeOption.show&&this.dataRangeOption.hoverLink&&this._indicatorShape&&a&&null!=a.seriesIndex&&null!=a.dataIndex){var b=a.value;""===b||isNaN(b)||(bthis.dataRangeOption.max&&(b=this.dataRangeOption.max),this._indicatorShape.position="horizontal"==this.dataRangeOption.orient?[(this.dataRangeOption.max-b)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.width,0]:[0,(this.dataRangeOption.max-b)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.height],this._indicatorShape.style.text=this._textFormat(a.value),this._indicatorShape.style.color=this.getColor(b),this.zr.addHoverShape(this._indicatorShape))}},_textFormat:function(a,b){if(a=a.toFixed(this.dataRangeOption.precision),b=null!=b?b.toFixed(this.dataRangeOption.precision):"",this.dataRangeOption.formatter){if("string"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.replace("{value}",a).replace("{value2}",b);if("function"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.call(this.myChart,a,b)}return""!==b?a+" - "+b:a},refresh:function(a){if(a){this.option=a;this.option.dataRange=this.reformOption(this.option.dataRange);this.dataRangeOption=this.option.dataRange;a=0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;if(this._colorList=m.getGradientColors(this.dataRangeOption.color,Math.max((a-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1),this._colorList.length>a){for(var b=this._colorList.length,d=[this._colorList[0]],c=b/(a-1),g=1;a-1>g;g++)d.push(this._colorList[Math.floor(g*c)]);d.push(this._colorList[b-1]);this._colorList=d}b=this.dataRangeOption.precision;for(this._gap=(this.dataRangeOption.max-this.dataRangeOption.min)/a;this._gap.toFixed(b)-0!=this._gap&&5>b;)b++;this.dataRangeOption.precision=b;this._gap=((this.dataRangeOption.max-this.dataRangeOption.min)/a).toFixed(b)-0;this._valueTextList=[];for(g=0;a>g;g++)this._selectedMap[g]=!0,this._valueTextList.unshift(this._textFormat(g*this._gap+this.dataRangeOption.min,(g+1)*this._gap+this.dataRangeOption.min))}this.clear();this._buildShape()},getColor:function(a){if(isNaN(a))return null;if(this.dataRangeOption.min==this.dataRangeOption.max)return this._colorList[0];if(athis.dataRangeOption.max&&(a=this.dataRangeOption.max),this.dataRangeOption.calculable&&(5E-5a-(this._gap*this._range.end+this.dataRangeOption.min)))return null;a=this._colorList.length-Math.ceil((a-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return a==this._colorList.length&&a--,this._selectedMap[a]?this._colorList[a]:null},getColorByIndex:function(a){return a>=this._colorList.length?a=this._colorList.length-1:0>a&&(a=0),this._colorList[a]},onbeforDispose:function(){this.messageCenter.unbind(k.EVENT.HOVER,this._onhoverlink)}},v.inherits(c,n),f("../component").define("dataRange",c),c});define("echarts/component/roamController","require ./base zrender/shape/Rectangle zrender/shape/Sector zrender/shape/Circle ../config zrender/tool/util zrender/tool/color zrender/tool/event ../component".split(" "),function(f){function c(a,b,c,d,g){if(d.roamController&&d.roamController.show){if(!d.roamController.mapTypeControl)return void console.error("option.roamController.mapTypeControl has not been defined.");n.call(this,a,b,c,d,g);this.rcOption=d.roamController;var k=this;this._drictionMouseDown=function(a){return k.__drictionMouseDown(a)};this._drictionMouseUp=function(a){return k.__drictionMouseUp(a)};this._drictionMouseMove=function(a){return k.__drictionMouseMove(a)};this._drictionMouseOut=function(a){return k.__drictionMouseOut(a)};this._scaleHandler=function(a){return k.__scaleHandler(a)};this.refresh(d)}}var n=f("./base"),b=f("zrender/shape/Rectangle"),a=f("zrender/shape/Sector"),t=f("zrender/shape/Circle"),k=f("../config");k.roamController={zlevel:0,z:4,show:!0,x:"left",y:"top",width:80,height:120,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:1,handleColor:"#6495ed",fillerColor:"#fff",step:15,mapTypeControl:null};var v=f("zrender/tool/util"),l=f("zrender/tool/color"),g=f("zrender/tool/event");return c.prototype={type:k.COMPONENT_TYPE_ROAMCONTROLLER,_buildShape:function(){if(this.rcOption.show){this._itemGroupLocation=this._getItemGroupLocation();this._buildBackground();this._buildItem();for(var a=0,b=this.shapeList.length;b>a;a++)this.zr.addShape(this.shapeList[a])}},_buildItem:function(){this.shapeList.push(this._getDirectionShape("up"));this.shapeList.push(this._getDirectionShape("down"));this.shapeList.push(this._getDirectionShape("left"));this.shapeList.push(this._getDirectionShape("right"));this.shapeList.push(this._getScaleShape("scaleUp"));this.shapeList.push(this._getScaleShape("scaleDown"))},_getDirectionShape:function(b){var e=this._itemGroupLocation.r,c=this._itemGroupLocation.x+e,d=this._itemGroupLocation.y+e,e={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:c,y:d,r:e,startAngle:-45,endAngle:45,color:this.rcOption.handleColor,text:"\x3e",textX:c+e/2+4,textY:d-.5,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(e/2)+"px arial"},highlightStyle:{color:l.lift(this.rcOption.handleColor,-.2),brushType:"fill"},clickable:!0};switch(b){case "up":e.rotation=[Math.PI/2,c,d];break;case "left":e.rotation=[Math.PI,c,d];break;case "down":e.rotation=[-Math.PI/2,c,d]}return e=new a(e),e._roamType=b,e.onmousedown=this._drictionMouseDown,e.onmouseup=this._drictionMouseUp,e.onmousemove=this._drictionMouseMove,e.onmouseout=this._drictionMouseOut,e},_getScaleShape:function(a){var b=this._itemGroupLocation.width,c=this._itemGroupLocation.height-b,c=Math.min(b/2-5,0>c?20:c)/2,b=this._itemGroupLocation.x+("scaleDown"===a?b-c:c),d=this._itemGroupLocation.y+this._itemGroupLocation.height-c,c={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:b,y:d,r:c,color:this.rcOption.handleColor,text:"scaleDown"===a?"-":"+",textX:b,textY:d-2,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(c)+"px verdana"},highlightStyle:{color:l.lift(this.rcOption.handleColor,-.2),brushType:"fill"},clickable:!0};return c=new t(c),c._roamType=a,c.onmousedown=this._scaleHandler,c},_buildBackground:function(){var a=this.reformCssArray(this.rcOption.padding);this.shapeList.push(new b({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-a[3],y:this._itemGroupLocation.y-a[0],width:this._itemGroupLocation.width+a[3]+a[1],height:this._itemGroupLocation.height+a[0]+a[2],brushType:0===this.rcOption.borderWidth?"fill":"both",color:this.rcOption.backgroundColor,strokeColor:this.rcOption.borderColor,lineWidth:this.rcOption.borderWidth}}))},_getItemGroupLocation:function(){var a,b=this.reformCssArray(this.rcOption.padding),c=this.rcOption.width,d=this.rcOption.height;a=this.zr.getWidth();var g=this.zr.getHeight();switch(this.rcOption.x){case "center":a=Math.floor((a-c)/2);break;case "left":a=b[3]+this.rcOption.borderWidth;break;case "right":a=a-c-b[1]-b[3]-2*this.rcOption.borderWidth;break;default:a=this.parsePercent(this.rcOption.x,a)}switch(this.rcOption.y){case "top":b=b[0]+this.rcOption.borderWidth;break;case "bottom":b=g-d-b[0]-b[2]-2*this.rcOption.borderWidth;break;case "center":b=Math.floor((g-d)/2);break;default:b=this.parsePercent(this.rcOption.y,g)}return{x:a,y:b,r:c/2,width:c,height:d}},__drictionMouseDown:function(a){this.mousedown=!0;this._drictionHandlerOn(a)},__drictionMouseUp:function(a){this.mousedown=!1;this._drictionHandlerOff(a)},__drictionMouseMove:function(a){this.mousedown&&this._drictionHandlerOn(a)},__drictionMouseOut:function(a){this._drictionHandlerOff(a)},_drictionHandlerOn:function(a){this._dispatchEvent(a.event,a.target._roamType);clearInterval(this.dircetionTimer);var b=this;this.dircetionTimer=setInterval(function(){b._dispatchEvent(a.event,a.target._roamType)},100);g.stop(a.event)},_drictionHandlerOff:function(){clearInterval(this.dircetionTimer)},__scaleHandler:function(a){this._dispatchEvent(a.event,a.target._roamType);g.stop(a.event)},_dispatchEvent:function(a,b){this.messageCenter.dispatch(k.EVENT.ROAMCONTROLLER,a,{roamType:b,mapTypeControl:this.rcOption.mapTypeControl,step:this.rcOption.step},this.myChart)},refresh:function(a){a&&(this.option=a||this.option,this.option.roamController=this.reformOption(this.option.roamController),this.rcOption=this.option.roamController);this.clear();this._buildShape()}},v.inherits(c,n),f("../component").define("roamController",c),c});define("echarts/util/mapData/params",["require"],function(f){function c(b){if(!b.UTF8Encoding)return b;for(var a=b.features,c=0;c>1^-(1&g),m=m>>1^-(1&m),g=g+k,m=m+f,k=g,f=m;c.push([g/1024,m/1024])}return c}return{decode:c,params:{none:{getGeoJson:function(b){b({type:"FeatureCollection",features:[{type:"Feature",geometry:{coordinates:[],encodeOffsets:[],type:"Polygon"},properties:{}}]})}},world:{getGeoJson:function(b){f(["./geoJson/world_geo"],function(a){b(c(a))})}},china:{getGeoJson:function(b){f(["./geoJson/china_geo"],function(a){b(c(a))})}},"\u5357\u6d77\u8bf8\u5c9b":{textCoord:[126,25],getPath:function(b,a){for(var c=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],k="",f=b[0],l=b[1],g=0,m=c.length;m>g;g++)for(var k=k+("M "+((c[g][0][0]*a+f).toFixed(2)-0)+" "+((c[g][0][1]*a+l).toFixed(2)-0)+" "),e=1,h=c[g].length;h>e;e++)k+="L "+((c[g][e][0]*a+f).toFixed(2)-0)+" "+((c[g][e][1]*a+l).toFixed(2)-0)+" ";return k+" Z"}},"\u65b0\u7586":{getGeoJson:function(b){f(["./geoJson/xin_jiang_geo"],function(a){b(c(a))})}},"\u897f\u85cf":{getGeoJson:function(b){f(["./geoJson/xi_zang_geo"],function(a){b(c(a))})}},"\u5185\u8499\u53e4":{getGeoJson:function(b){f(["./geoJson/nei_meng_gu_geo"],function(a){b(c(a))})}},"\u9752\u6d77":{getGeoJson:function(b){f(["./geoJson/qing_hai_geo"],function(a){b(c(a))})}},"\u56db\u5ddd":{getGeoJson:function(b){f(["./geoJson/si_chuan_geo"],function(a){b(c(a))})}},"\u9ed1\u9f99\u6c5f":{getGeoJson:function(b){f(["./geoJson/hei_long_jiang_geo"],function(a){b(c(a))})}},"\u7518\u8083":{getGeoJson:function(b){f(["./geoJson/gan_su_geo"],function(a){b(c(a))})}},"\u4e91\u5357":{getGeoJson:function(b){f(["./geoJson/yun_nan_geo"],function(a){b(c(a))})}},"\u5e7f\u897f":{getGeoJson:function(b){f(["./geoJson/guang_xi_geo"],function(a){b(c(a))})}},"\u6e56\u5357":{getGeoJson:function(b){f(["./geoJson/hu_nan_geo"],function(a){b(c(a))})}},"\u9655\u897f":{getGeoJson:function(b){f(["./geoJson/shan_xi_1_geo"],function(a){b(c(a))})}},"\u5e7f\u4e1c":{getGeoJson:function(b){f(["./geoJson/guang_dong_geo"],function(a){b(c(a))})}},"\u5409\u6797":{getGeoJson:function(b){f(["./geoJson/ji_lin_geo"],function(a){b(c(a))})}},"\u6cb3\u5317":{getGeoJson:function(b){f(["./geoJson/he_bei_geo"],function(a){b(c(a))})}},"\u6e56\u5317":{getGeoJson:function(b){f(["./geoJson/hu_bei_geo"],function(a){b(c(a))})}},"\u8d35\u5dde":{getGeoJson:function(b){f(["./geoJson/gui_zhou_geo"],function(a){b(c(a))})}},"\u5c71\u4e1c":{getGeoJson:function(b){f(["./geoJson/shan_dong_geo"],function(a){b(c(a))})}},"\u6c5f\u897f":{getGeoJson:function(b){f(["./geoJson/jiang_xi_geo"],function(a){b(c(a))})}},"\u6cb3\u5357":{getGeoJson:function(b){f(["./geoJson/he_nan_geo"],function(a){b(c(a))})}},"\u8fbd\u5b81":{getGeoJson:function(b){f(["./geoJson/liao_ning_geo"],function(a){b(c(a))})}},"\u5c71\u897f":{getGeoJson:function(b){f(["./geoJson/shan_xi_2_geo"],function(a){b(c(a))})}},"\u5b89\u5fbd":{getGeoJson:function(b){f(["./geoJson/an_hui_geo"],function(a){b(c(a))})}},"\u798f\u5efa":{getGeoJson:function(b){f(["./geoJson/fu_jian_geo"],function(a){b(c(a))})}},"\u6d59\u6c5f":{getGeoJson:function(b){f(["./geoJson/zhe_jiang_geo"],function(a){b(c(a))})}},"\u6c5f\u82cf":{getGeoJson:function(b){f(["./geoJson/jiang_su_geo"],function(a){b(c(a))})}},"\u91cd\u5e86":{getGeoJson:function(b){f(["./geoJson/chong_qing_geo"],function(a){b(c(a))})}},"\u5b81\u590f":{getGeoJson:function(b){f(["./geoJson/ning_xia_geo"],function(a){b(c(a))})}},"\u6d77\u5357":{getGeoJson:function(b){f(["./geoJson/hai_nan_geo"],function(a){b(c(a))})}},"\u53f0\u6e7e":{getGeoJson:function(b){f(["./geoJson/tai_wan_geo"],function(a){b(c(a))})}},"\u5317\u4eac":{getGeoJson:function(b){f(["./geoJson/bei_jing_geo"],function(a){b(c(a))})}},"\u5929\u6d25":{getGeoJson:function(b){f(["./geoJson/tian_jin_geo"],function(a){b(c(a))})}},"\u4e0a\u6d77":{getGeoJson:function(b){f(["./geoJson/shang_hai_geo"],function(a){b(c(a))})}},"\u9999\u6e2f":{getGeoJson:function(b){f(["./geoJson/xiang_gang_geo"],function(a){b(c(a))})}},"\u6fb3\u95e8":{getGeoJson:function(b){f(["./geoJson/ao_men_geo"],function(a){b(c(a))})}}}}});define("echarts/util/mapData/textFixed",[],function(){return{"\u5e7f\u4e1c":[0,-10],"\u9999\u6e2f":[10,10],"\u6fb3\u95e8":[-10,18],"\u9ed1\u9f99\u6c5f":[0,20],"\u5929\u6d25":[5,5],"\u6df1\u5733\u5e02":[-35,0],"\u7ea2\u6cb3\u54c8\u5c3c\u65cf\u5f5d\u65cf\u81ea\u6cbb\u5dde":[0,20],"\u695a\u96c4\u5f5d\u65cf\u81ea\u6cbb\u5dde":[-5,15],"\u77f3\u6cb3\u5b50\u5e02":[-5,5],"\u4e94\u5bb6\u6e20\u5e02":[0,-10],"\u660c\u5409\u56de\u65cf\u81ea\u6cbb\u5dde":[10,10],"\u660c\u6c5f\u9ece\u65cf\u81ea\u6cbb\u53bf":[0,20],"\u9675\u6c34\u9ece\u65cf\u81ea\u6cbb\u53bf":[0,20],"\u4e1c\u65b9\u5e02":[0,20],"\u6e2d\u5357\u5e02":[0,20]}});define("echarts/util/mapData/geoCoord",[],function(){return{Russia:[100,60],"United States of America":[-99,38]}});define("echarts/util/projection/svg",["require","zrender/shape/Path"],function(f){function c(a){return parseFloat(a||0)}var n=f("zrender/shape/Path"),b={path:function(a,b){var c=a.getAttribute("d"),f=n.prototype.getRect({path:c});return{shapeType:"path",path:c,cp:[(f.x+f.width/2)*b[0],(f.y+f.height/2)*b[1]]}},rect:function(a,b){var k=c(a.getAttribute("x")),f=c(a.getAttribute("y")),l=c(a.getAttribute("width")),g=c(a.getAttribute("height"));return{shapeType:"rectangle",x:k,y:f,width:l,height:g,cp:[(k+l/2)*b[0],(f+g/2)*b[1]]}},line:function(a,b){var f=c(a.getAttribute("x1")),n=c(a.getAttribute("y1")),l=c(a.getAttribute("x2")),g=c(a.getAttribute("y2"));return{shapeType:"line",xStart:f,yStart:n,xEnd:l,yEnd:g,cp:[.5*(f+l)*b[0],.5*(n+g)*b[1]]}},circle:function(a,b){var f=c(a.getAttribute("cx")),n=c(a.getAttribute("cy")),l=c(a.getAttribute("r"));return{shapeType:"circle",x:f,y:n,r:l,cp:[f*b[0],n*b[1]]}},ellipse:function(a,b){var c=parseFloat(a.getAttribute("cx")||0),f=parseFloat(a.getAttribute("cy")||0),l=parseFloat(a.getAttribute("rx")||0),g=parseFloat(a.getAttribute("ry")||0);return{shapeType:"ellipse",x:c,y:f,a:l,b:g,cp:[c*b[0],f*b[1]]}},polygon:function(a,b){var c=a.getAttribute("points"),f=[1/0,1/0],l=[-1/0,-1/0];if(c){for(var c=c.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace(/,/g," ").split(/\s+/),g=[],m=0;mc;c++)f(a[c])}var n=[c.scale.x,c.scale.y],l=[];return f(a),l},pos2geo:function(a,b){var c=b instanceof Array?[1*b[0],1*b[1]]:[1*b.x,1*b.y];return[c[0]/a.scale.x,c[1]/a.scale.y]},geo2pos:function(a,b){var c=b instanceof Array?[1*b[0],1*b[1]]:[1*b.x,1*b.y];return[c[0]*a.scale.x,c[1]*a.scale.y]}}});define("echarts/util/projection/normal",[],function(){function f(b,a){a=a||{};n.xmin=360;n.xmax=-360;n.ymin=180;n.ymax=-180;for(var c,f,v=b.features,l=0,g=v.length;g>l;l++)if(f=v[l],!f.properties.name||!a[f.properties.name])switch(f.type){case "Feature":n[f.geometry.type](f.geometry.coordinates);break;case "GeometryCollection":c=f.geometries;for(var m=0,e=c.length;e>m;m++)n[c[m].type](c[m].coordinates)}return b.srcSize={left:1*n.xmin.toFixed(4),top:1*n.ymin.toFixed(4),width:1*(n.xmax-n.xmin).toFixed(4),height:1*(n.ymax-n.ymin).toFixed(4)},b}var c={formatPoint:function(b){return[(-168.5>b[0]&&63.8b[0]&&(this._bbox.xmin=b[0]);this._bbox.xmaxb[1]&&(this._bbox.ymin=b[1]);this._bbox.ymaxk;k++)a=c.makePoint(b[k]),f=0===k?"M"+a.join(","):f+"L"+a.join(",");return f},Polygon:function(b){for(var a="",f=0,k=b.length;k>f;f++)a=a+c.LineString(b[f])+"z";return a},MultiPoint:function(b){for(var a=[],f=0,k=b.length;k>f;f++)a.push(c.Point(b[f]));return a},MultiLineString:function(b){for(var a="",f=0,k=b.length;k>f;f++)a+=c.LineString(b[f]);return a},MultiPolygon:function(b){for(var a="",f=0,k=b.length;k>f;f++)a+=c.Polygon(b[f]);return a}},n={formatPoint:c.formatPoint,makePoint:function(b){var a=this.formatPoint(b);b=a[0];a=a[1];this.xmin>b&&(this.xmin=b);this.xmaxa&&(this.ymin=a);this.ymaxa;a++)this.makePoint(b[a])},Polygon:function(b){for(var a=0,c=b.length;c>a;a++)this.LineString(b[a])},MultiPoint:function(b){for(var a=0,c=b.length;c>a;a++)this.Point(b[a])},MultiLineString:function(b){for(var a=0,c=b.length;c>a;a++)this.LineString(b[a])},MultiPolygon:function(b){for(var a=0,c=b.length;c>a;a++)this.Polygon(b[a])}};return{getBbox:function(b,a){return a=a||{},b.srcSize||f(b,a),b.srcSize},geoJson2Path:function(b,a,n){function k(a,b){u=a.type;B=a.coordinates;c._bbox={xmin:360,xmax:-360,ymin:180,ymax:-180};q=c[u](B);g.push({path:q,cp:c.makePoint(b.properties.cp?b.properties.cp:[(c._bbox.xmin+c._bbox.xmax)/2,(c._bbox.ymin+c._bbox.ymax)/2]),properties:b.properties,id:b.id})}n=n||{};c.scale=null;c.offset=null;b.srcSize||f(b,n);a.offset={x:b.srcSize.left,y:b.srcSize.top,left:a.OffsetLeft||0,top:a.OffsetTop||0};c.scale=a.scale;c.offset=a.offset;for(var v,l=b.features,g=[],m=0,e=l.length;e>m;m++)if(v=l[m],!v.properties.name||!n[v.properties.name])if("Feature"==v.type)k(v.geometry,v);else if("GeometryCollection"==v.type){b=v.geometries;for(var h=0,d=b.length;d>h;h++)a=b[h],k(a,a)}var u,B,q;return g},pos2geo:function(b,a){var c,f;return a instanceof Array?(c=1*a[0],f=1*a[1]):(c=1*a.x,f=1*a.y),c=c/b.scale.x+b.offset.x-168.5,c=180=c.x&&a<=c.x+c.width&&b>=c.y&&b<=c.y+c.height?!0:!1}},f.inherits(c,n),c});