Node
Direct Subclass:
Indirect Subclass:
Data representation of a graph node.
Constructor Summary
Public Constructor | ||
public |
constructor(x: number, y: number) Constructs a Node instance. |
Method Summary
Public Methods | ||
public abstract |
containsPoint(x: number, y: number) Check if the node contains the given point. |
|
public abstract |
distanceToPoint(x: number, y: number) Find the distance from the node's coordinates to a given point. |
|
public abstract |
draw(context: CanvasRenderingContext2D) Draw the node on the given canvas context. |
|
public |
drawLabel(context: CanvasRenderingContext2D) Draw the Label object associated with this node. |
|
public abstract |
edgePointInDirection(x: number, y: number) Find the point on the edge of the node in the direction of the given point. |
|
public abstract |
getAnglePoint(angle: number) Get the point on the edge of the node at the given angle. |
|
public |
Update the node position. |
Public Constructors
Public Methods
public abstract containsPoint(x: number, y: number) source
Check if the node contains the given point.
Throw:
Throws error if called. |
public abstract distanceToPoint(x: number, y: number) source
Find the distance from the node's coordinates to a given point.
Throw:
Throws error if called. |
public abstract draw(context: CanvasRenderingContext2D) source
Draw the node on the given canvas context.
Params:
Name | Type | Attribute | Description |
context | CanvasRenderingContext2D | Canvas 2D context. |
Throw:
Throws error if called. |
public drawLabel(context: CanvasRenderingContext2D) source
Draw the Label object associated with this node.
Params:
Name | Type | Attribute | Description |
context | CanvasRenderingContext2D | Canvas 2D context. |
public abstract edgePointInDirection(x: number, y: number) source
Find the point on the edge of the node in the direction of the given point.
Throw:
Throws error if called. |