UNPKG

basb-cli

Version:
2 lines (1 loc) 19.2 kB
import{_ as t,i as e,X as o,b8 as i,e as a,bT as n,x as s,Y as r,c4 as l,G as h,bW as d,ap as p,aq as u,D as c,c5 as g,c6 as f,ae as m,E as v,c7 as y,a9 as _,a0 as x,R as w,F as S,c8 as b,c9 as M,ca as D,I,J as Z,cb as R,al as z,am as C,ak as A,b9 as L}from"./index.js";import{D as E,c as B,a as P,i as k,g as T}from"./installCommon.js";import{s as H}from"./sliderMove.js";import{R as V}from"./RoamController.js";import"./interactionMutex.js";var O=function(o){function i(){var t=null!==o&&o.apply(this,arguments)||this;return t.type=i.type,t}return t(i,o),i.type="dataZoom.inside",i.defaultOption=e(E.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),i}(E),W=o();function Y(t,e){if(e){t.removeKey(e.model.uid);var o=e.controller;o&&o.dispose()}}function G(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function X(t,e,o,i){return t.coordinateSystem.containPoint([o,i])}function F(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,(function(t,e){var o=W(e),r=o.coordSysRecordMap||(o.coordSysRecordMap=i());r.each((function(t){t.dataZoomInfoMap=null})),t.eachComponent({mainType:"dataZoom",subType:"inside"},(function(t){var o=B(t);a(o.infoList,(function(o){var n=o.model.uid,l=r.get(n)||r.set(n,function(t,e){var o={model:e,containsPoint:s(X,e),dispatchAction:s(G,t),dataZoomInfoMap:null,controller:null},i=o.controller=new V(t.getZr());return a(["pan","zoom","scrollMove"],(function(t){i.on(t,(function(e){var i=[];o.dataZoomInfoMap.each((function(a){if(e.isAvailableBehavior(a.model.option)){var n=(a.getRange||{})[t],s=n&&n(a.dzReferCoordSysInfo,o.model.mainType,o.controller,e);!a.model.get("disabled",!0)&&s&&i.push({dataZoomId:a.model.id,start:s[0],end:s[1]})}})),i.length&&o.dispatchAction(i)}))})),o}(e,o.model));(l.dataZoomInfoMap||(l.dataZoomInfoMap=i())).set(t.uid,{dzReferCoordSysInfo:o,model:t,getRange:null})}))})),r.each((function(t){var e,o=t.controller,i=t.dataZoomInfoMap;if(i){var a=i.keys()[0];null!=a&&(e=i.get(a))}if(e){var s=function(t){var e,o="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return t.each((function(t){var n=t.model,s=!n.get("disabled",!0)&&(!n.get("zoomLock",!0)||"move");i[o+s]>i[o+e]&&(e=s),a=a&&n.get("preventDefaultMouseMove",!0)})),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!a}}}(i);o.enable(s.controlType,s.opt),o.setPointerChecker(t.containsPoint),n(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else Y(r,t)}))}))}var j=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return t(o,e),o.prototype.render=function(t,o,i){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),function(t,e,o){W(t).coordSysRecordMap.each((function(t){var i=t.dataZoomInfoMap.get(e.uid);i&&(i.getRange=o)}))}(i,t,{pan:r(N.pan,this),zoom:r(N.zoom,this),scrollMove:r(N.scrollMove,this)}))},o.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},o.prototype._clear=function(){!function(t,e){for(var o=W(t).coordSysRecordMap,i=o.keys(),a=0;a<i.length;a++){var n=i[a],s=o.get(n),r=s.dataZoomInfoMap;if(r){var l=e.uid;r.get(l)&&(r.removeKey(l),r.keys().length||Y(o,s))}}}(this.api,this.dataZoomModel),this.range=null},o.type="dataZoom.inside",o}(P),N={zoom:function(t,e,o,i){var a=this.range,n=a.slice(),s=t.axisModels[0];if(s){var r=q[e](null,[i.originX,i.originY],s,o,t),l=(r.signal>0?r.pixelStart+r.pixelLength-r.pixel:r.pixel-r.pixelStart)/r.pixelLength*(n[1]-n[0])+n[0],h=Math.max(1/i.scale,0);n[0]=(n[0]-l)*h+l,n[1]=(n[1]-l)*h+l;var d=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return H(0,n,[0,100],0,d.minSpan,d.maxSpan),this.range=n,a[0]!==n[0]||a[1]!==n[1]?n:void 0}},pan:K((function(t,e,o,i,a,n){var s=q[i]([n.oldX,n.oldY],[n.newX,n.newY],e,a,o);return s.signal*(t[1]-t[0])*s.pixel/s.pixelLength})),scrollMove:K((function(t,e,o,i,a,n){return q[i]([0,0],[n.scrollDelta,n.scrollDelta],e,a,o).signal*(t[1]-t[0])*n.scrollDelta}))};function K(t){return function(e,o,i,a){var n=this.range,s=n.slice(),r=e.axisModels[0];if(r){var l=t(s,r,e,o,i,a);return H(l,s,[0,100],"all"),this.range=s,n[0]!==s[0]||n[1]!==s[1]?s:void 0}}}var q={grid:function(t,e,o,i,a){var n=o.axis,s={},r=a.model.coordinateSystem.getRect();return t=t||[0,0],"x"===n.dim?(s.pixel=e[0]-t[0],s.pixelLength=r.width,s.pixelStart=r.x,s.signal=n.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=r.height,s.pixelStart=r.y,s.signal=n.inverse?-1:1),s},polar:function(t,e,o,i,a){var n=o.axis,s={},r=a.model.coordinateSystem,l=r.getRadiusAxis().getExtent(),h=r.getAngleAxis().getExtent();return t=t?r.pointToCoord(t):[0,0],e=r.pointToCoord(e),"radiusAxis"===o.mainType?(s.pixel=e[0]-t[0],s.pixelLength=l[1]-l[0],s.pixelStart=l[0],s.signal=n.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=h[1]-h[0],s.pixelStart=h[0],s.signal=n.inverse?-1:1),s},singleAxis:function(t,e,o,i,a){var n=o.axis,s=a.model.coordinateSystem.getRect(),r={};return t=t||[0,0],"horizontal"===n.orient?(r.pixel=e[0]-t[0],r.pixelLength=s.width,r.pixelStart=s.x,r.signal=n.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=s.height,r.pixelStart=s.y,r.signal=n.inverse?-1:1),r}},J=j;function Q(t){k(t),t.registerComponentModel(O),t.registerComponentView(J),F(t)}var U=function(o){function i(){var t=null!==o&&o.apply(this,arguments)||this;return t.type=i.type,t}return t(i,o),i.type="dataZoom.slider",i.layoutMode="box",i.defaultOption=e(E.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),i}(E),$=w,tt="horizontal",et="vertical",ot=["line","bar","candlestick","scatter"],it={easing:"cubicOut",duration:100,delay:0};function at(t){return"vertical"===t?"ns-resize":"ew-resize"}var nt=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=o.type,t._displayables={},t}return t(o,e),o.prototype.init=function(t,e){this.api=e,this._onBrush=r(this._onBrush,this),this._onBrushEnd=r(this._onBrushEnd,this)},o.prototype.render=function(t,o,i,a){if(e.prototype.render.apply(this,arguments),n(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();a&&"dataZoom"===a.type&&a.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},o.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},o.prototype._clear=function(){l(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},o.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new h;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},o.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,o=t.get("brushSelect")?7:0,i=this._findCoordRect(),n={width:e.getWidth(),height:e.getHeight()},s=this._orient===tt?{right:n.width-i.x-i.width,top:n.height-30-7-o,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},r=d(t.option);a(["right","top","width","height"],(function(t){"ph"===r[t]&&(r[t]=s[t])}));var l=p(r,n);this._location={x:l.x,y:l.y},this._size=[l.width,l.height],this._orient===et&&this._size.reverse()},o.prototype._positionGroup=function(){var t=this.group,e=this._location,o=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),a=i&&i.get("inverse"),n=this._displayables.sliderGroup,s=(this._dataShadowInfo||{}).otherAxisInverse;n.attr(o!==tt||a?o===tt&&a?{scaleY:s?1:-1,scaleX:-1}:o!==et||a?{scaleY:s?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:s?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:s?1:-1,scaleX:1});var r=t.getBoundingRect([n]);t.x=e.x-r.x,t.y=e.y-r.y,t.markRedraw()},o.prototype._getViewExtent=function(){return[0,this._size[0]]},o.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,o=this._displayables.sliderGroup,i=t.get("brushSelect");o.add(new $({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var a=new $({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:r(this._onClickPanel,this)}),n=this.api.getZr();i?(a.on("mousedown",this._onBrushStart,this),a.cursor="crosshair",n.on("mousemove",this._onBrush),n.on("mouseup",this._onBrushEnd)):(n.off("mousemove",this._onBrush),n.off("mouseup",this._onBrushEnd)),o.add(a)},o.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,o=this._shadowSize||[],i=t.series,a=i.getRawData(),n=i.getShadowDim&&i.getShadowDim(),s=n&&a.getDimensionInfo(n)?i.getShadowDim():t.otherDim;if(null!=s){var r=this._shadowPolygonPts,l=this._shadowPolylinePts;if(a!==this._shadowData||s!==this._shadowDim||e[0]!==o[0]||e[1]!==o[1]){var d=a.getDataExtent(s),p=.3*(d[1]-d[0]);d=[d[0]-p,d[1]+p];var c,g=[0,e[1]],f=[0,e[0]],m=[[e[0],0],[0,0]],v=[],y=f[1]/(a.count()-1),_=0,x=Math.round(a.count()/e[0]);a.each([s],(function(t,e){if(x>0&&e%x)_+=y;else{var o=null==t||isNaN(t)||""===t,i=o?0:u(t,d,g,!0);o&&!c&&e?(m.push([m[m.length-1][0],0]),v.push([v[v.length-1][0],0])):!o&&c&&(m.push([_,0]),v.push([_,0])),m.push([_,i]),v.push([_,i]),_+=y,c=o}})),r=this._shadowPolygonPts=m,l=this._shadowPolylinePts=v}this._shadowData=a,this._shadowDim=s,this._shadowSize=[e[0],e[1]];for(var w=this.dataZoomModel,S=0;S<3;S++){var b=M(1===S);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function M(t){var e=w.getModel(t?"selectedDataBackground":"dataBackground"),o=new h,i=new C({shape:{points:r},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),a=new A({shape:{points:l},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return o.add(i),o.add(a),o}},o.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var o,i=this.ecModel;return t.eachTargetAxis((function(n,s){var r=t.getAxisProxy(n,s).getTargetSeriesModels();a(r,(function(t){if(!(o||!0!==e&&c(ot,t.get("type"))<0)){var a,r=i.getComponent(T(n),s).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[n],h=t.coordinateSystem;null!=l&&h.getOtherAxis&&(a=h.getOtherAxis(r).inverse),l=t.getData().mapDimension(l),o={thisAxis:r,series:t,thisDim:n,otherDim:l,otherAxisInverse:a}}}),this)}),this),o}},o.prototype._renderHandle=function(){var t=this.group,e=this._displayables,o=e.handles=[null,null],i=e.handleLabels=[null,null],n=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,h=this.api,d=l.get("borderRadius")||0,p=l.get("brushSelect"),u=e.filler=new $({silent:p,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});n.add(u),n.add(new $({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:d},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),a([0,1],(function(e){var a=l.get("handleIcon");!g[a]&&a.indexOf("path://")<0&&a.indexOf("image://")<0&&(a="path://"+a,f("handleIcon now needs 'path://' prefix when using a path string"));var s=m(a,-1,0,2,2,null,!0);s.attr({cursor:at(this._orient),draggable:!0,drift:r(this._onDragMove,this,e),ondragend:r(this._onDragEnd,this),onmouseover:r(this._showDataInfo,this,!0),onmouseout:r(this._showDataInfo,this,!1),z2:5});var h=s.getBoundingRect(),d=l.get("handleSize");this._handleHeight=v(d,this._size[1]),this._handleWidth=h.width/h.height*this._handleHeight,s.setStyle(l.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),y(s);var p=l.get("handleColor");null!=p&&(s.style.fill=p),n.add(o[e]=s);var u=l.getModel("textStyle");t.add(i[e]=new _({silent:!0,invisible:!0,style:x(u,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:u.getTextColor(),font:u.getFont()}),z2:10}))}),this);var c=u;if(p){var S=v(l.get("moveHandleSize"),s[1]),b=e.moveHandle=new w({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:S}}),M=.8*S,D=e.moveHandleIcon=m(l.get("moveHandleIcon"),-M/2,-M/2,M,M,"#fff",!0);D.silent=!0,D.y=s[1]+S/2-.5,b.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var I=Math.min(s[1]/2,Math.max(S,10));(c=e.moveZone=new w({invisible:!0,shape:{y:s[1]-I,height:S+I}})).on("mouseover",(function(){h.enterEmphasis(b)})).on("mouseout",(function(){h.leaveEmphasis(b)})),n.add(b),n.add(D),n.add(c)}c.attr({draggable:!0,cursor:at(this._orient),drift:r(this._onDragMove,this,"all"),ondragstart:r(this._showDataInfo,this,!0),ondragend:r(this._onDragEnd,this),onmouseover:r(this._showDataInfo,this,!0),onmouseout:r(this._showDataInfo,this,!1)})},o.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[u(t[0],[0,100],e,!0),u(t[1],[0,100],e,!0)]},o.prototype._updateInterval=function(t,e){var o=this.dataZoomModel,i=this._handleEnds,a=this._getViewExtent(),n=o.findRepresentativeAxisProxy().getMinMaxSpan(),s=[0,100];H(e,i,a,o.get("zoomLock")?"all":t,null!=n.minSpan?u(n.minSpan,s,a,!0):null,null!=n.maxSpan?u(n.maxSpan,s,a,!0):null);var r=this._range,l=this._range=S([u(i[0],a,s,!0),u(i[1],a,s,!0)]);return!r||r[0]!==l[0]||r[1]!==l[1]},o.prototype._updateView=function(t){var e=this._displayables,o=this._handleEnds,i=S(o.slice()),n=this._size;a([0,1],(function(t){var i=e.handles[t],a=this._handleHeight;i.attr({scaleX:a/2,scaleY:a/2,x:o[t]+(t?-1:1),y:n[1]/2-a/2})}),this),e.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:n[1]});var s={x:i[0],width:i[1]-i[0]};e.moveHandle&&(e.moveHandle.setShape(s),e.moveZone.setShape(s),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",s.x+s.width/2));for(var r=e.dataShadowSegs,l=[0,i[0],i[1],n[0]],h=0;h<r.length;h++){var d=r[h],p=d.getClipPath();p||(p=new w,d.setClipPath(p)),p.setShape({x:l[h],y:0,width:l[h+1]-l[h],height:n[1]})}this._updateDataInfo(t)},o.prototype._updateDataInfo=function(t){var e=this.dataZoomModel,o=this._displayables,i=o.handleLabels,a=this._orient,n=["",""];if(e.get("showDetail")){var s=e.findRepresentativeAxisProxy();if(s){var r=s.getAxisModel().axis,l=this._range,h=t?s.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:s.getDataValueWindow();n=[this._formatLabel(h[0],r),this._formatLabel(h[1],r)]}}var d=S(this._handleEnds.slice());function p(t){var e=b(o.handles[t].parent,this.group),s=M(0===t?"right":"left",e),r=this._handleWidth/2+5,l=D([d[t]+(0===t?-r:r),this._size[1]/2],e);i[t].setStyle({x:l[0],y:l[1],verticalAlign:a===tt?"middle":s,align:a===tt?s:"center",text:n[t]})}p.call(this,0),p.call(this,1)},o.prototype._formatLabel=function(t,e){var o=this.dataZoomModel,i=o.get("labelFormatter"),a=o.get("labelPrecision");null!=a&&"auto"!==a||(a=e.getPixelPrecision());var n=null==t||isNaN(t)?"":"category"===e.type||"time"===e.type?e.scale.getLabel({value:Math.round(t)}):t.toFixed(Math.min(a,20));return I(i)?i(t,n):Z(i)?i.replace("{value}",n):n},o.prototype._showDataInfo=function(t){t=this._dragging||t;var e=this._displayables,o=e.handleLabels;o[0].attr("invisible",!t),o[1].attr("invisible",!t),e.moveHandle&&this.api[t?"enterEmphasis":"leaveEmphasis"](e.moveHandle,1)},o.prototype._onDragMove=function(t,e,o,i){this._dragging=!0,R(i.event);var a=this._displayables.sliderGroup.getLocalTransform(),n=D([e,o],a,!0),s=this._updateInterval(t,n[0]),r=this.dataZoomModel.get("realtime");this._updateView(!r),s&&r&&this._dispatchZoomAction(!0)},o.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction(!1)},o.prototype._onClickPanel=function(t){var e=this._size,o=this._displayables.sliderGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(o[0]<0||o[0]>e[0]||o[1]<0||o[1]>e[1])){var i=this._handleEnds,a=(i[0]+i[1])/2,n=this._updateInterval("all",o[0]-a);this._updateView(),n&&this._dispatchZoomAction(!1)}},o.prototype._onBrushStart=function(t){var e=t.offsetX,o=t.offsetY;this._brushStart=new z(e,o),this._brushing=!0,this._brushStartTime=+new Date},o.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var o=e.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(o.width)<5)){var i=this._getViewExtent(),a=[0,100];this._range=S([u(o.x,i,a,!0),u(o.x+o.width,i,a,!0)]),this._handleEnds=[o.x,o.x+o.width],this._updateView(),this._dispatchZoomAction(!1)}}}},o.prototype._onBrush=function(t){this._brushing&&(R(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},o.prototype._updateBrushRect=function(t,e){var o=this._displayables,i=this.dataZoomModel,a=o.brushRect;a||(a=o.brushRect=new $({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),o.sliderGroup.add(a)),a.attr("ignore",!1);var n=this._brushStart,s=this._displayables.sliderGroup,r=s.transformCoordToLocal(t,e),l=s.transformCoordToLocal(n.x,n.y),h=this._size;r[0]=Math.max(Math.min(h[0],r[0]),0),a.setShape({x:l[0],y:0,width:r[0]-l[0],height:h[1]})},o.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?it:null,start:e[0],end:e[1]})},o.prototype._findCoordRect=function(){var t,e=B(this.dataZoomModel).infoList;if(!t&&e.length){var o=e[0].model.coordinateSystem;t=o.getRect&&o.getRect()}if(!t){var i=this.api.getWidth(),a=this.api.getHeight();t={x:.2*i,y:.2*a,width:.6*i,height:.6*a}}return t},o.type="dataZoom.slider",o}(P);function st(t){t.registerComponentModel(U),t.registerComponentView(nt),k(t)}function rt(t){L(Q),L(st)}export{rt as install};