Constructor
# new LinkRenderer(pluginData, viewport, readOnly)
Default constructor.
Parameters:
Name | Type | Description |
---|---|---|
pluginData |
DefaultData
|
Plugin data storage. |
viewport |
object
|
D3 selection of the view port. |
readOnly |
boolean
|
Read only state. |
Members
Methods
# getClosestAnchor(sourceId, targetId) → {object}
Get the closest anchor of a source component to a target component.
Parameters:
Name | Type | Description |
---|---|---|
sourceId |
string
|
Source component id. |
targetId |
string
|
Target component id. |
- Object that contains name, position and width of the source anchor.
object
# getLinkPoints(sourceAnchor, targetAnchor) → {string}
Get path definition of a link.
Parameters:
Name | Type | Description |
---|---|---|
sourceAnchor |
object
|
BoundingClientRect of the source anchor. |
targetAnchor |
object
|
BoundingClientRect of the target anchor. |
Path definition.
string
# getReducedPointPositionOnSegment(xa, ya, xb, yb, reduction) → {object}
Computes a new point on the line segment defined by (xa, ya) and (xb, yb) that is reduced by a
specified distance from the end point (xb, yb).
Parameters:
Name | Type | Description |
---|---|---|
xa |
number
|
The x-coordinate of the start point of the segment. |
ya |
number
|
The y-coordinate of the start point of the segment. |
xb |
number
|
The x-coordinate of the end point of the segment. |
yb |
number
|
The y-coordinate of the end point of the segment. |
reduction |
number
|
The distance by which to reduce the segment from the end point (xb, yb). |
An object containing the x and y coordinates of the new point on the segment.
object
# getTemplateData(link) → {object}
Get data for nunjucks templating.
Parameters:
Name | Type | Description |
---|---|---|
link |
ComponentLink
|
Link to render. |
Data for templating.
object