A mutable implementation of the INode interface that can be used without an IGraph.
Remarks
Note that this class is not the one used as the default implementation of a DefaultGraph's INodes and casting them to SimpleNode will fail.
Instances of this class can be used without an accompanying graph instance. All of the properties are mutable. An example of a possible use case would be the rendering of a node into a graphics context: Simply create a SimpleNode, associate a style with it and use the style's renderer instance to obtain a rendering for the node.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.SimpleNode
Constructors
Creates a default node with default lookup, an instance of VoidNodeStyle, empty layout and no labels or ports.
Remarks
Parameters
A map of options to pass to the method.
- layout - IRectangle
The layout of the node. This option sets the layout property on the created object.
- style - INodeStyle
The style that is responsible for the visual representation of this node in a CanvasComponent. This option sets the style property on the created object.
- ports - IListEnumerable<IPort>
- labels - IListEnumerable<ILabel>
- tag - Object
Properties
Gets or sets the collection of labels that are owned by this instance.
Gets or sets the layout of the node.
Remarks
See Also
Implements
Gets or sets the collection of ports that are owned by this instance.
Gets or sets the style that is responsible for the visual representation of this node in a CanvasComponent.
Remarks
See Also
Implements
Gets or sets the tag associated with this instance.
Remarks
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