Defines the geometry of IPort instances with respect to specific IPortLocationModelParameters.
Remarks
In addition to defining the location of a port with respect to a specific IPortLocationModelParameter, a port location model is typically the factory of the model parameters that are compatible with it, too.
Typically, the port location model defines a compilation of valid locations for ports, and a specific model parameter specifies an exact geometry for a port.
By design, the same instance of a port location model can be shared by multiple port location model parameters. Similarly, the same instance of a port location model parameter can be shared by multiple ports.
This interface supports the lookup method that can be used to query additional aspects of the implementation.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.IPortLocationModel
See Also
Methods
Factory method that creates a parameter for the given owner
that tries to match the provided location in absolute world coordinates.
Parameters
A map of options to pass to the method.
- owner - IPortOwner
- The port owner that will own the port for which the parameter shall be created.
- location - Point
- The location in the world coordinate system that should be matched as best as possible.
Returns
- ↪IPortLocationModelParameter
- A new instance that can be used to describe the location of an IPort at the given
owner
.
Throws
- Exception({ name: 'ArgumentError' })
location
contains one or more NaN values.
Provides a lookup context for the given combination of port and parameter.
Parameters
A map of options to pass to the method.
- port - IPort
- The port to use in the context.
- locationParameter - IPortLocationModelParameter
- The parameter to use for the port in the context.
Returns
Determines the location of the port for the given parameter.
Parameters
A map of options to pass to the method.
- port - IPort
- The port to determine the location for.
- locationParameter - IPortLocationModelParameter
- The parameter to use. The parameter can be expected to be created by this instance having the model property set to this instance..
Returns
- ↪Point
- The calculated location of the port.
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.