Nodes
A node is a graph item that represents an entity. It is modeled by the interface INode. INode provides properties that define the node’s characteristics. All properties, except tag, are read-only. You can set their values using the corresponding methods on IGraph.
Property | Setter | Description |
---|---|---|




Nodes cannot be created with a constructor directly. Instead, create and remove nodes from the graph using IGraph’s methods:
- createNode(layout: Rect, style: INodeStyle, tag: Object): INode
- createNodeAt(location: Point, style: INodeStyle, tag: Object): INode
- createNode(parent: INode, layout: Rect, style: INodeStyle, tag: Object): INode
- Creates a node. The overloads allow setting the new node’s properties at creation time. Values not passed as parameters will be set to the default values as defined in the node defaults.
- remove(item: IModelItem): void
- Removes the specified node from the graph. Before the node is removed, all dependent items (the node’s labels and ports, and also adjacent edges) are removed.
You can only modify or remove nodes that are part of the current graph instance. Trying to modify or remove a node that has already been removed will result in an exception. Also, if your use case involves several IGraph instances (especially if you are using filtering or folding), take care to modify and remove nodes only with the graph the node belongs to.