Layout
Reading needs 1 minutes
Get layout options
getLayout(): LayoutOptions;
Returns:
Type: BuiltInLayoutOptions | BaseLayoutOptions | BaseLayoutOptions[]
Description: 布局配置
Execute layout
layout(): Promise<void>;
Returns:
Set layout
setLayout(layout: LayoutOptions | ((prev: LayoutOptions) => LayoutOptions)): void;
Example
graph.setLayout({type: 'dagre',});
Parameter | Type | Description |
---|---|---|
layout | BuiltInLayoutOptions | BaseLayoutOptions | BaseLayoutOptions[] | ((prev: BuiltInLayoutOptions | BaseLayoutOptions | BaseLayoutOptions[]) => BuiltInLayoutOptions | BaseLayoutOptions | BaseLayoutOptions[]) | 布局配置 |
Returns:
Stop layout
stopLayout(): void;
Suitable for layouts with iterative animations. Currently, force
belongs to this type of layout, that is, stop the iteration of the force-directed layout. It is generally used to manually stop the iteration animation when the layout iteration time is too long, such as calling in the click canvas/node listener