1 |
- !function(d){"use strict";var K="ht",S=d[K],c=S.Default,u=Math,m=(u.PI,u.sin,u.cos,u.atan2,u.sqrt,u.max),Y=u.floor,e=(u.round,u.ceil),z=S.Shape,v=(S.Edge,S.List),C=S.Style,M=S.graph,f=c.getInternal(),h=f.ui(),Z=null,p="prototype",Q=d.clearInterval,q=d.setInterval,T=function(u){var X=u.data,g=this.dm();if(X&&"add"===u.kind){var b=g.$1c,W=X instanceof z?"shape.":"edge.";b&&X.s(W+"dash.flow")&&b.indexOf(X)<0&&b.push(X)}"clear"===u.kind&&(g.$1c=[])},A=function(M){var V=M.property,G=M.data,t=M.newValue,U=this.dm().$1c,s=G instanceof z?"s:shape.dash.flow":"s:edge.dash.flow";if(U&&V===s)if(t)U.indexOf(G)<0&&U.push(G);else for(var h=U.length,b=0;h>b;b++)if(U[b]===G){U.splice(b,1);break}},$=M.GraphView[p],l=h.EdgeUI[p],I=h.ShapeUI[p],F=I._80o,U=l._80o,X=S.DataModel[p],b=X.prepareRemove,O=$.setDataModel;C["edge.dash.flow.step"]==Z&&(C["edge.dash.flow.step"]=3),C["shape.dash.flow.step"]==Z&&(C["shape.dash.flow.step"]=3),X.prepareRemove=function(I){b.call(this,I);var W=I._dataModel,C=W.$1c;if(C)for(var E=C.length,w=0;E>w;w++)if(C[w]===I){C.splice(w,1);break}},$.setDataModel=function(Y){var S=this,B=S._dataModel;if(B!==Y){B&&(B.umm(T,S),B.umd(A,S),B.$1c=[]),Y.mm(T,S),Y.md(A,S);var g=Y.$1c=[];Y.each(function(j){var u=j instanceof z?"shape.":"edge.";j.s(u+"dash.flow")&&g.indexOf(j)<0&&g.push(j)}),O.call(S,Y)}},$.setDashFlowInterval=function(q){var u=this,r=u.$2c;u.$2c=q,u.fp("dashFlowInterval",r,q),u.$3c!=Z&&(Q(u.$3c),delete u.$3c,u.enableDashFlow(q))},$.getDashFlowInterval=function(){return this.$2c},$.$4c=function(){var y,C,t,K=this,U=K.tx(),j=K.ty(),n=K._zoom,W=K.getWidth(),J=K.getHeight(),Q={x:-U/n,y:-j/n,width:W/n,height:J/n},N=K.dm().$1c,R=K._56I,d=new v;if(N.forEach(function(C){R[C.getId()]&&(y=K.getDataUI(C),y&&(t=y._79o(),t&&d.add(t)))}),0!==d.size()&&(d.each(function(z){c.intersectsRect(Q,z)&&(C=c.unionRect(C,z))}),C&&(C&&(c.grow(C,m(1,1/n)),C.x=Y(C.x*n)/n,C.y=Y(C.y*n)/n,C.width=e(C.width*n)/n,C.height=e(C.height*n)/n,C=c.intersection(Q,C)),C))){var P=K._canvas.getContext("2d");P.save(),P.lineCap=c.lineCap,P.lineJoin=c.lineJoin,f.translateAndScale(P,U,j,n),P.beginPath(),P.rect(C.x,C.y,C.width,C.height),P.clip(),P.clearRect(C.x,C.y,C.width,C.height),K.$5c(P,C),P.restore()}},$.$5c=function(F,I){var O,w,l=this;l._93db(F),l.each(function(u){l._56I[u._id]&&(O=l.getDataUI(u),O&&(w=O._79o(),(!I||c.intersectsRect(I,w))&&(O.$7c=!0,O._42(F),delete O.$7c)))}),l._92db(F)},$.enableDashFlow=function(C){var I=this;I.$3c==Z&&(I.$3c=q(function(){I.$4c()},C||I.$2c||50))},$.disableDashFlow=function(){var w=this;Q(w.$3c),delete w.$3c};var R=function(){var u=this,r=u._data,l=r instanceof z?"shape.":"edge.",k=r.s(l+"dash.pattern"),g=r.s(l+"dash.flow.reverse");if(k&&r.s(l+"dash")&&r.s(l+"dash.flow")&&u.$7c){var b=u.s(l+"dash.offset")||0,K=r.s(l+"dash.flow.step"),Q=r.getStyleMap(),$=0;k.forEach(function(n){$+=n}),g&&(K=-K),b-=K,b%=$,Q||(r._styleMap=Q={}),Q[l+"dash.offset"]=b}};l._80o=function(i){U.call(this,i),R.call(this)},I._80o=function(t){F.call(this,t),R.call(this)}}("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:this,Object);
|