=n.length)return e;for(var o=-1,a=e.length,s=n[i++],l={},u={};++o=n.length)return t;var a=[],s=i[o++];return r.each(t,function(t,n){a.push({key:n,values:e(t,o)})}),s?a.sort(function(t,e){return s(t.key,e.key)}):a}var n=[],i=[];return{key:function(t){return n.push(t),this},sortKeys:function(t){return i[n.length-1]=t,this},entries:function(n){return e(t(n,0),0)}}}var r=n(1);t.exports=i},function(t,e,n){var i=n(1),r={get:function(t,e,n){var r=i.clone((o[t]||{})[e]);return n&&i.isArray(r)?r[r.length-1]:r}},o={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};t.exports=r},function(t,e){"use strict";var n=t.exports={};n.isIE=function(t){return!(!function(){var t=navigator.userAgent.toLowerCase();return-1!==t.indexOf("msie")||-1!==t.indexOf("trident")||-1!==t.indexOf(" edge/")}()||t&&t!==function(){var t=3,e=document.createElement("div"),n=e.getElementsByTagName("i");do{e.innerHTML=""}while(n[0]);return t>4?t:void 0}())},n.isLegacyOpera=function(){return!!window.opera}},function(t,e){"use strict";(t.exports={}).forEach=function(t,e){for(var n=0;n p?_[f]:x[f],bodyEnds:M,whiskerEnds:S,brushRect:function(){var e=t(Math.min(d,p,g,v)),n=t(Math.max(d,p,g,v));return e[h]-=a/2,n[h]-=a/2,{x:e[0],y:e[1],width:f?a:n[0]-e[0],height:f?n[1]-e[1]:a}}()})},!0)})}},function(t,e){var n=["itemStyle","normal","borderColor"],i=["itemStyle","normal","borderColor0"],r=["itemStyle","normal","color"],o=["itemStyle","normal","color0"];t.exports=function(t,e){t.eachRawSeriesByType("candlestick",function(e){var a=e.getData();a.setVisual({legendSymbol:"roundRect"}),t.isSeriesFiltered(e)||a.each(function(t){var e=a.getItemModel(t),s=a.getItemLayout(t).sign;a.setItemVisual(t,{color:e.get(s>0?r:o),borderColor:e.get(s>0?n:i)})})})}},function(t,e,n){var i=n(1);t.exports=function(t){t&&i.isArray(t.series)&&i.each(t.series,function(t){i.isObject(t)&&"k"===t.type&&(t.type="candlestick")})}},function(t,e,n){var i=n(1),r=n(2);n(160),n(161),r.registerVisual(i.curry(n(32),"effectScatter","circle",null)),r.registerLayout(i.curry(n(69),"effectScatter"))},function(t,e,n){"use strict";var i=n(30),r=n(13);t.exports=r.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(t,e){return i(t.data,this,e)},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}})},function(t,e,n){var i=n(34),r=n(188);n(2).extendChartView({type:"effectScatter",init:function(){this._symbolDraw=new i(r)},render:function(t,e,n){var i=t.getData(),r=this._symbolDraw;r.updateData(i),this.group.add(r.group)},updateLayout:function(){this._symbolDraw.updateLayout()},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(e)},dispose:function(){}})},function(t,e,n){var i=n(1),r=n(2);n(163),n(164),r.registerVisual(i.curry(n(72),"funnel")),r.registerLayout(n(165)),r.registerProcessor(i.curry(n(47),"funnel"))},function(t,e,n){"use strict";var i=n(10),r=n(7),o=n(17),a=n(2).extendSeriesModel({type:"series.funnel",init:function(t){a.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this._defaultLabelLine(t)},getInitialData:function(t,e){var n=o(["value"],t.data),r=new i(n,this);return r.initData(t.data),r},_defaultLabelLine:function(t){r.defaultEmphasis(t.labelLine,["show"]);var e=t.labelLine.normal,n=t.labelLine.emphasis;e.show=e.show&&t.label.normal.show,n.show=n.show&&t.label.emphasis.show},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{normal:{show:!0,position:"outer"},emphasis:{show:!0}},labelLine:{normal:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},emphasis:{}},itemStyle:{normal:{borderColor:"#fff",borderWidth:1},emphasis:{}}}});t.exports=a},function(t,e,n){function i(t,e){function n(){a.ignore=a.hoverIgnore,s.ignore=s.hoverIgnore}function i(){a.ignore=a.normalIgnore,s.ignore=s.normalIgnore}o.Group.call(this);var r=new o.Polygon,a=new o.Polyline,s=new o.Text;this.add(r),this.add(a),this.add(s),this.updateData(t,e,!0),this.on("emphasis",n).on("normal",i).on("mouseover",n).on("mouseout",i)}function r(t,e,n,i){var r=i.getModel("textStyle"),o=i.get("position"),s="inside"===o||"inner"===o||"center"===o;return{fill:r.getTextColor()||(s?"#fff":t.getItemVisual(e,"color")),textFont:r.getFont(),text:a.retrieve(t.hostModel.getFormattedLabel(e,n),t.getName(e))}}var o=n(3),a=n(1),s=i.prototype,l=["itemStyle","normal","opacity"];s.updateData=function(t,e,n){var i=this.childAt(0),r=t.hostModel,s=t.getItemModel(e),u=t.getItemLayout(e),c=t.getItemModel(e).get(l);c=null==c?1:c,i.useStyle({}),n?(i.setShape({points:u.points}),i.setStyle({opacity:0}),o.initProps(i,{style:{opacity:c}},r,e)):o.updateProps(i,{style:{opacity:c},shape:{points:u.points}},r,e);var h=s.getModel("itemStyle"),f=t.getItemVisual(e,"color");i.setStyle(a.defaults({lineJoin:"round",fill:f},h.getModel("normal").getItemStyle(["opacity"]))),i.hoverStyle=h.getModel("emphasis").getItemStyle(),this._updateLabel(t,e),o.setHoverStyle(this)},s._updateLabel=function(t,e){var n=this.childAt(1),i=this.childAt(2),a=t.hostModel,s=t.getItemModel(e),l=t.getItemLayout(e),u=l.label,c=t.getItemVisual(e,"color");o.updateProps(n,{shape:{points:u.linePoints||u.linePoints}},a,e),o.updateProps(i,{style:{x:u.x,y:u.y}},a,e),i.attr({style:{textAlign:u.textAlign,textVerticalAlign:u.verticalAlign,textFont:u.font},rotation:u.rotation,origin:[u.x,u.y],z2:10});var h=s.getModel("label.normal"),f=s.getModel("label.emphasis"),d=s.getModel("labelLine.normal"),p=s.getModel("labelLine.emphasis");i.setStyle(r(t,e,"normal",h)),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!f.get("show"),n.ignore=n.normalIgnore=!d.get("show"),n.hoverIgnore=!p.get("show"),n.setStyle({stroke:c}),n.setStyle(d.getModel("lineStyle").getLineStyle()),i.hoverStyle=r(t,e,"emphasis",f),n.hoverStyle=p.getModel("lineStyle").getLineStyle()},a.inherits(i,o.Group);var u=n(24).extend({type:"funnel",render:function(t,e,n){var r=t.getData(),o=this._data,a=this.group;r.diff(o).add(function(t){var e=new i(r,t);r.setItemGraphicEl(t,e),a.add(e)}).update(function(t,e){var n=o.getItemGraphicEl(e);n.updateData(r,t),a.add(n),r.setItemGraphicEl(t,n)}).remove(function(t){var e=o.getItemGraphicEl(t);a.remove(e)}).execute(),this._data=r},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});t.exports=u},function(t,e,n){function i(t,e){return a.getLayoutRect(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function r(t,e){for(var n=t.mapArray("value",function(t){return t}),i=[],r="ascending"===e,o=0,a=t.count();o=t&&(0===e?0:i[e-1][0])-1&&t.instance.off(i)}}else for(var r=0,o=n.length;r
"),r=[];return null!=this.name&&r.push(s(this.name)),null!=n&&r.push(n),r.join("
")},brushSelector:function(t,e){return e.rect(t.brushRect)}});i.mixin(u,o.seriesModelMixin,!0),t.exports=u},function(t,e,n){"use strict";function i(t,e,n){var i=e.getItemModel(n),r=i.getModel(u),o=e.getItemVisual(n,"color"),s=e.getItemVisual(n,"borderColor")||o,l=r.getItemStyle(["color","color0","borderColor","borderColor0"]),h=t.childAt(t.whiskerIndex);h.useStyle(l),h.style.stroke=s;var f=t.childAt(t.bodyIndex);f.useStyle(l),f.style.fill=o,f.style.stroke=s;var d=i.getModel(c).getItemStyle();a.setHoverStyle(t,d)}var r=n(1),o=n(24),a=n(3),s=n(43),l=o.extend({type:"candlestick",getStyleUpdater:function(){return i},dispose:r.noop});r.mixin(l,s.viewMixin,!0);var u=["itemStyle","normal"],c=["itemStyle","emphasis"];t.exports=l},function(t,e,n){function i(t,e){var n,i=t.getBaseAxis(),a="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/e.count()),s=o(r(t.get("barMaxWidth"),a),a),l=o(r(t.get("barMinWidth"),1),a),u=t.get("barWidth");return null!=u?o(u,a):Math.max(Math.min(a/2,s),l)}var r=n(1).retrieve,o=n(4).parsePercent;t.exports=function(t){t.eachSeriesByType("candlestick",function(t){var e=t.coordinateSystem,n=t.getData(),r=t.dimensions,o=t.get("layout"),a=i(t,n);n.each(r,function(){function t(t){var n=[];return n[h]=u,n[f]=t,isNaN(u)||isNaN(t)?[NaN,NaN]:e.dataToPoint(n)}function i(t,e){var n=t.slice(),i=t.slice();n[h]+=a/2,i[h]-=a/2,e?M.push(n,i):M.push(i,n)}var s=arguments,l=r.length,u=s[0],c=s[l],h="horizontal"===o?0:1,f=1-h,d=s[1],p=s[2],g=s[3],v=s[4],m=Math.min(d,p),y=Math.max(d,p),x=t(m),_=t(y),b=t(g),w=t(v),S=[[w,_],[b,x]],M=[];i(_,0),i(x,1),n.setItemLayout(c,{chartLayout:o,sign:d>p?-1:d
")},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{normal:{width:2,type:"solid"}},label:{normal:{position:"top"}},symbol:"emptyCircle",symbolSize:4}});t.exports=l},function(t,e,n){function i(t){return o.isArray(t)||(t=[+t,+t]),t}var r=n(3),o=n(1),a=n(18);t.exports=n(2).extendChartView({type:"radar",render:function(t,e,n){function s(t,e){var n=t.getItemVisual(e,"symbol")||"circle",r=t.getItemVisual(e,"color");if("none"!==n){var o=a.createSymbol(n,-.5,-.5,1,1,r);return o.attr({style:{strokeNoScale:!0},z2:100,scale:i(t.getItemVisual(e,"symbolSize"))}),o}}function l(e,n,i,o,a,l){i.removeAll();for(var u=0;u0){var l=i.getLayout().y+r;i.setLayout({y:l},!0)}a=i.getLayout().y+i.getLayout().dy+e}if((r=a-e-n)>0){var l=i.getLayout().y-r;for(i.setLayout({y:l},!0),a=i.getLayout().y,o=s-2;o>=0;--o)i=t[o],r=i.getLayout().y+i.getLayout().dy+e-a,r>0&&(l=i.getLayout().y-r,i.setLayout({y:l},!0)),a=i.getLayout().y}})}function f(t,e){T.each(t.slice().reverse(),function(t){T.each(t,function(t){if(t.outEdges.length){var n=x(t.outEdges,d)/x(t.outEdges,S),i=t.getLayout().y+(n-_(t))*e;t.setLayout({y:i},!0)}})})}function d(t){return _(t.node2)*t.getValue()}function p(t,e){T.each(t,function(t){T.each(t,function(t){if(t.inEdges.length){var n=x(t.inEdges,g)/x(t.inEdges,S),i=t.getLayout().y+(n-_(t))*e;t.setLayout({y:i},!0)}})})}function g(t){return _(t.node1)*t.getValue()}function v(t){T.each(t,function(t){t.outEdges.sort(m),t.inEdges.sort(y)}),T.each(t,function(t){var e=0,n=0;T.each(t.outEdges,function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy}),T.each(t.inEdges,function(t){t.setLayout({ty:n},!0),n+=t.getLayout().dy})})}function m(t,e){return t.node2.getLayout().y-e.node2.getLayout().y}function y(t,e){return t.node1.getLayout().y-e.node1.getLayout().y}function x(t,e){for(var n=0,i=t.length,r=-1;++re?1:t===e?0:NaN}function S(t){return t.getValue()}var M=n(8),A=n(113),T=n(1);t.exports=function(t,e,n){t.eachSeriesByType("sankey",function(t){var n=t.get("nodeWidth"),a=t.get("nodeGap"),s=i(t,e);t.layoutInfo=s;var l=s.width,u=s.height,c=t.getGraph(),h=c.nodes,f=c.edges;o(h),r(h,f,n,a,l,u,0!==h.filter(function(t){return 0===t.getLayout().value}).length?0:t.get("layoutIterations"))})}},function(t,e,n){var i=n(28),r=n(1);t.exports=function(t,e){t.eachSeriesByType("sankey",function(t){var e=t.getGraph(),n=e.nodes;n.sort(function(t,e){return t.getLayout().value-e.getLayout().value});var o=n[0].getLayout().value,a=n[n.length-1].getLayout().value;r.each(n,function(e){var n=new i({type:"color",mappingMethod:"linear",dataExtent:[o,a],visual:t.get("color")}),r=n.mapValueToVisual(e.getLayout().value);e.setVisual("color",r);var s=e.getModel(),l=s.get("itemStyle.normal.color");null!=l&&e.setVisual("color",l)})})}},function(t,e,n){var i=n(1),r=n(2);n(230),n(231),r.registerVisual(i.curry(n(32),"scatter","circle",null)),r.registerLayout(i.curry(n(69),"scatter")),n(38)},function(t,e,n){"use strict";var i=n(30),r=n(13);t.exports=r.extend({type:"series.scatter",dependencies:["grid","polar"],getInitialData:function(t,e){return i(t.data,this,e)},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{normal:{opacity:.8}}}})},function(t,e,n){var i=n(34),r=n(190);n(2).extendChartView({type:"scatter",init:function(){this._normalSymbolDraw=new i,this._largeSymbolDraw=new r},render:function(t,e,n){var i=t.getData(),r=this._largeSymbolDraw,o=this._normalSymbolDraw,a=this.group,s=t.get("large")&&i.count()>t.get("largeThreshold")?r:o;this._symbolDraw=s,s.updateData(i),a.add(s.group),a.remove(s===r?o.group:r.group)},updateLayout:function(t){this._symbolDraw.updateLayout(t)},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(e,!0)},dispose:function(){}})},function(t,e,n){var i=n(2),r=n(1);n(97),n(233),n(234),i.registerLayout(n(235)),i.registerVisual(n(236)),i.registerProcessor(r.curry(n(47),"themeRiver"))},function(t,e,n){"use strict";var i=n(17),r=n(13),o=n(10),a=n(1),s=n(6),l=s.encodeHTML,u=n(113),c=r.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(t){c.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},fixData:function(t){for(var e=t.length,n=u().key(function(t){return t[2]}).entries(t),i=a.map(n,function(t){return{name:t.key,dataList:t.values}}),r=i.length,o=-1,s=-1,l=0;lr&&(r=i));var l=t.area*t.area,u=e*e*n;return l?x(u*r/l,l/(u*o)):1/0}function c(t,e,n,i,r){var o=e===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],c=e?t.area/e:0;(r||c>n[l[a]])&&(c=n[l[a]]);for(var h=0,f=t.length;h=0)return!0}function u(t){for(var e=t.split(/\n+/g),n=s(e.shift()).split(y),i=[],r=p.map(n,function(t){return{name:t,data:[]}}),o=0;o';window.open().document.write(u)}else{var c=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});o.dispatchEvent(c)}},n(22).register("saveAsImage",i),t.exports=i},function(t,e,n){n(312),n(313),n(2).registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),n(2).registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){})},function(t,e,n){function i(t){var e="cubic-bezier(0.23, 1, 0.32, 1)",n="left "+t+"s "+e+",top "+t+"s "+e;return s.map(p,function(t){return t+"transition:"+n}).join(";")}function r(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();return i&&e.push("color:"+i),e.push("font:"+t.getFont()),n&&e.push("line-height:"+Math.round(3*n/2)+"px"),h(["decoration","align"],function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)}),e.join(";")}function o(t){t=t;var e=[],n=t.get("transitionDuration"),o=t.get("backgroundColor"),a=t.getModel("textStyle"),s=t.get("padding");return n&&e.push(i(n)),o&&(d.canvasSupported?e.push("background-Color:"+o):(e.push("background-Color:#"+l.toHex(o)),e.push("filter:alpha(opacity=70)"))),h(["width","color","radius"],function(n){var i="border-"+n,r=f(i),o=t.get(r);null!=o&&e.push(i+":"+o+("color"===n?"":"px"))}),e.push(r(a)),null!=s&&e.push("padding:"+c.normalizeCssArray(s).join("px ")+"px"),e.join(";")+";"}function a(t,e){var n=document.createElement("div"),i=e.getZr();this.el=n,this._x=e.getWidth()/2,this._y=e.getHeight()/2,t.appendChild(n),this._container=t,this._show=!1,this._hideTimeout;var r=this;n.onmouseenter=function(){r.enterable&&(clearTimeout(r._hideTimeout),r._show=!0),r._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!r.enterable){var n=i.handler;u.normalizeEvent(t,e,!0),n.dispatch("mousemove",e)}},n.onmouseleave=function(){r.enterable&&r._show&&r.hideLater(r._hideDelay),r._inContent=!1}}var s=n(1),l=n(21),u=n(33),c=n(6),h=s.each,f=c.toCamelCase,d=n(14),p=["","-webkit-","-moz-","-o-"];a.prototype={constructor:a,enterable:!0,update:function(){var t=this._container,e=t.currentStyle||document.defaultView.getComputedStyle(t),n=t.style;"absolute"!==n.position&&"absolute"!==e.position&&(n.position="relative")},show:function(t){clearTimeout(this._hideTimeout);var e=this.el;e.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+o(t)+";left:"+this._x+"px;top:"+this._y+"px;"+(t.get("extraCssText")||""),e.style.display=e.innerHTML?"block":"none",this._show=!0},setContent:function(t){var e=this.el;e.innerHTML=t,e.style.display=t?"block":"none"},moveTo:function(t,e){var n=this.el.style;n.left=t+"px",n.top=e+"px",this._x=t,this._y=e},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(t){!this._show||this._inContent&&this.enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(s.bind(this.hide,this),t)):this.hide())},isShow:function(){return this._show}},t.exports=a},function(t,e,n){n(2).extendComponentModel({type:"tooltip",defaultOption:{zlevel:0,z:8,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove",alwaysShowContent:!1,confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:!0,animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",lineStyle:{color:"#555",width:1,type:"solid"},crossStyle:{color:"#555",width:1,type:"dashed",textStyle:{}},shadowStyle:{color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff",fontSize:14}}})},function(t,e,n){function i(t,e){if(!t||!e)return!1;var n=v.round;return n(t[0])===n(e[0])&&n(t[1])===n(e[1])}function r(t,e,n,i){return{x1:t,y1:e,x2:n,y2:i}}function o(t,e,n,i){return{x:t,y:e,width:n,height:i}}function a(t,e,n,i,r,o){return{cx:t,cy:e,r0:n,r:i,startAngle:r,endAngle:o,clockwise:!0}}function s(t,e,n,i,r){var o=n.clientWidth,a=n.clientHeight,s=20;return t+o+s>i?t-=o+s:t+=s,e+a+s>r?e-=a+s:e+=s,[t,e]}function l(t,e,n,i,r){var o=n.clientWidth,a=n.clientHeight;return t=Math.min(t+o,i)-o,e=Math.min(e+a,r)-a,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function u(t,e,n){var i=n.clientWidth,r=n.clientHeight,o=0,a=0,s=e.width,l=e.height;switch(t){case"inside":o=e.x+s/2-i/2,a=e.y+l/2-r/2;break;case"top":o=e.x+s/2-i/2,a=e.y-r-5;break;case"bottom":o=e.x+s/2-i/2,a=e.y+l+5;break;case"left":o=e.x-i-5,a=e.y+l/2-r/2;break;case"right":o=e.x+s+5,a=e.y+l/2-r/2}return[o,a]}function c(t,e,n,i,r,o,a,c){var h=c.getWidth(),f=c.getHeight(),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),"function"==typeof t&&(t=t([e,n],o,r.el,d)),p.isArray(t))e=y(t[0],h),n=y(t[1],f);else if("string"==typeof t&&a){var g=u(t,d,r.el);e=g[0],n=g[1]}else{var g=s(e,n,r.el,h,f);e=g[0],n=g[1]}if(i){var g=l(e,n,r.el,h,f);e=g[0],n=g[1]}r.moveTo(e,n)}function h(t){var e=t.coordinateSystem,n=t.get("tooltip.trigger",!0);return!(!e||"cartesian2d"!==e.type&&"polar"!==e.type&&"singleAxis"!==e.type||"item"===n)}var f=n(311),d=n(3),p=n(1),g=n(6),v=n(4),m=n(7),y=v.parsePercent,x=n(14),_=n(11);n(2).extendComponentView({type:"tooltip",_axisPointers:{},init:function(t,e){if(!x.node){var n=new f(e.getDom(),e);this._tooltipContent=n}},render:function(t,e,n){if(!x.node){this.group.removeAll(),this._axisPointers={},this._tooltipModel=t,this._ecModel=e,this._api=n,this._lastHover={};var i=this._tooltipContent;i.update(),i.enterable=t.get("enterable"),this._alwaysShowContent=t.get("alwaysShowContent"),this._seriesGroupByAxis=this._prepareAxisTriggerData(t,e);var r=this._crossText;r&&this.group.add(r);var o=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==o){var a=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){a.manuallyShowTip(t,e,n,{x:a._lastX,y:a._lastY})})}var s=this._api.getZr();s.off("click",this._tryShow),s.off("mousemove",this._mousemove),s.off("mouseout",this._hide),s.off("globalout",this._hide),"click"===o?s.on("click",this._tryShow,this):"mousemove"===o&&(s.on("mousemove",this._mousemove,this),s.on("mouseout",this._hide,this),s.on("globalout",this._hide,this))}},_mousemove:function(t){var e=this._tooltipModel.get("showDelay"),n=this;clearTimeout(this._showTimeout),e>0?this._showTimeout=setTimeout(function(){n._tryShow(t)},e):this._tryShow(t)},manuallyShowTip:function(t,e,n,i){function r(t){var e=t.getData(),n=m.queryDataIndex(e,i);if(null!=n&&!p.isArray(n)&&e.hasValue(n))return!0}if(i.from!==this.uid){var e=this._ecModel,o=i.seriesIndex,a=e.getSeriesByIndex(o),n=this._api,s="axis"===this._tooltipModel.get("trigger");if(null==i.x||null==i.y){if(s?(a&&!r(a)&&(a=null),a||e.eachSeries(function(t){h(t)&&!a&&r(t)&&(a=t)})):a=a||e.getSeriesByIndex(0),a){var l=a.getData(),u=m.queryDataIndex(l,i);if(null==u||p.isArray(u))return;var c,f,d=l.getItemGraphicEl(u),g=a.coordinateSystem;if(a.getTooltipPosition){var v=a.getTooltipPosition(u)||[];c=v[0],f=v[1]}else if(g&&g.dataToPoint){var v=g.dataToPoint(l.getValues(p.map(g.dimensions,function(t){return a.coordDimToDataDim(t)[0]}),u,!0));c=v&&v[0],f=v&&v[1]}else if(d){var y=d.getBoundingRect().clone();y.applyTransform(d.transform),c=y.x+y.width/2,f=y.y+y.height/2}null!=c&&null!=f&&this._tryShow({offsetX:c,offsetY:f,position:i.position,target:d,event:{}})}}else{var d=n.getZr().handler.findHover(i.x,i.y);this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:d,event:{}})}}},manuallyHideTip:function(t,e,n,i){i.from!==this.uid&&this._hide()},_prepareAxisTriggerData:function(t,e){var n={};return e.eachSeries(function(t){if(h(t)){var e,i,r=t.coordinateSystem;"cartesian2d"===r.type?(e=r.getBaseAxis(),i=e.dim+e.index):"singleAxis"===r.type?(e=r.getAxis(),i=e.dim+e.type):(e=r.getBaseAxis(),i=e.dim+r.name),n[i]=n[i]||{coordSys:[],series:[]},n[i].coordSys.push(r),n[i].series.push(t)}},this),n},_tryShow:function(t){var e=t.target,n=this._tooltipModel,i=n.get("trigger"),r=this._ecModel,o=this._api;if(n)if(this._lastX=t.offsetX,this._lastY=t.offsetY,e&&null!=e.dataIndex){var a=e.dataModel||r.getSeriesByIndex(e.seriesIndex),s=e.dataIndex,l=a.getData(),u=l.getItemModel(s);"axis"===(u.get("tooltip.trigger")||i)?this._showAxisTooltip(n,r,t):(this._ticket="",this._hideAxisPointer(),this._resetLastHover(),this._showItemTooltipContent(a,s,e.dataType,t)),o.dispatchAction({type:"showTip",from:this.uid,dataIndexInside:s,dataIndex:l.getRawIndex(s),seriesIndex:e.seriesIndex})}else if(e&&e.tooltip){var c=e.tooltip;if("string"==typeof c){var h=c;c={content:h,formatter:h}}var f=new _(c,n),d=f.get("content"),p=Math.random();this._showTooltipContent(f,d,f.get("formatterParams")||{},p,t.offsetX,t.offsetY,t.position,e,o)}else"item"===i?this._hide():this._showAxisTooltip(n,r,t),"cross"===n.get("axisPointer.type")&&o.dispatchAction({type:"showTip",from:this.uid,x:t.offsetX,y:t.offsetY})},_showAxisTooltip:function(t,e,n){var r=t.getModel("axisPointer"),o=r.get("type");if("cross"===o){var a=n.target;if(a&&null!=a.dataIndex){var s=e.getSeriesByIndex(a.seriesIndex),l=a.dataIndex;this._showItemTooltipContent(s,l,a.dataType,n)}}this._showAxisPointer();var u=!0;p.each(this._seriesGroupByAxis,function(e){var a=e.coordSys,s=a[0],l=[n.offsetX,n.offsetY];if(!s.containPoint(l))return void this._hideAxisPointer(s.name);u=!1;var c=s.dimensions,h=s.pointToData(l,!0);l=s.dataToPoint(h);var f=s.getBaseAxis(),d=r.get("axis");if("auto"===d&&(d=f.dim),f.isBlank()||p.eqNaN(l[0])||p.eqNaN(l[1]))return void this._hideAxisPointer(s.name);var g=!1,v=this._lastHover;if("cross"===o)i(v.data,h)&&(g=!0),v.data=h;else{var m=p.indexOf(c,d);v.data===h[m]&&(g=!0),v.data=h[m]}var y=t.get("animation");"cartesian2d"!==s.type||g?"polar"!==s.type||g?"singleAxis"!==s.type||g||this._showSinglePointer(r,s,d,l,y):this._showPolarPointer(r,s,d,l,y):this._showCartesianPointer(r,s,d,l,y),"cross"!==o&&this._dispatchAndShowSeriesTooltipContent(s,e.series,l,h,g,n.position)},this),this._tooltipModel.get("show")||this._hideAxisPointer(),u&&this._hide()},_showCartesianPointer:function(t,e,n,i,a){function s(n,i,o){var a="x"===n?r(i[0],o[0],i[0],o[1]):r(o[0],i[1],o[1],i[1]),s=u._getPointerElement(e,t,n,a);d.subPixelOptimizeLine({shape:a,style:s.style}),f?d.updateProps(s,{shape:a},t):s.attr({shape:a})}function l(n,i,r){var a=e.getAxis(n),s=a.getBandWidth(),l=r[1]-r[0],c="x"===n?o(i[0]-s/2,r[0],s,l):o(r[0],i[1]-s/2,l,s),h=u._getPointerElement(e,t,n,c);f?d.updateProps(h,{shape:c},t):h.attr({shape:c})}var u=this,c=t.get("type"),h=e.getBaseAxis(),f=a&&"cross"!==c&&"category"===h.type&&h.getBandWidth()>20;if("cross"===c)s("x",i,e.getAxis("y").getGlobalExtent()),s("y",i,e.getAxis("x").getGlobalExtent()),this._updateCrossText(e,i,t);else{var p=e.getAxis("x"===n?"y":"x"),g=p.getGlobalExtent();"cartesian2d"===e.type&&("line"===c?s:l)(n,i,g)}},_showSinglePointer:function(t,e,n,i,o){var a=this,s=t.get("type"),l=o&&"cross"!==s&&"category"===e.getBaseAxis().type,u=e.getRect();!function(n,i,o){var s=e.getAxis(),u=s.orient,c="horizontal"===u?r(i[0],o[0],i[0],o[1]):r(o[0],i[1],o[1],i[1]),h=a._getPointerElement(e,t,n,c);l?d.updateProps(h,{shape:c},t):h.attr({shape:c})}(n,i,[u.y,u.y+u.height])},_showPolarPointer:function(t,e,n,i,o){function s(n,i,o){var a,s=e.pointToCoord(i);if("angle"===n){var l=e.coordToPoint([o[0],s[1]]),c=e.coordToPoint([o[1],s[1]]);a=r(l[0],l[1],c[0],c[1])}else a={cx:e.cx,cy:e.cy,r:s[0]};var h=u._getPointerElement(e,t,n,a);p?d.updateProps(h,{shape:a},t):h.attr({shape:a})}function l(n,i,r){var o,s=e.getAxis(n),l=s.getBandWidth(),c=e.pointToCoord(i),h=Math.PI/180;o="angle"===n?a(e.cx,e.cy,r[0],r[1],(-c[1]-l/2)*h,(-c[1]+l/2)*h):a(e.cx,e.cy,c[0]-l/2,c[0]+l/2,0,2*Math.PI);var f=u._getPointerElement(e,t,n,o);p?d.updateProps(f,{shape:o},t):f.attr({shape:o})}var u=this,c=t.get("type"),h=e.getAngleAxis(),f=e.getRadiusAxis(),p=o&&"cross"!==c&&"category"===e.getBaseAxis().type;if("cross"===c)s("angle",i,f.getExtent()),s("radius",i,h.getExtent()),this._updateCrossText(e,i,t);else{var g=e.getAxis("radius"===n?"angle":"radius"),v=g.getExtent();("line"===c?s:l)(n,i,v)}},_updateCrossText:function(t,e,n){var i=n.getModel("crossStyle"),r=i.getModel("textStyle"),o=this._tooltipModel,a=this._crossText;a||(a=this._crossText=new d.Text({style:{textAlign:"left",textVerticalAlign:"bottom"}}),this.group.add(a));var s=t.pointToData(e),l=t.dimensions;s=p.map(s,function(e,n){var i=t.getAxis(l[n]);return e="category"===i.type||"time"===i.type?i.scale.getLabel(e):g.addCommas(e.toFixed(i.getPixelPrecision()))}),a.setStyle({fill:r.getTextColor()||i.get("color"),textFont:r.getFont(),text:s.join(", "),x:e[0]+5,y:e[1]-5}),a.z=o.get("z"),a.zlevel=o.get("zlevel")},_getPointerElement:function(t,e,n,i){var r=this._tooltipModel,o=r.get("z"),a=r.get("zlevel"),s=this._axisPointers,l=t.name;if(s[l]=s[l]||{},s[l][n])return s[l][n];var u=e.get("type"),c=e.getModel(u+"Style"),h="shadow"===u,f=c[h?"getAreaStyle":"getLineStyle"](),p="polar"===t.type?h?"Sector":"radius"===n?"Circle":"Line":h?"Rect":"Line";h?f.stroke=null:f.fill=null;var g=s[l][n]=new d[p]({style:f,z:o,zlevel:a,silent:!0,shape:i});return this.group.add(g),g},_dispatchAndShowSeriesTooltipContent:function(t,e,n,i,r,o){var a=this._tooltipModel,s=t.getBaseAxis(),l={x:1,radius:1,single:1}[s.dim]?0:1;if(e.length){var u,h=p.map(e,function(t){return{seriesIndex:t.seriesIndex,dataIndexInside:t.getAxisTooltipDataIndex?t.getAxisTooltipDataIndex(t.coordDimToDataDim(s.dim),i,s):t.getData().indexOfNearest(t.coordDimToDataDim(s.dim)[0],i[l],!1,"category"===s.type?.5:null)}});p.each(h,function(t,n){e[n].getData().hasValue(t.dataIndexInside)&&(u=n)}),u=u||0;var f=this._lastHover,d=this._api;f.payloadBatch&&!r&&d.dispatchAction({type:"downplay",batch:f.payloadBatch}),r||(d.dispatchAction({type:"highlight",batch:h}),f.payloadBatch=h);var v=h[u].dataIndexInside;if(d.dispatchAction({type:"showTip",dataIndexInside:v,dataIndex:e[u].getData().getRawIndex(v),seriesIndex:h[u].seriesIndex,from:this.uid}),s&&a.get("showContent")&&a.get("show")){var m=p.map(e,function(t,e){return t.getDataParams(h[e].dataIndexInside)});if(r)c(o||a.get("position"),n[0],n[1],a.get("confine"),this._tooltipContent,m,null,d);else{var y=h[u].dataIndexInside,x="time"===s.type?s.scale.getLabel(i[l]):e[u].getData().getName(y),_=(x?g.encodeHTML(x)+"
":"")+p.map(e,function(t,e){return t.formatTooltip(h[e].dataIndexInside,!0)}).join("
"),b="axis_"+t.name+"_"+y;this._showTooltipContent(a,_,m,b,n[0],n[1],o,null,d)}}}},_showItemTooltipContent:function(t,e,n,i){var r=this._api,o=t.getData(n),a=o.getItemModel(e),s=a.get("tooltip",!0);"string"==typeof s&&(s={formatter:s});var l=this._tooltipModel,u=t.getModel("tooltip",l),c=new _(s,u,u.ecModel),h=t.getDataParams(e,n),f=t.formatTooltip(e,!1,n),d="item_"+t.name+"_"+e;this._showTooltipContent(c,f,h,d,i.offsetX,i.offsetY,i.position,i.target,r)},_showTooltipContent:function(t,e,n,i,r,o,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent,h=t.get("confine"),f=t.get("formatter");a=a||t.get("position");var d=e;if(f)if("string"==typeof f)d=g.formatTpl(f,n,!0);else if("function"==typeof f){var p=this,v=i,m=function(t,e){t===p._ticket&&(u.setContent(e),c(a,r,o,h,u,n,s,l))};p._ticket=v,d=f(n,v,m)}u.show(t),u.setContent(d),c(a,r,o,h,u,n,s,l)}},_showAxisPointer:function(t){if(t){var e=this._axisPointers[t];e&&p.each(e,function(t){t.show()})}else this.group.eachChild(function(t){t.show()}),this.group.show()},_resetLastHover:function(){var t=this._lastHover;t.payloadBatch&&this._api.dispatchAction({type:"downplay",batch:t.payloadBatch}),this._lastHover={}},_hideAxisPointer:function(t){if(t){var e=this._axisPointers[t];e&&p.each(e,function(t){t.hide()})}else this.group.children().length&&this.group.hide()},_hide:function(){clearTimeout(this._showTimeout),this._hideAxisPointer(),this._resetLastHover(),this._alwaysShowContent||this._tooltipContent.hideLater(this._tooltipModel.get("hideDelay")),this._api.dispatchAction({type:"hideTip",from:this.uid}),this._lastX=this._lastY=null},dispose:function(t,e){if(!x.node){var n=e.getZr();this._tooltipContent.hide(),n.off("click",this._tryShow),n.off("mousemove",this._mousemove),n.off("mouseout",this._hide),n.off("globalout",this._hide)}}})},function(t,e,n){n(319),n(320)},function(t,e,n){function i(t,e,n){if(n[0]===n[1])return n.slice();for(var i=(n[1]-n[0])/200,r=n[0],o=[],a=0;a<=200&&r1&&o&&o.length>1){var s=i(o)/i(a);!isFinite(s)&&(s=1),e.pinchScale=s;var l=r(o);return e.pinchX=l[0],e.pinchY=l[1],{type:"pinch",target:t[0].target,event:e}}}}};t.exports=a},function(t,e){var n=function(){this.head=null,this.tail=null,this._len=0},i=n.prototype;i.insert=function(t){var e=new r(t);return this.insertEntry(e),e},i.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,this.tail=t):this.head=this.tail=t,this._len++},i.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},i.len=function(){return this._len};var r=function(t){this.value=t,this.next,this.prev},o=function(t){this._list=new n,this._map={},this._maxSize=t||10},a=o.prototype;a.put=function(t,e){var n=this._list,i=this._map;if(null==i[t]){var r=n.len();if(r>=this._maxSize&&r>0){var o=n.head;n.remove(o),delete i[o.key]}var a=n.insert(e);a.key=t,i[t]=a}},a.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},a.clear=function(){this._list.clear(),this._map={}},t.exports=o},function(t,e,n){function i(t){return"mousewheel"===t&&f.browser.firefox?"DOMMouseScroll":t}function r(t,e,n){var i=t._gestureMgr;"start"===n&&i.clear();var r=i.recognize(e,t.handler.findHover(e.zrX,e.zrY,null),t.dom);if("end"===n&&i.clear(),r){var o=r.type;e.gestureEvent=o,t.handler.dispatchToElement(r.target,o,r.event)}}function o(t){t._touching=!0,clearTimeout(t._touchTimer),t._touchTimer=setTimeout(function(){t._touching=!1},700)}function a(t){var e=t.pointerType;return"pen"===e||"touch"===e}function s(t){function e(t,e){return function(){if(!e._touching)return t.apply(e,arguments)}}c.each(y,function(e){t._handlers[e]=c.bind(b[e],t)}),c.each(_,function(e){t._handlers[e]=c.bind(b[e],t)}),c.each(m,function(n){t._handlers[n]=e(b[n],t)})}function l(t){function e(e,n){c.each(e,function(e){p(t,i(e),n._handlers[e])},n)}h.call(this),this.dom=t,this._touching=!1,this._touchTimer,this._gestureMgr=new d,this._handlers={},s(this),f.pointerEventsSupported?e(_,this):(f.touchEventsSupported&&e(y,this),e(m,this))}var u=n(33),c=n(1),h=n(29),f=n(14),d=n(392),p=u.addEventListener,g=u.removeEventListener,v=u.normalizeEvent,m=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],y=["touchstart","touchend","touchmove"],x={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},_=c.map(m,function(t){var e=t.replace("mouse","pointer");return x[e]?e:t}),b={mousemove:function(t){t=v(this.dom,t),this.trigger("mousemove",t)},mouseout:function(t){t=v(this.dom,t);var e=t.toElement||t.relatedTarget;if(e!=this.dom)for(;e&&9!=e.nodeType;){if(e===this.dom)return;e=e.parentNode}this.trigger("mouseout",t)},touchstart:function(t){t=v(this.dom,t),t.zrByTouch=!0,this._lastTouchMoment=new Date,r(this,t,"start"),b.mousemove.call(this,t),b.mousedown.call(this,t),o(this)},touchmove:function(t){t=v(this.dom,t),t.zrByTouch=!0,r(this,t,"change"),b.mousemove.call(this,t),o(this)},touchend:function(t){t=v(this.dom,t),t.zrByTouch=!0,r(this,t,"end"),b.mouseup.call(this,t),+new Date-this._lastTouchMoment<300&&b.click.call(this,t),o(this)},pointerdown:function(t){b.mousedown.call(this,t)},pointermove:function(t){a(t)||b.mousemove.call(this,t)},pointerup:function(t){b.mouseup.call(this,t)},pointerout:function(t){a(t)||b.mouseout.call(this,t)}};c.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){b[t]=function(e){e=v(this.dom,e),this.trigger(t,e)}});var w=l.prototype;w.dispose=function(){for(var t=m.concat(y),e=0;e