This project has been replaced by Cytoscape.js, and is no longer active.

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.

grouptargetvalue
nodesNodeundefined
edgesEdgeundefined
none: clicking the visualization backgroundundefinedundefined

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.

grouptargetvalue
nodesNodeundefined
edgesEdgeundefined
none: double-clicking the visualization backgroundundefinedundefined

Fired when the user starts dragging a node.

grouptargetvalue
nodesNodeundefined

Fired when the user stops dragging a node.

grouptargetvalue
nodesNodeundefined

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.

grouptargetvalue
nodesNodeundefined
edgesEdgeundefined
none: mouse enters the visualization areaundefinedundefined

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.

grouptargetvalue
nodesNodeundefined
edgesEdgeundefined
none: mouse leaves the visualization areaundefinedundefined

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.

grouptargetvalue
nodesArray of selected Node objectsundefined
edgesArray of selected Edge objectsundefined
noneArray of selected Node and Edge objectsundefined

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.

grouptargetvalue
nodesArray of deselected Node objectsundefined
edgesArray of deselected Edge objectsundefined
noneArray of deselected Node and Edge objectsundefined

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.

grouptargetvalue
nodesArray of filtered Node objects or nullundefined
edgesArray of filtered Edge objects or nullundefined
noneArray of filtered Node and Edge objects or nullundefined

Fired after a layout is applied (see org.cytoscapeweb.Visualization :: layout.

grouptargetvalue
noneundefinedThe 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.

grouptargetvalue
noneundefinedThe zoom value (float number from 0 to 1)

Fired when an exception is thrown.

grouptargetvalue
noneundefinedThe 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.

grouptargetvalue
nodesThe related Node objectundefined
edgesThe related Edge objectundefined
noneThe 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:

  • click: For mouse click events on nodes, edges or the visualization background.
  • dblclick: For double-click events on nodes, edges or the visualization background.
  • dragstart: For drag-start events on nodes.
  • dragstop: For drag-stop events on nodes.
  • mouseover: For mouse-over events on nodes, edges or the visualization background.
  • mouseout: For mouse-out events on nodes, edges or the visualization background.
  • select: For events dispatched after nodes or edges are selected (e.g. by direct mouse clicking or by drag-selecting).
  • deselect: For events dispatched after nodes or edges are unselected.
  • filter: For events dispatched after nodes or edges are filtered.
  • zoom: For events dispatched after the network is rescaled.
  • layout: For events dispatched after a new layout is applied or the current one is recomputed.
  • contextmenu: For events dispatched after a right-click context menu item is selected. You cannot use this type with the listener methods (e.g. org.cytoscapeweb.Visualization :: addListener). Events of this type are only dispatched to the callback functions that are registered with org.cytoscapeweb.Visualization :: addContextMenuItem.
  • error: For events dispatched when an internal error or exception occurs.

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.