reagraph
Version:
WebGL Node-based Graph for React
77 lines (76 loc) • 1.79 kB
TypeScript
import { LayoutFactoryProps } from './types';
export interface ForceAtlas2LayoutInputs extends LayoutFactoryProps {
/**
* Should the node’s sizes be taken into account.
*
* @default false
*/
adjustSizes?: boolean;
/**
* whether to use the Barnes-Hut approximation to compute
* repulsion in O(n*log(n)) rather than default O(n^2),
* n being the number of nodes.
*
* @default false
*/
barnesHutOptimize?: boolean;
/**
* Barnes-Hut approximation theta parameter.
*
* @default 0.5
*/
barnesHutTheta?: number;
/**
* Influence of the edge’s weights on the layout. To consider edge weight, don’t
* forget to pass weighted as true.
*
* @default 1
*/
edgeWeightInfluence?: number;
/**
* Strength of the layout’s gravity.
*
* @default 10
*/
gravity?: number;
/**
* Whether to use Noack’s LinLog model.
*
* @default false
*/
linLogMode?: boolean;
/**
* Whether to consider edge weights when calculating repulsion.
*
* @default false
*/
outboundAttractionDistribution?: boolean;
/**
* Scaling ratio for repulsion.
*
* @default 100
*/
scalingRatio?: number;
/**
* Speed of the slowdown.
*
* @default 1
*/
slowDown?: number;
/**
* Whether to use the strong gravity mode.
*
* @default false
*/
strongGravityMode?: boolean;
/**
* Number of iterations to perform.
*
* @default 50
*/
iterations?: number;
}
export declare function forceAtlas2({ graph, drags, iterations, ...rest }: ForceAtlas2LayoutInputs): {
step(): boolean;
getNodePosition(id: string): any;
};