Appearance
Ogma.events
Events API module: listen to events triggered by the Ogma instance to add interactivity to your application.
ogma.events.off(listener)
Remove a listener from all events it was bound to.
Arguments
- listener
function
ogma.events.on(eventName, listener)
Listen to an event and call the listener function.
Arguments
- eventName
string|string[]
Can be an event or an array of events - listener
function
ogma.events.onEdgesClassAdded(className, listener)
Triggers the specified function when the specified class is added to some edges.
Arguments
- className
string
- listener
function(evt: {edges: EdgeList})
ogma.events.onEdgesClassRemoved(className, listener)
Triggers the specified function when the specified class is removed from some edges.
Arguments
- className
string
- listener
function(evt: {edges: EdgeList})
ogma.events.onKeyPress(key, listener)
Triggers the specified function when the specified key is pressed.
Arguments
- key
KeyName|KeyCode|Array<KeyName|KeyCode>|string
Key to listen to. Multiple keys can be specified; in that case the function is triggered when the last key of the list is pressed, only if all the other keys are pressed. - listener
function(evt: {domEvent: Event})
ogma.events.onNodesClassAdded(className, listener)
Triggers the specified function when the specified class is added to some nodes.
Arguments
- className
string
- listener
function(evt: {nodes: NodeList})
ogma.events.onNodesClassRemoved(className, listener)
Triggers the specified function when the specified class is removed from some nodes.
Arguments
- className
string
- listener
function(evt: {nodes: NodeList})
ogma.events.once(eventName, listener)
Listen to an event only once.
Arguments
- eventName
string|string[]
Can be an event or an array of events - listener
function
ogma.events.onAnimate(listener)
deprecated
Deprecated, use animate
event instead. Trigger the specified function when the animation is called on nodes or edges.
Arguments
ogma.events.onBeforeEdgesRemoved(listener)
deprecated
Deprecated, use beforeRemoveEdges
event instead. Triggers right before the edges are removed, but they are still in the graph and their data is accessible.
Arguments
- listener
function(evt: {edges: EdgeList})
ogma.events.onBeforeNodesRemoved(listener)
deprecated
Deprecated, use beforeRemoveNodes
event instead. Triggers right before the nodes are removed, but they are still in the graph and their data is accessible.
Arguments
- listener
function (evt: {nodes: NodeList})
ogma.events.onClick(listener)
deprecated
Deprecated, use click
event instead..
Arguments
- listener
function(evt: {x: number, y: number, target: InputTarget, button: MouseButton, source: InputSource, domEvent: Event})
ogma.events.onDoubleClick(listener)
deprecated
Deprecated, use doubleclick
event instead..
Arguments
- listener
function(evt: {x: number, y: number, target: InputTarget, button: MouseButton, source: InputSource, domEvent: Event})
ogma.events.onDragEnd(listener)
deprecated
Deprecated, use dragEnd
event instead. Triggers the specified function when the user releases a mouse button, if a onDragStart
has been emitted before.
Arguments
- listener
function(evt: {x: number, y: number, target: InputTarget, button: MouseButton, source: InputSource, domEvent: Event})
If a node or edge was under the cursor when the firstonDragStart
event was emitted, it is passed as thetarget
property.
ogma.events.onDragProgress(listener)
deprecated
Deprecated, use dragProgress
event instead. Triggers the specified function every time the user moves the mouse after a onDragStart
event has been emitted, as long as the user doesn't release the mouse.
Arguments
- listener
function(evt: {x: number, y: number, target: InputTarget, button: MouseButton, source: InputSource, domEvent: Event})
If a node or edge was under the cursor when the firstonDragStart
event was emitted, it is passed as thetarget
property.
ogma.events.onDragStart(listener)
deprecated
Deprecated, use dragStart
event instead..
Arguments
- listener
function(evt: {x: number, y: number, target: InputTarget, button: MouseButton, source: InputSource, domEvent: Event})
ogma.events.onDrop(listener)
deprecated
Deprecated, use drop
event instead. Triggered when the user drops an element into the Ogma container. Note that x and y arguments are Graph coordinates.
Arguments
- listener
function(evt: {domEvent: Event, x: number, y: number})
ogma.events.onEdgeDataChange(listener)
deprecated
Deprecated, use updateEdgeData
event instead. Trigger the specified function when the data of some nodes is updated.
Arguments
- listener
function(evt: {changes: Array<{property: PropertyPath, edges: EdgeList, previousValues: Array<any>, newValues: Array<any>}>})
ogma.events.onEdgesAdded(listener)
deprecated
Deprecated, use addEdges
event instead. Triggers the specified function when some edges are added to the graph.
Arguments
- listener
function (evt: {edges: EdgeList})
ogma.events.onEdgesRemoved(listener)
deprecated
Deprecated, use removeEdges
event instead. Triggers the specified function when some edges are removed from the graph.
Arguments
- listener
function (evt: {edges: EdgeList})
ogma.events.onEdgesSelected(listener)
deprecated
Deprecated, use edgesSelected
event instead. Triggers the specified function when some edges are selected.
Arguments
- listener
function(evt: {edges: EdgeList})
ogma.events.onEdgesUnselected(listener)
deprecated
Deprecated, use edgesUnselected
event instead.
Arguments
- listener
function(evt: {edges: EdgeList})
ogma.events.onGeoModeDisabled(listener)
deprecated
Deprecated, use geoDisabled
event instead. Triggered when the geo mode is switched off
Arguments
- listener
function()
ogma.events.onGeoModeEnabled(listener)
deprecated
Deprecated, use geoEnabled
event instead. Triggered when the geo mode is activated
Arguments
- listener
function()
ogma.events.onGeoModeLoaded(listener)
deprecated
Deprecated, use geoLoaded
event instead. Triggered when the background map images are loaded
Arguments
- listener
function()
ogma.events.onGestureEnd(listener)
deprecated
Deprecated, use gestureEnd
event instead. Triggers the specified function when the user stop touching the screen with two fingers.
Arguments
- listener
function(evt: {domEvent: Event})
ogma.events.onGestureProgress(listener)
deprecated
Deprecated, use gestureProgress
event instead. Triggers the specified function when the users moves two fingers.
Arguments
- listener
function(evt: {x: number, y: number, scale: number, angle: number, dx: number, dy: number, domEvent: Event})
ogma.events.onGestureStart(listener)
deprecated
Deprecated, use gestureStart
event instead. Triggers the specified function when the user touch the screen with two fingers.
Arguments
- listener
function(evt: {domEvent: Event})
ogma.events.onGraphCleared(listener)
deprecated
Deprecated, use clearGraph
event instead. Triggers the specified function when ogma.clearGraph is called.
Arguments
ogma.events.onHover(listener)
deprecated
Deprecated, use mouseover
event instead. Triggers the specified function when a node or edge is hovered.
Arguments
- listener
function(evt: {x: number, y: number, target: InputTarget, domEvent: Event})
ogma.events.onLayoutComplete(listener)
deprecated
Deprecated, use layoutEnd
event instead.
Arguments
- listener
function(evt: { name: string, ids: Array<NodeId>, positions: { before: Array<{x: number, y: number}>, after: Array<{x: number, y: number}>}})
ogma.events.onLayoutComputed(listener)
deprecated
Deprecated, use layoutComputed
event instead.
This event is fired after the layout algorithm has finished the calculations, but before the positions are applied. Use it for UI interactions, because if you would add position manipulations into the listener, they can interfere with the layout results.
Arguments
- listener
function(payload: { name: string })
ogma.events.onLayoutStart(listener)
deprecated
Deprecated, use layoutStart
event instead.
Arguments
- listener
function(evt: { name: string, ids: Array<NodeId>})
ogma.events.onMouseButtonDown(listener)
deprecated
Deprecated, use mousedown
event instead..
Arguments
- listener
function(evt: {x: number, y: number, target: InputTarget, button: MouseButton, source: InputSource, domEvent: Event})
ogma.events.onMouseButtonUp(listener)
deprecated
Deprecated, use mouseup
event instead..
Arguments
- listener
function(evt: {x: number, y: number, target: InputTarget, button: MouseButton, source: InputSource, domEvent: Event})
ogma.events.onMouseMove(listener)
deprecated
Deprecated, use mousemove
event instead..
Arguments
- listener
function(evt: {x: number, y: number, dx: number, dy: number, source: InputSource, domEvent: Event})
ogma.events.onMouseWheel(listener)
deprecated
Deprecated, use mousewheel
event instead. Triggers the specified function when the user uses the mouse wheel.
Arguments
- listener
function(evt: {x: number, y: number, delta: number, domEvent: Event})
delta
is a number between -1 and 1.
ogma.events.onNodeDataChange(listener)
deprecated
Deprecated, use updateNodeData
event instead. Trigger the specified function when the data of some nodes is updated.
Arguments
- listener
function(evt: {changes: Array<{property: PropertyPath, nodes: NodeList, previousValues: Array<any>, newValues: Array<any>}>})
ogma.events.onNodeDragEnd(listener)
deprecated
Deprecated, use nodesDragEnd
event instead. Triggered when the user stop dragging some nodes.
Arguments
- listener
function(evt: {nodes: NodeList, start: Array<{x: number, y: number}>, end: Array<{x: number, y: number}>})
ogma.events.onNodeDragProgress(listener)
deprecated
Deprecated, use nodesDragProgress
event instead. Triggered when the user drags some nodes.
Arguments
- listener
function(evt: {nodes: NodeList, dx: number, dy: number })
ogma.events.onNodeDragStart(listener)
deprecated
Deprecated, use nodesDragStart
event instead. Triggered when the user starts to drag some nodes.
Arguments
- listener
function(evt: {nodes: NodeList})
ogma.events.onNodesAdded(listener)
deprecated
Deprecated, use addNodes
event instead. Triggers the specified function when some nodes are added to the graph.
Arguments
- listener
function (evt: {nodes: NodeList})
ogma.events.onNodesConnected(listener)
deprecated
Deprecated, use connectNodes
event instead. Trigger the specified function when two nodes are connected using the module.
Arguments
ogma.events.onNodesRemoved(listener)
deprecated
DEPRECATED: see #Event:-removeNodes DEPRECATED see #Event:- Triggers the specified function when some nodes are removed from the graph.
Arguments
- listener
function (evt: {nodes: NodeList})
ogma.events.onNodesSelected(listener)
deprecated
Deprecated, use nodesSelected
event instead. Triggers the specified function when some nodes are selected.
Arguments
- listener
function(evt: {nodes: NodeList})
ogma.events.onNodesUnselected(listener)
deprecated
Deprecated, use nodesUnselected
event instead. Triggers the specified function when some nodes are removed from the selection.
Arguments
- listener
function(evt: {nodes: NodeList})
ogma.events.onRendererStateChange(listener)
deprecated
Deprecated, use rendererStateChange
event instead. Triggered when the renderer is requested, successfully initialized or encounters an error.
Arguments
- listener
function (evt: {type: RendererType, state: RendererState, code: RendererErrorCode, message: string})
ogma.events.onTooltipHidden(listener)
deprecated
Deprecated, use tooltipHide
event instead. Triggers the specified function when a tooltip is hidden.
Arguments
- listener
function (evt: {tooltip: HTMLElement})
ogma.events.onTooltipShown(listener)
deprecated
Deprecated, use tooltipShow
event instead. Triggers the specified function when a tooltip is shown.
Arguments
- listener
function (evt: {tooltip: HTMLElement})
ogma.events.onTransformationDestroyed(listener)
deprecated
Deprecated, use transformationDestroyed
event instead. Triggered when a transformation is destroyed
Arguments
- listener
function({ target: Transformation }):void
ogma.events.onTransformationDisabled(listener)
deprecated
Deprecated, use transformationDisabled
event instead. Triggered when a transformation is disabled
Arguments
- listener
function({ target: Transformation }):void
ogma.events.onTransformationEnabled(listener)
deprecated
Deprecated, use transformationEnabled
event instead. Triggered when a transformation is activated
Arguments
- listener
function({ target: Transformation }):void
ogma.events.onTransformationRefreshed(listener)
deprecated
Deprecated, use transformationRefresh
event instead. Triggered when a transformation index is set
Arguments
- listener
function({ target: Transformation }):void
ogma.events.onTransformationSetIndex(listener)
deprecated
Deprecated, use transformationSetIndex
event instead. Triggered when a transformation index is set
Arguments
- listener
function({ target: Transformation, index: number }):void
ogma.events.onUnhover(listener)
deprecated
Deprecated, use mouseOut
event instead. Triggers the specified function when a node or edge stops being hovered.
Arguments
- listener
function(evt: {x: number, y: number, target: InputTarget, domEvent: Event})
ogma.events.onViewChanged(listener)
deprecated
Deprecated, use viewChanged
event instead. is finished.
Arguments
- listener
function()
ogma.events.onZoomProgress(listener)
deprecated
Deprecated, use cameraZoom
event instead. Triggers the specified function when zoom animation is in progress
Arguments
- listener
function()