|
|
@ -48,7 +48,14 @@ |
|
|
|
nodes: nodes, |
|
|
|
edges: edges |
|
|
|
}; |
|
|
|
var options = {interaction:{hover:true}}; |
|
|
|
|
|
|
|
var options = { |
|
|
|
interaction:{hover:true}, |
|
|
|
manipulation: { |
|
|
|
enabled: true |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
var network = new vis.Network(container, data, options); |
|
|
|
|
|
|
|
network.on("click", function (params) { |
|
|
@ -65,8 +72,10 @@ |
|
|
|
document.getElementById('eventSpan').innerHTML = '<h2>oncontext (right click) event:</h2>' + JSON.stringify(params, null, 4); |
|
|
|
}); |
|
|
|
network.on("dragStart", function (params) { |
|
|
|
// There's no point in displaying this event on screen, it gets immediately overwritten |
|
|
|
params.event = "[original event]"; |
|
|
|
document.getElementById('eventSpan').innerHTML = '<h2>dragStart event:</h2>' + JSON.stringify(params, null, 4); |
|
|
|
console.log('dragStart Event:', params); |
|
|
|
console.log('dragStart event, getNodeAt returns: ' + this.getNodeAt(params.pointer.DOM)); |
|
|
|
}); |
|
|
|
network.on("dragging", function (params) { |
|
|
|
params.event = "[original event]"; |
|
|
@ -75,6 +84,8 @@ |
|
|
|
network.on("dragEnd", function (params) { |
|
|
|
params.event = "[original event]"; |
|
|
|
document.getElementById('eventSpan').innerHTML = '<h2>dragEnd event:</h2>' + JSON.stringify(params, null, 4); |
|
|
|
console.log('dragEnd Event:', params); |
|
|
|
console.log('dragEnd event, getNodeAt returns: ' + this.getNodeAt(params.pointer.DOM)); |
|
|
|
}); |
|
|
|
network.on("zoom", function (params) { |
|
|
|
document.getElementById('eventSpan').innerHTML = '<h2>zoom event:</h2>' + JSON.stringify(params, null, 4); |
|
|
|