Adds Interaction Listener
There are three ways for event monitoring: Graph#on***, Graph#addCustomInteraction(interaction), Graph#interactionMode, the previous two will not affect current interaction mode (such as default translation and zoom interaction). For the later one, you have to combine the interaction mode by yourself. Now the first method is introduced. And the later two kinds will be introduced in the chapter of interaction mode
Graph.on***
the usage of this method is simplest
**Example: **
graph.onclick = function(evt, graph){
Q.log(evt);
}
Graph#addCustomInteraction(interaction)
Example
graph.addCustomInteraction({
onevent: function (type, evt, graph) {
Q.log(type)
}
})
Graph#interactionMode
Example
graph.interactionMode = Q.Consts.INTERACTION_MODE_VIEW