text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("echarts/lib/echarts"),require("echarts/lib/component/tooltip"),require("echarts/lib/component/legend"),require("echarts/lib/chart/tree")):"function"==typeof define&&define.amd?define(["echarts/lib/echarts","echarts/lib/component/tooltip","echarts/lib/component/legend","echarts/lib/chart/tree"],e):t.VeTree=e(t.echarts)}(this,function(t){"use strict";(t=t&&t.hasOwnProperty("default")?t.default:t).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 e=["#19d4ae","#5ab1ef","#fa6e86","#ffb980","#0067a6","#c4b4e4","#d87a80","#9cbbff","#d9d0c7","#87a997","#d49ea2","#5b4947","#7ba3a8"];function i(t,e){var i=null;return function(){var n=this,r=arguments;clearTimeout(i),i=setTimeout(function(){t.apply(n,r)},e)}}function n(t){return Object.prototype.toString.call(t)}function r(t){return"[object Object]"===n(t)}var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t};var s=function(t,e,i,n){var s=i.dimension,o=void 0===s?t[0]:s,c=i.metrics,h=void 0===c?t[1]:c,l=i.seriesMap,d=void 0===l?{}:l,f=n.legendVisible,u=n.tooltipFormatter,p=n.tooltipVisible;return{series:function(t){var e=t.dimension,i=t.metrics,n=t.rows,s=t.seriesMap,o=[];return n.forEach(function(t){var n=t[e],c=s[n],h={type:"tree",name:t[e],data:t[i]};s[t[e]]&&Object.keys(c).forEach(function(t){r(h[t])?a(h[t],c[t]):h[t]=c[t]}),o.push(h)}),o}({dimension:o,metrics:h,rows:e,seriesMap:d}),legend:f&&e.length>1&&function(t){var e=t.dimension;return{data:t.rows.map(function(t){return t[e]})}}({dimension:o,rows:e}),tooltip:p&&{trigger:"item",triggerOn:"mousemove",formatter:{tooltipFormatter:u}.tooltipFormatter}}},o={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"v-charts-component-loading"},[e("div",{staticClass:"loader"},[e("div",{staticClass:"loading-spinner"},[e("svg",{staticClass:"circular",attrs:{viewBox:"25 25 50 50"}},[e("circle",{staticClass:"path",attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})])])])])},staticRenderFns:[]},c={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"v-charts-data-empty"},[this._v(" 暂无数据 ")])},staticRenderFns:[]},h=["initOptions","loading","dataEmpty","judgeWidth","widthChangeDelay"];return{name:"VeTree",mixins:[{render:function(t){return t("div",{class:[(e=this.$options.name||this.$options._componentTag,e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())],style:this.canvasStyle},[t("div",{style:this.canvasStyle,ref:"canvas"}),t(o,{style:{display:this.loading?"":"none"}}),t(c,{style:{display:this.dataEmpty?"":"none"}}),this.$slots.default]);var e},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:!1},widthChangeDelay:{type:Number,default:300},tooltipFormatter:{type:Function},resizeable:{type:Boolean,default:!0},resizeDelay:{type:Number,default:200},changeDelay:{type:Number,default:0},setOptionOpts:{type:[Boolean,Object],default:!0}},watch:{data:{deep:!0,handler:function(t){t&&this.changeHandler()}},settings:{deep:!0,handler:function(t){t.type&&this.chartLib&&(this.chartHandler=this.chartLib[t.type]),this.changeHandler()}},events:{deep:!0,handler:function(){this.createEventProxy()}},theme:{deep:!0,handler:function(t){this.themeChange(t)}},themeName:function(t){this.themeChange(t)}},computed:{canvasStyle:function(){return{width:this.width,height:this.height,position:"relative"}},chartColor:function(){return this.colors||this.theme&&this.theme.color||e}},methods:{dataHandler:function(){if(this.chartHandler){var t=this.data,e=t,i=e.columns,n=void 0===i?[]:i,r=e.rows,a=void 0===r?[]:r,s={tooltipVisible:this.tooltipVisible,legendVisible:this.legendVisible,echarts:this.echarts,color:this.chartColor,tooltipFormatter:this.tooltipFormatter,_once:this._once};this.beforeConfig&&(t=this.beforeConfig(t));var o=this.chartHandler(n,a,this.settings,s);o&&("function"==typeof o.then?o.then(this.optionsHandler):this.optionsHandler(o))}},resize:function(){this.echarts.resize()},optionsHandler:function(t){var e=this;this.legendPosition&&t.legend&&(t.legend[this.legendPosition]=10,~["left","right"].indexOf(this.legendPosition)&&(t.legend.top="middle",t.legend.orient="vertical")),this.themeName||(t.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){e[i]&&(t[i]=e[i])}),this.animation&&Object.keys(this.animation).forEach(function(i){t[i]=e.animation[i]}),this.markArea||this.markLine||this.markPoint){var i={markArea:this.markArea,markLine:this.markLine,markPoint:this.markPoint},s=t.series;"[object Array]"===n(s)?s.forEach(function(t){e.addMark(t,i)}):"[object Object]"===n(s)&&this.addMark(s,i)}this.extend&&Object.keys(this.extend).forEach(function(i){"function"==typeof e.extend[i]?t[i]=e.extend[i](t[i]):"[object Array]"===n(t[i])&&r(t[i][0])?t[i].forEach(function(n,r){t[i][r]=a({},n,e.extend[i])}):r(t[i])?t[i]=a({},t[i],e.extend[i]):t[i]=e.extend[i]}),this.afterConfig&&(t=this.afterConfig(t)),this.echarts.setOption(t,this.setOptionOpts),this.$emit("ready",this.echarts),this._once["ready-once"]||(this._once["ready-once"]=!0,this.$emit("ready-once",this.echarts)),this.judgeWidth&&this.judgeWidthHandler(t),this.afterSetOption&&this.afterSetOption(this.echarts),this.afterSetOptionOnce&&!this._once.afterSetOptionOnce&&(this._once.afterSetOptionOnce=!0,this.afterSetOptionOnce(this.echarts))},judgeWidthHandler:function(t){var e=this,i=this.echarts,n=this.widthChangeDelay;this.$el.clientWidth?i&&i.resize():this.$nextTick(function(t){e.$el.clientWidth?i&&i.resize():setTimeout(function(t){i&&i.resize(),e.$el.clientWidth||console.warn(" Can't get dom width or height ")},n)})},addMark:function(t,e){Object.keys(e).forEach(function(i){e[i]&&(t[i]=e[i])})},init:function(){if(!this.echarts){var t=this.themeName||this.theme||"ve-chart";this.echarts=this.echartsLib.init(this.$refs.canvas,t,this.initOptions),this.data&&this.changeHandler(),this.createEventProxy(),this.resizeable&&window.addEventListener("resize",this.resizeHandler)}},addWatchToProps:function(){var t=this,e=this._watchers.map(function(t){return t.expression});Object.keys(this.$props).forEach(function(i){if(!~e.indexOf(i)&&!~h.indexOf(i)){var r={};~["[object Object]","[object Array]"].indexOf(n(t.$props[i]))&&(r.deep=!0),t.$watch(i,function(){t.changeHandler()},r)}})},createEventProxy:function(){var t=this,e=this,i=Object.keys(this.events||{});i.length&&i.forEach(function(i){-1===t.registeredEvents.indexOf(i)&&(t.registeredEvents.push(i),t.echarts.on(i,function(t){return function(){if(t in e.events){for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];e.events[t].apply(null,n)}}}(i)))})},themeChange:function(t){this.clean(),this.echarts=null,this.init()},clean:function(){this.resizeable&&window.removeEventListener("resize",this.resizeHandler),this.echarts.dispose()}},created:function(){var t=this;this.echarts=null,this.registeredEvents=[],this._once={},this.resizeHandler=i(function(e){t.echarts&&t.echarts.resize()},this.resizeDelay),this.changeHandler=i(function(e){t.dataHandler()},this.changeDelay),this.addWatchToProps()},mounted:function(){this.init()},beforeDestroy:function(){this.clean()}}],created:function(){this.chartHandler=s,this.echartsLib=t}}});
  