trassel
Version:
Graph computing in JavaScript
15 lines (14 loc) • 529 B
TypeScript
/**
* Uses the average of all node positions to create a center force that stops nodes from floating away
* @param {number=} x - x coordinate for the component
* @param {number=} y - y coordinate for the component
* @param {number=} strength - Strength of the force
*/
export default class Center extends LayoutComponent {
constructor(x?: number, y?: number, strength?: number);
x: number;
y: number;
strength: number;
initialize(...args: any[]): void;
}
import LayoutComponent from "./layoutcomponent";