UNPKG

react-echarts-v3

Version:

React.js component wrap for ECharts.js(v3.x+)

2 lines 23.5 kB
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("echarts"),require("react"),require("react-dom"),require("prop-types"));else if("function"==typeof define&&define.amd)define(["echarts","react","react-dom","prop-types"],t);else{var n="object"==typeof exports?t(require("echarts"),require("react"),require("react-dom"),require("prop-types")):t(e.echarts,e.React,e.ReactDOM,e.PropTypes);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}("undefined"!=typeof self?self:this,function(e,t,n,i){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t){function n(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=n},function(e,t,n){"use strict";(e.exports={}).forEach=function(e,t){for(var n=0;n<e.length;n++){var i=t(e[n]);if(i)return i}}},function(e,t,n){"use strict";var i=e.exports={};i.isIE=function(e){return!!function(){var e=navigator.userAgent.toLowerCase();return-1!==e.indexOf("msie")||-1!==e.indexOf("trident")||-1!==e.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}())},i.isLegacyOpera=function(){return!!window.opera}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=(n.n(i),n(5)),r=Object(o.a)(i);r.__echarts__=i,t.default=r},function(t,n){t.exports=e},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){var t=function(t){function n(t){i(this,n);var r=o(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return r._init=function(){var t=r;if(!t.state.instance){var n=f.a.findDOMNode(t),i=e.getInstanceByDom(n);i||(i=e.init(n,t.props.theme,t.props.initOpts)),t.props.loading?i.showLoading("default",t.props.optsLoading):i.hideLoading(),i.group=t.props.group,t._bind(i);var o=null,a=t.state.fnResize||c()(t._resize,250,{leading:!0,trailing:!0});t.props.resizable&&(o=t.state.resize||g()({strategy:"scroll"}),o.listenTo(n,function(e){var t=e.offsetWidth,n=e.offsetHeight;a({width:t,height:n,silent:!1})})),t.props.onReady(i,e),t.setState({resize:o,fnResize:a,instance:i})}},r._update=function(){var e=r;e.state.instance.setOption(e.props.option,e.props.notMerge,e.props.lazyUpdate)},r._resize=function(e){var t=r,n=e&&e.width,i=e&&e.height;t.props.onResize(n,i),t.state.instance.resize(e)},r._getInstance=function(){var t=r;return e.getInstanceByDom(f.a.findDOMNode(t))},r._bind=function(e){var t=r;for(var n in t.props.onEvents)Array.hasOwnProperty.call(t.props.onEvents,n)&&function(t,n){"function"==typeof n&&(n=n.bind(e),e.off(t,n),e.on(t,n))}(n.toLowerCase(),t.props.onEvents[n])},r.state={fnResize:null,resize:null,instance:null},r}return r(n,t),m(n,[{key:"componentDidMount",value:function(){this._init()}},{key:"componentWillReceiveProps",value:function(e){var t=this;t.state.instance&&t.props.loading!==e.loading&&(e.loading?t.state.instance.showLoading("default",t.props.optsLoading):t.state.instance.hideLoading())}},{key:"componentDidUpdate",value:function(e,t){var n=this;n.props.option&&n._update()}},{key:"componentWillUnmount",value:function(){var e=this;if(e.state.resize&&e.state.resize.uninstall){var t=f.a.findDOMNode(e);e.state.resize.uninstall(t)}e.state.fnResize&&e.state.fnResize.cancel&&e.state.fnResize.cancel(),e.state.instance.dispose()}},{key:"render",value:function(){var e=this,t=e.props,n=t.className,i=t.style;return u.a.createElement("div",{className:n,style:i})}}]),n}(u.a.Component);return t.propTypes={className:h.a.string,style:h.a.object,theme:h.a.oneOfType([h.a.string,h.a.object]),group:h.a.string,option:h.a.object.isRequired,initOpts:h.a.object,notMerge:h.a.bool,lazyUpdate:h.a.bool,loading:h.a.bool,optsLoading:h.a.object,onReady:h.a.func,onResize:h.a.func,resizable:h.a.bool,onEvents:h.a.object},t.defaultProps={className:"react-echarts",style:{width:"100%",height:"100%"},notMerge:!1,lazyUpdate:!1,onReady:function(e){},onResize:function(e,t){},loading:!1,resizable:!1,onEvents:{}},t}var s=n(6),c=n.n(s),l=n(13),u=n.n(l),d=n(14),f=n.n(d),p=n(15),h=n.n(p),v=n(16),g=n.n(v),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();t.a=a},function(e,t,n){function i(e,t,n){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError(a);return r(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),o(e,t,{leading:i,maxWait:t,trailing:s})}var o=n(7),r=n(0),a="Expected a function";e.exports=i},function(e,t,n){function i(e,t,n){function i(t){var n=b,i=y;return b=y=void 0,z=t,x=e.apply(i,n)}function u(e){return z=e,E=setTimeout(p,t),O?i(e):x}function d(e){var n=e-S,i=e-z,o=t-n;return j?l(o,w-i):o}function f(e){var n=e-S,i=e-z;return void 0===S||n>=t||n<0||j&&i>=w}function p(){var e=r();if(f(e))return h(e);E=setTimeout(p,d(e))}function h(e){return E=void 0,k&&b?i(e):(b=y=void 0,x)}function v(){void 0!==E&&clearTimeout(E),z=0,b=S=y=E=void 0}function g(){return void 0===E?x:h(r())}function m(){var e=r(),n=f(e);if(b=arguments,y=this,S=e,n){if(void 0===E)return u(S);if(j)return E=setTimeout(p,t),i(S)}return void 0===E&&(E=setTimeout(p,t)),x}var b,y,w,x,E,S,z=0,O=!1,j=!1,k=!0;if("function"!=typeof e)throw new TypeError(s);return t=a(t)||0,o(n)&&(O=!!n.leading,j="maxWait"in n,w=j?c(a(n.maxWait)||0,t):w,k="trailing"in n?!!n.trailing:k),m.cancel=v,m.flush=g,m}var o=n(0),r=n(8),a=n(12),s="Expected a function",c=Math.max,l=Math.min;e.exports=i},function(e,t,n){var i=n(9),o=function(){return i.Date.now()};e.exports=o},function(e,t,n){var i=n(10),o="object"==typeof self&&self&&self.Object===Object&&self,r=i||o||Function("return this")();e.exports=r},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,n(11))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){function n(e){return e}e.exports=n},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=i},function(e,t,n){"use strict";function i(e){return Array.isArray(e)||void 0!==e.length}function o(e){if(Array.isArray(e))return e;var t=[];return s(e,function(e){t.push(e)}),t}function r(e){return e&&1===e.nodeType}function a(e,t,n){var i=e[t];return void 0!==i&&null!==i||void 0===n?i:n}var s=n(1).forEach,c=n(17),l=n(18),u=n(19),d=n(20),f=n(21),p=n(2),h=n(22),v=n(24),g=n(25),m=n(26);e.exports=function(e){function t(e,t,n){function c(e){var t=O.get(e);s(t,function(t){t(e)})}function l(e,t,n){O.add(t,n),e&&n(t)}if(n||(n=t,t=e,e={}),!t)throw new Error("At least one element required.");if(!n)throw new Error("Listener required.");if(r(t))t=[t];else{if(!i(t))return x.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");t=o(t)}var u=0,d=a(e,"callOnAdd",S.callOnAdd),f=a(e,"onReady",function(){}),p=a(e,"debug",S.debug);s(t,function(e){v.getState(e)||(v.initState(e),b.set(e));var i=b.get(e);if(p&&x.log("Attaching listener to element",i,e),!j.isDetectable(e))return p&&x.log(i,"Not detectable."),j.isBusy(e)?(p&&x.log(i,"System busy making it detectable"),l(d,e,n),A[i]=A[i]||[],void A[i].push(function(){++u===t.length&&f()})):(p&&x.log(i,"Making detectable..."),j.markBusy(e,!0),z.makeDetectable({debug:p},e,function(e){if(p&&x.log(i,"onElementDetectable"),v.getState(e)){j.markAsDetectable(e),j.markBusy(e,!1),z.addListener(e,c),l(d,e,n);var o=v.getState(e);if(o&&o.startSize){var r=e.offsetWidth,a=e.offsetHeight;o.startSize.width===r&&o.startSize.height===a||c(e)}A[i]&&s(A[i],function(e){e()})}else p&&x.log(i,"Element uninstalled before being detectable.");delete A[i],++u===t.length&&f()}));p&&x.log(i,"Already detecable, adding listener."),l(d,e,n),u++}),u===t.length&&f()}function n(e){if(!e)return x.error("At least one element is required.");if(r(e))e=[e];else{if(!i(e))return x.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=o(e)}s(e,function(e){O.removeAllListeners(e),z.uninstall(e),v.cleanState(e)})}e=e||{};var b;if(e.idHandler)b={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var y=u(),w=d({idGenerator:y,stateHandler:v});b=w}var x=e.reporter;if(!x){x=f(!1===x)}var E=a(e,"batchProcessor",h({reporter:x})),S={};S.callOnAdd=!!a(e,"callOnAdd",!0),S.debug=!!a(e,"debug",!1);var z,O=l(b),j=c({stateHandler:v}),k=a(e,"strategy","object"),_={reporter:x,batchProcessor:E,stateHandler:v,idHandler:b};if("scroll"===k&&(p.isLegacyOpera()?(x.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),k="object"):p.isIE(9)&&(x.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),k="object")),"scroll"===k)z=m(_);else{if("object"!==k)throw new Error("Invalid strategy name: "+k);z=g(_)}var A={};return{listenTo:t,removeListener:O.removeListener,removeAllListeners:O.removeAllListeners,uninstall:n}}},function(e,t,n){"use strict";e.exports=function(e){function t(e){var t=r(e);return t&&!!t.isDetectable}function n(e){r(e).isDetectable=!0}function i(e){return!!r(e).busy}function o(e,t){r(e).busy=!!t}var r=e.stateHandler.getState;return{isDetectable:t,markAsDetectable:n,isBusy:i,markBusy:o}}},function(e,t,n){"use strict";e.exports=function(e){function t(t){var n=e.get(t);return void 0===n?[]:r[n]||[]}function n(t,n){var i=e.get(t);r[i]||(r[i]=[]),r[i].push(n)}function i(e,n){for(var i=t(e),o=0,r=i.length;o<r;++o)if(i[o]===n){i.splice(o,1);break}}function o(e){var n=t(e);n&&(n.length=0)}var r={};return{get:t,add:n,removeListener:i,removeAllListeners:o}}},function(e,t,n){"use strict";e.exports=function(){function e(){return t++}var t=1;return{generate:e}}},function(e,t,n){"use strict";e.exports=function(e){function t(e){var t=o(e);return t&&void 0!==t.id?t.id:null}function n(e){var t=o(e);if(!t)throw new Error("setId required the element to have a resize detection state.");var n=i.generate();return t.id=n,n}var i=e.idGenerator,o=e.stateHandler.getState;return{get:t,set:n}}},function(e,t,n){"use strict";e.exports=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}},function(e,t,n){"use strict";function i(){function e(e,t){t||(t=e,e=0),e>r?r=e:e<a&&(a=e),i[e]||(i[e]=[]),i[e].push(t),o++}function t(){for(var e=a;e<=r;e++)for(var t=i[e],n=0;n<t.length;n++){var o=t[n];o()}}function n(){return o}var i={},o=0,r=0,a=0;return{add:e,process:t,size:n}}var o=n(23);e.exports=function(e){function t(e,t){!h&&d&&u&&0===p.size()&&a(),p.add(e,t)}function n(){for(h=!0;p.size();){var e=p;p=i(),e.process()}h=!1}function r(e){h||(void 0===e&&(e=u),f&&(s(f),f=null),e?a():n())}function a(){f=c(n)}function s(e){return clearTimeout(e)}function c(e){return function(e){return setTimeout(e,0)}(e)}e=e||{};var l=e.reporter,u=o.getOption(e,"async",!0),d=o.getOption(e,"auto",!0);d&&!u&&(l&&l.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),u=!0);var f,p=i(),h=!1;return{add:t,force:r}}},function(e,t,n){"use strict";function i(e,t,n){var i=e[t];return void 0!==i&&null!==i||void 0===n?i:n}(e.exports={}).getOption=i},function(e,t,n){"use strict";function i(e){return e[a]={},o(e)}function o(e){return e[a]}function r(e){delete e[a]}var a="_erd";e.exports={initState:i,getState:o,cleanState:r}},function(e,t,n){"use strict";var i=n(2);e.exports=function(e){function t(e,t){function n(){t(e)}if(!o(e))throw new Error("Element is not detectable by this strategy.");if(i.isIE(8))c(e).object={proxy:n},e.attachEvent("onresize",n);else{o(e).contentDocument.defaultView.addEventListener("resize",n)}}function n(e,t,n){n||(n=t,t=e,e=null),e=e||{};e.debug;i.isIE(8)?n(t):function(e,t){function n(){function n(){if("static"===l.position){e.style.position="relative";var t=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)};t(a,e,l,"top"),t(a,e,l,"right"),t(a,e,l,"bottom"),t(a,e,l,"left")}}function s(){function i(e,t){if(!e.contentDocument)return void setTimeout(function(){i(e,t)},100);t(e.contentDocument)}r||n(),i(this,function(n){t(e)})}""!==l.position&&(n(l),r=!0);var u=document.createElement("object");u.style.cssText=o,u.tabIndex=-1,u.type="text/html",u.onload=s,i.isIE()||(u.data="about:blank"),e.appendChild(u),c(e).object=u,i.isIE()&&(u.data="about:blank")}var 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;",r=!1,l=window.getComputedStyle(e),u=e.offsetWidth,d=e.offsetHeight;c(e).startSize={width:u,height:d},s?s.add(n):n()}(t,n)}function o(e){return c(e).object}function r(e){i.isIE(8)?e.detachEvent("onresize",c(e).object.proxy):e.removeChild(o(e)),delete c(e).object}e=e||{};var a=e.reporter,s=e.batchProcessor,c=e.stateHandler.getState;if(!a)throw new Error("Missing required dependency: reporter.");return{makeDetectable:n,addListener:t,uninstall:r}}},function(e,t,n){"use strict";var i=n(1).forEach;e.exports=function(e){function t(e){e.className+=" "+v+"_animation_active"}function n(e,t,n){if(e.addEventListener)e.addEventListener(t,n);else{if(!e.attachEvent)return u.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+t,n)}}function o(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n);else{if(!e.detachEvent)return u.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+t,n)}}function r(e){return f(e).container.childNodes[0].childNodes[0].childNodes[0]}function a(e){return f(e).container.childNodes[0].childNodes[0].childNodes[1]}function s(e,t){if(!f(e).listeners.push)throw new Error("Cannot add listener to an element that is not detectable.");f(e).listeners.push(t)}function c(e,o,s){function c(){if(e.debug){var t=Array.prototype.slice.call(arguments);if(t.unshift(p.get(o),"Scroll: "),u.log.apply)u.log.apply(null,t);else for(var n=0;n<t.length;n++)u.log(t[n])}}function l(e){var t=f(e).container.childNodes[0],n=getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function g(){var e=getComputedStyle(o),t={};return t.position=e.position,t.width=o.offsetWidth,t.height=o.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(){var e=g();f(o).startSize={width:e.width,height:e.height},c("Element start size",f(o).startSize)}function b(){f(o).listeners=[]}function y(){if(c("storeStyle invoked."),!f(o))return void c("Aborting because element has been uninstalled");var e=g();f(o).style=e}function w(e,t,n){f(e).lastWidth=t,f(e).lastHeight=n}function x(e){return r(e).childNodes[0]}function E(){return 2*h.width+1}function S(){return 2*h.height+1}function z(e){return e+10+E()}function O(e){return e+10+S()}function j(e){return 2*e+E()}function k(e){return 2*e+S()}function _(e,t,n){var i=r(e),o=a(e),s=z(t),c=O(n),l=j(t),u=k(n);i.scrollLeft=s,i.scrollTop=c,o.scrollLeft=l,o.scrollTop=u}function A(){var e=f(o).container;if(!e){e=document.createElement("div"),e.className=v,e.style.cssText="visibility: hidden; display: inline; width: 0px; height: 0px; z-index: -1; overflow: hidden; margin: 0; padding: 0;",f(o).container=e,t(e),o.appendChild(e);var i=function(){f(o).onRendered&&f(o).onRendered()};n(e,"animationstart",i),f(o).onAnimationStart=i}return e}function T(){function e(){f(o).onExpand&&f(o).onExpand()}function t(){f(o).onShrink&&f(o).onShrink()}if(c("Injecting elements"),!f(o))return void c("Aborting because element has been uninstalled");!function(){var e=f(o).style;if("static"===e.position){o.style.position="relative";var t=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)};t(u,o,e,"top"),t(u,o,e,"right"),t(u,o,e,"bottom"),t(u,o,e,"left")}}();var i=f(o).container;i||(i=A());var r=h.width,a=h.height,s="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; "+function(e,t,n,i){return e=e?e+"px":"0",t=t?t+"px":"0",n=n?n+"px":"0",i=i?i+"px":"0","left: "+e+"; top: "+t+"; right: "+i+"; bottom: "+n+";"}(-(1+r),-(1+a),-a,-r),l=document.createElement("div"),d=document.createElement("div"),p=document.createElement("div"),g=document.createElement("div"),m=document.createElement("div"),b=document.createElement("div");l.dir="ltr",l.style.cssText="position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; width: 100%; height: 100%; left: 0px; top: 0px;",l.className=v,d.className=v,d.style.cssText=s,p.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",g.style.cssText="position: absolute; left: 0; top: 0;",m.style.cssText="position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;",b.style.cssText="position: absolute; width: 200%; height: 200%;",p.appendChild(g),m.appendChild(b),d.appendChild(p),d.appendChild(m),l.appendChild(d),i.appendChild(l),n(p,"scroll",e),n(m,"scroll",t),f(o).onExpandScroll=e,f(o).onShrinkScroll=t}function L(){function t(e,t,n){var i=x(e),o=z(t),r=O(n);i.style.width=o+"px",i.style.height=r+"px"}function n(n){var i=o.offsetWidth,r=o.offsetHeight;c("Storing current size",i,r),w(o,i,r),d.add(0,function(){if(!f(o))return void c("Aborting because element has been uninstalled");if(!s())return void c("Aborting because element container has not been initialized");if(e.debug){var n=o.offsetWidth,a=o.offsetHeight;n===i&&a===r||u.warn(p.get(o),"Scroll: Size changed before updating detector elements.")}t(o,i,r)}),d.add(1,function(){return f(o)?s()?void _(o,i,r):void c("Aborting because element container has not been initialized"):void c("Aborting because element has been uninstalled")}),n&&d.add(2,function(){return f(o)?s()?void n():void c("Aborting because element container has not been initialized"):void c("Aborting because element has been uninstalled")})}function s(){return!!f(o).container}function h(){c("notifyListenersIfNeeded invoked");var e=f(o);return function(){return void 0===f(o).lastNotifiedWidth}()&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?c("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?c("Not notifying: Size already notified"):(c("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void i(f(o).listeners,function(e){e(o)}))}function v(){if(c("startanimation triggered."),l(o))return void c("Ignoring since element is still unrendered...");c("Element rendered.");var e=r(o),t=a(o);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(c("Scrollbars out of sync. Updating detector elements..."),n(h))}function g(){if(c("Scroll detected."),l(o))return void c("Scroll event fired while unrendered. Ignoring...");var e=o.offsetWidth,t=o.offsetHeight;e!==o.lastWidth||t!==o.lastHeight?(c("Element size changed."),n(h)):c("Element size has not changed ("+e+"x"+t+").")}if(c("registerListenersAndPositionElements invoked."),!f(o))return void c("Aborting because element has been uninstalled");f(o).onRendered=v,f(o).onExpand=g,f(o).onShrink=g;var m=f(o).style;t(o,m.width,m.height)}function D(){if(c("finalizeDomMutation invoked."),!f(o))return void c("Aborting because element has been uninstalled");var e=f(o).style;w(o,e.width,e.height),_(o,e.width,e.height)}function H(){s(o)}function C(){c("Installing..."),b(),m(),d.add(0,y),d.add(1,T),d.add(2,L),d.add(3,D),d.add(4,H)}s||(s=o,o=e,e=null),e=e||{},c("Making detectable..."),!function(e){return!function(e){return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)}(e)||null===getComputedStyle(e)}(o)?C():(c("Element is detached"),A(),c("Waiting until element is attached..."),f(o).onRendered=function(){c("Element is now attached"),C()})}function l(e){var t=f(e);t&&(t.onExpandScroll&&o(r(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&o(a(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&o(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))}e=e||{};var u=e.reporter,d=e.batchProcessor,f=e.stateHandler.getState,p=(e.stateHandler.hasState,e.idHandler);if(!d)throw new Error("Missing required dependency: batchProcessor");if(!u)throw new Error("Missing required dependency: reporter.");var h=function(){var e=document.createElement("div");e.style.cssText="position: absolute; width: 1000px; height: 1000px; visibility: hidden; margin: 0; padding: 0;";var t=document.createElement("div");t.style.cssText="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}}(),v="erd_scroll_detection_container";return function(e,t){if(!document.getElementById(e)){var n=t+"_animation",i=t+"_animation_active",o="/* Created by the element-resize-detector library. */\n";o+="."+t+" > div::-webkit-scrollbar { display: none; }\n\n",o+="."+i+" { -webkit-animation-duration: 0.1s; animation-duration: 0.1s; -webkit-animation-name: "+n+"; animation-name: "+n+"; }\n",o+="@-webkit-keyframes "+n+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",o+="@keyframes "+n+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }",function(t,n){n=n||function(e){document.head.appendChild(e)};var i=document.createElement("style");i.innerHTML=t,i.id=e,n(i)}(o)}}("erd_scroll_detection_scrollbar_style",v),{makeDetectable:c,addListener:s,uninstall:l}}}])}); //# sourceMappingURL=react-echarts.js.map