fybdp-d3-kg
Version:
Knowledge Graph using React and D3.js
52 lines (51 loc) • 1.69 kB
TypeScript
export declare class VowlMath {
static loopFunction: 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 path for a link, if it is a loop. Currently only working for circlular nodes.
* @param link the link
* @returns {*}
*/
static getLoopPoints: (link: any) => {
x: any;
y: any;
}[];
static calculateLoopPath: (link: any) => any;
static calculateLoopPoints: (link: any) => any[];
/**
* @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;
/**
* 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;
};
}