Node

Node~ Node

Single point (node) within a Path, whose only job is to manage it's position and movement towards new position.

Constructor

new Node(p5, x, y, settingsopt, isFixedopt, minDistanceopt, repulsionRadiusopt)

Source:
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()

Source:
Draw this Node to the canvas

iterate()

Source:
Moves Node by one "step