/** * Sankey Diagram Wrapper Class * * A unified API for building, mutating, and querying sankey diagrams. * Provides a fluent interface that wraps the SankeyAST. */ import { DiagramWrapper } from './diagram-wrapper.js'; import type { RenderOptions } from './types/render-options.js'; import type { SankeyAST, SankeyLink, SankeyNode } from './types/sankey.js'; /** * Query options for finding nodes */ export interface FindSankeyNodesQuery { /** Find nodes whose label contains this string */ labelContains?: string; } /** * Query options for finding links */ export interface FindSankeyLinksQuery { /** Find links from this source */ source?: string; /** Find links to this target */ target?: string; /** Find links with value greater than this */ minValue?: number; /** Find links with value less than this */ maxValue?: number; } /** * A fluent wrapper for SankeyAST that supports building, mutating, and querying. */ export declare class Sankey extends DiagramWrapper { private constructor(); /** * Create a new empty sankey diagram */ static create(): Sankey; /** * Create a Sankey wrapper from an existing AST */ static from(ast: SankeyAST): Sankey; /** * Parse Mermaid syntax and create a Sankey wrapper */ static parse(text: string): Sankey; /** * Render to Mermaid syntax */ render(options?: RenderOptions): string; /** * Create a deep clone of this sankey diagram */ clone(): Sankey; /** * Get all nodes as an array */ get nodes(): SankeyNode[]; /** * Get all links */ get links(): SankeyLink[]; /** * Get node count */ get nodeCount(): number; /** * Get link count */ get linkCount(): number; /** * Add a node */ addNode(id: string, label?: string): this; /** * Get a node by ID */ getNode(id: string): SankeyNode | undefined; /** * Remove a node and all its connected links */ removeNode(id: string): this; /** * Update node label */ updateNodeLabel(id: string, label: string): this; /** * Add a link between two nodes */ addLink(source: string, target: string, value: number): this; /** * Get all links from a source node */ getLinksFrom(source: string): SankeyLink[]; /** * Get all links to a target node */ getLinksTo(target: string): SankeyLink[]; /** * Remove a specific link */ removeLink(source: string, target: string): this; /** * Update link value */ updateLinkValue(source: string, target: string, value: number): this; /** * Find nodes matching a query */ findNodes(query: FindSankeyNodesQuery): SankeyNode[]; /** * Find links matching a query */ findLinks(query: FindSankeyLinksQuery): SankeyLink[]; /** * Get total flow value (sum of all link values) */ getTotalFlow(): number; } //# sourceMappingURL=sankey.d.ts.map