Right click menus
Background menu
The main background menu (right-click on the canvas) is generated by a call toLGraphCanvas.getCanvasMenuOptions. The standard way of editing this is to implement the getCanvasMenuItems method on your extension:
Node menu
When you right click on a node, the menu is similarly generated bynode.getExtraMenuOptions.
The standard way is to implement the getNodeMenuItems method on your extension:
Submenus
If you want a submenu, use thesubmenu property with an options array:
Capture UI events
This works just like you’d expect - find the UI element in the DOM and add an eventListener.setup() is a good place to do this, since the page
has fully loaded. For instance, to detect a click on the ‘Queue’ button:
Detect when a workflow starts
This is one of manyapi events:
Detect an interrupted workflow
Deprecated: The API hijacking pattern shown below is deprecated and subject to change at any point in the near future. Use the official extension hooks and API event listeners where available.
Catch clicks on your node
Deprecated: The node method hijacking pattern shown below is deprecated and subject to change at any point in the near future. Use the official extension hooks where available.
node has a mouseDown method you can hijack.
This time we’re careful to pass on any return value.