trassel
Version:
Graph computing in JavaScript
21 lines (20 loc) • 957 B
TypeScript
/**
* An n-body approximation based on Barnes and Hut.
* To read more:
* https://people.eecs.berkeley.edu/~demmel/cs267/lecture26/lecture26.html
* https://jheer.github.io/barnes-hut/
* @param {number=} theta - Parameter used to control performance vs accuracy. Should be around 1 +/- 0,3
* @param {number=} distanceMax - The maximum distance between nodes to consider approximations
* @param {number=} distanceMin - The minimum distance between nodes to consider approxiamations
* @param {boolean=} isRepulse - If true nodes push each other away, if false nodes attract each other
*/
export default class NBody extends LayoutComponent {
constructor(theta?: number, distanceMax?: number, distanceMin?: number, isRepulse?: boolean);
theta: number;
distanceMax: number;
distanceMin: number;
isRepulse: boolean;
initialize(...args: any[]): void;
execute(alpha: any): void;
}
import LayoutComponent from "./layoutcomponent";