# Class: Node

## Node

#### new Node(pos, props)

Constructs a new Node

##### Parameters:

Name | Type | Description
--- | --- | ---
`pos` | Array | Array of three Numbers representing the position of the Node in 3D space (x, y, z)
`props` | Object | Object containing optional properties of the Node ###### Properties
Name | Type | Description
--- | --- | ---
`id` | Number | String | null | Optional unique identifier; Numbers will be converted into Strings; defaults to null
`color` | Number | String | Hexadecimal or CSS-style string representation of a color; defaults to 'white'

Source:
  - graphosaurus_src/graphosaurus.js, line 72312

### Methods

#### addTo(graph) → {Node}

Add the Node to a Graph

##### Parameters:

Name | Type | Description
--- | --- | ---
`graph` | Graph | Graph the Node will be added to

Source:
  - graphosaurus_src/graphosaurus.js, line 72426

##### Returns:

The Node the method was called on

Type
  Node

#### getColor() → {String}

Get the color of the Node

Source:
  - graphosaurus_src/graphosaurus.js, line 72412

##### Returns:

String hexadecimal representation of the Edge's color

Type
  String

#### getId() → {String|Number|null}

Get the ID of the Node

Source:
  - graphosaurus_src/graphosaurus.js, line 72349

##### Returns:

ID of the Node

Type
  String | Number | null

#### getPos() → {Array}

Get the position of the Node

Source:
  - graphosaurus_src/graphosaurus.js, line 72377

##### Returns:

Array of three Numbers representing the position of the Node in 3D space (x, y, z)

Type
  Array

##### Example

    var x = 14, y = 20, z = -5;
    myNode.getPos([x, y, z]);

#### setColor(color)

Set the color of the Node

##### Parameters:

Name | Type | Description
--- | --- | ---
`color` | Number | String | Hexadecimal or CSS-style string representation of a color

Source:
  - graphosaurus_src/graphosaurus.js, line 72387

##### Returns:

The Node the method was called

#### setColorHex(color)

Set the color of the Node

##### Parameters:

Name | Type | Description
--- | --- | ---
`color` | Number | String | Hexadecimal or CSS-style string representation of a color

Source:
  - graphosaurus_src/graphosaurus.js, line 72400

##### Returns:

The Node the method was called

#### setPos(pos) → {Node}

Set the position of the Node

##### Parameters:

Name | Type | Description
--- | --- | ---
`pos` | Array | Array of three Numbers representing the position of the Node in 3D space (x, y, z)

Source:
  - graphosaurus_src/graphosaurus.js, line 72363

##### Returns:

The Node the method was called on

Type
  Node

##### Example

    var x = 14, y = 20, z = -5;
    myNode.setPos([x, y, z]);