cytoscape-edgehandles
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "cytoscape-edgehandles", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Edge creation UI extension for Cytoscape", | ||
@@ -11,5 +11,6 @@ "main": "cytoscape-edgehandles.js", | ||
"scripts": { | ||
"postpublish": "run-s gh-pages:demo gh-pages:deploy", | ||
"postpublish": "run-s gh-pages:demo gh-pages:deploy gh-pages:cleanup", | ||
"gh-pages:demo": "cpy demo.html . --rename=index.html", | ||
"gh-pages:deploy": "gh-pages -d .", | ||
"gh-pages:cleanup": "rimraf index.html", | ||
"lint": "eslint src", | ||
@@ -41,10 +42,11 @@ "build": "cross-env NODE_ENV=production webpack", | ||
"chai": "4.0.2", | ||
"cpy-cli": "^1.0.1", | ||
"cross-env": "^5.0.0", | ||
"eslint": "^3.9.1", | ||
"gh-pages": "^1.0.0", | ||
"mocha": "3.4.2", | ||
"npm-run-all": "^4.1.2", | ||
"rimraf": "^2.6.2", | ||
"webpack": "^2.6.1", | ||
"webpack-dev-server": "^2.4.5", | ||
"cpy-cli": "^1.0.1", | ||
"npm-run-all": "^4.1.2", | ||
"gh-pages": "^1.0.0" | ||
"webpack-dev-server": "^2.4.5" | ||
}, | ||
@@ -51,0 +53,0 @@ "peerDependencies": { |
@@ -169,35 +169,35 @@ cytoscape-edgehandles | ||
* `eh-show` : when the handle is shown | ||
* `ehshow` : when the handle is shown | ||
* `(event, sourceNode)` | ||
* `event.position` : handle position | ||
* `eh-hide` : when the handle is hidden | ||
* `ehhide` : when the handle is hidden | ||
* `(event, sourceNode)` | ||
* `event.position` : handle position | ||
* `eh-start` : when the edge creation gesture starts | ||
* `ehstart` : when the edge creation gesture starts | ||
* `(event, sourceNode)` | ||
* `event.position` : handle position | ||
* `eh-complete` : when the edge creation gesture is successfully completed | ||
* `ehcomplete` : when the edge creation gesture is successfully completed | ||
* `(event, sourceNode, targetNode, addedEles)` | ||
* `event.position` : cursor/finger position | ||
* `eh-stop` : when the edge creation gesture is stopped (either successfully completed or cancelled) | ||
* `ehstop` : when the edge creation gesture is stopped (either successfully completed or cancelled) | ||
* `(event, sourceNode)` | ||
* `event.position` : cursor/finger position | ||
* `eh-cancel` : when the edge creation gesture is cancelled | ||
* `ehcancel` : when the edge creation gesture is cancelled | ||
* `(event, sourceNode, cancelledTargets)` | ||
* `event.position` : cursor/finger position | ||
* `eh-hoverover` : when hovering over a target | ||
* `ehhoverover` : when hovering over a target | ||
* `(event, sourceNode, targetNode)` | ||
* `event.position` : cursor/finger position | ||
* `eh-hoverout` : when leaving a target node | ||
* `ehhoverout` : when leaving a target node | ||
* `(event, sourceNode, targetNode)` | ||
* `event.position` : cursor/finger position | ||
* `eh-previewon` : when a preview is shown | ||
* `ehpreviewon` : when a preview is shown | ||
* `(event, sourceNode, targetNode, previewEles)` | ||
* `event.position` : cursor/finger position | ||
* `eh-previewoff` : when the preview is removed | ||
* `ehpreviewoff` : when the preview is removed | ||
* `(event, sourceNode, targetNode, previewEles)` | ||
* `event.position` : cursor/finger position | ||
* `eh-drawon` : when draw mode is enabled | ||
* `ehdrawon` : when draw mode is enabled | ||
* `(event)` | ||
* `eh-drawoff` : when draw mode is disabled | ||
* `ehdrawoff` : when draw mode is disabled | ||
* `(event)` | ||
@@ -208,3 +208,3 @@ | ||
```js | ||
cy.on('eh-complete', (event, sourceNode, targetNode, addedEles) => { | ||
cy.on('ehcomplete', (event, sourceNode, targetNode, addedEles) => { | ||
let { position } = event; | ||
@@ -211,0 +211,0 @@ |
@@ -28,3 +28,3 @@ const assign = require('../assign'); | ||
this.emit( 'cancel', this.mp(), [source, presumptiveTargets, cy.collection()] ); | ||
this.emit( 'cancel', this.mp(), source, presumptiveTargets ); | ||
@@ -38,3 +38,3 @@ return; | ||
this.emit( 'complete', this.mp(), [source, target, previewEles] ); | ||
this.emit( 'complete', this.mp(), source, target, previewEles ); | ||
@@ -120,3 +120,3 @@ return; | ||
} else { | ||
this.emit( 'complete', this.mp(), [source, target, added] ); | ||
this.emit( 'complete', this.mp(), source, target, added ); | ||
} | ||
@@ -190,10 +190,11 @@ | ||
} else { | ||
this.handleNode = cy.add({ | ||
classes: 'eh-handle', | ||
position: pos, | ||
grabbable: false, | ||
style: { | ||
'z-index': 9007199254740991 | ||
} | ||
}); | ||
cy.batch( () => { | ||
this.handleNode = cy.add({ | ||
classes: 'eh-handle', | ||
position: pos, | ||
grabbable: false | ||
}); | ||
this.handleNode.style('z-index', 9007199254740991); | ||
} ); | ||
} | ||
@@ -216,6 +217,13 @@ | ||
ghostNode = this.ghostNode = cy.add( { | ||
group: 'nodes', | ||
classes: 'eh-ghost eh-ghost-node', | ||
css: { | ||
cy.batch( () => { | ||
ghostNode = this.ghostNode = cy.add( { | ||
group: 'nodes', | ||
classes: 'eh-ghost eh-ghost-node', | ||
position: { | ||
x: 0, | ||
y: 0 | ||
} | ||
} ); | ||
ghostNode.style({ | ||
'background-color': 'blue', | ||
@@ -226,19 +234,16 @@ 'width': 0.0001, | ||
'events': 'no' | ||
}, | ||
position: { | ||
x: 0, | ||
y: 0 | ||
} | ||
} ); | ||
}); | ||
ghostEdge = cy.add( { | ||
group: 'edges', | ||
classes: 'eh-ghost eh-ghost-edge', | ||
data: { | ||
source: sourceNode.id(), | ||
target: ghostNode.id() | ||
}, | ||
css: { | ||
ghostEdge = cy.add( { | ||
group: 'edges', | ||
classes: 'eh-ghost eh-ghost-edge', | ||
data: { | ||
source: sourceNode.id(), | ||
target: ghostNode.id() | ||
} | ||
} ); | ||
ghostEdge.style({ | ||
'events': 'no' | ||
} | ||
}); | ||
} ); | ||
@@ -245,0 +250,0 @@ |
@@ -34,3 +34,3 @@ function canStartOn( node ){ | ||
this.emit( 'show', this.hp() ); | ||
this.emit( 'show', this.hp(), this.sourceNode ); | ||
@@ -47,3 +47,3 @@ return this; | ||
this.emit( 'hide', this.hp() ); | ||
this.emit( 'hide', this.hp(), this.sourceNode ); | ||
@@ -63,3 +63,3 @@ return this; | ||
this.emit( 'start', this.hp() ); | ||
this.emit( 'start', this.hp(), node ); | ||
} | ||
@@ -104,3 +104,3 @@ | ||
this.emit( 'hoverover', this.mp(), [ source, target ] ); | ||
this.emit( 'hoverover', this.mp(), source, target ); | ||
@@ -112,3 +112,3 @@ if( options.preview ){ | ||
this.emit( 'previewon', this.mp(), [ source, target, previewEles ] ); | ||
this.emit( 'previewon', this.mp(), source, target, previewEles ); | ||
} | ||
@@ -134,4 +134,4 @@ } | ||
this.emit( 'hoverout', this.mp(), [ source, target ] ); | ||
this.emit( 'previewoff', this.mp(), [ source, target, previewEles ] ); | ||
this.emit( 'hoverout', this.mp(), source, target ); | ||
this.emit( 'previewoff', this.mp(), source, target, previewEles ); | ||
@@ -161,3 +161,3 @@ return this; | ||
this.emit( 'stop', this.mp(), [ sourceNode, targetNode ] ); | ||
this.emit( 'stop', this.mp(), sourceNode ); | ||
@@ -164,0 +164,0 @@ return this; |
@@ -89,3 +89,3 @@ function addListeners(){ | ||
cy.emit( { type, position }, args ); | ||
cy.emit( { type: `eh${type}`, position }, args ); | ||
@@ -92,0 +92,0 @@ options[ type ]( ...args ); |
Sorry, the diff of this file is too big to display
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
156171
1538
14