From e5b7c5aadcf24efccf46a450f7eeb036b23458d7 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 17 Feb 2012 06:37:00 +0100 Subject: SONAR-3059 Remove the Javascript Infovis Toolkit 1.3.x from the sonar bundle --- sonar-server/src/main/webapp/javascripts/jit-yc.js | 2161 -------------------- 1 file changed, 2161 deletions(-) delete mode 100644 sonar-server/src/main/webapp/javascripts/jit-yc.js diff --git a/sonar-server/src/main/webapp/javascripts/jit-yc.js b/sonar-server/src/main/webapp/javascripts/jit-yc.js deleted file mode 100644 index 70d994d3766..00000000000 --- a/sonar-server/src/main/webapp/javascripts/jit-yc.js +++ /dev/null @@ -1,2161 +0,0 @@ -(function(){function B(){}function C(W,U){for(var V in (U||{})){W[V]=U[V] -}return W -}function M(U){return(typeof U=="function")?U:function(){return U -} -}var K=Date.now||function(){return +new Date -}; -function J(V){var U=H(V); -return(U)?((U!="array")?[V]:V):[] -}var H=function(U){return H.s.call(U).match(/^\[object\s(.*)\]$/)[1].toLowerCase() -}; -H.s=Object.prototype.toString; -function G(Y,X){var W=H(Y); -if(W=="object"){for(var V in Y){X(Y[V],V) -}}else{for(var U=0; -U-1 -}function P(V,U){if(!S(V,U)){V.className=(V.className+" "+U) -}}function A(V,U){V.className=V.className.replace(new RegExp("(^|\\s)"+U+"(?:\\s|$)"),"$1") -}function E(U){return document.getElementById(U) -}var O=function(V){V=V||{}; -var U=function(){this.constructor=U; -if(O.prototyping){return this -}var X=(this.initialize)?this.initialize.apply(this,arguments):this; -return X -}; -for(var W in O.Mutators){if(!V[W]){continue -}V=O.Mutators[W](V,V[W]); -delete V[W] -}C(U,this); -U.constructor=O; -U.prototype=V; -return U -}; -O.Mutators={Extends:function(W,U){O.prototyping=U.prototype; -var V=new U; -delete V.parent; -V=O.inherit(V,W); -delete O.prototyping; -return V -},Implements:function(U,V){G(J(V),function(W){O.prototying=W; -C(U,(H(W)=="function")?new W:W); -delete O.prototyping -}); -return U -}}; -C(O,{inherit:function(V,Y){var U=arguments.callee.caller; -for(var X in Y){var W=Y[X]; -var a=V[X]; -var Z=H(W); -if(a&&Z=="function"){if(W!=a){if(U){W.__parent=a; -V[X]=W -}else{O.override(V,X,W) -}}}else{if(Z=="object"){V[X]=R(a,W) -}else{V[X]=W -}}}if(U){V.parent=function(){return arguments.callee.caller.__parent.apply(this,arguments) -} -}return V -},override:function(V,U,Y){var X=O.prototyping; -if(X&&V[U]!=X[U]){X=null -}var W=function(){var Z=this.parent; -this.parent=X?X[U]:V[U]; -var a=Y.apply(this,arguments); -this.parent=Z; -return a -}; -V[U]=W -}}); -O.prototype.implement=function(){var U=this.prototype; -G(Array.prototype.slice.call(arguments||[]),function(V){O.inherit(U,V) -}); -return this -}; -this.TreeUtil={prune:function(V,U){this.each(V,function(X,W){if(W==U&&X.children){delete X.children; -X.children=[] -}}) -},getParent:function(U,Y){if(U.id==Y){return false -}var X=U.children; -if(X&&X.length>0){for(var W=0; -WX){if(Z>b){Y=V((b+((Z-a)-b)*c)) -}else{Y=V((b-a+(Z-(b-a))*c)) -}}else{Y=V((b+(Z-b)*c)) -}var U=(this.rho-W.rho)*c+W.rho; -return{theta:Y,rho:U} -}}; -var L=function(V,U){return new Polar(V,U) -}; -Polar.KER=L(0,0); -this.Complex=function(U,V){this.x=U; -this.y=V -}; -Complex.prototype={getc:function(){return this -},getp:function(U){return this.toPolar(U) -},set:function(U){U=U.getc(true); -this.x=U.x; -this.y=U.y -},setc:function(U,V){this.x=U; -this.y=V -},setp:function(V,U){this.x=Math.cos(V)*U; -this.y=Math.sin(V)*U -},clone:function(){return new Complex(this.x,this.y) -},toPolar:function(W){var U=this.norm(); -var V=Math.atan2(this.y,this.x); -if(V<0){V+=Math.PI*2 -}if(W){return{theta:V,rho:U} -}return new Polar(V,U) -},norm:function(){return Math.sqrt(this.squaredNorm()) -},squaredNorm:function(){return this.x*this.x+this.y*this.y -},add:function(U){return new Complex(this.x+U.x,this.y+U.y) -},prod:function(U){return new Complex(this.x*U.x-this.y*U.y,this.y*U.x+this.x*U.y) -},conjugate:function(){return new Complex(this.x,-this.y) -},scale:function(U){return new Complex(this.x*U,this.y*U) -},equals:function(U){return this.x==U.x&&this.y==U.y -},$add:function(U){this.x+=U.x; -this.y+=U.y; -return this -},$prod:function(W){var U=this.x,V=this.y; -this.x=U*W.x-V*W.y; -this.y=V*W.x+U*W.y; -return this -},$conjugate:function(){this.y=-this.y; -return this -},$scale:function(U){this.x*=U; -this.y*=U; -return this -},$div:function(X){var U=this.x,W=this.y; -var V=X.squaredNorm(); -this.x=U*X.x+W*X.y; -this.y=W*X.x-U*X.y; -return this.$scale(1/V) -}}; -var Q=function(V,U){return new Complex(V,U) -}; -Complex.KER=Q(0,0); -this.Graph=new O({initialize:function(U){var V={complex:false,Node:{}}; -this.opt=R(V,U||{}); -this.nodes={} -},getNode:function(U){if(this.hasNode(U)){return this.nodes[U] -}return false -},getAdjacence:function(W,U){var V=[]; -if(this.hasNode(W)&&this.hasNode(U)&&this.nodes[W].adjacentTo({id:U})&&this.nodes[U].adjacentTo({id:W})){V.push(this.nodes[W].getAdjacency(U)); -V.push(this.nodes[U].getAdjacency(W)); -return V -}return false -},addNode:function(U){if(!this.nodes[U.id]){this.nodes[U.id]=new Graph.Node(C({id:U.id,name:U.name,data:U.data},this.opt.Node),this.opt.complex) -}return this.nodes[U.id] -},addAdjacence:function(X,W,V){var Y=[]; -if(!this.hasNode(X.id)){this.addNode(X) -}if(!this.hasNode(W.id)){this.addNode(W) -}X=this.nodes[X.id]; -W=this.nodes[W.id]; -for(var U in this.nodes){if(this.nodes[U].id==X.id){if(!this.nodes[U].adjacentTo(W)){Y.push(this.nodes[U].addAdjacency(W,V)) -}}if(this.nodes[U].id==W.id){if(!this.nodes[U].adjacentTo(X)){Y.push(this.nodes[U].addAdjacency(X,V)) -}}}return Y -},removeNode:function(W){if(this.hasNode(W)){var V=this.nodes[W]; -for(var U=0 in V.adjacencies){var adj=V.adjacencies[U]; -this.removeAdjacence(W,adj.nodeTo.id) -}delete this.nodes[W] -}},removeAdjacence:function(Y,X){if(this.hasNode(Y)){this.nodes[Y].removeAdjacency(X) -}if(this.hasNode(X)){this.nodes[X].removeAdjacency(Y) -}},hasNode:function(X){return X in this.nodes -}}); -Graph.Node=new O({initialize:function(X,Z){var Y={id:"",name:"",data:{},adjacencies:{},selected:false,drawn:false,exist:false,angleSpan:{begin:0,end:0},alpha:1,startAlpha:1,endAlpha:1,pos:(Z&&Q(0,0))||L(0,0),startPos:(Z&&Q(0,0))||L(0,0),endPos:(Z&&Q(0,0))||L(0,0)}; -C(this,C(Y,X)) -},adjacentTo:function(X){return X.id in this.adjacencies -},getAdjacency:function(X){return this.adjacencies[X] -},addAdjacency:function(Y,Z){var X=new Graph.Adjacence(this,Y,Z); -return this.adjacencies[Y.id]=X -},removeAdjacency:function(X){delete this.adjacencies[X] -}}); -Graph.Adjacence=function(X,Z,Y){this.nodeFrom=X; -this.nodeTo=Z; -this.data=Y||{}; -this.alpha=1; -this.startAlpha=1; -this.endAlpha=1 -}; -Graph.Util={filter:function(Y){if(!Y||!(H(Y)=="string")){return function(){return true -} -}var X=Y.split(" "); -return function(a){for(var Z=0; -Z=h&&k<=i&&X(j)){c(j,k) -}if(kk){Z(l,h,i) -}}) -}})(b,g+f,Y+f) -},eachSubgraph:function(Y,Z,X){this.eachLevel(Y,0,false,Z,X) -},eachSubnode:function(Y,Z,X){this.eachLevel(Y,1,1,Z,X) -},anySubnode:function(a,Z,Y){var X=false; -Z=Z||M(true); -var b=H(Z)=="string"?function(c){return c[Z] -}:Z; -this.eachSubnode(a,function(c){if(b(c)){X=true -}},Y); -return X -},getSubnodes:function(c,d,X){var Z=[],b=this; -d=d||0; -var a,Y; -if(H(d)=="array"){a=d[0]; -Y=d[1] -}else{a=d; -Y=Number.MAX_VALUE-c._depth -}this.eachLevel(c,a,Y,function(e){Z.push(e) -},X); -return Z -},getParents:function(Y){var X=[]; -this.eachAdjacency(Y,function(Z){var a=Z.nodeTo; -if(a._depth=0.95){c.plotLabel(Z,h,Y) -}else{c.hideLabel(h,false) -}}f.restore(); -h.visited=!a -}) -},plotLabel:function(a,b,Z){var c=b.id,X=this.getLabel(c); -if(!X&&!(X=document.getElementById(c))){X=document.createElement("div"); -var Y=this.getLabelContainer(); -Y.appendChild(X); -X.id=c; -X.className="node"; -X.style.position="absolute"; -Z.onCreateLabel(X,b); -this.labels[b.id]=X -}this.placeLabel(X,b,Z) -},plotNode:function(Z,Y,h){var e=this.node,b=Z.data; -var d=e.overridable&&b; -var X=d&&b.$lineWidth||e.lineWidth; -var a=d&&b.$color||e.color; -var g=Y.getCtx(); -g.lineWidth=X; -g.fillStyle=a; -g.strokeStyle=a; -var c=Z.data&&Z.data.$type||e.type; -this.nodeTypes[c].call(this,Z,Y,h) -},plotLine:function(e,Z,h){var X=this.edge,b=e.data; -var d=X.overridable&&b; -var Y=d&&b.$lineWidth||X.lineWidth; -var a=d&&b.$color||X.color; -var g=Z.getCtx(); -g.lineWidth=Y; -g.fillStyle=a; -g.strokeStyle=a; -var c=e.data&&e.data.$type||X.type; -this.edgeTypes[c].call(this,e,Z,h) -},fitsInCanvas:function(Z,X){var Y=X.getSize(); -if(Z.x>=Y.width||Z.x<0||Z.y>=Y.height||Z.y<0){return false -}return true -}}; -var Loader={construct:function(Y){var Z=(H(Y)=="array"); -var X=new Graph(this.graphOptions); -if(!Z){(function(a,c){a.addNode(c); -for(var b=0,d=c.children; -b=(7-4*c)/11){d=Z*Z-Math.pow((11-6*c-11*e)/4,2); -break -}}return d -},Elastic:function(a,Z){return Math.pow(2,10*--a)*Math.cos(20*a*Math.PI*(Z[0]||1)/3) -}}; -G(Y,function(a,Z){Trans[Z]=X(a) -}); -G(["Quad","Cubic","Quart","Quint"],function(a,Z){Trans[a]=X(function(b){return Math.pow(b,[Z+2]) -}) -}) -})(); -var Animation=new O({initalize:function(X){this.setOptions(X) -},setOptions:function(X){var Y={duration:2500,fps:40,transition:Trans.Quart.easeInOut,compute:B,complete:B}; -this.opt=R(Y,X||{}); -return this -},getTime:function(){return K() -},step:function(){var Y=this.getTime(),X=this.opt; -if(Y0)?r[0]:null; -q(r) -}for(var l=0,m=[p.id].concat(j); -l=i._depth) -}); -for(var p=0; -p0&&i.drawn){i.drawn=false; -k[n.id].push(i) -}else{if((!s||!q)&&i.drawn){i.drawn=false; -k[n.id].push(i) -}}}); -n.drawn=true -}if(j.length>0){t.fx.plot() -}for(o in k){G(k[o],function(i){i.drawn=true -}) -}for(o=0; -oi?k:i)+this.config.subtreeOffset -},getEdge:function(i,n,q){var m=function(s,r){return function(){return i.pos.add(new Complex(s,r)) -} -}; -var l=this.node; -var o=this.node.overridable,j=i.data; -var p=o&&j.$width||l.width; -var k=o&&j.$height||l.height; -if(n=="begin"){if(l.align=="center"){return this.dispatch(q,m(0,k/2),m(-p/2,0),m(0,-k/2),m(p/2,0)) -}else{if(l.align=="left"){return this.dispatch(q,m(0,k),m(0,0),m(0,0),m(p,0)) -}else{if(l.align=="right"){return this.dispatch(q,m(0,0),m(-p,0),m(0,-k),m(0,0)) -}else{throw"align: not implemented" -}}}}else{if(n=="end"){if(l.align=="center"){return this.dispatch(q,m(0,-k/2),m(p/2,0),m(0,k/2),m(-p/2,0)) -}else{if(l.align=="left"){return this.dispatch(q,m(0,0),m(p,0),m(0,k),m(0,0)) -}else{if(l.align=="right"){return this.dispatch(q,m(0,-k),m(0,0),m(0,0),m(-p,0)) -}else{throw"align: not implemented" -}}}}}},getScaledTreePosition:function(i,j){var l=this.node; -var o=this.node.overridable,k=i.data; -var p=(o&&k.$width||l.width); -var m=(o&&k.$height||l.height); -var q=(this.config.multitree&&("$orn" in i.data)&&i.data.$orn)||this.config.orientation; -var n=function(s,r){return function(){return i.pos.add(new Complex(s,r)).$scale(1-j) -} -}; -if(l.align=="left"){return this.dispatch(q,n(0,m),n(0,0),n(0,0),n(p,0)) -}else{if(l.align=="center"){return this.dispatch(q,n(0,m/2),n(-p/2,0),n(0,-m/2),n(p/2,0)) -}else{if(l.align=="right"){return this.dispatch(q,n(0,0),n(-p,0),n(0,-m),n(0,0)) -}else{throw"align: not implemented" -}}}},treeFitsInCanvas:function(n,i,o){var k=i.getSize(n); -var l=(this.config.multitree&&("$orn" in n.data)&&n.data.$orn)||this.config.orientation; -var j=this.dispatch(l,k.width,k.height); -var m=this.getTreeBaseSize(n,o,function(q,p){return q===0||!Graph.Util.anySubnode(p) -}); -return(ml){o.drawn=false; -o.exist=false; -j.hideLabel(o,false) -}else{o.exist=true -}}); -k.drawn=true -},getRightLevelToShow:function(l,j){var i=this.config; -var m=i.levelsToShow; -var k=i.constrained; -if(!k){return m -}while(!this.treeFitsInCanvas(l,j,m)&&m>1){m-- -}return m -}}); -ST.Plot=new O({Implements:Graph.Plot,initialize:function(i){this.viz=i; -this.config=i.config; -this.node=this.config.Node; -this.edge=this.config.Edge; -this.animation=new Animation; -this.nodeTypes=new ST.Plot.NodeTypes; -this.edgeTypes=new ST.Plot.EdgeTypes -},plotSubtree:function(n,m,p,k){var i=this.viz,l=i.canvas; -p=Math.min(Math.max(0.001,p),1); -if(p>=0){n.drawn=false; -var j=l.getCtx(); -var o=i.geom.getScaledTreePosition(n,p); -j.translate(o.x,o.y); -j.scale(p,p) -}this.plotTree(n,!p,m,k); -if(p>=0){n.drawn=true -}},plotTree:function(l,m,i,s){var o=this,q=this.viz,j=q.canvas,k=this.config,r=j.getCtx(); -var p=k.multitree&&!("$orn" in l.data); -var n=p&&l.data.$orns; -Graph.Util.eachSubnode(l,function(u){if((!p||n.indexOf(u.data.$orn)>0)&&u.exist&&u.drawn){var t=l.getAdjacency(u.id); -!s&&i.onBeforePlotLine(t); -r.globalAlpha=Math.min(l.alpha,u.alpha); -o.plotLine(t,j,s); -!s&&i.onAfterPlotLine(t); -o.plotTree(u,m,i,s) -}}); -if(l.drawn){r.globalAlpha=l.alpha; -!s&&i.onBeforePlotNode(l); -this.plotNode(l,j,s); -!s&&i.onAfterPlotNode(l); -if(m&&r.globalAlpha>=0.95){this.plotLabel(j,l,i) -}else{this.hideLabel(l,false) -}}else{this.hideLabel(l,true) -}},placeLabel:function(t,l,o){var r=l.pos.getc(true),m=this.node,j=this.viz.canvas; -var s=m.overridable&&l.data.$width||m.width; -var n=m.overridable&&l.data.$height||m.height; -var p=j.getSize(); -var k,q; -if(m.align=="center"){k={x:Math.round(r.x-s/2+p.width/2),y:Math.round(r.y-n/2+p.height/2)} -}else{if(m.align=="left"){q=this.config.orientation; -if(q=="bottom"||q=="top"){k={x:Math.round(r.x-s/2+p.width/2),y:Math.round(r.y+p.height/2)} -}else{k={x:Math.round(r.x+p.width/2),y:Math.round(r.y-n/2+p.height/2)} -}}else{if(m.align=="right"){q=this.config.orientation; -if(q=="bottom"||q=="top"){k={x:Math.round(r.x-s/2+p.width/2),y:Math.round(r.y-n+p.height/2)} -}else{k={x:Math.round(r.x-s+p.width/2),y:Math.round(r.y-n/2+p.height/2)} -}}else{throw"align: not implemented" -}}}var i=t.style; -i.left=k.x+"px"; -i.top=k.y+"px"; -i.display=this.fitsInCanvas(k,j)?"":"none"; -o.onPlaceLabel(t,l) -},getAlignedPos:function(n,l,i){var k=this.node; -var m,j; -if(k.align=="center"){m={x:n.x-l/2,y:n.y-i/2} -}else{if(k.align=="left"){j=this.config.orientation; -if(j=="bottom"||j=="top"){m={x:n.x-l/2,y:n.y} -}else{m={x:n.x,y:n.y-i/2} -}}else{if(k.align=="right"){j=this.config.orientation; -if(j=="bottom"||j=="top"){m={x:n.x-l/2,y:n.y-i} -}else{m={x:n.x-l,y:n.y-i/2} -}}else{throw"align: not implemented" -}}}return m -},getOrientation:function(i){var k=this.config; -var j=k.orientation; -if(k.multitree){var l=i.nodeFrom; -var m=i.nodeTo; -j=(("$orn" in l.data)&&l.data.$orn)||(("$orn" in m.data)&&m.data.$orn) -}return j -}}); -ST.Plot.NodeTypes=new O({none:function(){},circle:function(m,j){var p=m.pos.getc(true),l=this.node,n=m.data; -var k=l.overridable&&n; -var o=k&&n.$dim||l.dim; -var i=this.getAlignedPos(p,o*2,o*2); -j.path("fill",function(q){q.arc(i.x+o,i.y+o,o,0,Math.PI*2,true) -}) -},square:function(m,j){var p=m.pos.getc(true),l=this.node,n=m.data; -var k=l.overridable&&n; -var o=k&&n.$dim||l.dim; -var i=this.getAlignedPos(p,o,o); -j.getCtx().fillRect(i.x,i.y,o,o) -},ellipse:function(k,j){var n=k.pos.getc(true),o=this.node,l=k.data; -var m=o.overridable&&l; -var i=(m&&l.$width||o.width)/2; -var q=(m&&l.$height||o.height)/2; -var p=this.getAlignedPos(n,i*2,q*2); -var r=j.getCtx(); -r.save(); -r.scale(i/q,q/i); -j.path("fill",function(s){s.arc((p.x+i)*(q/i),(p.y+q)*(i/q),q,0,Math.PI*2,true) -}); -r.restore() -},rectangle:function(k,j){var n=k.pos.getc(true),o=this.node,l=k.data; -var m=o.overridable&&l; -var i=m&&l.$width||o.width; -var q=m&&l.$height||o.height; -var p=this.getAlignedPos(n,i,q); -j.getCtx().fillRect(p.x,p.y,i,q) -}}); -ST.Plot.EdgeTypes=new O({none:function(){},line:function(j,l){var k=this.getOrientation(j); -var n=j.nodeFrom,o=j.nodeTo; -var m=this.viz.geom.getEdge(n._depth1){var k={}; -k[u.id]=u; -k[m.id]=m; -var v=z.$direction; -u=k[v[0]]; -m=k[v[1]] -}var n=this.viz.geom.getEdge(u,"begin",w); -var s=this.viz.geom.getEdge(m,"end",w); -var t=new Complex(s.x-n.x,s.y-n.y); -t.$scale(o/t.norm()); -var x=new Complex(s.x-t.x,s.y-t.y); -var y=new Complex(-t.y/2,t.x/2); -var j=x.add(y),i=x.$add(y.$scale(-1)); -l.path("stroke",function(AA){AA.moveTo(n.x,n.y); -AA.lineTo(s.x,s.y) -}); -l.path("fill",function(AA){AA.moveTo(j.x,j.y); -AA.lineTo(i.x,i.y); -AA.lineTo(s.x,s.y) -}) -}}) -})(); -var AngularWidth={setAngularWidthForNodes:function(){var X=this.config.Node; -var Z=X.overridable; -var Y=X.dim; -Graph.Util.eachBFS(this.graph,this.root,function(c,a){var b=(Z&&c.data&&c.data.$aw)||Y; -c._angularWidth=b/a -},"ignore") -},setSubtreesAngularWidth:function(){var X=this; -Graph.Util.eachNode(this.graph,function(Y){X.setSubtreeAngularWidth(Y) -},"ignore") -},setSubtreeAngularWidth:function(a){var Z=this,Y=a._angularWidth,X=0; -Graph.Util.eachSubnode(a,function(b){Z.setSubtreeAngularWidth(b); -X+=b._treeAngularWidth -},"ignore"); -a._treeAngularWidth=Math.max(Y,X) -},computeAngularWidths:function(){this.setAngularWidthForNodes(); -this.setSubtreesAngularWidth() -}}; -this.RGraph=new O({Implements:[Loader,AngularWidth],initialize:function(a,X){var Z={labelContainer:a.id+"-label",interpolation:"linear",levelDistance:100,withLabels:true,Node:{overridable:false,type:"circle",dim:3,color:"#ccb",width:5,height:5,lineWidth:1},Edge:{overridable:false,type:"line",color:"#ccb",lineWidth:1},fps:40,duration:2500,transition:Trans.Quart.easeInOut,clearCanvas:true}; -var Y={onBeforeCompute:B,onAfterCompute:B,onCreateLabel:B,onPlaceLabel:B,onComplete:B,onBeforePlotLine:B,onAfterPlotLine:B,onBeforePlotNode:B,onAfterPlotNode:B}; -this.controller=this.config=R(Z,Y,X); -this.graphOptions={complex:false,Node:{selected:false,exist:true,drawn:true}}; -this.graph=new Graph(this.graphOptions); -this.fx=new RGraph.Plot(this); -this.op=new RGraph.Op(this); -this.json=null; -this.canvas=a; -this.root=null; -this.busy=false; -this.parent=false -},refresh:function(){this.compute(); -this.plot() -},reposition:function(){this.compute("endPos") -},plot:function(){this.fx.plot() -},compute:function(Y){var Z=Y||["pos","startPos","endPos"]; -var X=this.graph.getNode(this.root); -X._depth=0; -Graph.Util.computeLevels(this.graph,this.root,0,"ignore"); -this.computeAngularWidths(); -this.computePositions(Z) -},computePositions:function(e){var Y=J(e); -var d=this.graph; -var c=Graph.Util; -var X=this.graph.getNode(this.root); -var b=this.parent; -var Z=this.config; -for(var a=0; -a0&&f[0].dist){f.sort(function(k,i){return(k.dist>=i.dist)-(k.dist<=i.dist) -}) -}for(var l=0; -l0)?b[0]:false; -if(a){var X=a.pos.getc(),c=d.pos.getc(); -var Y=X.add(c.scale(-1)); -Z=Math.atan2(Y.y,Y.x); -if(Z<0){Z+=2*Math.PI -}}return{parent:a,theta:Z} -},tagChildren:function(b,d){if(b.angleSpan){var c=[]; -Graph.Util.eachAdjacency(b,function(e){c.push(e.nodeTo) -},"ignore"); -var X=c.length; -for(var a=0; -a1){var Y={}; -Y[d.id]=d; -Y[a.id]=a; -var Z=e.$direction; -d=Y[Z[0]]; -a=Y[Z[1]] -}var n=d.pos.getc(true),c=a.pos.getc(true); -var h=new Complex(c.x-n.x,c.y-n.y); -h.$scale(l/h.norm()); -var f=new Complex(c.x-h.x,c.y-h.y); -var g=new Complex(-h.y/2,h.x/2); -var m=f.add(g),k=f.$add(g.$scale(-1)); -b.path("stroke",function(o){o.moveTo(n.x,n.y); -o.lineTo(c.x,c.y) -}); -b.path("fill",function(o){o.moveTo(m.x,m.y); -o.lineTo(k.x,k.y); -o.lineTo(c.x,c.y) -}) -}}); -Complex.prototype.moebiusTransformation=function(Z){var X=this.add(Z); -var Y=Z.$conjugate().$prod(this); -Y.x++; -return X.$div(Y) -}; -Graph.Util.getClosestNodeToOrigin=function(Y,Z,X){return this.getClosestNodeToPos(Y,Polar.KER,Z,X) -}; -Graph.Util.getClosestNodeToPos=function(Z,c,b,X){var Y=null; -b=b||"pos"; -c=c&&c.getc(true)||Complex.KER; -var a=function(e,d){var g=e.x-d.x,f=e.y-d.y; -return g*g+f*f -}; -this.eachNode(Z,function(d){Y=(Y==null||a(d[b].getc(true),c)l)?i._depth:l; -i._scale=Z -},"ignore"); -for(var k=0.51; -k<=1; -k+=0.01){var j=(function(i,m){return(1-Math.pow(i,m))/(1-i) -})(k,l+1); -if(j>=2){return k-0.01 -}}return 0.5 -})(); -d.eachBFS(this.graph,this.root,function(o){var k=o.angleSpan.end-o.angleSpan.begin; -var p=o.angleSpan.begin; -var n=(function(i){var r=0; -d.eachSubnode(i,function(s){r+=s._treeAngularWidth -},"ignore"); -return r -})(o); -for(var m=1,j=0,l=Y,q=o._depth; -m<=q+1; -m++){j+=l; -l*=Y -}d.eachSubnode(o,function(u){if(!u._flag){u._rel=u._treeAngularWidth/n; -var t=u._rel*k; -var s=p+t/2; -for(var r=0; -r1000||d.b>1000||d.ratio>1000){a.path("stroke",function(l){l.moveTo(j.x*c,j.y*c); -l.lineTo(e.x*c,e.y*c) -}) -}else{var h=Math.atan2(e.y-d.y,e.x-d.x); -var g=Math.atan2(j.y-d.y,j.x-d.x); -var Y=this.sense(h,g); -var X=a.getCtx(); -a.path("stroke",function(l){l.arc(d.x*c,d.y*c,d.ratio*c,h,g,Y) -}) -}},computeArcThroughTwoPoints:function(l,k){var d=(l.x*k.y-l.y*k.x),X=d; -var c=l.squaredNorm(),Z=k.squaredNorm(); -if(d==0){return{x:0,y:0,ratio:1001} -}var j=(l.y*Z-k.y*c+l.y-k.y)/d; -var h=(k.x*c-l.x*Z+k.x-l.x)/X; -var i=-j/2; -var g=-h/2; -var f=(j*j+h*h)/4-1; -if(f<0){return{x:0,y:0,ratio:1001} -}var e=Math.sqrt(f); -var Y={x:i,y:g,ratio:e,a:j,b:h}; -return Y -},sense:function(X,Y){return(XY)?false:true):((Y+Math.PI>X)?true:false) -},placeLabel:function(f,a,c){var e=a.pos.getc(true),Y=this.viz.canvas; -var d=Y.getSize(); -var b=a._scale; -var Z={x:Math.round(e.x*b+d.width/2),y:Math.round(e.y*b+d.height/2)}; -var X=f.style; -X.left=Z.x+"px"; -X.top=Z.y+"px"; -X.display=""; -c.onPlaceLabel(f,a) -}}); -Hypertree.Plot.NodeTypes=new O({none:function(){},circle:function(a,Y){var Z=this.node,c=a.data; -var b=Z.overridable&&c&&c.$dim||Z.dim; -var d=a.pos.getc(),e=d.scale(a._scale); -var X=Z.transform?b*(1-d.squaredNorm()):b; -if(X>=b/4){Y.path("fill",function(f){f.arc(e.x,e.y,X,0,Math.PI*2,true) -}) -}},square:function(a,Z){var f=this.node,c=a.data; -var X=f.overridable&&c&&c.$dim||f.dim; -var Y=a.pos.getc(),e=Y.scale(a._scale); -var d=f.transform?X*(1-Y.squaredNorm()):X; -var b=2*d; -if(d>=X/4){Z.getCtx().fillRect(e.x-d,e.y-d,b,b) -}},rectangle:function(a,Z){var e=this.node,b=a.data; -var Y=e.overridable&&b&&b.$width||e.width; -var f=e.overridable&&b&&b.$height||e.height; -var X=a.pos.getc(),d=X.scale(a._scale); -var c=1-X.squaredNorm(); -Y=e.transform?Y*c:Y; -f=e.transform?f*c:f; -if(c>=0.25){Z.getCtx().fillRect(d.x-Y/2,d.y-f/2,Y,f) -}},triangle:function(c,Z){var i=this.node,d=c.data; -var X=i.overridable&&d&&d.$dim||i.dim; -var Y=c.pos.getc(),h=Y.scale(c._scale); -var g=i.transform?X*(1-Y.squaredNorm()):X; -if(g>=X/4){var b=h.x,a=h.y-g,k=b-g,j=h.y+g,f=b+g,e=j; -Z.path("fill",function(l){l.moveTo(b,a); -l.lineTo(k,j); -l.lineTo(f,e) -}) -}},star:function(a,Z){var g=this.node,c=a.data; -var X=g.overridable&&c&&c.$dim||g.dim; -var Y=a.pos.getc(),f=Y.scale(a._scale); -var e=g.transform?X*(1-Y.squaredNorm()):X; -if(e>=X/4){var h=Z.getCtx(),d=Math.PI/5; -h.save(); -h.translate(f.x,f.y); -h.beginPath(); -h.moveTo(X,0); -for(var b=0; -b<9; -b++){h.rotate(d); -if(b%2==0){h.lineTo((e/0.525731)*0.200811,0) -}else{h.lineTo(e,0) -}}h.closePath(); -h.fill(); -h.restore() -}}}); -Hypertree.Plot.EdgeTypes=new O({none:function(){},line:function(X,Y){var Z=X.nodeFrom._scale; -var b=X.nodeFrom.pos.getc(true); -var a=X.nodeTo.pos.getc(true); -Y.path("stroke",function(c){c.moveTo(b.x*Z,b.y*Z); -c.lineTo(a.x*Z,a.y*Z) -}) -},hyperline:function(X,Y){this.hyperline(X,Y) -}}); -this.TM={layout:{orientation:"h",vertical:function(){return this.orientation=="v" -},horizontal:function(){return this.orientation=="h" -},change:function(){this.orientation=this.vertical()?"h":"v" -}},innerController:{onBeforeCompute:B,onAfterCompute:B,onComplete:B,onCreateElement:B,onDestroyElement:B,request:false},config:{orientation:"h",titleHeight:13,rootId:"infovis",offset:4,levelsToShow:3,addLeftClickHandler:false,addRightClickHandler:false,selectPathOnHover:false,Color:{allow:false,minValue:-100,maxValue:100,minColorValue:[255,0,50],maxColorValue:[0,255,50]},Tips:{allow:false,offsetX:20,offsetY:20,onShow:B}},initialize:function(X){this.tree=null; -this.shownTree=null; -this.controller=this.config=R(this.config,this.innerController,X); -this.rootId=this.config.rootId; -this.layout.orientation=this.config.orientation; -if(this.config.Tips.allow&&document.body){var b=document.getElementById("_tooltip")||document.createElement("div"); -b.id="_tooltip"; -b.className="tooltip"; -var Z=b.style; -Z.position="absolute"; -Z.display="none"; -Z.zIndex=13000; -document.body.appendChild(b); -this.tip=b -}var a=this; -var Y=function(){a.empty(); -if(window.CollectGarbage){window.CollectGarbage() -}delete Y -}; -if(window.addEventListener){window.addEventListener("unload",Y,false) -}else{window.attachEvent("onunload",Y) -}},each:function(X){(function Y(d){if(!d){return -}var c=d.childNodes,Z=c.length; -if(Z>0){X.apply(this,[d,Z===1,c[0],c[1]]) -}if(Z>1){for(var a=c[1].childNodes,b=0; -b1){a+=this.plot(Y) -}}return this.createBox(b,d,a) -},headBox:function(Y,b){var X=this.config,a=X.offset; -var Z={height:X.titleHeight+"px",width:(b.width-a)+"px",left:a/2+"px"}; -return'
'+Y.name+"
" -},bodyBox:function(Y,d){var X=this.config,Z=X.titleHeight,b=X.offset; -var a={width:(d.width-b)+"px",height:(d.height-b-Z)+"px",top:(Z+b/2)+"px",left:(b/2)+"px"}; -return'
'+Y+"
" -},contentBox:function(Z,b,Y){var a={}; -for(var X in b){a[X]=b[X]+"px" -}return'
'+Y+"
" -},leafBox:function(a,f){var Z=this.config; -var Y=Z.Color.allow&&this.setColor(a),e=Z.offset,b=f.width-e,X=f.height-e; -var d={top:(e/2)+"px",height:X+"px",width:b+"px",left:(e/2)+"px"}; -if(Y){d["background-color"]=Y -}return'
'+a.name+"
" -},setColor:function(f){var Z=this.config.Color,a=Z.maxColorValue,X=Z.minColorValue,b=Z.maxValue,g=Z.minValue,e=b-g,d=(f.data.$color-0); -var Y=function(h,c){return Math.round((((a[h]-X[h])/e)*(c-g)+X[h])) -}; -return D([Y(0,d),Y(1,d),Y(2,d)]) -},enter:function(X){this.view(X.parentNode.id) -},onLeftClick:function(X){this.enter(X) -},out:function(){var X=TreeUtil.getParent(this.tree,this.shownTree.id); -if(X){if(this.controller.request){TreeUtil.prune(X,this.config.levelsToShow) -}this.view(X.id) -}},onRightClick:function(){this.out() -},view:function(b){var X=this.config,Z=this; -var Y={onComplete:function(){Z.loadTree(b); -E(X.rootId).focus() -}}; -if(this.controller.request){var a=TreeUtil; -a.loadSubtrees(a.getSubtree(this.tree,b),R(this.controller,Y)) -}else{Y.onComplete() -}},resetPath:function(X){var Y=this.rootId,b=this.resetPath.previous; -this.resetPath.previous=X||false; -function Z(e){var d=e.parentNode; -return d&&(d.id!=Y)&&d -}function a(f,c){if(f){var d=E(f.id); -if(d){var e=Z(d); -while(e){f=e.childNodes[0]; -if(S(f,"in-path")){if(c==undefined||!!c){A(f,"in-path") -}}else{if(!c){P(f,"in-path") -}}e=Z(e) -}}}}a(b,true); -a(X,false) -},initializeElements:function(){var X=this.controller,Z=this; -var Y=M(false),a=X.Tips.allow; -this.each(function(f,e,d,c){var b=TreeUtil.getSubtree(Z.tree,f.id); -X.onCreateElement(f,b,e,d,c); -if(X.addRightClickHandler){d.oncontextmenu=Y -}if(X.addLeftClickHandler||X.addRightClickHandler){T(d,"mouseup",function(g){var i=g.target||g.srcElement; -if(i.nodeName.toLowerCase() == 'a'){return -}var h=(g.which==3||g.button==2); -if(h){if(X.addRightClickHandler){Z.onRightClick() -}}else{if(X.addLeftClickHandler){Z.onLeftClick(d) -}}if(g.preventDefault){g.preventDefault() -}else{g.returnValue=false -}}) -}if(X.selectPathOnHover||a){T(d,"mouseover",function(g){if(X.selectPathOnHover){if(e){P(d,"over-leaf") -}else{P(d,"over-head"); -P(f,"over-content") -}if(f.id){Z.resetPath(b) -}}if(a){X.Tips.onShow(Z.tip,b,e,d) -}}); -T(d,"mouseout",function(g){if(X.selectPathOnHover){if(e){A(d,"over-leaf") -}else{A(d,"over-head"); -A(f,"over-content") -}Z.resetPath() -}if(a){Z.tip.style.display="none" -}}); -if(a){T(d,"mousemove",function(j,i){var o=Z.tip; -i=i||window; -j=j||i.event; -var n=i.document; -n=n.html||n.body; -var k={x:j.pageX||j.clientX+n.scrollLeft,y:j.pageY||j.clientY+n.scrollTop}; -o.style.display=""; -i={height:document.body.clientHeight,width:document.body.clientWidth}; -var h={width:o.offsetWidth,height:o.offsetHeight}; -var g=o.style,m=X.Tips.offsetX,l=X.Tips.offsetY; -g.top=((k.y+l+h.height>i.height)?(k.y-h.height-l):k.y+l)+"px"; -g.left=((k.x+h.width+m>i.width)?(k.x-h.width-m):k.x+m)+"px" -}) -}}}) -},destroyElements:function(){if(this.controller.onDestroyElement!=B){var X=this.controller,Y=this; -this.each(function(c,b,a,Z){X.onDestroyElement(c,TreeUtil.getSubtree(Y.tree,c.id),b,a,Z) -}) -}},empty:function(){this.destroyElements(); -F(E(this.rootId)) -},loadTree:function(X){this.empty(); -this.loadJSON(TreeUtil.getSubtree(this.tree,X)) -}}; -TM.SliceAndDice=new O({Implements:TM,loadJSON:function(a){this.controller.onBeforeCompute(a); -var Y=E(this.rootId),Z=this.config,b=Y.offsetWidth,X=Y.offsetHeight; -var c={coord:{top:0,left:0,width:b,height:X+Z.titleHeight+Z.offset}}; -if(this.tree==null){this.tree=a -}this.shownTree=a; -this.compute(c,a,this.layout.orientation); -Y.innerHTML=this.plot(a); -this.initializeElements(); -this.controller.onAfterCompute(a) -},compute:function(d,m,b){var o=this.config,i=d.coord,l=o.offset,h=i.width-l,f=i.height-l-o.titleHeight,Y=d.data,X=(Y&&("$area" in Y))?m.data.$area/Y.$area:1; -var g,e,k,c,a; -var n=(b=="h"); -if(n){b="v"; -g=f; -e=Math.round(h*X); -k="height"; -c="top"; -a="left" -}else{b="h"; -g=Math.round(f*X); -e=h; -k="width"; -c="left"; -a="top" -}m.coord={width:e,height:g,top:0,left:0}; -var j=0,Z=this; -G(m.children,function(p){Z.compute(m,p,b); -p.coord[c]=j; -p.coord[a]=0; -j+=Math.floor(p.coord[k]) -}) -}}); -TM.Area=new O({loadJSON:function(Z){this.controller.onBeforeCompute(Z); -var Y=E(this.rootId),a=Y.offsetWidth,X=Y.offsetHeight,e=this.config.offset,c=a-e,b=X-e-this.config.titleHeight; -Z.coord={height:X,width:a,top:0,left:0}; -var d=R(Z.coord,{width:c,height:b}); -this.compute(Z,d); -Y.innerHTML=this.plot(Z); -if(this.tree==null){this.tree=Z -}this.shownTree=Z; -this.initializeElements(); -this.controller.onAfterCompute(Z) -},computeDim:function(a,f,Y,e,Z){if(a.length+f.length==1){var X=(a.length==1)?a:f; -this.layoutLast(X,Y,e); -return -}if(a.length>=2&&f.length==0){f=[a[0]]; -a=a.slice(1) -}if(a.length==0){if(f.length>0){this.layoutRow(f,Y,e) -}return -}var d=a[0]; -if(Z(f,Y)>=Z([d].concat(f),Y)){this.computeDim(a.slice(1),f.concat([d]),Y,e,Z) -}else{var b=this.layoutRow(f,Y,e); -this.computeDim(a,[],b.dim,b,Z) -}},worstAspectRatio:function(X,e){if(!X||X.length==0){return Number.MAX_VALUE -}var Y=0,f=0,b=Number.MAX_VALUE; -for(var c=0; -cZ)?f:Z -}var d=e*e,a=Y*Y; -return Math.max(d*f/a,a/(d*b)) -},avgAspectRatio:function(a,X){if(!a||a.length==0){return Number.MAX_VALUE -}var c=0; -for(var Y=0; -YZ)?X/Z:Z/X -}return c/a.length -},layoutLast:function(Y,X,Z){Y[0].coord=Z -}}); -TM.Squarified=new O({Implements:[TM,TM.Area],compute:function(f,c){if(!(c.width>=c.height&&this.layout.horizontal())){this.layout.change() -}var X=f.children,Z=this.config; -if(X.length>0){this.processChildrenLayout(f,X,c); -for(var b=0; -b=h._area) -}); -var e=[X[0]]; -var d=X.slice(1); -this.squarify(d,e,Z,b) -},squarify:function(Y,a,X,Z){this.computeDim(Y,a,X,Z,this.worstAspectRatio) -},layoutRow:function(Y,X,Z){if(this.layout.horizontal()){return this.layoutV(Y,X,Z) -}else{return this.layoutH(Y,X,Z) -}},layoutV:function(X,f,c){var g=0,Z=Math.round; -G(X,function(h){g+=h._area -}); -var Y=Z(g/f),d=0; -for(var a=0; -a0){this.processChildrenLayout(f,X,c); -for(var b=0; -b