Skip to content

Event Reference

Every event BlowCanvas raises, wired to one canvas and logged under it with its payload - the quickest way to find out which event answers your question, when it fires and what it carries. Repeats are merged into one line with a count, and the three noisiest families stay off until you tick them.

select, then drag an end
Input
Hover, click, drag me
Resize me
Output
bit Blow

Try it

  • Look at the bottom of the log: OnInit and OnNodesInitialized were raised as the page opened, once the canvas had rendered and measured its nodes.
  • Hover a node or an edge for its mouse-enter and mouse-leave events; tick Node and edge mouse moves to see the moves between them. Move onto and off the canvas for OnPaneMouseEnter and OnPaneMouseLeave; tick Pane mouse moves for OnPaneMouseMove.
  • Click, double-click and right-click a node, an edge and the empty background. No browser menu opens over the canvas.
  • Drag a node: OnNodeDragStart, one OnNodeDrag line counting the moves, OnNodeDragStop, then the edit's NodesChanged, OnGraphChanged and OnHistoryChanged.
  • Drag the background to pan and scroll to zoom: OnMoveStart, OnMoveEnd, OnViewportChanged and OnPaneScroll. Tick Viewport moves for the stream of OnMove in between. Resize the browser window for OnPaneResize.
  • Shift+drag a box round two nodes for OnSelectionStart, OnSelectionChange and OnSelectionEnd; drag one of them for the selection-drag events, and right-click one for OnSelectionContextMenu.
  • Drag from a handle to a handle of another node: OnConnectStart, OnConnectionChange while the line follows the pointer, OnConnect and OnConnectEnd. Let go on empty space instead and there is no OnConnect, and OnConnectEnd says the drop was not valid.
  • Click an edge to select it, then drag one of the dots at its ends to another handle: OnReconnectStart, OnReconnect and OnReconnectEnd.
  • Click "Resize me" to select it and drag a corner or a side: OnNodeResizeStart, OnNodeResize and OnNodeResizeEnd.
  • Select something and press Delete: OnNodesDelete, OnEdgesDelete and OnDelete. Ctrl+Z (Cmd+Z) brings it back.
  • Select a node and press Ctrl+C then Ctrl+V (Cmd on a Mac) for OnPaste.
  • Click Add a broken edge: it points at a node that does not exist, and OnError reports it. Clear log empties the log.

How it works

  • Node pointer events carry a BlowNodeMouseEvent - the Node and the DOM Event (MouseEventArgs: ClientX, ClientY, the modifier keys) - except OnNodeClick, which carries the BlowNode. Edge events match with BlowEdgeMouseEvent (Edge, Event) and OnEdgeClick's BlowEdge.
  • Pane events carry the MouseEventArgs; OnPaneScroll carries the WheelEventArgs (DeltaX, DeltaY) of every wheel event, before it pans or zooms.
  • The canvas only listens for node and edge mouse moves, enters, leaves, double-clicks and context menus, and for pane mouse moves, while a handler is supplied. The checkboxes pass a default EventCallback when off, which takes the DOM listener away rather than merely ignoring what it hears.
  • A handled OnNodeContextMenu, OnEdgeContextMenu or OnSelectionContextMenu suppresses the browser's menu; OnPaneContextMenu does not, so the page wraps the canvas in an element with @oncontextmenu:preventDefault.
  • Drag and resize events carry the live BlowNode grabbed, its Position, Width and Height already updated. A drag moving several nodes adds the BlowSelectionMouseEvent events (Nodes, Event). The start events are raised at the press, so a plain click on a node logs a drag start and stop too.
  • OnMoveStart, OnMove, OnMoveEnd and OnViewportChanged carry the BlowViewport (X, Y, Zoom); OnPaneResize the pane's new BlowDimensions (Width, Height). OnSelectionStart and OnSelectionEnd carry the PointerEventArgs of the box; OnSelectionChange a BlowSelectionChange (Nodes, Edges).
  • OnConnectStart carries a BlowConnectionStartInfo (NodeId, HandleId, HandleType); OnConnectionChange a BlowConnectionLineContext (From, To, IsValid), and null once it ends; OnConnect a BlowConnection (Source, Target, SourceHandle, TargetHandle); OnConnectEnd a BlowConnectEndInfo (IsValid, IsDropped, IsReconnect, FlowPosition, Rejection).
  • Reconnecting raises BlowEdgeReconnectStart (Edge, MovingEnd), BlowEdgeReconnect (Edge, Connection) and BlowEdgeReconnectEnd (Edge, MovingEnd, Rewired); EdgesReconnectable is on by default.
  • Deleting raises OnNodesDelete (IReadOnlyList<BlowNode>), OnEdgesDelete (IReadOnlyList<BlowEdge>) and OnDelete (a BlowSelectionChange of what went).
  • After every completed edit NodesChanged and EdgesChanged hand back the live lists, and OnGraphChanged a BlowGraphChange (Kind, Origin, Label, Nodes, Edges, RemovedNodes, RemovedEdges). With HistoryEnabled, OnHistoryChanged carries a BlowHistoryState (CanUndo, UndoDepth, UndoLabel ...); with ClipboardShortcutsEnabled, OnPaste carries the pasted BlowFragment (Nodes, Edges).
  • OnInit carries the BlowCanvas itself, once, after the first render and measurement; OnNodesInitialized carries nothing; OnError carries a BlowError (Code, Message), once for each distinct problem.
  • "Resize me" has a BlowNodeResizer in its template; the other nodes fall back to BlowDefaultNode. The page merges a repeating event into one line with a count, so a drag is one line rather than fifty.
An unhandled error has occurred. Reload 🗙