Appearance
Ogma.tools.connectNodes
Connect Nodes API: functions to connect nodes by drawing edges.
ogma.tools.connectNodes.disable()
Disable the "connectNodes" mode.
ogma.tools.connectNodes.enable([options])
Enable the "connectNodes" mode, allowing the user to draw edges with the mouse.
Arguments
- options(optional)
object- condition(optional)
function(source: Node, target: Node): booleanIf specified, will only connect nodes that satisfy this condition. - continueDrawing(optional)
boolean[=false]Iftrue, the mode will not be disabled after the first connection is created. - createEdge(optional)
function(rawEdge: RawEdge):RawEdgeCallback called before creating a new edge: allows you to change the id, data and attributes of the new edge. - createNode(optional)
function(rawNode: RawNode):RawNodeCallback called before creating a new node: allows you to change the id, data and attributes of the new node. - createNodes(optional)
boolean[=true]Indicates if a node should be created when pointing on an empty space. - cursorStyle(optional)
CursorStyle[="cell"] - dashLength(optional)
number[=8] - onComplete(optional)
function(source:Node, target: Node, edge: Edge):voidCalled when a new connection is created. Note that target and edge could benullin case of no edge is created. - onEdgeCreated(optional)
function(edge: Edge):voidIn this callback you can add properties or styles to the created edge. - onNodeCreated(optional)
function(node: Node):voidIfcreateNodesis set to true, a new node will be created and here you can add properties or styles to it. - strokeColor(optional)
Color[="black"] - strokeWidth(optional)
number[=2]
- condition(optional)
ogma.tools.connectNodes.enabled()
Indicates if the "connectNodes" mode is enabled.