![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
cytoscape-edge-editing
Advanced tools
A Cytoscape.js extension enabling interactive editing of edge bend points and reconnection of edges to other source/target nodes, distributed under The MIT License.
Please cite the following paper when using this extension:
U. Dogrusoz , A. Karacelik, I. Safarli, H. Balci, L. Dervishi, and M.C. Siper, "Efficient methods and readily customizable libraries for managing complexity of large networks", PLoS ONE, 13(5): e0197238, 2018.
Click here for demo
Download the library:
npm install cytoscape-edge-editing
,bower install cytoscape-edge-editing
, orrequire()
the library as appropriate for your project:
CommonJS:
var cytoscape = require('cytoscape');
var jquery = require('jquery');
var edgeEditing = require('cytoscape-edge-editing');
edgeEditing( cytoscape, jquery ); // register extension
AMD:
require(['cytoscape', 'cytoscape-edge-editing'], function( cytoscape, edge-editing ){
edge-editing( cytoscape ); // register extension
});
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
var instance = cy.edgeEditing( options );
An instance has a number of functions available:
/*
* Get segment points of the given 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. (Returns undefined if the curve style is not segments)
*/
instance.getSegmentPoints(ele);
// Initilize bend points for the given edges using 'options.bendPositionsFunction'
instance.initBendPoints(eles)
You can also get an existing instance:
cy.edgeEditing('get'); // Returns undefined if the extension is not initialized yet
Or you can check if the extension is initilized before
cy.edgeEditing('initialized');
var options = {
// this function specifies the positions of bend points
bendPositionsFunction: function(ele) {
return ele.data('bendPointPositions');
},
// whether to initilize bend points on creation of this extension automatically
initBendPointsAutomatically: true,
// whether the bend editing operations are undoable (requires cytoscape-undo-redo.js)
undoable: false,
// the size of bend shape is obtained by multipling width of edge with this parameter
bendShapeSizeFactor: 3,
// z-index value of the canvas in which bend points are drawn
zIndex: 999,
// whether to start the plugin in the enabled state
enabled: true,
/*An option that controls the distance (in pixels) within which a bend point is considered near the line segment between
its two neighbors and will be automatically removed
min value = 0 , max value = 20 , values less than 0 are set to 0 and values greater than 20 are set to 20
*/
bendRemovalSensitivity : 8,
// title of add bend point menu item (User may need to adjust width of menu items according to length of this option)
addBendMenuItemTitle: "Add Bend Point",
// title of remove bend point menu item (User may need to adjust width of menu items according to length of this option)
removeBendMenuItemTitle: "Remove Bend Point",
// whether the bend point can be moved by arrow keys
moveSelectedBendPointsOnKeyEvents: function () {
return true;
}
// this function handles reconnection of the edge, if undefined simply connect edge to its new source/target
// handleReconnectEdge (newSource.id(), newTarget.id(), edge.data())
handleReconnectEdge: undefined,
// this function checks validation of the edge and its new source/target
validateEdge: function (edge, newSource, newTarget) {
return 'valid';
},
// this function is called if reconnected edge is not valid according to validateEdge function
actOnUnsuccessfulReconnection: undefined,
};
This project is set up to automatically be published to npm and bower. To publish:
export VERSION=1.2.3
gulp publish
bower register cytoscape-edge-editing https://github.com/iVis-at-Bilkent/cytoscape.js-edge-editing.git
FAQs
A Cytoscape.js extension that enables editing edges by adding and modifying anchor points
The npm package cytoscape-edge-editing receives a total of 129 weekly downloads. As such, cytoscape-edge-editing popularity was classified as not popular.
We found that cytoscape-edge-editing demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.