![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@layer5/cytoscape-compound-drag-and-drop
Advanced tools
Drag-and-drop UI for creating and editing the children of compound parent nodes
Multi-layer compound node drag-and-drop UI for adding and removing children. This an extension of cytoscape-compound-drag-and-drop@v1.1.0 This extension adds the functionality of nested compound nodes inside each other and functionality to dynamically allowing the conversion of nodes to compound nodes on overlaps. It also adds support for multiple nodes being able to be dragged into a compound node.
Download the library:
npm install cytoscape-compound-drag-and-drop
,bower install cytoscape-compound-drag-and-drop
, orImport the library as appropriate for your project:
ES import:
import cytoscape from 'cytoscape';
import compoundDragAndDrop from 'cytoscape-compound-drag-and-drop';
cytoscape.use( compoundDragAndDrop );
CommonJS require:
let cytoscape = require('cytoscape');
let compoundDragAndDrop = require('cytoscape-compound-drag-and-drop');
cytoscape.use( compoundDragAndDrop ); // register extension
AMD:
require(['cytoscape', 'cytoscape-compound-drag-and-drop'], function( cytoscape, compoundDragAndDrop ){
compoundDragAndDrop( cytoscape ); // register extension
});
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
true
return value for options.grabbedNode(node)
.true
return value for options.dropTarget(node)
.options.newParentNode(grabbedNode, dropSibling)
. The grabbed node and drop sibling are made to be children of the newly created drop target.
true
return value for options.dropSibling(node)
.Create an instance of the drag-and-drop UI:
const cdnd = cy.compoundDragAndDrop(options);
The options
object is outlined below with the default values:
const options = {
grabbedNode: node => true, // filter function to specify which nodes are valid to grab and drop into other nodes
dropTarget: (dropTarget, grabbedNode) => true, // filter function to specify which parent nodes are valid drop targets
dropSibling: (dropSibling, grabbedNode) => true, // filter function to specify which orphan nodes are valid drop siblings
newParentNode: (grabbedNode, dropSibling) => ({}), // specifies element json for parent nodes added by dropping an orphan node on another orphan (a drop sibling). You can chose to return the dropSibling in which case it becomes the parent node and will be preserved after all its children are removed.
boundingBoxOptions: { // same as https://js.cytoscape.org/#eles.boundingBox, used when calculating if one node is dragged over another
includeOverlays: false,
includeLabels: true
},
overThreshold: 10, // make dragging over a drop target easier by expanding the hit area by this amount on all sides
outThreshold: 10 // make dragging out of a drop target a bit harder by expanding the hit area by this amount on all sides
};
There are a number of functions available on the cdnd
object:
cdnd.disable(); // disables the UI
cdnd.enable(); // re-enables the UI
cdnd.destroy(); // removes the UI
These events are emitted by the extension during its gesture cycle.
cdndgrab
: Emitted on a grabbed node that is compatible with the drag-and-drop gesture.
grabbedNode.on('cdndgrab', (event) => {})
cdndover
: Emitted on a grabbed node when it is dragged over another node.
grabbedNode.on('cdndover', (event, dropTarget, dropSibling) => {})
cdndout
: Emmitted on a grabbed node when it is dragged out of its parent.
grabbedNode.on('cdndout', (event, dropTarget, dropSibling) => {})
cdnddrop
: Emitted on a grabbed node when it is dropped (freed).
droppedNode.on('cdnddrop', (event, dropTarget, dropSibling) => {})
For these events:
dropTarget
is always the parent node under consideration.dropSibling
is nonempty only if the grabbed node was originally dragged over the drop sibling.These classes are applied to nodes during the gesture cycle. You can use them in your stylesheet to customise the look of the nodes during different phases of the gesture.
cdnd-grabbed-node
: Applied to the grabbed node, until it is dropped.cdnd-drop-target
: Applied to a drop target node, while the grabbed node is over it.cdnd-drop-sibling
: Applied to drop sibling node, while the grabbed node is over its drop target (parent).cdnd-new-parent
: Applied to a parent node that has been created after dragging a node over. This class will not be present if the parent node is the dropSibling - see the newParentNode
callback function.npm run build
: Build ./src/**
into cytoscape-compound-drag-and-drop.js
npm run watch
: Automatically build on changes with live reloading (N.b. you must already have an HTTP server running)npm run lint
: Run eslint on the sourceN.b. all builds use babel, so modern ES features can be used in the src
.
This project is set up to automatically be published to npm and bower. To publish:
npm run build:release
git commit -am "Build for release"
npm version major|minor|patch
git push && git push --tags
npm publish .
Nodemon is configured to recompile the plugin when changes are made.
MESHMAP_PATH="../meshery-extensions/meshmap" npm run watch
FAQs
Drag-and-drop UI for creating and editing the children of compound parent nodes
The npm package @layer5/cytoscape-compound-drag-and-drop receives a total of 29 weekly downloads. As such, @layer5/cytoscape-compound-drag-and-drop popularity was classified as not popular.
We found that @layer5/cytoscape-compound-drag-and-drop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.