diff --git a/dist/index.html b/dist/index.html index 60935942..8cfa0ac2 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -
1&&i>0?s:o}};return a;function o(){return t =2){if(i){var a=fy(r,i,n,t.smoothConstraint);e.moveTo(r[0][0],r[0][1]);for(var o=r.length,s=0;s<(n?o:o-1);s++){var l=a[2*s],u=a[2*s+1],c=r[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{e.moveTo(r[0][0],r[0][1]);s=1;for(var d=r.length;sm[1]&&(m[1]=f)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var i=this._provider,r=this._chunks,a=this._dimensions,o=a.length,s=this._rawExtent,l=ie(a,(function(e){return e.property})),u=0;uc[1]&&(c[1]=g),d[h++]=v}return r._count=h,r._indices=d,r._updateGetRawIdx(),r},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,i=this._chunks,r=0,a=this.count();rs&&(s=c)}return i=[o,s],this._extent[e]=i,i},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],i=this._chunks,r=0;r0&&e.arc(c+U.cx,d+U.cy,G,Jv(U.y0,U.x0),Jv(U.y1,U.x1),!h),e.arc(c,d,r,Jv(U.cy+U.y1,U.cx+U.x1),Jv(q.cy+q.y1,q.cx+q.x1),h),W>0&&e.arc(c+q.cx,d+q.cy,W,Jv(q.y1,q.x1),Jv(q.y0,q.x0),!h))}else e.lineTo(c+P,d+E),e.arc(c,d,r,u,l,h);else e.lineTo(c+P,d+E)}else e.moveTo(c,d);e.closePath()}}}var ly=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0}return e}(),uy=function(e){function t(t){return e.call(this,t)||this}return Ge(t,e),t.prototype.getDefaultShape=function(){return new ly},t.prototype.buildPath=function(e,t){sy(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Ou);uy.prototype.type="sector";var cy=uy,dy=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),hy=function(e){function t(t){return e.call(this,t)||this}return Ge(t,e),t.prototype.getDefaultShape=function(){return new dy},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=2*Math.PI;e.moveTo(n+t.r,i),e.arc(n,i,t.r,0,r,!1),e.moveTo(n+t.r0,i),e.arc(n,i,t.r0,0,r,!0)},t}(Ou);hy.prototype.type="ring";var py=hy;function fy(e,t,n,i){var r,a,o,s,l=[],u=[],c=[],d=[];if(i){o=[1/0,1/0],s=[-1/0,-1/0];for(var h=0,p=e.length;hi&&(i=o));var l=e.area*e.area,u=t*t*n;return l?IR(u*i/l,l/(u*r)):1/0}function WR(e,t,n,i,r){var a=t===n.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=n[s[a]],c=t?e.area/t:0;(r||c>n[l[o]])&&(c=n[l[o]]);for(var d=0,h=e.length;d=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function tH(e,t){var n=[],i=wi,r=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[Xe(l[0]),Xe(l[1])],l[2]&&l.__original.push(Xe(l[2])));var d=l.__original;if(null!=l[2]){if(qe(r[0],d[0]),qe(r[1],d[2]),qe(r[2],d[1]),u&&"none"!==u){var h=gj(e.node1),p=eH(r,d[0],h*t);i(r[0][0],r[1][0],r[2][0],p,n),r[0][0]=n[3],r[1][0]=n[4],i(r[0][1],r[1][1],r[2][1],p,n),r[0][1]=n[3],r[1][1]=n[4]}if(c&&"none"!==c){h=gj(e.node2),p=eH(r,d[1],h*t);i(r[0][0],r[1][0],r[2][0],p,n),r[1][0]=n[1],r[2][0]=n[2],i(r[0][1],r[1][1],r[2][1],p,n),r[1][1]=n[1],r[2][1]=n[2]}qe(l[0],r[0]),qe(l[1],r[2]),qe(l[2],r[1])}else{if(qe(a[0],d[0]),qe(a[1],d[1]),Qe(o,a[1],a[0]),lt(o,o),u&&"none"!==u){h=gj(e.node1);Je(a[0],a[0],o,h*t)}if(c&&"none"!==c){h=gj(e.node2);Je(a[1],a[1],o,-h*t)}qe(l[0],a[0]),qe(l[1],a[1])}}))}function nH(e){return"view"===e.type}var iH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(e,t){var n=new HT,i=new Uj,r=this.group;this._controller=new NP(t.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},t.prototype.render=function(e,t,n){var i=this,r=e.coordinateSystem;this._model=e;var a=this._symbolDraw,o=this._lineDraw,s=this.group;if(nH(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):Ad(s,l,e)}tH(e.getGraph(),mj(e));var u=e.getData();a.updateData(u);var c=e.getEdgeData();o.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,t,n),clearTimeout(this._layoutTimeout);var d=e.forceLayout,h=e.get(["force","layoutAnimation"]);d&&this._startForceLayoutIteration(d,h);var p=e.get("layout");u.graph.eachNode((function(t){var n=t.dataIndex,r=t.getGraphicEl(),a=t.getModel();if(r){r.off("drag").off("dragend");var o=a.get("draggable");o&&r.on("drag",(function(a){switch(p){case"force":d.warmUp(),!i._layouting&&i._startForceLayoutIteration(d,h),d.setFixed(n),u.setItemLayout(n,[r.x,r.y]);break;case"circular":u.setItemLayout(n,[r.x,r.y]),t.setLayout({fixed:!0},!0),_j(e,"symbolSize",t,[a.offsetX,a.offsetY]),i.updateLayout(e);break;case"none":default:u.setItemLayout(n,[r.x,r.y]),pj(e.getGraph(),e),i.updateLayout(e);break}})).on("dragend",(function(){d&&d.setUnfixed(n)})),r.setDraggable(o,!!a.get("cursor"));var s=a.get(["emphasis","focus"]);"adjacency"===s&&(pc(r).focus=t.getAdjacentDataIndices())}})),u.graph.eachEdge((function(e){var t=e.getGraphicEl(),n=e.getModel().get(["emphasis","focus"]);t&&"adjacency"===n&&(pc(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})}));var f="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),m=u.getLayout("cx"),g=u.getLayout("cy");u.graph.eachNode((function(e){xj(e,f,m,g)})),this._firstRender=!1},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,t){var n=this;(function i(){e.step((function(e){n.updateLayout(n._model),(n._layouting=!e)&&(t?n._layoutTimeout=setTimeout(i,16):i())}))})()},t.prototype._updateController=function(e,t,n){var i=this,r=this._controller,a=this._controllerHost,o=this.group;r.setPointerChecker((function(t,i,r){var a=o.getBoundingRect();return a.applyTransform(o.transform),a.contain(i,r)&&!FP(t,n,e)})),nH(e.coordinateSystem)?(r.enable(e.get("roam")),a.zoomLimit=e.get("scaleLimit"),a.zoom=e.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",(function(t){RP(a,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){jP(a,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),i._updateNodeAndLinkScale(),tH(e.getGraph(),mj(e)),i._lineDraw.updateLayout(),n.updateLabelLayout()}))):r.disable()},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=mj(e);t.eachItemGraphicEl((function(e,t){e&&e.setSymbolScale(n)}))},t.prototype.updateLayout=function(e){tH(e.getGraph(),mj(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph",t}(R_),rH=iH;function aH(e){return"_EC_"+e}var oH=function(){function e(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(e,t){e=null==e?""+t:""+e;var n=this._nodesMap;if(!n[aH(e)]){var i=new sH(e,t);return i.hostGraph=this,this.nodes.push(i),n[aH(e)]=i,i}},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[aH(e)]},e.prototype.addEdge=function(e,t,n){var i=this._nodesMap,r=this._edgesMap;if(me(e)&&(e=this.nodes[e]),me(t)&&(t=this.nodes[t]),e instanceof sH||(e=i[aH(e)]),t instanceof sH||(t=i[aH(t)]),e&&t){var a=e.id+"-"+t.id,o=new lH(e,t,n);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),r[a]=o,o}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof sH&&(e=e.id),t instanceof sH&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},e.prototype.eachNode=function(e,t){for(var n=this.nodes,i=n.length,r=0;r=0&&e.call(t,n[r],r)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,i=n.length,r=0;r=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&e.call(t,n[r],r)},e.prototype.breadthFirstTraverse=function(e,t,n,i){if(t instanceof sH||(t=this._nodesMap[aH(t)]),t){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",a=0;anz)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==r.behavior&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&az(this,"mousemove")){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function az(e,t){var n=e._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===t}var oz=iz,sz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return g(t,e),t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(e){var t=this.option;e&&U(t,e,!0),this._initDimensions()},t.prototype.contains=function(e,t){var n=e.get("parallelIndex");return null!=n&&t.getComponent("parallel",n)===this},t.prototype.setAxisExpand=function(e){ne(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])}),this)},t.prototype._initDimensions=function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[],n=ae(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this);ne(n,(function(n){e.push("dim"+n.get("dim")),t.push(n.componentIndex)}))},t.type="parallel",t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},t}(zp),lz=sz,uz=function(e){function t(t,n,i,r,a){var o=e.call(this,t,n,i)||this;return o.type=r||"value",o.axisIndex=a,o}return g(t,e),t.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},t}(ZC),cz=uz;function dz(e,t,n,i,r,a){e=e||0;var o=n[1]-n[0];if(null!=r&&(r=pz(r,[0,o])),null!=a&&(a=Math.max(a,null!=r?r:0)),"all"===i){var s=Math.abs(t[1]-t[0]);s=pz(s,[0,o]),r=a=pz(s,[r,a]),i=0}t[0]=pz(t[0],n),t[1]=pz(t[1],n);var l=hz(t,i);t[i]+=e;var u,c=r||0,d=n.slice();return l.sign<0?d[0]+=c:d[1]-=c,t[i]=pz(t[i],d),u=hz(t,i),null!=r&&(u.sign!==l.sign||u.span