vue3-echarts-v3
Version:
Vue.js component wrap for ECharts.js(v3.x+)
3 lines (2 loc) • 24.2 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("echarts")):"function"==typeof define&&define.amd?define(["vue","echarts"],t):e.VueECharts=t(e.Vue,e.echarts)}(this,function(e,t){"use strict";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e,t){return e(t={exports:{}},t.exports),t.exports}var o="Expected a function",r=NaN,a="[object Symbol]",s=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,d=/^0o[0-7]+$/i,u=parseInt,f="object"==typeof n&&n&&n.Object===Object&&n,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),g=Object.prototype.toString,m=Math.max,v=Math.min,b=function(){return p.Date.now()};function y(e,t,n){var i,r,a,s,c,l,d=0,u=!1,f=!1,h=!0;if("function"!=typeof e)throw new TypeError(o);function p(t){var n=i,o=r;return i=r=void 0,d=t,s=e.apply(o,n)}function g(e){var n=e-l;return void 0===l||n>=t||n<0||f&&e-d>=a}function y(){var e=b();if(g(e))return z(e);c=setTimeout(y,function(e){var n=t-(e-l);return f?v(n,a-(e-d)):n}(e))}function z(e){return c=void 0,h&&i?p(e):(i=r=void 0,s)}function E(){var e=b(),n=g(e);if(i=arguments,r=this,l=e,n){if(void 0===c)return function(e){return d=e,c=setTimeout(y,t),u?p(e):s}(l);if(f)return c=setTimeout(y,t),p(l)}return void 0===c&&(c=setTimeout(y,t)),s}return t=x(t)||0,w(n)&&(u=!!n.leading,a=(f="maxWait"in n)?m(x(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),E.cancel=function(){void 0!==c&&clearTimeout(c),d=0,i=l=r=c=void 0},E.flush=function(){return void 0===c?s:z(b())},E}function w(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function x(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&g.call(e)==a}(e))return r;if(w(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=w(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var n=l.test(e);return n||d.test(e)?u(e.slice(2),n?2:8):c.test(e)?r:+e}var z=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(o);return w(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),y(e,t,{leading:i,maxWait:t,trailing:r})},E=i(function(e){(e.exports={}).forEach=function(e,t){for(var n=0;n<e.length;n++){var i=t(e[n]);if(i)return i}}}),S=i(function(e){var t=e.exports={};t.isIE=function(e){return(-1!==(t=navigator.userAgent.toLowerCase()).indexOf("msie")||-1!==t.indexOf("trident")||-1!==t.indexOf(" edge/"))&&(!e||e===function(){var e=3,t=document.createElement("div"),n=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(n[0]);return e>4?e:void 0}());var t},t.isLegacyOpera=function(){return!!window.opera}}),O=i(function(e){(e.exports={}).getOption=function(e,t,n){var i=e[t];if(null==i&&void 0!==n)return n;return i}}),T=function(e){var t=(e=e||{}).reporter,n=O.getOption(e,"async",!0),i=O.getOption(e,"auto",!0);i&&!n&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o,r=k(),a=!1;function s(){for(a=!0;r.size();){var e=r;r=k(),e.process()}a=!1}function c(){var e;e=s,o=setTimeout(e,0)}return{add:function(e,t){!a&&i&&n&&0===r.size()&&c(),r.add(e,t)},force:function(e){a||(void 0===e&&(e=n),o&&(clearTimeout(o),o=null),e?c():s())}}};function k(){var e={},t=0,n=0,i=0;return{add:function(o,r){r||(r=o,o=0),o>n?n=o:o<i&&(i=o),e[o]||(e[o]=[]),e[o].push(r),t++},process:function(){for(var t=i;t<=n;t++)for(var o=e[t],r=0;r<o.length;r++)(0,o[r])()},size:function(){return t}}}var D="_erd";function L(e){return e[D]}var A={initState:function(e){return e[D]={},L(e)},getState:L,cleanState:function(e){delete e[D]}},j=E.forEach,C=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,i=e.stateHandler.getState,o=(e.stateHandler.hasState,e.idHandler);if(!n)throw new Error("Missing required dependency: batchProcessor");if(!t)throw new Error("Missing required dependency: reporter.");var r=function(){var e=document.createElement("div");e.style.cssText=l(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var t=document.createElement("div");t.style.cssText=l(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),t.appendChild(e),document.body.insertBefore(t,document.body.firstChild);var n=500-t.clientWidth,i=500-t.clientHeight;return document.body.removeChild(t),{width:n,height:i}}(),a="erd_scroll_detection_scrollbar_style",s="erd_scroll_detection_container";function c(e){!function(e,t,n){if(!e.getElementById(t)){var i=n+"_animation",o=n+"_animation_active",r="/* Created by the element-resize-detector library. */\n";r+="."+n+" > div::-webkit-scrollbar { "+l(["display: none"])+" }\n\n",r+="."+o+" { "+l(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+i,"animation-name: "+i])+" }\n",r+="@-webkit-keyframes "+i+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(n,i){i=i||function(t){e.head.appendChild(t)};var o=e.createElement("style");o.innerHTML=n,o.id=t,i(o)}(r+="@keyframes "+i+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}(e,a,s)}function l(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function d(e,n,i){if(e.addEventListener)e.addEventListener(n,i);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+n,i)}}function u(e,n,i){if(e.removeEventListener)e.removeEventListener(n,i);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+n,i)}}function f(e){return i(e).container.childNodes[0].childNodes[0].childNodes[0]}function h(e){return i(e).container.childNodes[0].childNodes[0].childNodes[1]}return c(window.document),{makeDetectable:function(e,a,c){function u(){if(e.debug){var n=Array.prototype.slice.call(arguments);if(n.unshift(o.get(a),"Scroll: "),t.log.apply)t.log.apply(null,n);else for(var i=0;i<n.length;i++)t.log(n[i])}}function p(e){var t=i(e).container.childNodes[0],n=window.getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function g(){var e=window.getComputedStyle(a),t={};return t.position=e.position,t.width=a.offsetWidth,t.height=a.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function m(){if(u("storeStyle invoked."),i(a)){var e=g();i(a).style=e}else u("Aborting because element has been uninstalled")}function v(e,t,n){i(e).lastWidth=t,i(e).lastHeight=n}function b(){return 2*r.width+1}function y(){return 2*r.height+1}function w(e){return e+10+b()}function x(e){return e+10+y()}function z(e,t,n){var i=f(e),o=h(e),r=w(t),a=x(n),s=function(e){return 2*e+b()}(t),c=function(e){return 2*e+y()}(n);i.scrollLeft=r,i.scrollTop=a,o.scrollLeft=s,o.scrollTop=c}function E(){var e=i(a).container;if(!e){(e=document.createElement("div")).className=s,e.style.cssText=l(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),i(a).container=e,function(e){e.className+=" "+s+"_animation_active"}(e),a.appendChild(e);var t=function(){i(a).onRendered&&i(a).onRendered()};d(e,"animationstart",t),i(a).onAnimationStart=t}return e}function S(){if(u("Injecting elements"),i(a)){!function(){var n=i(a).style;if("static"===n.position){a.style.setProperty("position","relative",e.important?"important":"");var o=function(e,t,n,i){var o=n[i];"auto"!==o&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(o)&&(e.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",t),t.style[i]=0)};o(t,a,n,"top"),o(t,a,n,"right"),o(t,a,n,"bottom"),o(t,a,n,"left")}}();var n=i(a).container;n||(n=E());var o,c,f,h,p=r.width,g=r.height,m=l(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),v=l(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(o=(o=-(1+p))?o+"px":"0"),"top: "+(c=(c=-(1+g))?c+"px":"0"),"right: "+(h=(h=-p)?h+"px":"0"),"bottom: "+(f=(f=-g)?f+"px":"0")])),b=l(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),y=l(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),w=l(["position: absolute","left: 0","top: 0"]),x=l(["position: absolute","width: 200%","height: 200%"]),z=document.createElement("div"),S=document.createElement("div"),O=document.createElement("div"),T=document.createElement("div"),k=document.createElement("div"),D=document.createElement("div");z.dir="ltr",z.style.cssText=m,z.className=s,S.className=s,S.style.cssText=v,O.style.cssText=b,T.style.cssText=w,k.style.cssText=y,D.style.cssText=x,O.appendChild(T),k.appendChild(D),S.appendChild(O),S.appendChild(k),z.appendChild(S),n.appendChild(z),d(O,"scroll",L),d(k,"scroll",A),i(a).onExpandScroll=L,i(a).onShrinkScroll=A}else u("Aborting because element has been uninstalled");function L(){var e=i(a);e&&e.onExpand?e.onExpand():u("Aborting expand scroll handler: element has been uninstalled")}function A(){var e=i(a);e&&e.onShrink?e.onShrink():u("Aborting shrink scroll handler: element has been uninstalled")}}function O(){function r(t,n,i){var o=function(e){return f(e).childNodes[0]}(t),r=w(n),a=x(i);o.style.setProperty("width",r+"px",e.important?"important":""),o.style.setProperty("height",a+"px",e.important?"important":"")}function s(s){var l=a.offsetWidth,d=a.offsetHeight,f=l!==i(a).lastWidth||d!==i(a).lastHeight;u("Storing current size",l,d),v(a,l,d),n.add(0,function(){if(f)if(i(a))if(c()){if(e.debug){var n=a.offsetWidth,s=a.offsetHeight;n===l&&s===d||t.warn(o.get(a),"Scroll: Size changed before updating detector elements.")}r(a,l,d)}else u("Aborting because element container has not been initialized");else u("Aborting because element has been uninstalled")}),n.add(1,function(){i(a)?c()?z(a,l,d):u("Aborting because element container has not been initialized"):u("Aborting because element has been uninstalled")}),f&&s&&n.add(2,function(){i(a)?c()?s():u("Aborting because element container has not been initialized"):u("Aborting because element has been uninstalled")})}function c(){return!!i(a).container}function l(){u("notifyListenersIfNeeded invoked");var e=i(a);return void 0===i(a).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?u("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?u("Not notifying: Size already notified"):(u("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void j(i(a).listeners,function(e){e(a)}))}function d(){u("Scroll detected."),p(a)?u("Scroll event fired while unrendered. Ignoring..."):s(l)}if(u("registerListenersAndPositionElements invoked."),i(a)){i(a).onRendered=function(){if(u("startanimation triggered."),p(a))u("Ignoring since element is still unrendered...");else{u("Element rendered.");var e=f(a),t=h(a);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(u("Scrollbars out of sync. Updating detector elements..."),s(l))}},i(a).onExpand=d,i(a).onShrink=d;var g=i(a).style;r(a,g.width,g.height)}else u("Aborting because element has been uninstalled")}function T(){if(u("finalizeDomMutation invoked."),i(a)){var e=i(a).style;v(a,e.width,e.height),z(a,e.width,e.height)}else u("Aborting because element has been uninstalled")}function k(){c(a)}function D(){var e;u("Installing..."),i(a).listeners=[],e=g(),i(a).startSize={width:e.width,height:e.height},u("Element start size",i(a).startSize),n.add(0,m),n.add(1,S),n.add(2,O),n.add(3,T),n.add(4,k)}c||(c=a,a=e,e=null),e=e||{},u("Making detectable..."),function(e){return!function(e){var t=e.getRootNode&&e.getRootNode().contains(e);return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)||t}(e)||null===window.getComputedStyle(e)}(a)?(u("Element is detached"),E(),u("Waiting until element is attached..."),i(a).onRendered=function(){u("Element is now attached"),D()}):D()},addListener:function(e,t){if(!i(e).listeners.push)throw new Error("Cannot add listener to an element that is not detectable.");i(e).listeners.push(t)},uninstall:function(e){var t=i(e);t&&(t.onExpandScroll&&u(f(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&u(h(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&u(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:c}},I=E.forEach;function R(e){return Array.isArray(e)||void 0!==e.length}function H(e){if(Array.isArray(e))return e;var t=[];return I(e,function(e){t.push(e)}),t}function N(e){return e&&1===e.nodeType}var M=function(e){var t;if((e=e||{}).idHandler)t={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var n=function(e){var t=e.idGenerator,n=e.stateHandler.getState;return{get:function(e){var t=n(e);return t&&void 0!==t.id?t.id:null},set:function(e){var i=n(e);if(!i)throw new Error("setId required the element to have a resize detection state.");var o=t.generate();return i.id=o,o}}}({idGenerator:function(){var e=1;return{generate:function(){return e++}}}(),stateHandler:A});t=n}var i=e.reporter;i||(i=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var i=function(e,t){e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var n=0;n<arguments.length;n++)e(arguments[n])}};i(n,"log"),i(n,"warn"),i(n,"error")}return n}(!1===i));var o=_(e,"batchProcessor",T({reporter:i})),r={};r.callOnAdd=!!_(e,"callOnAdd",!0),r.debug=!!_(e,"debug",!1);var a,s=function(e){var t={};function n(n){var i=e.get(n);return void 0===i?[]:t[i]||[]}return{get:n,add:function(n,i){var o=e.get(n);t[o]||(t[o]=[]),t[o].push(i)},removeListener:function(e,t){for(var i=n(e),o=0,r=i.length;o<r;++o)if(i[o]===t){i.splice(o,1);break}},removeAllListeners:function(e){var t=n(e);t&&(t.length=0)}}}(t),c=function(e){var t=e.stateHandler.getState;return{isDetectable:function(e){var n=t(e);return n&&!!n.isDetectable},markAsDetectable:function(e){t(e).isDetectable=!0},isBusy:function(e){return!!t(e).busy},markBusy:function(e,n){t(e).busy=!!n}}}({stateHandler:A}),l=_(e,"strategy","object"),d=_(e,"important",!1),u={reporter:i,batchProcessor:o,stateHandler:A,idHandler:t,important:d};if("scroll"===l&&(S.isLegacyOpera()?(i.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),l="object"):S.isIE(9)&&(i.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),l="object")),"scroll"===l)a=C(u);else{if("object"!==l)throw new Error("Invalid strategy name: "+l);a=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,i=e.stateHandler.getState;if(!t)throw new Error("Missing required dependency: reporter.");function o(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function r(e){return i(e).object}return{makeDetectable:function(e,r,a){a||(a=r,r=e,e=null),(e=e||{}).debug,S.isIE(8)?a(r):function(r,a){var s=o(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),c=!1,l=window.getComputedStyle(r),d=r.offsetWidth,u=r.offsetHeight;function f(){function n(){if("static"===l.position){r.style.setProperty("position","relative",e.important?"important":"");var n=function(t,n,i,o){var r=i[o];"auto"!==r&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(r)&&(t.warn("An element that is positioned static has style."+o+"="+r+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+o+" will be set to 0. Element: ",n),n.style.setProperty(o,"0",e.important?"important":""))};n(t,r,l,"top"),n(t,r,l,"right"),n(t,r,l,"bottom"),n(t,r,l,"left")}}""!==l.position&&(n(),c=!0);var o=document.createElement("object");o.style.cssText=s,o.tabIndex=-1,o.type="text/html",o.setAttribute("aria-hidden","true"),o.onload=function(){c||n(),function e(t,n){if(!t.contentDocument){var o=i(t);return o.checkForObjectDocumentTimeoutId&&window.clearTimeout(o.checkForObjectDocumentTimeoutId),void(o.checkForObjectDocumentTimeoutId=setTimeout(function(){o.checkForObjectDocumentTimeoutId=0,e(t,n)},100))}n(t.contentDocument)}(this,function(e){a(r)})},S.isIE()||(o.data="about:blank"),i(r)&&(r.appendChild(o),i(r).object=o,S.isIE()&&(o.data="about:blank"))}i(r).startSize={width:d,height:u},n?n.add(f):f()}(r,a)},addListener:function(e,t){function n(){t(e)}if(S.isIE(8))i(e).object={proxy:n},e.attachEvent("onresize",n);else{var o=r(e);if(!o)throw new Error("Element is not detectable by this strategy.");o.contentDocument.defaultView.addEventListener("resize",n)}},uninstall:function(e){if(i(e)){var t=r(e);t&&(S.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),i(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(i(e).checkForObjectDocumentTimeoutId),delete i(e).object)}}}}(u)}var f={};return{listenTo:function(e,n,o){function l(e){var t=s.get(e);I(t,function(t){t(e)})}function u(e,t,n){s.add(t,n),e&&n(t)}if(o||(o=n,n=e,e={}),!n)throw new Error("At least one element required.");if(!o)throw new Error("Listener required.");if(N(n))n=[n];else{if(!R(n))return i.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");n=H(n)}var h=0,p=_(e,"callOnAdd",r.callOnAdd),g=_(e,"onReady",function(){}),m=_(e,"debug",r.debug);I(n,function(e){A.getState(e)||(A.initState(e),t.set(e));var r=t.get(e);if(m&&i.log("Attaching listener to element",r,e),!c.isDetectable(e))return m&&i.log(r,"Not detectable."),c.isBusy(e)?(m&&i.log(r,"System busy making it detectable"),u(p,e,o),f[r]=f[r]||[],void f[r].push(function(){++h===n.length&&g()})):(m&&i.log(r,"Making detectable..."),c.markBusy(e,!0),a.makeDetectable({debug:m,important:d},e,function(e){if(m&&i.log(r,"onElementDetectable"),A.getState(e)){c.markAsDetectable(e),c.markBusy(e,!1),a.addListener(e,l),u(p,e,o);var t=A.getState(e);if(t&&t.startSize){var s=e.offsetWidth,d=e.offsetHeight;t.startSize.width===s&&t.startSize.height===d||l(e)}f[r]&&I(f[r],function(e){e()})}else m&&i.log(r,"Element uninstalled before being detectable.");delete f[r],++h===n.length&&g()}));m&&i.log(r,"Already detecable, adding listener."),u(p,e,o),h++}),h===n.length&&g()},removeListener:s.removeListener,removeAllListeners:s.removeAllListeners,uninstall:function(e){if(!e)return i.error("At least one element is required.");if(N(e))e=[e];else{if(!R(e))return i.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=H(e)}I(e,function(e){s.removeAllListeners(e),a.uninstall(e),A.cleanState(e)})},initDocument:function(e){a.initDocument&&a.initDocument(e)}}};function _(e,t,n){var i=e[t];return null==i&&void 0!==n?n:i}var W=["click","dblclick","mouseover","mouseout","mousedown","mouseup","globalout","legendselectchanged","legendselected","legendunselected","datazoom","datarangeselected","timelinechanged","timelineplaychanged","restore","dataviewchanged","magictypechanged","geoselectchanged","geoselected","geounselected","pieselectchanged","pieselected","pieunselected","mapselectchanged","mapselected","mapunselected","axisareaselected","brush","brushselected"];var q,P=(q=t,{name:"IEcharts",props:{styles:{type:Object,required:!1,default:function(){return{width:"100%",height:"100%"}}},theme:{type:[String,Object],required:!1},group:{type:String,required:!1},option:{type:Object,required:!0},initOpts:{type:Object,required:!1},notMerge:{type:Boolean,required:!1,default:!1},lazyUpdate:{type:Boolean,required:!1,default:!1},loading:{type:Boolean,required:!1,default:!1},loadingOpts:{type:Object,required:!1},resizable:{type:Boolean,required:!1,default:!1}},data:function(){return{fnResize:null,insResize:null,watches:{loading:null,option:null,group:null}}},computed:{width:{cache:!1,get:function(){return this.instance.getWidth()}},height:{cache:!1,get:function(){return this.instance.getHeight()}},isDisposed:{cache:!1,get:function(){return this.instance.isDisposed()}}},watch:{loading:{handler:function(e){this.ifLoading(e)},deep:!1},option:{handler:function(e){this.instance.setOption(e,this.notMerge,this.lazyUpdate)},deep:!0},group:{handler:function(e){this.instance.group=e},deep:!1}},methods:{initResize:function(e){var t=this;t.resizable&&(t.insResize=t.insResize||M({strategy:"scroll"}),t.fnResize=t.fnResize||z(t.resize,250,{leading:!0,trailing:!0}),t.insResize.listenTo(e,function(e){var n=e.offsetWidth,i=e.offsetHeight;t.fnResize({width:n,height:i,silent:!1})}))},init:function(){var e=this;if(!e.instance){var t=e.$el,n=q.getInstanceByDom(t);n||(n=q.init(t,e.theme,e.initOpts)),n.group=e.group,e.instance=n,e.$emit("ready",n,q),e.$nextTick(function(){e.ifLoading(e.loading),e.update(),e.bind(),e.initResize(t)})}},bind:function(){var e=this,t=function(t){e.instance.on(t,function(n){e.$emit(t,n,e.instance,q)})};if(e._events){for(var n in e._events)if(Object.prototype.hasOwnProperty.call(e._events,n)){var i=n.toLowerCase();W.indexOf(i)>-1&&t(i)}}else for(var o=0,r=W.length;o<r;o++)t(W[o])},unbind:function(){if(this._events){for(var e in this._events)if(Object.prototype.hasOwnProperty.call(this._events,e)){var t=e.toLowerCase();W.indexOf(t)>-1&&this.instance.off(t)}}else for(var n=0,i=W.length;n<i;n++)this.instance.off(W[n])},ifLoading:function(e){e?this.showLoading():this.hideLoading()},watch:function(){var e=this;e.watches.loading=e.$watch("loading",function(t){e.ifLoading(t)}),e.watches.option=e.$watch("option",function(t){e.instance.setOption(t,e.notMerge,e.lazyUpdate)},{deep:!0}),e.watches.group=e.$watch("group",function(t){e.instance.group=t})},unwatch:function(){this.watches.loading&&(this.watches.loading(),this.watches.loading=null),this.watches.option&&(this.watches.option(),this.watches.option=null),this.watches.group&&(this.watches.group(),this.watches.group=null)},resize:function(e){if(this.instance){var t=e&&e.width,n=e&&e.height;this.$emit("resize",t,n),this.instance.resize(e)}},update:function(){this.instance&&(this.instance.setOption(this.option,this.notMerge,this.lazyUpdate),this.resize())},mergeOption:function(e){this.instance&&(this.instance.setOption(e,!1,this.lazyUpdate),this.resize())},dispatchAction:function(e){this.instance&&this.instance.dispatchAction(e)},convertToPixel:function(e,t){return this.instance.convertToPixel(e,t)},convertFromPixel:function(e,t){return this.instance.convertFromPixel(e,t)},containPixel:function(e,t){return this.instance.containPixel(e,t)},showLoading:function(){this.instance&&this.instance.showLoading("default",this.loadingOpts)},hideLoading:function(){this.instance&&this.instance.hideLoading()},getDataURL:function(e){return this.instance.getDataURL(e)},getConnectedDataURL:function(e){return this.instance.getConnectedDataURL(e)},clear:function(){this.instance&&this.instance.clear()},uninitResize:function(){this.insResize&&this.insResize.uninstall&&(this.insResize.uninstall(this.$el),this.insResize=null),this.fnResize&&this.fnResize.cancel&&(this.fnResize.cancel(),this.fnResize=null)},uninit:function(){this.instance&&(this.unbind(),this.uninitResize(),this.instance.dispose(),this.instance=null)}},mounted:function(){this.init()},beforeDestroy:function(){this.uninit()},connect:function(e){return q.connect(e)},disConnect:function(e){return q.disConnect(e)},dispose:function(e){return q.dispose(e)},getInstanceByDom:function(e){return q.getInstanceByDom(e)},registerMap:function(e,t,n){return q.registerMap(e,t,n)},getMap:function(e){return q.getMap(e)},registerTheme:function(e,t){return q.registerTheme(e,t)},render:function(){return e.h("div",{style:this.styles})}});return P.__echarts__=t,P});
//# sourceMappingURL=VueECharts.min.js.map