UNPKG

@logicflow/extension

Version:
42 lines (41 loc) 1.2 kB
import LogicFlow from '@logicflow/core'; export declare const ROOT_NODE = "mark:root"; export declare const FAKER_NODE = "faker:root"; declare class MindMap { static pluginName: string; lf: any; constructor({ lf }: { lf: any; }); setContextMenu(): void; private addChild; private removeNode; private getGraphTreeData; private renderTree; private graphToTree; /** * 将树这种数据格式转换为图 */ private treeToGraph; /** * 由于树这种数据格式本身是没有坐标的 * 需要使用一些算法来将树转换为有坐标的树 */ layoutTree(tree: any): any; /** * 遍历树的每一项,已传入的回调方法重新构建一个新的树 */ dfsTree(tree: any, callback: any): any; /** * 将传入的数据转换为logicflow格式的数据 */ adapterIn: (trees: any) => { nodes: LogicFlow.NodeConfig<LogicFlow.PropertiesType>[]; edges: LogicFlow.EdgeConfig<LogicFlow.PropertiesType>[]; }; /** * 将logicflow格式的数据转换为mindmap需要的数据 */ adapterOut: (graphData: any) => any; } export { MindMap };