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.

83 lines
3.5 KiB

4 months ago
import { BaseLayout } from '../layouts/base-layout';
import type { LayoutMapping } from '@antv/layout';
import type { AntVLayout } from '../layouts/types';
import type { RuntimeContext } from '../runtime/types';
import type { GraphData } from '../spec/data';
import type { LayoutOptions, STDLayoutOptions } from '../spec/layout';
/**
* <zh/> combo
*
* <en/> Determine if it is a combo layout
* @param options - <zh/> | <en/> Layout options
* @returns <zh/> combo | <en/> Whether it is a combo layout
*/
export declare function isComboLayout(options: STDLayoutOptions): boolean;
/**
* <zh/>
*
* <en/> Determine if it is a tree layout
* @param options - <zh/> | <en/> Layout options
* @returns <zh/> | <en/> Whether it is a tree layout
*/
export declare function isTreeLayout(options: STDLayoutOptions): boolean;
/**
* <zh/>
*
* <en/> Is the position specified in the data
* @param data - <zh/> | <en/> Data
* @returns <zh/> | <en/> Is the position specified
*/
export declare function isPositionSpecified(data: Record<string, unknown>): boolean;
/**
* <zh/>
*
* <en/> Is pre-layout
* @remarks
* <zh/>
*
* <en/> Pre-layout refers to calculating the layout before initializing the elements, which is suitable for some layouts that need to calculate the position in advance.
* @param options - <zh/> | <en/> Layout options
* @returns <zh/> | <en/> Is it a pre-layout
*/
export declare function isPreLayout(options?: LayoutOptions): boolean | undefined;
/**
* <zh/> G6
*
* <en/> Convert the layout result to G6 data
* @param layoutMapping - <zh/> | <en/> Layout mapping
* @returns <zh/> G6 | <en/> G6 data
*/
export declare function layoutMapping2GraphData(layoutMapping: LayoutMapping): GraphData;
/**
* <zh/> @antv/layout G6
*
* <en/> Adapt @antv/layout layout to G6 layout
* @param Ctor - <zh/> | <en/> Layout class
* @param context - <zh/> | <en/> Runtime context
* @returns <zh/> G6 | <en/> G6 layout class
*/
export declare function layoutAdapter(Ctor: new (options: Record<string, unknown>) => AntVLayout, context: RuntimeContext): new (context: RuntimeContext, options?: Record<string, unknown>) => BaseLayout;
/**
* <zh/>
*
* <en/> Call layout member methods
* @remarks
* <zh/> G6 \@antv/layout
*
* <en/> Provide a common way to call methods on G6 layout and \@antv/layout layout
* @param layout - <zh/> | <en/> Layout instance
* @param method - <zh/> | <en/> Method name
* @param args - <zh/> | <en/> Arguments
* @returns <zh/> | <en/> Return value
*/
export declare function invokeLayoutMethod(layout: BaseLayout, method: string, ...args: unknown[]): any;
/**
* <zh/>
*
* <en/> Get layout member properties
* @param layout - <zh/> | <en/> Layout instance
* @param name - <zh/> | <en/> Property name
* @returns <zh/> | <en/> Return value
*/
export declare function getLayoutProperty(layout: BaseLayout, name: string): any;