A port location model that places the port on a certain edge segment at a specified ratio.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.SegmentRatioPortLocationModel
See Also
Methods
Creates the a new parameter for the specified segment index and ratio.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- ratio - number
- The ratio for the segment, with
0
being at the start of the segment and1
at the end. - segmentIndex - number
- The index of the segment.
Returns
- ↪IPortLocationModelParameter
- A parameter for the given ratio and segment.
Creates the a new parameter for the specified segment index counted from the target end of the edge and the provided ratio.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- ratio - number
- The ratio for the segment, with
0
being at the start of the segment and1
at the end. - segmentIndex - number
- The index of the segment counted from the target end.
Returns
- ↪IPortLocationModelParameter
- A parameter for the given ratio and segment.
Factory method that creates a parameter for the given owner
that tries to match the provided location in absolute world coordinates.
Parameters
options - Object
A map of options to pass to the method.
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.
Implements
Provides a lookup context for the given combination of port and parameter.
Parameters
options - Object
A map of options to pass to the method.
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
- ↪ILookup
- An implementation of the ILookup interface that can be used to query additional aspects of the port/parameter combination.
Implements
Determines the location of the port for the given parameter.
Parameters
options - Object
A map of options to pass to the method.
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.
Implements
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
Implements
Constants
A static immutable global instance of this class.