import type { GraphData, VisualizationOptions } from '../../types'; export type NetworkGraphNode = GraphData['nodes'][number]; export type NetworkGraphEdge = GraphData['edges'][number]; export type NetworkGraphData = GraphData; /** * NetworkGraphConfig defines the configuration for rendering the network graph. */ export interface NetworkGraphConfig { type?: 'network-graph'; data: NetworkGraphData; layout?: 'force' | 'circular' | 'grid' | 'radial' | 'concentric' | 'dagre'; theme?: 'default' | 'academy' | 'dark'; title?: string; style?: { backgroundColor?: string; palette?: string[]; }; } /** * NetworkGraphInstance represents a network graph instance with render and destroy methods. */ export interface NetworkGraphInstance { render: (config: NetworkGraphConfig) => void; destroy: () => void; zoomTo: (zoom: number) => void; getZoom: () => number | undefined; } /** * NetworkGraph component using G6 5.0. * * @example * ```ts * const graph = NetworkGraph({ * container: '#container', * width: 600, * height: 400, * }); * * graph.render({ * type: 'network-graph', * data: { * nodes: [ * { name: '哈利·波特' }, * { name: '赫敏·格兰杰' }, * { name: '伏地魔' }, * ], * edges: [ * { source: '哈利·波特', target: '赫敏·格兰杰', name: '朋友' }, * { source: '哈利·波特', target: '伏地魔', name: '敌人' }, * ], * }, * layout: 'force', * theme: 'academy', * }); * * graph.destroy(); * ``` */ export declare const NetworkGraph: (options: VisualizationOptions) => NetworkGraphInstance;