Constructor
new Node(p5, x, y, settingsopt, isFixedopt, minDistanceopt, repulsionRadiusopt)
Create a new Node object
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
p5 |
object | Reference to global instance of p5.js for drawing | ||
x |
number | Initial X coordinate | ||
y |
number | Initial Y coordinate | ||
settings |
object |
<optional> |
Object of local override Settings to merge with Defaults | |
isFixed |
boolean |
<optional> |
false
|
Whether or not this Node is allowed to move |
minDistance |
number |
<optional> |
Minimum distance this Node wants to be to nearby Nodes | |
repulsionRadius |
number |
<optional> |
Radius around Node that will affect movement of other Nodes |
Extends
- Vec2
Methods
draw()
Draw this Node to the canvas
iterate()
Moves Node by one "step