Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
cytoscape-edge-bend-editing
Advanced tools
Readme
This package is deprecated in favour of the cytoscape-edge-editing package!
A Cytoscape.js extension enabling interactive editing of edge bend points, distributed under The MIT License.
Click here for demo
Download the library:
npm install cytoscape-edge-bend-editing
,bower install cytoscape-edge-bend-editing
, orrequire()
the library as appropriate for your project:
CommonJS:
var cytoscape = require('cytoscape');
var jquery = require('jquery');
var edgeBendEditing = require('cytoscape-edge-bend-editing');
edgeBendEditing( cytoscape, jquery ); // register extension
AMD:
require(['cytoscape', 'cytoscape-edge-bend-editing'], function( cytoscape, edge-bend-editing ){
edge-bend-editing( cytoscape ); // register extension
});
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
var instance = cy.edgeBendEditing( 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.edgeBendEditing('get'); // Returns undefined if the extension is not initialized yet
Or you can check if the extension is initilized before
cy.edgeBendEditing('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: 6,
// whether to start the plugin in the enabled state
enabled: true,
// 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 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-bend-editing https://github.com/iVis-at-Bilkent/cytoscape.js-edge-bend-editing.git
FAQs
A Cytoscape.js extension enables editing edge bend points
The npm package cytoscape-edge-bend-editing receives a total of 27 weekly downloads. As such, cytoscape-edge-bend-editing popularity was classified as not popular.
We found that cytoscape-edge-bend-editing demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.