- I
Remarks
This model is intended to work with a BezierEdgeStyle and assumes an edge path consisting of cubic segments.
It places the label at a given ratio of the whole path length and distance from the path, which are parameter specific. Additionally, the label can be automatically rotated to be parallel to the tangent vector at the given ratio ( autoRotation) and can have an additional rotation angle (independently of the automatic rotation (angle)
If the parameter is specified as an absolute parameter, a placement outside of the path is assumed by taking the connection between source and target as base line and applying the ratio to this line segment. In this case, if auto rotation is enabled, the label will be rotated to match the path slope at the beginning resp. end of the edge path in order to ensure a smooth movement.
Labels are freely movable and movement can optionally be snapped so that the center of the label lies on the edge path, if the label intersects the edge path.
Members
Constructors
Properties
Property Value
Property Value
true if edge labels are automatically rotated; false otherwise.true: - The distance of the parameter will be adjusted so that the whole box has a minimum distance to the edge path - Interactive movements will snap to the edge path as soon as the label layout would come too near to the edge path. Default value is falseMethods
createParameter
(ratio: numberdistance?: numberabsolute?: boolean): BezierEdgePathLabelModelParameterCreates a parameter at the provided edge path ratio.
createParameter
(Parameters
- ratio: number
- The cubic ratio on the segment
- distance?: number
- The distance from the segment. This may be interpreted differently, depending on whether autoSnapping is enabled or not.
- absolute?: boolean
- Whether the ratio should be interpreted as the ratio between the source and target ports of the edge. Default is false.
Return Value
- BezierEdgePathLabelModelParameter
- A new parameter with the given specification.
Tries to find a parameter that best matches the given layout for the provided label instance.
Parameters
- label: ILabel
- The label to find a parameter for.
- layout: IOrientedRectangle
- The anticipated layout for the label.
Return Value
- ILabelModelParameter
- A non-
nullparameter that can be used for the label to approximate the provided layout.
Parameters
- label: ILabel
- The label to use in the context.
Return Value
- ILookup
- An empty context.
Implements
ILabelModel.getContextCalculates the geometry of the given label using the given model parameter.
Parameters
- label: ILabel
- The label to calculate the geometry for.
- layoutParameter: ILabelModelParameter
- A parameter that is compatible with this model. Typically, this is a parameter that has been created by this model, and its property model returns this instance.
Return Value
- IOrientedRectangle
- An IOrientedRectangle that describes the geometry of the label. This is typically designed as a flyweight, therefore clients should not cache the instance but store the values if they need a snapshot for later use.