/** * @fileOverview concentric layout * @author shiwu.wyy@antfin.com * this algorithm refers to - https://github.com/cytoscape/cytoscape.js/ */ import { OutNode, Edge, PointTuple } from './types'; import { Base } from './base'; declare type INode = OutNode & { degree: number; size: number | PointTuple; }; /** * 同心圆布局 */ export declare class ConcentricLayout extends Base { /** 布局中心 */ center: PointTuple; nodeSize: number | PointTuple; /** min spacing between outside of nodes (used for radius adjustment) */ minNodeSpacing: number; /** prevents node overlap, may overflow boundingBox if not enough space */ preventOverlap: boolean; /** how many radians should be between the first and last node (defaults to full circle) */ sweep: number | undefined; /** whether levels have an equal radial distance betwen them, may cause bounding box overflow */ equidistant: boolean; /** where nodes start in radians */ startAngle: number; /** whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) */ clockwise: boolean; /** the letiation of concentric values in each level */ maxLevelDiff: undefined | number; /** 根据 sortBy 指定的属性进行排布,数值高的放在中心,如果是 sortBy 则会计算节点度数,度数最高的放在中心 */ sortBy: string; nodes: INode[]; edges: Edge[]; width: number; height: number; private maxValueNode; private counterclockwise; constructor(options?: ConcentricLayout.ConcentricLayoutOptions); getDefaultCfg(): { nodeSize: number; minNodeSpacing: number; preventOverlap: boolean; sweep: undefined; equidistant: boolean; startAngle: number; clockwise: boolean; maxLevelDiff: undefined; sortBy: string; }; /** * 执行布局 */ execute(): { nodes: INode[]; edges: Edge[]; } | undefined; getType(): string; } export declare namespace ConcentricLayout { interface ConcentricLayoutOptions { type: 'concentric'; center?: PointTuple; preventOverlap?: boolean; nodeSize?: number | PointTuple; minNodeSpacing?: number; sweep?: number; equidistant?: boolean; startAngle?: number; clockwise?: boolean; maxLevelDiff?: number; sortBy?: string; workerEnabled?: boolean; width?: number; height?: number; } } export {};