cytoscape-edge-bend-editing
Advanced tools
Comparing version 1.3.0 to 1.3.1
{ | ||
"name": "cytoscape-edge-bend-editing", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A Cytoscape.js extension enables editing edge bend points", | ||
@@ -41,4 +41,5 @@ "main": "cytoscape-edge-bend-editing.js", | ||
"peerDependencies": { | ||
"cytoscape": "^2.7.0" | ||
"cytoscape": "^2.7.0", | ||
"jquery": "^1.7.0 || ^2.0.0 || ^3.0.0" | ||
} | ||
} |
@@ -6,3 +6,3 @@ cytoscape-edge-bend-editing | ||
To use this extension you should include 'cytoscape.js-context-menus' extension. | ||
To use this extension you must include 'cytoscape.js-context-menus' extension. | ||
Please see 'https://github.com/iVis-at-Bilkent/cytoscape.js-context-menus'. | ||
@@ -12,3 +12,3 @@ | ||
A Cytoscape.js extension enables editing edge bend points. | ||
A Cytoscape.js extension enabling interactive editing of edge bend points, distributed under [The MIT License](https://opensource.org/licenses/MIT). | ||
* To add a bend point select the edge, right click where you want to add the bend point and click 'Add Bend Point' on the context menu (requires 'cytoscape.js-context-menus' extension). | ||
@@ -19,3 +19,3 @@ * To remove a bend point select the edge, right click on the bend point and click 'Remove Bend Point' on the context menu (requires 'cytoscape.js-context-menus' extension). | ||
* You can click anywhere on the edge to introduce and relocate a bend point by dragging. | ||
* A bend point is removed if it is dropped near to the line between its neighbours. | ||
* A bend point is removed if it is dropped near the line segment between its two neighbours. | ||
@@ -25,2 +25,3 @@ ## Dependencies | ||
* Cytoscape.js ^1.7.0 | ||
* jQuery ^1.7.0 || ^2.0.0 || ^3.0.0 | ||
* cytoscape-undo-redo.js(optional) ^1.0.1 | ||
@@ -42,5 +43,6 @@ * cytoscape-context-menus.js(optional) ^2.0.0 | ||
var cytoscape = require('cytoscape'); | ||
var edge-bend-editing = require('cytoscape-edge-bend-editing'); | ||
var jquery = require('jquery'); | ||
var edgeBendEditing = require('cytoscape-edge-bend-editing'); | ||
edge-bend-editing( cytoscape ); // register extension | ||
edgeBendEditing( cytoscape, jquery ); // register extension | ||
``` | ||
@@ -47,0 +49,0 @@ |
@@ -1,9 +0,8 @@ | ||
;(function($$, $){ 'use strict'; | ||
;(function(){ 'use strict'; | ||
var bendPointUtilities = require('./bendPointUtilities'); | ||
$.fn.cytoscapeEdgeBendEditing = require('./UIUtilities'); | ||
// registers the extension on a cytoscape lib ref | ||
var register = function( cytoscape ){ | ||
var register = function( cytoscape, $ ){ | ||
var uiUtilities = require('./UIUtilities'); | ||
@@ -69,5 +68,5 @@ if( !cytoscape ){ return; } // can't register if cytoscape unspecified | ||
if(options.enabled) | ||
$(cy.container()).cytoscapeEdgeBendEditing(options, cy); | ||
uiUtilities(options, cy); | ||
else | ||
$(cy.container()).cytoscapeEdgeBendEditing("unbind", cy); | ||
uiUtilities("unbind", cy); | ||
} | ||
@@ -101,6 +100,6 @@ | ||
if( typeof cytoscape !== 'undefined' ){ // expose to global cytoscape (i.e. window.cytoscape) | ||
register( cytoscape ); | ||
if( typeof cytoscape !== 'undefined' && $ ){ // expose to global cytoscape (i.e. window.cytoscape) | ||
register( cytoscape, $ ); | ||
} | ||
})(cytoscape, jQuery); | ||
})(); |
@@ -509,5 +509,5 @@ var debounce = require('./debounce'); | ||
if (functions[fn]) { | ||
return functions[fn].apply(this, Array.prototype.slice.call(arguments, 1)); | ||
return functions[fn].apply($(cy.container()), Array.prototype.slice.call(arguments, 1)); | ||
} else if (typeof fn == 'object' || !fn) { | ||
return functions.init.apply(this, arguments); | ||
return functions.init.apply($(cy.container()), arguments); | ||
} else { | ||
@@ -514,0 +514,0 @@ $.error('No such function `' + fn + '` for cytoscape.js-edge-bend-editing'); |
Sorry, the diff of this file is too big to display
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
110
186061
2