Base interface for items that can be used in a CanvasComponent.
Inheritance Hierarchy
Implemented Interfaces
Remarks
Most prominently this is the interface all graph elements used in IGraph implement.
It adds no functionality over the ILookup and ITagOwner interfaces it inherits.
To add custom visuals to a CanvasComponent it is not necessary to implement this interface. Instead, any object can be added directly to the canvas, provided there is a suitable ICanvasObjectDescriptor implementation for rendering it.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.IModelItem
See Also
Properties
Gets or sets the tag associated with this instance.
Remarks
The tag is an optional user-defined object which can be used to store arbitrary data related to this item. The item itself does not normally depend on the tag associated with it. It serves as storage for the object only.
Examples
See Also
Nodes,
Edges,
Labels,
Ports,
Associating Data with Graph Elements,
Using Data Binding,
Adding Custom Data for Serialization,
Examples for Lookup Decoration
Defined in
Methods
Returns an instance that implements the given type or null
.
Remarks
Typically, this method will be called in order to obtain a different view or aspect of the current instance. This is quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or compile time constraints. An instance implementing this method is not required to return non-
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
options - Object
A map of options to pass to the method.
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
Note that the
$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.