Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
cytoscape.js-undo-redo
Advanced tools
This extension represents an interface to control actions on Cytoscape.js graph and also provides built-in functionalities for common cytoscape.js operations like dragging nodes, adding/removing new node et al.
var cy = cytoscape({...});
var ur = cy.undoRedo(options);
ur.action( actionName, actionFunction, undoFunction)
Register action with its undo function & action name.
ur.do(actionName, args)
Calls registered function with action name actionName via actionFunction(args)
ur.undo()
Undo last action
ur.redo()
Redo last action
cy.on("undo", function(actionName, args){} )
Calls registered function with action name actionName via actionFunction(args)
cy.on("redo", function(actionName, args){} )
Calls registered function with action name actionName via actionFunction(args)
*Note that args are returned from opposite action like (undo => redo || redo => undo)
ur.isUndoStackEmpty()
Get whether undo stack is empty (namely is undoable)
ur.isRedoStackEmpty()
Get whether undo stack is empty (namely is redoable)
ur.getUndoStack()
Gets actions (with their args) in undo stack
ur.getRedoStack()
Gets actions (with their args) in redo stack
var options = {
isDebug: false, // Debug mode for console messages
actions: {},// actions to be added
undoableDrag: true, // Whether dragging nodes are undoable
keyboardShortcuts: {
ctrl_z: true, // undo
ctrl_y: true, // redo
ctrl_shift_z: false // redo
},
beforeUndo: function () { // callback before undo is triggered.
},
afterUndo: function () { // callback after undo is triggered.
},
beforeRedo: function () { // callback before redo is triggered.
},
afterRedo: function () { // callback after redo is triggered.
},
ready: function () {
}
}
var ur = cy.undoRedo(options); // Can also be set whenever wanted.
ur.do("remove", "#spec")
undoableDrag: false
.do("add", eleObj)
http://js.cytoscape.org/#cy.add
.do("remove", eles/selector)
http://js.cytoscape.org/#cy.remove
.do("layout", options)
http://js.cytoscape.org/#core/layout
.do("restore", eles/selector)
http://js.cytoscape.org/#eles.restore
.do("clone", eles/selector)
http://js.cytoscape.org/#eles.restore
.do("select", eles/selector)
http://js.cytoscape.org/#eles.select
.do("unselect", eles/selector)
http://js.cytoscape.org/#eles.unselect
.do("move", arg)
http://js.cytoscape.org/#eles.move
var arg = {
eles: ... // eles/selector
location: ... // as is in docs
}
Cytoscape.js ^1.5.0
Download the library:
npm install cytoscape.js-undo-redo
,bower install cytoscape.js-undo-redo
, orrequire()
the library as appropriate for your project:
CommonJS:
var cytoscape = require('cytoscape');
var undoRedo = require('cytoscape.js-undo-redo');
undoRedo( cytoscape ); // register extension
AMD:
require(['cytoscape', 'cytoscape.js-undo-redo'], function( cytoscape, undoRedo ){
undoRedo( cytoscape ); // register extension
});
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
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.js-undo-redo https://github.com/iVis-at-Bilkent/cytoscape.js-undo-redo.git
FAQs
Manages undo/redo actions
The npm package cytoscape.js-undo-redo receives a total of 3 weekly downloads. As such, cytoscape.js-undo-redo popularity was classified as not popular.
We found that cytoscape.js-undo-redo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.