Class

OutputPlugComponent

OutputPlugComponent(type, engine, node, styleType, label) → {object}

Constructor

# new OutputPlugComponent(type, engine, node, styleType, label) → {object}

Initiate the OututPlugComponent object.

Parameters:
Name Type Default Description
type OutputPlugComponentType

The type of the plug. All of the outgoing connectors will only connect to compatible sockets. Also changes in design. See OutputPlugComponent.Type for the types.

engine object

The SVGEngine object that contains this plug.

node object

The object type of Node, this plug is attached to.

styleType string ""

The style of the Connector. See the Connector class for more details.

label string ""

The label of the plug.

See:
  • Component.constructor For the base parameters (x, y, ...)

View Source index.js, line 610

The OutputPlugComponent object.

object

Members

string

# constant Type

Enum for Plug types; (BOOLEAN|NUMBER|INTEGER|CONNECTOR|ANY)

View Source index.js, line 564

Methods

# distance(x, y, x1, y1) → {number}

Get the distance between two points in a 2D system.

Parameters:
Name Type Description
x number

X coordinate of the first point

y number

Y coordinate of the first point

x1 number

X coordinate of the second point

y1 number

Y coordinate of the second point

View Source index.js, line 731

The distance between the two points

number

# getSockets() → {Array.<InputSocketComponent>}

Creates a collection of suitable sockets for connector connections by searching recursively through the elements inside the parent SVG engine object declared on initialization.

View Source index.js, line 769

The collected sockets.

Array.<InputSocketComponent>

# setColor(c) → {void}

Set the colour of the parts creating the connector, like the triangle and the dot.

Parameters:
Name Type Description
c string

The CSS colour you want to switch to.

View Source index.js, line 813

void

# setConnectorType(type) → {void}

Set the type of newly created connectors

Parameters:
Name Type Description
type string

The connector type. See the connector class for possible options.

View Source index.js, line 741

void

# setOpacity(o) → {void}

Set the opacity of this plug (every child element included).

Parameters:
Name Type Description
o string | float | number

The CSS opacity

View Source index.js, line 697

void

# setType(type) → {void}

Change the type of the plug after initialization

Parameters:
Name Type Description
type OutputPlugComponentType

Type to set the plug to.

View Source index.js, line 683

void