/* jquery.cxtmenu.min.js */ /** * This file is part of cytoscape.js 2.0.2. * * Cytoscape.js is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Cytoscape.js is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License along with * cytoscape.js. If not, see . */ (function(a){var b={menuRadius:100,cytoscape:true,selector:undefined,commands:[],fillColor:"rgba(0, 0, 0, 0.75)",activeFillColor:"rgba(92, 194, 237, 0.75)",activePadding:20,indicatorSize:30,indicatorColor:"black",separatorWidth:3,spotlightPadding:4,itemColor:"white",itemTextShadowColor:"black"};a.fn.cxtmenu=function(g){var c=a.extend(true,{},b,g);var d=g;var f=a(this);var h;f.cytoscape(function(i){h=this});var e={destroy:function(){},init:function(){var D=a('
');var w=a(""); var F=w[0].getContext("2d");var A=c.menuRadius;var u=f.offset();var H=(A+c.activePadding)*2;var y=undefined;f.append(D);D.append(w);D.css({width:H+"px",height:H+"px",position:"fixed",zIndex:999999,marginLeft:u.left-c.activePadding+"px",marginTop:u.top-c.activePadding+"px"}).hide();w[0].width=H;w[0].height=H;var v=c.commands;var z=2*Math.PI/(v.length);var E=v.length%2!==0?Math.PI/2:0;var C=E+z;var o=[];for(var J=0;J');j.css({color:c.itemColor,cursor:"default",display:"table","text-align":"center",position:"absolute","text-shadow":"-1px -1px "+c.itemTextShadowColor+", 1px -1px "+c.itemTextShadowColor+", -1px 1px "+c.itemTextShadowColor+", 1px 1px "+c.itemTextShadowColor,left:"50%",top:"50%","min-height":A*0.66,width:A*0.66,height:A*0.66,marginLeft:K-A*0.33,marginTop:-t-A*0.33});var s=a('
'+p.content+"
");s.css({width:A*0.66,height:A*0.66,"vertical-align":"middle",display:"table-cell"}); D.append(j);j.append(s);E+=z;C+=z}function k(S){S=S!==undefined?S:x;F.globalCompositeOperation="source-over";F.clearRect(0,0,H,H);F.fillStyle=c.fillColor;F.beginPath();F.arc(A+c.activePadding,A+c.activePadding,A,0,Math.PI*2,true);F.closePath();F.fill();F.globalCompositeOperation="destination-out";F.strokeStyle="white";F.lineWidth=c.separatorWidth;var r=c.commands;var T=2*Math.PI/(r.length);var Q=r.length%2!==0?Math.PI/2:0;var P=Q+T;for(var O=0;O=q+M){N(r);q=i;L=false}else{G=setTimeout(function(){N(r);q=i},M*2)}}var n,l,x;var B;h.on("cxttapstart",c.selector,function(P){var N=this;var r=N.renderedPosition();var R=N.renderedWidth();var i=N.renderedHeight();var Q=a(window).scrollLeft();var O=a(window).scrollTop();n=r.x;l=r.y;D.show().css({left:r.x-A-Q,top:r.y-A-O});x=Math.max(R,i);x=32;k();y=undefined}).on("cxtdrag",c.selector,function(i){m(function(){var Z=i.originalEvent.pageX-f.offset().left-n;var Y=i.originalEvent.pageY-f.offset().top-l; if(Z===0){Z=0.01}var W=Math.sqrt(Z*Z+Y*Y);var V=(Y*Y-W*W-Z*Z)/(-2*W*Z);var O=Math.acos(V);y=undefined;if(W0){O=Math.PI+Math.abs(O-Math.PI)}var P=c.commands;var X=2*Math.PI/(P.length);var U=P.length%2!==0?Math.PI/2:0;var T=U+X;for(var S=0;S