The interface for node entities in an IGraph.
Remarks
IGraph
, nodes support the lookup method inherited from the IModelItem interface can be used to query additional aspects of each instance.Examples
Related Reading in the Developer's Guide
The graph model with all relevant types and their relationships is presented in detail in the section The Graph Model.
Using the look-up mechanism is explained in the section Service Locator Pattern: Lookup.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.INode
See Also
Properties
Gets a collection of labels that are owned by this instance.
Remarks
This gives access to a read-only live view of the labels, i.e. the collection can change over time, as well as the labels contained in it. If a snapshot of the current state is needed, one needs to copy the collection and its contents.
To modify the label collection for instances of the default implementations that were created via the factory methods on IGraph, use addLabel and remove.
Examples
See Also
Defined in
Gets a rectangle describing the position and size of the node.
Remarks
The layout of a node is defined as a rectangle in the world coordinate system that describes the bounding box of the representation of a node.
To change the layout for instances of the default implementation that were created via the factory methods on IGraph, use setNodeLayout
This method will yield a live view. To obtain a snapshot one has to copy the values of the instance, e.g. by calling toRect on it.
Examples
See Also
Gets a collection of ports that are owned by this instance.
Remarks
This gives access to a read-only live view of the ports, i.e. the collection can change over time, as well as the ports contained in it. If a snapshot of the current state is needed, one needs to copy the collection.
To modify the port collection for instances of the default implementations that were created via the factory methods on IGraph, use addPort and remove.
Examples
See Also
Defined in
Gets the style that is responsible for the visual representation of this node in a CanvasComponent.
Remarks
Note that the style instance associated with a node instance may be shared between multiple node instances and that the modification of this style will result in a change of the appearance of all nodes that are associated with the same style instance.
To change the style for instances of the default implementation that were created via the factory methods on IGraph, use setStyle
Examples
See Also
Gets or sets the tag associated with this instance.
Remarks
Examples
See Also
Implements
Methods
Returns an instance that implements the given type or null
.
Remarks
null
implementations for the types, nor does it have to return the same instance any time. Also it depends on the type and context whether the instance returned stays up to date or needs to be reobtained for subsequent use.Type Parameters
- T: any
Parameters
A map of options to pass to the method.
- type - Class<T>
- The type for which an instance shall be returned.
Returns
- ↪T
- an instance that is assignable to type or
null
See Also
$class
property on JavaScript classes inheriting from yFiles classes is only valid once an instance of this subclass was created. Call fixType, first or instantiate the class at least once.