Constructor Summary
Public Constructor | ||
public |
constructor(startNode: Node, destNode: Node) Constructs an Edge instance. |
Member Summary
Public Members | ||
public |
bezierPoint: * |
|
public |
destNode: * |
|
public |
destPoint: * |
|
public |
|
|
public |
label: * |
|
public |
partners: * |
|
public |
startNode: * |
|
public |
startPoint: * |
Method Summary
Public Methods | ||
public |
containsPoint(x: number, y: number): boolean Check if the edge contains a given point (within a distance threshold). |
|
public |
detach() Remove the edge from all other graph objects associated with it. |
|
public abstract |
draw(context: CanvasRenderingContext2D) Draw the edge on the given canvas context. |
|
public |
drawArrow(context: CanvasRenderingContext2D) Draw an arrow on the destination side of the edge on the given context. |
|
public |
drawLabel(context: CanvasRenderingContext2D) Draw the Label object associated with this edge. |
|
public |
updateCurvedEdgeLabel(oldStartPoint2D: Point2D, oldBezierPoint2D: Point2D, oldDestPoint2D: Point2D, startPoint2D: Point2D, bezierPoint2D: Point2D, destPoint2D: Point2D) Update the position of the Label for a curved edge. |
|
public |
Update the endpoints of the edge. |
|
public |
Update endpoints for a normal edge. |
|
public |
Update endpoints for a self-loop edge. |
|
public |
updateSelfLoopLabel(oldBezierPoint: Object) Update the position of the Label for a self-loop edge. |
|
public |
updateStraightEdgeLabel(oldStartPoint2D: Point2D, oldBezierPoint2D: Point2D, oldDestPoint2D: Point2D, startPoint2D: Point2D, bezierPoint2D: Point2D, destPoint2D: Point2D) Update the position of the Label for a straight edge. |
Public Constructors
Public Members
public bezierPoint: * source
public destNode: * source
public destPoint: * source
public label: * source
public partners: * source
public startNode: * source
public startPoint: * source
Public Methods
public containsPoint(x: number, y: number): boolean source
Check if the edge contains a given point (within a distance threshold).
public abstract draw(context: CanvasRenderingContext2D) source
Draw the edge on the given canvas context.
Params:
Name | Type | Attribute | Description |
context | CanvasRenderingContext2D | Canvas 2D context. |
Throw:
Throws error if called. |
public drawArrow(context: CanvasRenderingContext2D) source
Draw an arrow on the destination side of the edge on the given context.
Params:
Name | Type | Attribute | Description |
context | CanvasRenderingContext2D | Canvas 2D context. |
public drawLabel(context: CanvasRenderingContext2D) source
Draw the Label object associated with this edge.
Params:
Name | Type | Attribute | Description |
context | CanvasRenderingContext2D | Canvas 2D context. |
public updateCurvedEdgeLabel(oldStartPoint2D: Point2D, oldBezierPoint2D: Point2D, oldDestPoint2D: Point2D, startPoint2D: Point2D, bezierPoint2D: Point2D, destPoint2D: Point2D) source
Update the position of the Label for a curved edge.
Params:
Name | Type | Attribute | Description |
oldStartPoint2D | Point2D | The previous start point. |
|
oldBezierPoint2D | Point2D | The previous bezier point. |
|
oldDestPoint2D | Point2D | The previous destination point. |
|
startPoint2D | Point2D | The current start point. |
|
bezierPoint2D | Point2D | The current bezier point. |
|
destPoint2D | Point2D | The current destination point. |
public updateNormalEdgeEndpoints() source
Update endpoints for a normal edge. Called by updateEndpoints().
public updateSelfLoopEndpoints() source
Update endpoints for a self-loop edge. Called by updateEndpoints().
public updateSelfLoopLabel(oldBezierPoint: Object) source
Update the position of the Label for a self-loop edge.
public updateStraightEdgeLabel(oldStartPoint2D: Point2D, oldBezierPoint2D: Point2D, oldDestPoint2D: Point2D, startPoint2D: Point2D, bezierPoint2D: Point2D, destPoint2D: Point2D) source
Update the position of the Label for a straight edge.
Params:
Name | Type | Attribute | Description |
oldStartPoint2D | Point2D | The previous start point. |
|
oldBezierPoint2D | Point2D | The previous bezier point. |
|
oldDestPoint2D | Point2D | The previous destination point. |
|
startPoint2D | Point2D | The current start point. |
|
bezierPoint2D | Point2D | The current bezier point. |
|
destPoint2D | Point2D | The current destination point. |