Node(index)

Base class for graph nodes.

new Node(index)

Constructs a new node.

Parameters:
Name Type Description
index Number

The unique index of this node.

Author:

Members

index :Number

The unique index of this node. The default value -1 means invalid index.

Default Value:
  • -1

Methods

fromJSON(json) → {Node}

Restores this instance from the given JSON object.

Parameters:
Name Type Description
json Object

The JSON object.

Returns:
Node -

A reference to this node.

toJSON() → {Object}

Transforms this instance into a JSON object.

Returns:
Object -

The JSON object.