fybdp-d3-kg
Version:
Knowledge Graph using React and D3.js
66 lines (65 loc) • 2.21 kB
TypeScript
export declare class LinkMath {
static loopFunction: any;
static curveFunction: any;
/**
* 计算两个节点之间路径的法向量。
* Calculates the normal vector of the path between the two nodes.
* @param source the first node
* @param target the second node
* @param length the length of the calculated normal vector
* @returns {{x: number, y: number}}
*/
static calculateNormalVector: (source: any, target: any, length: any) => {
x: number;
y: number;
};
/**
* 计算一个角的弧度
* Calculates the radian of an angle
* @param angle
* @returns {number} the radian of the angle
*/
static calculateRadian: (angle: any) => number;
/**
* 计算的角度
* @param radian
* @returns {number} the angle of the radian
*/
static calculateAngle: (radian: any) => number;
static calculateCurvePoint(source: any, target: any, l: any): {
x: any;
y: any;
};
static calculateMultiLinkDistance(l: any, visibleLinkDistance?: number): number;
static calculateSelfLinkPath(l: any): any;
/**
* 计算源节点和目标节点之间的链接点与目标节点的边界相交。
* Calculates the point where the link between the source and target node
* intersects the border of the target node
* @param source the source node
* @param target the target node
* @param additionalDistance additional distance the
* @returns {{x: number, y: number}}
*/
static calculateIntersection: (source: any, target: any, additionalDistance: any) => {
x: any;
y: any;
};
static calculateCenter: (firstPoint: any, secondPoint: any) => {
x: number;
y: number;
};
/**
* 如果是循环,则计算链接的路径。目前仅适用于环状节点。
* @param link the link
* @returns {*}
*/
static getLoopPoints: (link: any) => {
x: any;
y: any;
}[];
/**
* 计算label节点的循环曲线路径
*/
static calculateLoopPath: (link: any) => any;
}