UNPKG

dagre-compound

Version:

A multi-level compound graph layout library based on dagre

61 lines (60 loc) 2.04 kB
import { Edge, graphlib } from 'dagre'; import { SafeAny } from '../interfaces/any'; import { AttrDef, BaseEdge, GraphDef, GroupNode, IGraphLabel, InclusionType, MetaEdge, MetaNode, Node, NodeDef, NodeInputDef, NodeType } from '../interfaces/graph'; import { Hierarchy } from './hierarchy'; export declare class BaseNode implements NodeDef, Node { attr: AttrDef; inputs: NodeInputDef[]; name: SafeAny; cardinality: number; include: InclusionType; isGroupNode: boolean; parentNode: Node; type: NodeType; path: SafeAny[]; width?: number; height?: number; constructor(rawNode: NodeDef); } export declare class SlimGraph { nodes: { [nodeName: string]: BaseNode; }; edges: BaseEdge[]; constructor(); } export declare function addEdgeToGraph(graph: SlimGraph, outputNode: BaseNode, input: NodeInputDef): void; export declare function buildDef(graphDef: GraphDef): SlimGraph; export declare class MetaNodeImpl implements MetaNode { attr: AttrDef; bridgeGraph: graphlib.Graph<GroupNode | BaseNode>; cardinality: number; depth: number; include: InclusionType; isGroupNode: boolean; metaGraph: graphlib.Graph<GroupNode | BaseNode>; name: string; parentNode: Node; type: NodeType; path: SafeAny[]; constructor(name: string, opt?: {}); getFirstChild(): GroupNode | BaseNode; getChildren(): Array<GroupNode | BaseNode>; leaves(): SafeAny[]; } export declare class MetaEdgeImpl implements MetaEdge { v: string; w: string; baseEdgeList: Edge[]; points: Array<{ x: number; y: number; }>; inbound: boolean; name: string; constructor(v: string, w: string); addBaseEdge(edge: BaseEdge, _h: Hierarchy): void; } export declare function createMetaNode(name: string, opt?: {}): MetaNode; export declare function createMetaEdge(v: string, w: string): MetaEdge; export declare function createGraph<N>(name: string, type: string | number, opt?: IGraphLabel): graphlib.Graph<N>;