This page exists for two reasons: Test of the existing events in APEX for the
plugin development and showing you implementation examples.
12 events are available:
- Node Mouse Enter
- Node Mouse Leave
- Node Click
- Node Double Click
- Node Contextmenu
- Link Click
- Lasso Start
- Lasso End
- Force Start
- Force End
- Render End
- Resize
You can access the events in two ways:
- Configure event functions...
- ...in the graph region attributes
- ...or by using the API methods to configure the event functions on runtime
- Use the APEX dynamic actions to access the graph events
Function example for a node click event:
function(event, data) {
console.log(
"Test Event Function - Node Click - event:",
event
);
console.log(
"Test Event Function - Node Click - data:",
data
);
console.log(
"Test Event Function - Node Click - this:",
this
);
}
APEX dynamic action example on the component event "Node Click [D3 - Force
Layout]"
console.log(
"Test Dynamic Action - Node Click - event:",
this.browserEvent
);
console.log(
"Test Dynamic Action - Node Click - data:",
this.data
);
console.log(
"Test Dynamic Action - Node Click - this:",
this.triggeringElement
);
Please refer also to the APEX dynamic action documentation and keep in mind,
that the data is the same in both ways but the event differs, because APEX
dynamic actions providing a jQuery event and the registered event functions the
original D3 events.