tracking-code-which-will-go-to-the-HEAD LinkRenderer

Class

LinkRenderer

LinkRenderer(pluginData, viewport, readOnly)

Class to render link.
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.

View Source draw/render/LinkRenderer.js, line 7

Members

DefaultData

# pluginData

Plugin data storage.

View Source draw/render/LinkRenderer.js, line 19

# readOnly

Read only state.

View Source draw/render/LinkRenderer.js, line 30

object

# scenePosition

Object that contains position x and y of the scene.

View Source draw/render/LinkRenderer.js, line 36

Selection

# viewport

D3 selection of the view port.

View Source draw/render/LinkRenderer.js, line 25

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.

View Source draw/render/LinkRenderer.js, line 106

- 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.

View Source draw/render/LinkRenderer.js, line 63

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).

View Source draw/render/LinkRenderer.js, line 148

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.

View Source draw/render/LinkRenderer.js, line 171

Data for templating.
object

# render()

Render nodes for each link.

View Source draw/render/LinkRenderer.js, line 42