Label
Data representation of text objects. Not called Text due to JavaScript already having a Text class.
Constructor Summary
Public Constructor | ||
public |
constructor(x: number, y: number, parentObject: Node | Edge) Constructs a Label instance. |
Member Summary
Public Members | ||
public get |
Returns the font properties concatenated to match the CanvasRenderingContext2D.font property. |
|
public |
parentObject: * |
|
public |
textMetric: * |
|
public |
x: * |
|
public |
y: * |
Method Summary
Public Methods | ||
public |
containsPoint(x: number, y: number): boolean Check if the label contains the given point. |
|
public |
draw(context: CanvasRenderingContext2D) Draw the label on the given canvas context. |
|
public |
drawBox(context: CanvasRenderingContext2D) Draw a box around the label's selection area on the given canvas context. |
|
public |
Update the label's position. |
Public Constructors
Public Members
public get font: string: string source
Returns the font properties concatenated to match the CanvasRenderingContext2D.font property.
public parentObject: * source
public textMetric: * source
public x: * source
public y: * source
Public Methods
public containsPoint(x: number, y: number): boolean source
Check if the label contains the given point.
public draw(context: CanvasRenderingContext2D) source
Draw the label on the given canvas context.
Params:
Name | Type | Attribute | Description |
context | CanvasRenderingContext2D | Canvas 2D context. |
public drawBox(context: CanvasRenderingContext2D) source
Draw a box around the label's selection area on the given canvas context.
Params:
Name | Type | Attribute | Description |
context | CanvasRenderingContext2D | Canvas 2D context. |