12 |
- (self["webpackChunkapp"]=self["webpackChunkapp"]||[]).push([[6431],{1501:function(e,t,n){var i=n(33051),r={updateSelectedMap:function(e){this._targetList=i.isArray(e)?e.slice():[],this._selectTargetMap=i.reduce(e||[],(function(e,t){return e.set(t.name,t),e}),i.createHashMap())},select:function(e,t){var n=null!=t?this._targetList[t]:this._selectTargetMap.get(e),i=this.get("selectedMode");"single"===i&&this._selectTargetMap.each((function(e){e.selected=!1})),n&&(n.selected=!0)},unSelect:function(e,t){var n=null!=t?this._targetList[t]:this._selectTargetMap.get(e);n&&(n.selected=!1)},toggleSelected:function(e,t){var n=null!=t?this._targetList[t]:this._selectTargetMap.get(e);if(null!=n)return this[n.selected?"unSelect":"select"](e,t),n.selected},isSelected:function(e,t){var n=null!=t?this._targetList[t]:this._selectTargetMap.get(e);return n&&n.selected}};e.exports=r},19233:function(e){function t(e,t,r,o,a,l){e=e||0;var s=r[1]-r[0];if(null!=a&&(a=i(a,[0,s])),null!=l&&(l=Math.max(l,null!=a?a:0)),"all"===o){var c=Math.abs(t[1]-t[0]);c=i(c,[0,s]),a=l=i(c,[a,l]),o=0}t[0]=i(t[0],r),t[1]=i(t[1],r);var u=n(t,o);t[o]+=e;var g=a||0,d=r.slice();u.sign<0?d[0]+=g:d[1]-=g,t[o]=i(t[o],d);var p=n(t,o);null!=a&&(p.sign!==u.sign||p.span<a)&&(t[1-o]=t[o]+u.sign*a);p=n(t,o);return null!=l&&p.span>l&&(t[1-o]=t[o]+p.sign*l),t}function n(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function i(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}e.exports=t},78511:function(e,t,n){var i=n(70492);n(73650),n(13174),n(13134);var r=n(3391),o=n(98071);i.registerProcessor(i.PRIORITY.PROCESSOR.SERIES_FILTER,r),o.registerSubTypeDefaulter("legend",(function(){return"plain"}))},77139:function(e,t,n){n(78511),n(264),n(33681),n(50444)},73650:function(e,t,n){var i=n(70492),r=n(33051),o=n(4272),a=n(32234),l=a.isNameSpecified,s=n(40292),c=s.legend.selector,u={all:{type:"all",title:r.clone(c.all)},inverse:{type:"inverse",title:r.clone(c.inverse)}},g=i.extendComponentModel({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},mergeOption:function(e){g.superCall(this,"mergeOption",e),this._updateSelector(e)},_updateSelector:function(e){var t=e.selector;!0===t&&(t=e.selector=["all","inverse"]),r.isArray(t)&&r.each(t,(function(e,n){r.isString(e)&&(e={type:e}),t[n]=r.merge(e,u[e.type])}))},optionUpdated:function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,n=0;n<e.length;n++){var i=e[n].get("name");if(this.isSelected(i)){this.select(i),t=!0;break}}!t&&this.select(e[0].get("name"))}},_updateData:function(e){var t=[],n=[];e.eachRawSeries((function(i){var r,o=i.name;if(n.push(o),i.legendVisualProvider){var a=i.legendVisualProvider,s=a.getAllNames();e.isSeriesFiltered(i)||(n=n.concat(s)),s.length?t=t.concat(s):r=!0}else r=!0;r&&l(i)&&t.push(i.name)})),this._availableNames=n;var i=this.get("data")||t,a=r.map(i,(function(e){return"string"!==typeof e&&"number"!==typeof e||(e={name:e}),new o(e,this,this.ecModel)}),this);this._data=a},getData:function(){return this._data},select:function(e){var t=this.option.selected,n=this.get("selectedMode");if("single"===n){var i=this._data;r.each(i,(function(e){t[e.get("name")]=!1}))}t[e]=!0},unSelect:function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},toggleSelected:function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},allSelect:function(){var e=this._data,t=this.option.selected;r.each(e,(function(e){t[e.get("name",!0)]=!0}))},inverseSelect:function(){var e=this._data,t=this.option.selected;r.each(e,(function(e){var n=e.get("name",!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]}))},isSelected:function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&r.indexOf(this._availableNames,e)>=0},getOrient:function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:" sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}}}),d=g;e.exports=d},13134:function(e,t,n){var i=n(38175),r=(i.__DEV__,n(70492)),o=n(33051),a=n(41525),l=a.createSymbol,s=n(51177),c=n(99337),u=c.makeBackground,g=n(76172),d=o.curry,p=o.each,h=s.Group,f=r.extendComponentView({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new h),this._backgroundEl,this.group.add(this._selectorGroup=new h),this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},getSelectorGroup:function(){return this._selectorGroup},render:function(e,t,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var r=e.get("align"),a=e.get("orient");r&&"auto"!==r||(r="right"===e.get("left")&&"vertical"===a?"right":"left");var l=e.get("selector",!0),s=e.get("selectorPosition",!0);!l||s&&"auto"!==s||(s="horizontal"===a?"end":"start"),this.renderInner(r,e,t,n,l,a,s);var c=e.getBoxLayoutParams(),d={width:n.getWidth(),height:n.getHeight()},p=e.get("padding"),h=g.getLayoutRect(c,d,p),f=this.layoutInner(e,r,h,i,l,s),v=g.getLayoutRect(o.defaults({width:f.width,height:f.height},c),d,p);this.group.attr("position",[v.x-f.x,v.y-f.y]),this.group.add(this._backgroundEl=u(f,e))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},renderInner:function(e,t,n,i,r,a,l){var s=this.getContentGroup(),c=o.createHashMap(),u=t.get("selectedMode"),g=[];n.eachRawSeries((function(e){!e.get("legendHoverLink")&&g.push(e.id)})),p(t.getData(),(function(r,o){var a=r.get("name");if(this.newlineDisabled||""!==a&&"\n"!==a){var l=n.getSeriesByName(a)[0];if(!c.get(a))if(l){var p=l.getData(),f=p.getVisual("color"),v=p.getVisual("borderColor");"function"===typeof f&&(f=f(l.getDataParams(0))),"function"===typeof v&&(v=v(l.getDataParams(0)));var S=p.getVisual("legendSymbol")||"roundRect",_=p.getVisual("symbol"),I=this._createItem(a,o,r,t,S,_,e,f,v,u);I.on("click",d(m,a,null,i,g)).on("mouseover",d(x,l.name,null,i,g)).on("mouseout",d(y,l.name,null,i,g)),c.set(a,!0)}else n.eachRawSeries((function(n){if(!c.get(a)&&n.legendVisualProvider){var l=n.legendVisualProvider;if(!l.containName(a))return;var s=l.indexOfName(a),p=l.getItemVisual(s,"color"),h=l.getItemVisual(s,"borderColor"),f="roundRect",v=this._createItem(a,o,r,t,f,null,e,p,h,u);v.on("click",d(m,null,a,i,g)).on("mouseover",d(x,null,a,i,g)).on("mouseout",d(y,null,a,i,g)),c.set(a,!0)}}),this)}else s.add(new h({newline:!0}))}),this),r&&this._createSelector(r,t,i,a,l)},_createSelector:function(e,t,n,i,r){var o=this.getSelectorGroup();function a(e){var i=e.type,r=new s.Text({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});o.add(r);var a=t.getModel("selectorLabel"),l=t.getModel("emphasis.selectorLabel");s.setLabelStyle(r.style,r.hoverStyle={},a,l,{defaultText:e.title,isRectText:!1}),s.setHoverStyle(r)}p(e,(function(e){a(e)}))},_createItem:function(e,t,n,i,r,a,c,u,g,d){var p=i.get("itemWidth"),f=i.get("itemHeight"),m=i.get("inactiveColor"),x=i.get("inactiveBorderColor"),y=i.get("symbolKeepAspect"),S=i.getModel("itemStyle"),_=i.isSelected(e),I=new h,C=n.getModel("textStyle"),b=n.get("icon"),G=n.getModel("tooltip"),w=G.parentModel;r=b||r;var M=l(r,0,0,p,f,_?u:m,null==y||y);if(I.add(v(M,r,S,g,x,_)),!b&&a&&(a!==r||"none"===a)){var P=.8*f;"none"===a&&(a="circle");var D=l(a,(p-P)/2,(f-P)/2,P,P,_?u:m,null==y||y);I.add(v(D,a,S,g,x,_))}var A="left"===c?p+5:-5,R=c,T=i.get("formatter"),L=e;"string"===typeof T&&T?L=T.replace("{name}",null!=e?e:""):"function"===typeof T&&(L=T(e)),I.add(new s.Text({style:s.setTextStyle({},C,{text:L,x:A,y:f/2,textFill:_?C.getTextColor():m,textAlign:R,textVerticalAlign:"middle"})}));var O=new s.Rect({shape:I.getBoundingRect(),invisible:!0,tooltip:G.get("show")?o.extend({content:e,formatter:w.get("formatter",!0)||function(){return e},formatterParams:{componentType:"legend",legendIndex:i.componentIndex,name:e,$vars:["name"]}},G.option):null});return I.add(O),I.eachChild((function(e){e.silent=!0})),O.silent=!d,this.getContentGroup().add(I),s.setHoverStyle(I),I.__legendDataIndex=t,I},layoutInner:function(e,t,n,i,r,o){var a=this.getContentGroup(),l=this.getSelectorGroup();g.box(e.get("orient"),a,e.get("itemGap"),n.width,n.height);var s=a.getBoundingRect(),c=[-s.x,-s.y];if(r){g.box("horizontal",l,e.get("selectorItemGap",!0));var u=l.getBoundingRect(),d=[-u.x,-u.y],p=e.get("selectorButtonGap",!0),h=e.getOrient().index,f=0===h?"width":"height",v=0===h?"height":"width",m=0===h?"y":"x";"end"===o?d[h]+=s[f]+p:c[h]+=u[f]+p,d[1-h]+=s[v]/2-u[v]/2,l.attr("position",d),a.attr("position",c);var x={x:0,y:0};return x[f]=s[f]+p+u[f],x[v]=Math.max(s[v],u[v]),x[m]=Math.min(0,u[m]+d[1-h]),x}return a.attr("position",c),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});function v(e,t,n,i,r,o){var a;return"line"!==t&&t.indexOf("empty")<0?(a=n.getItemStyle(),e.style.stroke=i,o||(a.stroke=r)):a=n.getItemStyle(["borderWidth","borderColor"]),e.setStyle(a)}function m(e,t,n,i){y(e,t,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),x(e,t,n,i)}function x(e,t,n,i){var r=n.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||n.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:i})}function y(e,t,n,i){var r=n.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||n.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:i})}e.exports=f},264:function(e,t,n){var i=n(73650),r=n(76172),o=r.mergeLayoutParam,a=r.getLayoutParams,l=i.extend({type:"legend.scroll",setScrollDataIndex:function(e){this.option.scrollDataIndex=e},defaultOption:{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800},init:function(e,t,n,i){var r=a(e);l.superCall(this,"init",e,t,n,i),s(this,e,r)},mergeOption:function(e,t){l.superCall(this,"mergeOption",e,t),s(this,this.option,e)}});function s(e,t,n){var i=e.getOrient(),r=[1,1];r[i.index]=0,o(t,n,{type:"box",ignoreSize:r})}var c=l;e.exports=c},33681:function(e,t,n){var i=n(33051),r=n(51177),o=n(76172),a=n(13134),l=r.Group,s=["width","height"],c=["x","y"],u=a.extend({type:"legend.scroll",newlineDisabled:!0,init:function(){u.superCall(this,"init"),this._currentIndex=0,this.group.add(this._containerGroup=new l),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new l),this._showController},resetInner:function(){u.superCall(this,"resetInner"),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},renderInner:function(e,t,n,o,a,l,s){var c=this;u.superCall(this,"renderInner",e,t,n,o,a,l,s);var g=this._controllerGroup,d=t.get("pageIconSize",!0);i.isArray(d)||(d=[d,d]),h("pagePrev",0);var p=t.getModel("pageTextStyle");function h(e,n){var a=e+"DataIndex",l=r.createIcon(t.get("pageIcons",!0)[t.getOrient().name][n],{onclick:i.bind(c._pageGo,c,a,t,o)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});l.name=e,g.add(l)}g.add(new r.Text({name:"pageText",style:{textFill:p.getTextColor(),font:p.getFont(),textVerticalAlign:"middle",textAlign:"center"},silent:!0})),h("pageNext",1)},layoutInner:function(e,t,n,r,a,l){var u=this.getSelectorGroup(),g=e.getOrient().index,d=s[g],p=c[g],h=s[1-g],f=c[1-g];a&&o.box("horizontal",u,e.get("selectorItemGap",!0));var v=e.get("selectorButtonGap",!0),m=u.getBoundingRect(),x=[-m.x,-m.y],y=i.clone(n);a&&(y[d]=n[d]-m[d]-v);var S=this._layoutContentAndController(e,r,y,g,d,h,f);if(a){if("end"===l)x[g]+=S[d]+v;else{var _=m[d]+v;x[g]-=_,S[p]-=_}S[d]+=m[d]+v,x[1-g]+=S[f]+S[h]/2-m[h]/2,S[h]=Math.max(S[h],m[h]),S[f]=Math.min(S[f],m[f]+x[1-g]),u.attr("position",x)}return S},_layoutContentAndController:function(e,t,n,a,l,s,c){var u=this.getContentGroup(),g=this._containerGroup,d=this._controllerGroup;o.box(e.get("orient"),u,e.get("itemGap"),a?n.width:null,a?null:n.height),o.box("horizontal",d,e.get("pageButtonItemGap",!0));var p=u.getBoundingRect(),h=d.getBoundingRect(),f=this._showController=p[l]>n[l],v=[-p.x,-p.y];t||(v[a]=u.position[a]);var m=[0,0],x=[-h.x,-h.y],y=i.retrieve2(e.get("pageButtonGap",!0),e.get("itemGap",!0));if(f){var S=e.get("pageButtonPosition",!0);"end"===S?x[a]+=n[l]-h[l]:m[a]+=h[l]+y}x[1-a]+=p[s]/2-h[s]/2,u.attr("position",v),g.attr("position",m),d.attr("position",x);var _={x:0,y:0};if(_[l]=f?n[l]:p[l],_[s]=Math.max(p[s],h[s]),_[c]=Math.min(0,h[c]+x[1-a]),g.__rectSize=n[l],f){var I={x:0,y:0};I[l]=Math.max(n[l]-h[l]-y,0),I[s]=_[s],g.setClipPath(new r.Rect({shape:I})),g.__rectSize=I[l]}else d.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var C=this._getPageInfo(e);return null!=C.pageIndex&&r.updateProps(u,{position:C.contentPosition},!!f&&e),this._updatePageInfoView(e,C),_},_pageGo:function(e,t,n){var i=this._getPageInfo(t)[e];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:t.id})},_updatePageInfoView:function(e,t){var n=this._controllerGroup;i.each(["pagePrev","pageNext"],(function(i){var r=null!=t[i+"DataIndex"],o=n.childOfName(i);o&&(o.setStyle("fill",r?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),o.cursor=r?"pointer":"default")}));var r=n.childOfName("pageText"),o=e.get("pageFormatter"),a=t.pageIndex,l=null!=a?a+1:0,s=t.pageCount;r&&o&&r.setStyle("text",i.isString(o)?o.replace("{current}",l).replace("{total}",s):o({current:l,total:s}))},_getPageInfo:function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=e.getOrient().index,o=s[r],a=c[r],l=this._findTargetItemIndex(t),u=n.children(),g=u[l],d=u.length,p=d?1:0,h={contentPosition:n.position.slice(),pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!g)return h;var f=S(g);h.contentPosition[r]=-f.s;for(var v=l+1,m=f,x=f,y=null;v<=d;++v)y=S(u[v]),(!y&&x.e>m.s+i||y&&!_(y,m.s))&&(m=x.i>m.i?x:y,m&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=m.i),++h.pageCount)),x=y;for(v=l-1,m=f,x=f,y=null;v>=-1;--v)y=S(u[v]),y&&_(x,y.s)||!(m.i<x.i)||(x=m,null==h.pagePrevDataIndex&&(h.pagePrevDataIndex=m.i),++h.pageCount,++h.pageIndex),m=y;return h;function S(e){if(e){var t=e.getBoundingRect(),n=t[a]+e.position[r];return{s:n,e:n+t[o],i:e.__legendDataIndex}}}function _(e,t){return e.e>=t&&e.s<=t+i}},_findTargetItemIndex:function(e){if(!this._showController)return 0;var t,n,i=this.getContentGroup();return i.eachChild((function(i,r){var o=i.__legendDataIndex;null==n&&null!=o&&(n=r),o===e&&(t=r)})),null!=t?t:n}}),g=u;e.exports=g},13174:function(e,t,n){var i=n(70492),r=n(33051);function o(e,t,n){var i,o={},a="toggleSelected"===e;return n.eachComponent("legend",(function(n){a&&null!=i?n[i?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?n[e]():(n[e](t.name),i=n.isSelected(t.name));var l=n.getData();r.each(l,(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var i=n.isSelected(t);o.hasOwnProperty(t)?o[t]=o[t]&&i:o[t]=i}}))})),"allSelect"===e||"inverseSelect"===e?{selected:o}:{name:t.name,selected:o}}i.registerAction("legendToggleSelect","legendselectchanged",r.curry(o,"toggleSelected")),i.registerAction("legendAllSelect","legendselectall",r.curry(o,"allSelect")),i.registerAction("legendInverseSelect","legendinverseselect",r.curry(o,"inverseSelect")),i.registerAction("legendSelect","legendselected",r.curry(o,"select")),i.registerAction("legendUnSelect","legendunselected",r.curry(o,"unSelect"))},3391:function(e){function t(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries((function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0}))}e.exports=t},50444:function(e,t,n){var i=n(70492);i.registerAction("legendScroll","legendscroll",(function(e,t){var n=e.scrollDataIndex;null!=n&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(n)}))}))}}]);
- //# sourceMappingURL=chunk-vendors-02ec2db9.f60e3c5f.js.map
|