UNPKG

1.04 kBTypeScriptView Raw
1/**
2 * @fileOverview MDS layout
3 * @author shiwu.wyy@antfin.com
4 */
5import { PointTuple, OutNode, Edge, Matrix } from './types';
6import { Base } from './base';
7/**
8 * mds 布局
9 */
10export declare class MDSLayout extends Base {
11 /** 布局中心 */
12 center: PointTuple;
13 /** 边长度 */
14 linkDistance: number;
15 private scaledDistances;
16 nodes: OutNode[];
17 edges: Edge[];
18 constructor(options?: MDSLayout.MDSLayoutOptions);
19 getDefaultCfg(): {
20 center: number[];
21 linkDistance: number;
22 };
23 /**
24 * 执行布局
25 */
26 execute(): {
27 nodes: OutNode[];
28 edges: Edge[];
29 } | undefined;
30 /**
31 * mds 算法
32 * @return {array} positions 计算后的节点位置数组
33 */
34 runMDS(): PointTuple[];
35 handleInfinity(distances: Matrix[]): void;
36 getType(): string;
37}
38export declare namespace MDSLayout {
39 interface MDSLayoutOptions {
40 type: 'mds';
41 center?: PointTuple;
42 linkDistance?: number;
43 workerEnabled?: boolean;
44 }
45}