Event
This object represents an Event.
Events are objects passed as arguments to listeners when an event occurs.
All event objects have at least the following fields:
type
group
The following tables lists the possible properties for each event type.
Fired when the user clicks an element that belongs to the group
you registered.
If you don't specify any group or if the group is none
, the event will be fired when the background of the network visualization is clicked.
group | target | value |
---|---|---|
nodes | Node | undefined |
edges | Edge | undefined |
none : clicking the visualization background | undefined | undefined |
Fired when the user double clicks an element that belongs to the group
you registered.
If you don't specify any group or if the group is none
, the event will be fired when the background of the network visualization is double-clicked.
group | target | value |
---|---|---|
nodes | Node | undefined |
edges | Edge | undefined |
none : double-clicking the visualization background | undefined | undefined |
Fired when the user starts dragging a node.
group | target | value |
---|---|---|
nodes | Node | undefined |
Fired when the user stops dragging a node.
group | target | value |
---|---|---|
nodes | Node | undefined |
Fired when the user moves the mouse over an element that belongs to the group
you registered.
If you don't specify any group or if the group is none
, the event will be fired any time the cursor enters the visualization rectangle.
group | target | value |
---|---|---|
nodes | Node | undefined |
edges | Edge | undefined |
none : mouse enters the visualization area | undefined | undefined |
Fired when the user moves the mouse out of an element that belongs to the group
you registered.
If you don't specify any group or if the group is none
, the event will be fired when the cursor leaves the visualization area.
group | target | value |
---|---|---|
nodes | Node | undefined |
edges | Edge | undefined |
none : mouse leaves the visualization area | undefined | undefined |
Fired when an element that belongs to the group
you registered is selected.
Nodes and edges can be selected by three possible ways:
directly clicking it; using the drag-rectangle (the select event is dispatched only after the the mouse button is released); programmatically, with org.cytoscapeweb.Visualization :: select.
If you don't specify any group or if the group is none
, the event will be fired after selecting any nodes or edges.
group | target | value |
---|---|---|
nodes | Array of selected Node objects | undefined |
edges | Array of selected Edge objects | undefined |
none | Array of selected Node and Edge objects | undefined |
Fired when an element that belongs to the group
you registered is deselected.
Nodes and edges can be deselected by the user or programmatically, with org.cytoscapeweb.Visualization :: deselect.
If you don't specify any group or if the group is none
, the event will be fired after deselecting any nodes or edges.
group | target | value |
---|---|---|
nodes | Array of deselected Node objects | undefined |
edges | Array of deselected Edge objects | undefined |
none | Array of deselected Node and Edge objects | undefined |
Fired when the group
you registered is filtered.
Nodes and edges can be filtered with org.cytoscapeweb.Visualization :: filter.
If you don't specify any group or if the group is none
, the event will be fired after filtering nodes or edges elements.
It is important to be aware that if no element of the specified group
is filtered (no filter applied),
the event's target
property will be null
.
But if all the elements of that group
is filtered out, target
will be an empty array.
group | target | value |
---|---|---|
nodes | Array of filtered Node objects or null | undefined |
edges | Array of filtered Edge objects or null | undefined |
none | Array of filtered Node and Edge objects or null | undefined |
Fired after a layout is applied (see org.cytoscapeweb.Visualization :: layout.
group | target | value |
---|---|---|
none | undefined | The applied Layout object |
Fired after the network is rescaled, either by calling org.cytoscapeweb.Visualization :: zoom or when the user interacts with the visualization's pan-zoom control.
group | target | value |
---|---|---|
none | undefined | The zoom value (float number from 0 to 1) |
Fired when an exception is thrown.
group | target | value |
---|---|---|
none | undefined | The Error object |
Events of this type are only passed to the callback functions that are registered with org.cytoscapeweb.Visualization :: addContextMenuItem. You cannot add listeners to this event.
group | target | value |
---|---|---|
nodes | The related Node object | undefined |
edges | The related Edge object | undefined |
none | The Node or Edge object, if a node or edge was right-clicked. Or undefined , if the right click was done on an empty background area. | undefined |
group {Group} : The group of network elements the event is related to.
mouseX : The local x coordinate of the mouse position, in pixels. Available only when the event type is 'click', 'dblclick', 'mouseover', 'mouseout' or 'contextmenu'.
mouseY : The local y coordinate of the mouse position, in pixels. Available only when the event type is 'click', 'dblclick', 'mouseover', 'mouseout' or 'contextmenu'.
target {Object} : The event target. For example, if one or more nodes are selected, the target of the
"select"
event will be an array of node objects.
But if a node is clicked, the target of the "click"
event will be just a node object.
This property is available only for event types that are related to actions performed on nodes or edges.
For the other events it is undefined
.
type {EventType} : The event type name.
value : This property is a very generic one and is usually used to send back any important value that
is not defined as target
. For example, for "zoom"
events, value is
the new scale, but for "error"
events it is an error object.
EventType
This object represents an event type. In actuality, it is a string.
All of them, but "contextmenu"
can be used with the listener methods
(org.cytoscapeweb.Visualization :: addListener, org.cytoscapeweb.Visualization :: hasListener and
org.cytoscapeweb.Visualization :: removeListener).
Its value must be one of:
Error
This object represents an Error type, but is just an untyped object.
It is returned by "error"
type events.
id {String} : The error id.
msg {String} : The error message.
name {String} : The error name.
stackTrace {String} : The stack trace of the error.