Class: Connector

Connector

new Connector()

Creates a new Connector. Connectors render a straight line between two Flora items. The Connector carries a reference to the two items as parentA and parentB. If the parent items move, the Connector moves with them.
Source:

Extends

  • Item

Members

borderWidth

Connectors have no height or color and rely on the associated DOM element's CSS border to render their line.
Source:

Methods

<static> draw()

Updates the corresponding DOM element's style property.
Source:

<static> getCSSText(props) → {string}

Concatenates a new cssText string.
Parameters:
Name Type Description
props Object A map of object properties.
Source:
Returns:
A string representing cssText.
Type
string

init(options, parentA, parentB)

Parameters:
Name Type Argument Default Description
options Object A map of initial properties.
parentA Object The object that starts the connection.
parentB Object The object that ends the connection.
options.zIndex number <optional>
0 zIndex.
options.borderStyle string <optional>
'dotted' Border style.
options.borderColor Array <optional>
150, 150, 150 Border color.
Source:

step()

Called every frame, step() updates the instance's properties.
Source: