Browse Source

Merge remote-tracking branch 'origin/develop' into develop

flowchartTest
jos 9 years ago
parent
commit
786765c45a
3 changed files with 1027 additions and 1010 deletions
  1. +1011
    -1005
      dist/vis.js
  2. +2
    -2
      examples/network/events/interactionEvents.html
  3. +14
    -3
      lib/network/modules/InteractionHandler.js

+ 1011
- 1005
dist/vis.js
File diff suppressed because it is too large
View File


+ 2
- 2
examples/network/events/interactionEvents.html View File

@ -80,8 +80,8 @@
network.on("showPopup", function (params) { network.on("showPopup", function (params) {
document.getElementById('eventSpan').innerHTML = '<h2>showPopup event: </h2>' + JSON.stringify(params, null, 4); document.getElementById('eventSpan').innerHTML = '<h2>showPopup event: </h2>' + JSON.stringify(params, null, 4);
}); });
network.on("hidePopup", function (params) {
console.log('hidePopup Event:', params);
network.on("hidePopup", function () {
console.log('hidePopup Event');
}); });
network.on("select", function (params) { network.on("select", function (params) {
console.log('select Event:', params); console.log('select Event:', params);

+ 14
- 3
lib/network/modules/InteractionHandler.js View File

@ -190,7 +190,7 @@ class InteractionHandler {
let {nodesChanges, edgesChanges} = this._determineIfDifferent(previousSelection, currentSelection); let {nodesChanges, edgesChanges} = this._determineIfDifferent(previousSelection, currentSelection);
if (selectedNodesCount - previouslySelectedNodeCount > 0 || (selectedNodesCount === previouslySelectedNodeCount && nodesChanges === true)) { // node was selected
if (selectedNodesCount - previouslySelectedNodeCount > 0) { // node was selected
this.selectionHandler._generateClickEvent('selectNode', event, pointer); this.selectionHandler._generateClickEvent('selectNode', event, pointer);
selected = true; selected = true;
} }
@ -198,15 +198,26 @@ class InteractionHandler {
this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection); this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection);
selected = true; selected = true;
} }
else if (selectedNodesCount === previouslySelectedNodeCount && nodesChanges === true) {
this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection);
this.selectionHandler._generateClickEvent('selectNode', event, pointer);
selected = true;
}
if (selectedEdgesCount - previouslySelectedEdgeCount > 0|| (selectedEdgesCount === previouslySelectedEdgeCount && edgesChanges === true)) { // node was selected
if (selectedEdgesCount - previouslySelectedEdgeCount > 0) { // edge was selected
this.selectionHandler._generateClickEvent('selectEdge', event, pointer); this.selectionHandler._generateClickEvent('selectEdge', event, pointer);
selected = true; selected = true;
} }
else if (selectedEdgesCount - previouslySelectedEdgeCount < 0) { // node was deselected
else if (selectedEdgesCount - previouslySelectedEdgeCount < 0) { // edge was deselected
this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection); this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);
selected = true; selected = true;
} }
else if (selectedEdgesCount === previouslySelectedEdgeCount && edgesChanges === true) {
this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);
this.selectionHandler._generateClickEvent('selectEdge', event, pointer);
selected = true;
}
if (selected === true) { // select or unselect if (selected === true) { // select or unselect
this.selectionHandler._generateClickEvent('select', event, pointer); this.selectionHandler._generateClickEvent('select', event, pointer);

Loading…
Cancel
Save