Updates based on feedback

This commit is contained in:
David Newell
2017-07-05 12:07:33 -04:00
parent a820963086
commit 101ffe8194
+13 -8
View File
@@ -11,22 +11,27 @@ export namespace graphlib {
edge(id: any): any;
nodes(): string[];
node(id: any): any;
setDefaultEdgeLabel(callback: () => void): Graph;
setDefaultNodeLabel(callback: () => void): Graph;
setDefaultEdgeLabel(callback: string|(() => string)): Graph;
setDefaultNodeLabel(callback: string|(() => string)): Graph;
setEdge(sourceId: string, targetId: string, options?: { [key: string]: any }, value?: string): Graph;
setGraph(options: { [key: string]: any }): Graph;
setEdge(params: {v: string, w: string, name?: string}, value?: string): Graph;
setGraph(label: GraphLabel): Graph;
setNode(id: string, node: { [key: string]: any }): Graph;
graph(): GraphOptions;
graph(): GraphLabel;
constructor(opt?: {});
constructor(opt?: {directed?: boolean, multigraph?: boolean, compound?: boolean});
setParent(name: string, parentName: string): void;
hasNode(name: string): boolean;
}
}
export interface GraphOptions {
width: number;
height: number;
export interface GraphLabel {
width?: number;
height?: number;
compound: boolean;
rankdir: string;
nodesep: number;
edgesep: number;
}
export function layout(graph: graphlib.Graph): void;