cytoscape-cxtmenu
Advanced tools
Comparing version 2.4.0 to 2.5.0
@@ -31,2 +31,3 @@ /*! | ||
{ // example command | ||
fillColor: 'rgba(200, 200, 200, 0.75)', // optional: custom background color for item | ||
content: 'a command name' // html/text content to be displayed in the menu | ||
@@ -113,3 +114,3 @@ select: function(ele){ // a function to execute when the command is selected | ||
var dtheta = 2 * Math.PI / (commands.length); | ||
var theta1 = commands.length % 2 !== 0 ? Math.PI / 2 : 0; | ||
var theta1 = Math.PI / 2; | ||
var theta2 = theta1 + dtheta; | ||
@@ -162,3 +163,2 @@ | ||
} | ||
var hideParentOnClick, selectOnClickWrapper; | ||
@@ -176,18 +176,34 @@ function queueDrawBg( rspotlight ){ | ||
// draw background items | ||
c2d.fillStyle = options.fillColor; | ||
c2d.beginPath(); | ||
c2d.arc(r + options.activePadding, r + options.activePadding, r, 0, Math.PI*2, true); | ||
c2d.closePath(); | ||
c2d.fill(); | ||
var dtheta = 2*Math.PI/(commands.length); | ||
var theta1 = Math.PI/2; | ||
var theta2 = theta1 + dtheta; | ||
for( var index = 0; index < commands.length; index++ ){ | ||
var command = commands[index]; | ||
if( command.fillColor ){ | ||
c2d.fillStyle = command.fillColor; | ||
} | ||
c2d.beginPath(); | ||
c2d.moveTo(r + options.activePadding, r + options.activePadding); | ||
c2d.arc(r + options.activePadding, r + options.activePadding, r, 2*Math.PI - theta1, 2*Math.PI - theta2, true); | ||
c2d.closePath(); | ||
c2d.fill(); | ||
theta1 += dtheta; | ||
theta2 += dtheta; | ||
c2d.fillStyle = options.fillColor; | ||
} | ||
// draw separators between items | ||
c2d.globalCompositeOperation = 'destination-out'; | ||
c2d.strokeStyle = 'white'; | ||
c2d.lineWidth = options.separatorWidth; | ||
var dtheta = 2*Math.PI/(commands.length); | ||
var theta1 = commands.length % 2 !== 0 ? Math.PI/2 : 0; | ||
var theta2 = theta1 + dtheta; | ||
theta1 = Math.PI/2; | ||
theta2 = theta1 + dtheta; | ||
for( var i = 0; i < commands.length; i++ ){ | ||
var command = commands[i]; | ||
var rx1 = r * Math.cos(theta1); | ||
@@ -222,3 +238,3 @@ var ry1 = r * Math.sin(theta1); | ||
var dtheta = 2*Math.PI/(commands.length); | ||
var theta1 = commands.length % 2 !== 0 ? Math.PI/2 : 0; | ||
var theta1 = Math.PI/2; | ||
var theta2 = theta1 + dtheta; | ||
@@ -281,4 +297,3 @@ | ||
var ctrx, ctry, rs, theta; | ||
var tapendHandler; | ||
var ctrx, ctry, rs; | ||
@@ -368,4 +383,2 @@ var bindings = { | ||
var scrollLeft = $(window).scrollLeft(); | ||
var scrollTop = $(window).scrollTop(); | ||
offset = getOffset( $container ); | ||
@@ -430,3 +443,3 @@ | ||
var dtheta = 2*Math.PI/(commands.length); | ||
var theta1 = commands.length % 2 !== 0 ? Math.PI/2 : 0; | ||
var theta1 = Math.PI/2; | ||
var theta2 = theta1 + dtheta; | ||
@@ -433,0 +446,0 @@ |
{ | ||
"name": "cytoscape-cxtmenu", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"description": "A context menu for Cytoscape.js", | ||
@@ -5,0 +5,0 @@ "main": "cytoscape-cxtmenu.js", |
@@ -72,2 +72,3 @@ cytoscape-cxtmenu | ||
{ // example command | ||
fillColor: 'rgba(200, 200, 200, 0.75)', // optional: custom background color for item | ||
content: 'a command name' // html/text content to be displayed in the menu | ||
@@ -74,0 +75,0 @@ select: function(ele){ // a function to execute when the command is selected |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
601577
1872
112