import { _ as GraphFormatConverter, f as Graph } from "../../types-BAEQTwK_.mjs"; //#region src/formats/d3/index.d.ts interface D3Node { id: string; [key: string]: any; } interface D3Link { source: string; target: string; [key: string]: any; } interface D3Graph { id?: string; mode?: Graph['mode']; initialNodeId?: string | null; data?: any; direction?: Graph['direction']; style?: Graph['style']; nodes: D3Node[]; links: D3Link[]; [key: string]: any; } /** * Converts a graph to D3.js force-directed format. * * @example * ```ts * import { createGraph } from '@statelyai/graph'; * import { toD3Graph } from '@statelyai/graph/d3'; * * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e0', sourceId: 'a', targetId: 'b' }], * }); * * const d3 = toD3Graph(graph); * // { nodes: [{ id: 'a' }, { id: 'b' }], links: [{ source: 'a', target: 'b' }] } * ``` */ declare function toD3Graph(graph: Graph): D3Graph; /** * Parses a D3.js force-directed JSON object into a graph. * * @example * ```ts * import { fromD3Graph } from '@statelyai/graph/d3'; * * const graph = fromD3Graph({ * nodes: [{ id: 'a' }, { id: 'b' }], * links: [{ source: 'a', target: 'b' }], * }); * ``` */ declare function fromD3Graph(d3: D3Graph): Graph; /** * Bidirectional converter for D3.js force-directed JSON format. * * @example * ```ts * import { createGraph } from '@statelyai/graph'; * import { d3Converter } from '@statelyai/graph/d3'; * * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e0', sourceId: 'a', targetId: 'b' }], * }); * * const d3 = d3Converter.to(graph); * const roundTripped = d3Converter.from(d3); * ``` */ declare const d3Converter: GraphFormatConverter; //#endregion export { D3Graph, D3Link, D3Node, d3Converter, fromD3Graph, toD3Graph };