C

BezierEdgePathLabelModel

An edge label model that allows placement of labels along the edge path for bezier edges.
ImplementsInheritance Hierarchy

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

No filters for this type

Constructors

Creates a default instance of the label model with no angle, auto ratio enabled, and snapping disabled.

Parameters

Properties

Gets or sets the rotation angle of all labels with this model in radians.
final

Property Value

The rotation angle of all labels with this model in radians.
Gets or sets whether or not edge labels are automatically rotated according to the tangent of the corresponding reference edge segment.
By default, this feature is enabled.
final

Property Value

true if edge labels are automatically rotated; false otherwise.
Gets or sets whether the model should snap automatically the layout center to the edge path.
If set to 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 false
final

Methods

Creates a parameter at the provided edge path ratio.
final

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.
This method does not necessarily have to find a parameter that exactly matches the specified layout.
final

Parameters

label: ILabel
The label to find a parameter for.
layout: IOrientedRectangle
The anticipated layout for the label.

Return Value

ILabelModelParameter
A non-null parameter that can be used for the label to approximate the provided layout.
Returns an empty context.
final

Parameters

label: ILabel
The label to use in the context.

Return Value

ILookup
An empty context.
Calculates the geometry of the given label using the given model parameter.
final

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.