insertLink method

Link? insertLink([
  1. Node? fromnode,
  2. GraphObject? fromport,
  3. Node? tonode,
  4. GraphObject? toport,
])

Make a copy of the #archetypeLinkData, set its node and port properties, and add it to the GraphLinksModel. If the model is a TreeModel, set the parent key of the child's node data object.

For GraphLinksModels, if #archetypeLabelNodeData is non-null, this method also adds that node data as an initial label node for the new link data.

For TreeModels, if Diagram#isTreePathToChildren is false, the roles of the fromnode and tonode arguments are exchanged.

This method may be overridden, but we recommend that you call this base method. Usually though it is easiest to just set #archetypeLinkData to control what kind of link is created. Please read the Introduction page on Extensions for how to override methods and how to call this base method. @expose @param {Node} fromnode @param {GraphObject} fromport the from-port, or null to use the node itself @param {Node} tonode @param {GraphObject} toport the to-port, or null to use the node itself @return {Link} the newly created Link, or null if it failed. @see #doNoLink

Implementation

_i3.Link? insertLink([
  _i3.Node? fromnode,
  _i3.GraphObject? fromport,
  _i3.Node? tonode,
  _i3.GraphObject? toport,
]) =>
    _i4.callMethod(
      this,
      'insertLink',
      [
        fromnode ?? _i5.undefined,
        fromport ?? _i5.undefined,
        tonode ?? _i5.undefined,
        toport ?? _i5.undefined,
      ],
    );