Node$Typings extension

on

Properties

avoidable bool
Gets or sets whether this Node is to be avoided by Links whose Link#routing is Link.AvoidsNodes.
getter/setter pair
avoidableMargin Object
Gets or sets the margin around this Node in which avoidable links will not be routed.
getter/setter pair
isLinkLabel bool
This read-only property is true when this Node is a label node for a Link.
getter/setter pair
isTreeExpanded bool
Gets or sets whether the subtree graph starting at this node is expanded. Changing this property's value will call #collapseTree or #expandTree, and also will call the value of #treeExpandedChanged if it is a function.
getter/setter pair
isTreeLeaf bool
Gets whether this node has no tree children.
getter/setter pair
Gets or sets the Link for which this Node is acting as a smart label. Most nodes do not act as link labels, so this property will be null.
getter/setter pair
linkConnected ↔ void Function(Node, Link, GraphObject)?
Gets or sets the function that is called after a Link has been connected with this Node. It is typically used to modify the appearance of the node. The first argument will be this Node. The second argument will be a Link that is now connected with this node. The third argument will be a GraphObject port indicating which port the link was connected with.
getter/setter pair
linkDisconnected ↔ void Function(Node, Link, GraphObject)?
Gets or sets the function that is called after a Link has been disconnected from this Node. It is typically used to modify the appearance of the node. The first argument will be this Node. The second argument will be a Link that had been connected with this node. The third argument will be a GraphObject port indicating which port the link had been connected with.
getter/setter pair
linksConnected Iterator<Link>
This read-only property returns an iterator over all of the Links that are connected with this node. This includes both links that are coming out of this node as well as links that are going into this node. Setting Link#fromNode or Link#toNode to refer to this Node will add that Link to this collection.
getter/setter pair
linkValidation bool Function(Node, GraphObject, Node, GraphObject, Link)?
Gets or sets a predicate that determines whether or not a Link may be connected with this node. If this is non-null, the predicate is called in addition to the predicate that is LinkingBaseTool#linkValidation on the LinkingTool and RelinkingTool. See LinkingBaseTool#isValidLink for more details.
getter/setter pair
port GraphObject
This read-only property returns the primary GraphObject representing a port in this node. If there is a GraphObject whose GraphObject#portId is the empty string, return it. If there is no such element, just return this whole Node.
getter/setter pair
ports Iterator<GraphObject>
This read-only property returns an iterator over all of the GraphObjects in this node that act as ports.
getter/setter pair
portSpreading EnumValue
Gets or sets how link points are computed when the port spot is a "side" spot. The value must be one of Node.SpreadingNone|SpreadingNone, Node.SpreadingEvenly|SpreadingEvenly, Node.SpreadingPacked|SpreadingPacked. The default value is Node.SpreadingEvenly.
getter/setter pair
treeExpandedChanged ↔ void Function(Node)?
Gets or sets the function that is called when #isTreeExpanded has changed value. The argument to that function will be this Node.
getter/setter pair
wasTreeExpanded bool
Gets or sets whether the subtree graph starting at this node had been collapsed by a call to #expandTree on the parent node. The initial value is false.
getter/setter pair

Methods

