UNPKG

2.17 kBTypeScriptView Raw
1import { BezierEdgeBase } from "./util/bezier-edge-base";
2import { EdgeFormattingValues, Label, EdgeOptions, Point, PointT, SelectiveRequired, VBody, VNode } from "./util/types";
3/**
4 * A Dynamic Bezier Edge. Bezier curves are used to model smooth gradual
5 * curves in paths between nodes. The Dynamic piece refers to how the curve
6 * reacts to physics changes.
7 *
8 * @augments BezierEdgeBase
9 */
10export declare class BezierEdgeDynamic extends BezierEdgeBase<Point> {
11 via: VNode;
12 private readonly _boundFunction;
13 /**
14 * Create a new instance.
15 *
16 * @param options - The options object of given edge.
17 * @param body - The body of the network.
18 * @param labelModule - Label module.
19 */
20 constructor(options: EdgeOptions, body: VBody, labelModule: Label);
21 /** @inheritDoc */
22 setOptions(options: EdgeOptions): void;
23 /** @inheritDoc */
24 connect(): void;
25 /** @inheritDoc */
26 cleanup(): boolean;
27 /**
28 * Create and add a support node if not already present.
29 *
30 * @remarks
31 * Bezier curves require an anchor point to calculate the smooth flow.
32 * These points are nodes.
33 * These nodes are invisible but are used for the force calculation.
34 *
35 * The changed data is not called, if needed, it is returned by the main edge constructor.
36 */
37 setupSupportNode(): void;
38 /**
39 * Position bezier node.
40 */
41 positionBezierNode(): void;
42 /** @inheritDoc */
43 protected _line(ctx: CanvasRenderingContext2D, values: SelectiveRequired<EdgeFormattingValues, "backgroundColor" | "backgroundSize" | "shadowColor" | "shadowSize" | "shadowX" | "shadowY">, viaNode: VNode): void;
44 /** @inheritDoc */
45 protected _getViaCoordinates(): Point;
46 /** @inheritDoc */
47 getViaNode(): Point;
48 /** @inheritDoc */
49 getPoint(position: number, viaNode?: Point): Point;
50 /** @inheritDoc */
51 protected _findBorderPosition(nearNode: VNode, ctx: CanvasRenderingContext2D): PointT;
52 /** @inheritDoc */
53 protected _getDistanceToEdge(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): number;
54}
55//# sourceMappingURL=bezier-edge-dynamic.d.ts.map
\No newline at end of file