text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("echarts/lib/echarts"),require("echarts/lib/component/tooltip"),require("echarts/lib/component/legend"),require("echarts/lib/chart/map")):"function"==typeof define&&define.amd?define(["echarts/lib/echarts","echarts/lib/component/tooltip","echarts/lib/component/legend","echarts/lib/chart/map"],t):e.VeMap=t(e.echarts)}(this,function(e){"use strict";(e="default"in e?e.default:e).registerTheme("ve-chart",{categoryAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1}},valueAxis:{axisLine:{show:!1}},line:{smooth:!0},grid:{containLabel:!0,left:10,right:10}});var t=function(e){return['<span style="',"background-color:"+e+";","display: inline-block;","width: 10px;","height: 10px;","border-radius: 50%;","margin-right:2px;",'"></span>'].join("")},i=["#19d4ae","#5ab1ef","#fa6e86","#ffb980","#0067a6","#c4b4e4","#d87a80","#9cbbff","#d9d0c7","#87a997","#d49ea2","#5b4947","#7ba3a8"],n=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-";if(null==e||isNaN(e))return n;switch(t){case"KMB":return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(isNaN(+e))return e;for(var i=[{value:1e18,symbol:"E"},{value:1e15,symbol:"P"},{value:1e12,symbol:"T"},{value:1e9,symbol:"B"},{value:1e6,symbol:"M"},{value:1e3,symbol:"k"}],n=0;n<i.length;n++)if(Math.abs(e)>=i[n].value)return(e/i[n].value).toFixed(t)+i[n].symbol;return e.toString()}(e);case"percent":return parseFloat((100*e).toFixed(i))+"%";case"normal":return String(e).replace(/^(\s+|-)?\d+(?=.?\d*($|\s))/g,function(e){return e.replace(/(?=(?!\b)(\d{3})+$)/g,",")});default:return e}},r=function(e,t){var i;return i=t||"https://unpkg.com/echarts@3.6.2/map/json/"+e+".json",new Promise(function(e,t){var n=new XMLHttpRequest;n.open("GET",i),n.send(null),n.onload=function(){e(JSON.parse(n.responseText))},n.onerror=function(){t(JSON.parse(n.responseText))}})},a=function(e){return Object.prototype.toString.call(e)},o=function(e){return"[object Object]"===a(e)},s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e};function l(e,t,i){"object"===(void 0===e?"undefined":s(e))?t[i]=e:e&&(t[i]={normal:{show:!0},emphasis:{show:!0}})}var h=function(i,a,o,s){var h=o.position,d=void 0===h?"china":h,u=o.selectData,p=void 0!==u&&u,f=o.selectedMode,m=o.label,b=void 0===m||m,y=o.dataType,g=void 0===y?{}:y,v=o.digit,O=void 0===v?2:v,j=o.dimension,x=void 0===j?i[0]:j,S=o.roam,k=o.center,w=o.aspectScale,A=o.boundingCoords,E=o.zoom,C=o.scaleLimit,M=o.legendName,L=void 0===M?{}:M,P=o.labelMap,T=void 0===P?{}:P,$=o.mapGrid,H=o.itemStyle,z=o.positionJsonLink,F=o.beforeRegisterMap,N=i.slice();o.metrics?N=o.metrics:N.splice(i.indexOf(x),1);var V=s.tooltipVisible,_=s.legendVisible,W=s.color,B={};a.forEach(function(e){B[e[x]]=e});var D,q,G,R,J,Z,K,X,I,Q,U,Y,ee,te,ie,ne,re,ae,oe,se,ce,le,he,de,ue,pe,fe,me,be,ye=V&&(D=g,q=O,G=B,R=N,J=W,Z=T,{formatter:function(e){var i=[];return i.push(e.name+"<br>"),R.forEach(function(r,a){var o=null!=Z[r]?Z[r]:r;i.push(t(J[a])+" "+o+" : "),G[e.name]?i.push(n(G[e.name][r],D[r],q)):i.push("-"),i.push("<br>")}),i.join(" ")}}),ge=_&&(X=(K={metrics:N,legendName:L,labelMap:T}).metrics,I=K.legendName,Q=K.labelMap,I||Q?{data:Q?X.map(function(e){return null==Q[e]?e:Q[e]}):X,formatter:function(e){return null!=I[e]?I[e]:e}}:{data:X}),ve=(Y=(U={position:d,selectData:p,label:b,itemStyle:H,dimension:x,metrics:N,rows:a,selectedMode:f,roam:S,center:k,aspectScale:w,boundingCoords:A,zoom:E,labelMap:T,scaleLimit:C,mapGrid:$}).position,ee=U.selectData,te=U.dimension,ie=U.metrics,ne=U.rows,re=U.label,ae=U.itemStyle,oe=U.selectedMode,se=U.roam,ce=U.center,le=U.aspectScale,he=U.boundingCoords,de=U.zoom,ue=U.labelMap,pe=U.scaleLimit,fe=U.mapGrid,me=[],be={type:"map",mapType:Y},ie.forEach(function(e){var t=c({name:null!=ue[e]?ue[e]:e,data:[],selectedMode:oe,roam:se,center:ce,aspectScale:le,boundingCoords:he,zoom:de,scaleLimit:pe},be);fe&&Object.keys(fe).forEach(function(e){t[e]=fe[e]}),l(ae,t,"itemStyle"),l(re,t,"label"),ne.forEach(function(i){t.data.push({name:i[te],value:i[e],selected:ee})}),me.push(t)}),me);return r(d,z).then(function(t){return F&&(t=F(t)),e.registerMap(d,t),{series:ve,tooltip:ye,legend:ge}})},d={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v-charts-component-loading"},[t("div",{staticClass:"loader"},[t("div",{staticClass:"loading-spinner"},[t("svg",{staticClass:"circular",attrs:{viewBox:"25 25 50 50"}},[t("circle",{staticClass:"path",attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})])])])])},staticRenderFns:[]},u={render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"v-charts-data-empty"},[this._v(" 暂无数据 ")])},staticRenderFns:[]};return{name:"VeMap",mixins:[{render:function(e){return e("div",{class:[(t=this.$options.name||this.$options._componentTag,t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())],style:this.canvasStyle},[e("div",{style:this.canvasStyle,ref:"canvas"}),e(d,{style:{display:this.loading?"":"none"}}),e(u,{style:{display:this.dataEmpty?"":"none"}}),this.$slots.default]);var t},props:{data:{type:[Object,Array],default:function(){return{}}},settings:{type:Object,default:function(){return{}}},width:{type:String,default:"auto"},height:{type:String,default:"400px"},beforeConfig:{type:Function},afterConfig:{type:Function},afterSetOption:{type:Function},afterSetOptionOnce:{type:Function},events:{type:Object},grid:{type:[Object,Array]},colors:{type:Array},tooltipVisible:{type:Boolean,default:!0},legendVisible:{type:Boolean,default:!0},legendPosition:{type:String},markLine:{type:Object},markArea:{type:Object},markPoint:{type:Object},visualMap:{type:[Object,Array]},dataZoom:{type:[Object,Array]},toolbox:{type:[Object,Array]},initOptions:{type:Object,default:function(){return{}}},title:Object,legend:[Object,Array],xAxis:[Object,Array],yAxis:[Object,Array],radar:Object,tooltip:Object,axisPointer:Object,brush:[Object,Array],geo:Object,timeline:[Object,Array],graphic:[Object,Array],series:[Object,Array],backgroundColor:[Object,String],textStyle:Object,animation:Object,theme:Object,themeName:String,loading:Boolean,dataEmpty:Boolean,extend:Object,judgeWidth:{type:Boolean,default:!0},widthChangeDelay:{type:Number,default:300},tooltipFormatter:{type:Function}},watch:{data:{deep:!0,handler:function(e){e&&this.dataHandler(e)}},settings:{deep:!0,handler:function(e){e.type&&this.chartLib&&(this.chartHandler=this.chartLib[e.type]),this.dataHandler(this.data)}},events:{deep:!0,handler:function(){this.createEventProxy()}}},computed:{canvasStyle:function(){return{width:this.width,height:this.height,position:"relative"}},chartColor:function(){return this.colors||this.theme&&this.theme.color||i}},methods:{dataHandler:function(e){if(this.chartHandler){var t=e,i=t.columns,n=void 0===i?[]:i,r=t.rows,a=void 0===r?[]:r,o={tooltipVisible:this.tooltipVisible,legendVisible:this.legendVisible,echarts:this.echarts,color:this.chartColor,tooltipFormatter:this.tooltipFormatter};this.beforeConfig&&(e=this.beforeConfig(e));var s=this.chartHandler(n,a,this.settings,o);s&&("function"==typeof s.then?s.then(this.optionsHandler):this.optionsHandler(s))}},resize:function(){this.echarts.resize()},optionsHandler:function(e){var t=this;this.legendPosition&&e.legend&&(e.legend[this.legendPosition]=10,~["left","right"].indexOf(this.legendPosition)&&(e.legend.top="middle",e.legend.orient="vertical")),this.themeName||(e.color=this.chartColor);if(["grid","dataZoom","visualMap","toolbox","title","legend","xAxis","yAxis","radar","tooltip","axisPointer","brush","geo","timeline","graphic","series","backgroundColor","textStyle"].forEach(function(i){t[i]&&(e[i]=t[i])}),this.animation&&Object.keys(this.animation).forEach(function(i){e[i]=t.animation[i]}),this.markArea||this.markLine||this.markPoint){var i={markArea:this.markArea,markLine:this.markLine,markPoint:this.markPoint},n=e.series;"[object Array]"===a(n)?n.forEach(function(e){t.addMark(e,i)}):"[object Object]"===a(n)&&this.addMark(n,i)}this.extend&&Object.keys(this.extend).forEach(function(i){var n;"function"==typeof t.extend[i]?e[i]=t.extend[i](e[i]):(n=e[i],"[object Array]"===a(n)&&o(e[i][0])?e[i].forEach(function(n,r){e[i][r]=c({},n,t.extend[i])}):o(e[i])?e[i]=c({},e[i],t.extend[i]):e[i]=t.extend[i])}),this.afterConfig&&(e=this.afterConfig(e)),this.echarts.setOption(e,!0),this.judgeWidth&&this.judgeWidthHandler(e),this.afterSetOption&&this.afterSetOption(this.echarts),this.afterSetOptionOnce&&!this._once.afterSetOptionOnce&&(this._once.afterSetOptionOnce=this.afterSetOptionOnce(this.echarts))},judgeWidthHandler:function(e){var t=this;this.$el.clientWidth?this.echarts.resize():this.$nextTick(function(e){t.$el.clientWidth?t.echarts.resize():setTimeout(function(e){t.echarts.resize(),t.$el.clientWidth||console.warn(" Can't get dom width or height ")},t.widthChangeDelay)})},addMark:function(e,t){Object.keys(t).forEach(function(i){t[i]&&(e[i]=t[i])})},init:function(){if(!this.echarts){var e=this.themeName||(this.theme?"outer-theme":"ve-chart");this.echarts=this.echartsLib.init(this.$refs.canvas,e,this.initOptions),this.data&&this.dataHandler(this.data),this.createEventProxy()}},addWatchToProps:function(){var e=this,t=this._watchers.map(function(e){return e.expression});Object.keys(this.$props).forEach(function(i){if(!~t.indexOf(i)){var n={};"[object Object]"===a(i)&&(n.deep=!0),e.$watch(i,function(){e.dataHandler(e.data)},n)}})},registerTheme:function(){e.registerTheme("outer-theme",this.theme)},createEventProxy:function(){var e=this,t=this,i=Object.keys(this.events||{});i.length&&i.forEach(function(i){var n;-1===e.registeredEvents.indexOf(i)&&(e.registeredEvents.push(i),e.echarts.on(i,(n=i,function(){if(n in t.events){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];t.events[n].apply(null,i)}})))})}},created:function(){this.echarts=null,this.registeredEvents=[],this._once={},this.addWatchToProps(),this.theme&&this.registerTheme()},mounted:function(){this.init(),window.addEventListener("resize",this.echarts.resize)},beforeDestroy:function(){window.removeEventListener("resize",this.echarts.resize),this.echarts.dispose()}}],created:function(){this.chartHandler=h,this.echartsLib=e}}});
  