You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.6 KiB

4 months ago
import type { RuntimeContext } from '../../runtime/types';
import type { BasePluginOptions } from '../base-plugin';
import { BasePlugin } from '../base-plugin';
/**
* <zh/>
*
* <en/> Edge bundling options
*/
export interface EdgeBundlingOptions extends BasePluginOptions {
/**
* <zh/>
*
* <en/> The strength of the edge
* @defaultValue 0.1
*/
K?: number;
/**
* <zh/>
*
* <en/> An initial step size. In subsequent cycles, the step size will double incrementally
* @defaultValue 0.1
*/
lambda?: number;
/**
* <zh/>
*
* <en/> The number of simulation cycles
* @defaultValue 6
*/
cycles?: number;
/**
* <zh/> `divRate`
*
* <en/> An initial number of subdivision points for each edge. In subsequent cycles, the number of subdivision points will increase gradually according to `divRate`
* @defaultValue 1
*/
divisions?: number;
/**
* <zh/>
*
* <en/> The rate at which the number of subdivision points increases
* @defaultValue 2
*/
divRate?: number;
/**
* <zh/> `iterRate`
*
* <en/> The number of iteration steps during the first cycle. In subsequent cycles, the number of iterations will decrease gradually according to `iterRate`
* @defaultValue 90
*/
iterations?: number;
/**
* <zh/>
*
* <en/> The rate at which the number of iterations decreases
* @defaultValue 2 / 3
*/
iterRate?: number;
/**
* <zh/>
*
* <en/> Edge compatibility threshold, which determines which edges should be bundled together
* @defaultValue 0.6
*/
bundleThreshold?: number;
}
/**
* <zh/>
*
* <en/> Edge bundling
* @remarks
* <zh/> Edge Bundling
*
* <zh/> G6 FEDBForce-Directed Edge Bundling for Graph Visualization
*
* <en/> Edge bundling is a graph visualization technique used to reduce visual clutter in complex network graphs and reveal high-level patterns and structures in the graph. The idea is to bundle adjacent edges together.
*
* <en/> The edge bundling plugin provided in G6 is based on the implementation of the paper FEDB (Force-Directed Edge Bundling for Graph Visualization): modeling edges as flexible springs that can attract each other and bundling them in a self-organizing way.
*/
export declare class EdgeBundling extends BasePlugin<EdgeBundlingOptions> {
static defaultOptions: Partial<EdgeBundlingOptions>;
constructor(context: RuntimeContext, options?: EdgeBundlingOptions);
private edgeBundles;
private edgePoints;
private get nodeMap();
private divideEdges;
private getVectorPosition;
private measureEdgeCompatibility;
private getEdgeBundles;
private getSpringForce;
private getElectrostaticForce;
private getEdgeForces;
protected onBundle: () => void;
private bindEvents;
private unbindEvents;
destroy(): void;
}