collapseTree([num? level]) → void
Hide each child node and the connecting link, and recursively collapse each child node. This changes the value of Part#isVisible of the whole subtree and the parts owned by those nodes and links. However, this root node's visibility is unchanged.
expandTree([num? level]) → void
Show each child node and the connecting link, and perhaps recursively expand their child nodes. This may change the value of Part#isVisible of the whole subtree and the parts owned by those nodes and links. However, this root node's visibility is unchanged.
findCommonTreeParent(Node other) Node?
Find the Node that is the perhaps indirect tree parent of both this node and another one, or this node if it is an ancestor of the other node, or vice-versa.
findExternalTreeLinksConnected() Iterator<Link>
Return a collection of Links that connect with this Node or any in its subtree, excluding any isTreeLink Links. For trees this is the analog of Group#findExternalLinksConnected for Groups. @return {Iterator.} @since 2.2
findLinksBetween(Node othernode, [String? pid, String? otherpid]) Iterator<Link>
Returns an iterator over all of the Links that go from this node to another node or vice-versa, perhaps limited to a given port id on this node and a port id on the other node.
findLinksConnected([String? pid]) Iterator<Link>
Returns an iterator over all of the Links that connect with this node in either direction, perhaps limited to the given port id on this node. @expose @param {string|null=} pid A port identifier string; if null the link's portId is ignored and all links are included in the search. @return {Iterator.}
findLinksInto([String? pid]) Iterator<Link>
Returns an iterator over all of the Links that go into this node, perhaps limited to the given port id on this node. @param {string|null=} pid A port identifier string; if null the link's portId is ignored and all links are included in the search. @return {Iterator.}
findLinksOutOf([String? pid]) Iterator<Link>
Returns an iterator over all of the Links that come out of this node, perhaps limited to the given port id on this node. @param {string|null=} pid A port identifier string; if null the link's portId is ignored and all links are included in the search. @return {Iterator.}
findLinksTo(Node othernode, [String? pid, String? otherpid]) Iterator<Link>
Returns an iterator over all of the Links that go from this node to another node, perhaps limited to a given port id on this node and a port id on the other node.
findNodesConnected([String? pid]) Iterator<Node>
Returns an iterator over the Nodes that are connected with this node in either direction, perhaps limited to the given port id on this node.
findNodesInto([String? pid]) Iterator<Node>
Returns an iterator over the Nodes that are connected with this node by links going into this node, perhaps limited to the given port id on this node. @param {string|null=} pid A port identifier string; if null the link's portId is ignored and all links are included in the search. @return {Iterator.
findNodesOutOf([String? pid]) Iterator<Node>
Returns an iterator over the Nodes that are connected with this node by links coming out of this node, perhaps limited to the given port id on this node. @param {string|null=} pid A port identifier string; if null the link's portId is ignored and all links are included in the search. @return {Iterator.
findPort(String pid) GraphObject
Find a GraphObject with a given GraphObject#portId. If no such GraphObject is found, search for one with the empty string as its port identifier. Finally, when failing to find a port with either the given name or the empty string, this method returns this whole node itself. @param {string} pid @return {GraphObject}
Returns an Iterator for the collection of Links that connect with the immediate tree children of this node. Links for which Link#isTreeLink is false are ignored.
findTreeChildrenNodes() Iterator<Node>
Returns an Iterator for the collection of Nodes that are the immediate tree children of this node. Nodes only connected by links for which Link#isTreeLink is false are ignored.
findTreeLevel() num
Return how deep this node is in a tree structure. For tree root nodes, this returns zero. This calls #findTreeParentNode to find any tree parent node, so this respects Diagram#isTreePathToChildren and Link#isTreeLink to know which way to traverse links and to know to ignore non-tree links.
findTreeParentChain() Set<Part>
Return a collection of Parts including this Node, its tree parent link and node, and so on up the chain to the root node.
Returns the Link that connects with the tree parent Node of this node if the graph is tree-structured, if there is such a link and Link#isTreeLink is true. @return {Link} The Link to the parent Node, or null if there is no parent node. @see #findTreeParentNode @see #findTreeChildrenLinks @see Diagram#isTreePathToChildren @see #findTreeRoot @see #findTreeParentChain @since 1.1
findTreeParentNode() Node?
Returns the Node that is the tree parent of this node if the graph is tree-structured, if there is a parent. Links for which Link#isTreeLink is false are ignored. @return {Node} The parent Node, or null if there is no parent node. @see #findTreeParentLink @see #findTreeChildrenNodes @see Diagram#isTreePathToChildren @see #findTreeRoot @see #findTreeParentChain @since 1.1
findTreeParts([num? level]) Set<Part>
Return a collection of Parts including this Node, all of the Links going to child Nodes, and all of their tree child nodes and links. Links for which Link#isTreeLink is false are ignored.
findTreeRoot() Node
Return the Node that is at the root of the tree that this node is in, perhaps this node itself.
findVisibleNode() Node?
Starting with this node, walk up the chain of containingGroups to find a node that is visible. This can be overridden to find a tree-parent/ancestor if the reason that this node is not visible is because of a collapsed tree rather than a collapsed group. @expose @since 2.2 @return {Node}
getAvoidableRect(Rect result) Rect
Return the area to be avoided for this node -- the node's GraphObject#actualBounds plus the Node#avoidableMargin. @expose @param {Rect} result a Rect to be modified and returned. @return {Rect} the area in document coordinates. @since 2.2
(undocumented) This invalidates the routes of all links connected to this node. Basically this calls Link#invalidateRoute on all connected links and invalidates any cached side-connection information. @param {Set.
invalidateLinkBundle(Node other, [String? thisportid, String? otherportid]) → void
(undocumented) @param {Node} other @param {string=} thisportid @param {string=} otherportid
isInTreeOf(Node node) bool
This predicate is true if this node is a child of the given Node, perhaps indirectly as a descendant.