# 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, ...)
The OutputPlugComponent object.
object
Members
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 |
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.
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. |
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. |
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 |
void
# setType(type) → {void}
Change the type of the plug after initialization
Parameters:
Name | Type | Description |
---|---|---|
type |
OutputPlugComponentType
|
Type to set the plug to. |
void