cytoscape-edge-bend-editing
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "cytoscape-edge-bend-editing", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A Cytoscape.js extension enables editing edge bend points", | ||
@@ -5,0 +5,0 @@ "main": "cytoscape-edge-bend-editing.js", |
@@ -52,2 +52,5 @@ cytoscape-edge-bend-editing | ||
`ele.getSegmentPoints()` | ||
Returns the center coordinates of segment points. | ||
## Default Options | ||
@@ -77,1 +80,5 @@ ```js | ||
1. If publishing to bower for the first time, you'll need to run `bower register cytoscape-edge-bend-editing https://github.com/iVis-at-Bilkent/cytoscape.js-edge-bend-editing.git` | ||
## Team | ||
* [Metin Can Siper](https://github.com/metincansiper), [Ugur Dogrusoz](https://github.com/ugurdogrusoz) of [i-Vis at Bilkent University](http://www.cs.bilkent.edu.tr/~ivis) |
@@ -276,2 +276,4 @@ var bendPointUtilities = { | ||
// var segPts = this.getSegmentPoints(edge); | ||
var minDist = Infinity; | ||
@@ -383,2 +385,9 @@ var intersection; | ||
} | ||
}, | ||
calculateDistance: function(pt1, pt2) { | ||
var diffX = pt1.x - pt2.x; | ||
var diffY = pt1.y - pt2.y; | ||
var dist = Math.sqrt( Math.pow( diffX, 2 ) + Math.pow( diffY, 2 ) ); | ||
return dist; | ||
} | ||
@@ -385,0 +394,0 @@ }; |
@@ -65,2 +65,13 @@ ;(function($$, $){ 'use strict'; | ||
} ); | ||
/* | ||
* get segment points of an edge in an array A, | ||
* A[2 * i] is the x coordinate and A[2 * i + 1] is the y coordinate | ||
* of the ith bend point. | ||
*/ | ||
cytoscape( 'collection', 'getSegmentPoints', function(){ | ||
var ele = this; | ||
return bendPointUtilities.getSegmentPoints(ele); | ||
} ); | ||
@@ -67,0 +78,0 @@ }; |
@@ -244,3 +244,3 @@ var debounce = require('./debounce'); | ||
var segpts = edge._private.rscratch.segpts; | ||
var segpts = bendPointUtilities.getSegmentPoints(edge);//edge._private.rscratch.segpts; | ||
var length = getBendShapesLenght(edge); | ||
@@ -384,2 +384,7 @@ | ||
var edge = this; | ||
if(!edge.selected()) { | ||
return; | ||
} | ||
var containerPos = $(cy.container()).position(); | ||
@@ -386,0 +391,0 @@ |
Sorry, the diff of this file is too big to display
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
169048
2769
83