The 'anchor'
places the connection point so that it coincides with the link end's anchor point (determined either by the anchor
function or by the defaultAnchor
paper option). The position of the connection point may be modified by several additional arguments, which may be passed within the connectionPoint.args
property:
offset | number | object | An object with x and y properties. The connection point will be moved:
x offset.
|
---|---|---|
align | 'top' | 'left' | 'bottom' | 'right' | Offset the connection point to the point given by projecting the first vertex onto the vector which points from the anchor point in the direction specified. (If there are no vertices, use the projection of the other anchor point instead.) Notably, if the reference point is not the direction-most point of the two, the connection point is set to be the same as the anchor point. Let us illustrate that outcome and the other possible outcome on the `'top'` direction:
|
alignOffset | number | After having determined the position of the connection point according to the `align` algorithm (see above), additionally offset the connection point by the specified amount in the direction specified by `align`. |
Example:
link.source(model, {
connectionPoint: {
name: 'anchor',
args: {
offset: 10
}
}
});