trassel
Version:
Graph computing in JavaScript
26 lines (25 loc) • 1.25 kB
TypeScript
/**
* Grid layout creates a grid on either the Y-axis, X-axis or both.
* The grid draws nodes towards these sets of axises, creating a matrix of small gravitational spaces resulting in a more square looking graph.
* This layout can help make some graphs look much more tidy.
* @param {boolean=} useY - If true the Y axis force will be activated
* @param {boolean=} useX - If true the X axis force will be activated
* @param {number=} strength - How strong should the force that pulls node into the axis be?
* @param {number=} size - How large should each axis space be?
* @param {number=} offsetMultiplier - If no size is provided the size of nodes will be used. This multiplier can be used to multiply the measurements by a given number.
*/
export default class Grid extends LayoutComponent {
constructor(useX?: boolean, useY?: boolean, strength?: number, size?: undefined, offsetMultiplier?: number);
useX: boolean;
useY: boolean;
strength: number;
size: any;
offsetMultiplier: number;
maxSizeX: number;
maxSizeY: number;
getWidth(node: any): any;
getHeight(node: any): any;
initialize(...args: any[]): void;
execute(alpha: any): void;
}
import LayoutComponent from "./layoutcomponent";