Merge pull request #3925 from markwongsk/master

Updated dagre.d.ts to support fluent-chaining
This commit is contained in:
Horiuchi_H
2015-03-21 14:05:32 +09:00
2 changed files with 9 additions and 12 deletions
+4 -7
View File
@@ -1,13 +1,10 @@
/// <reference path="dagre.d.ts"/>
module DagreTests {
var gDagre = new dagre.graphlib.Graph();
gDagre.setGraph({});
gDagre.setDefaultEdgeLabel(function(){
return ;
});
gDagre.setNode("a", {});
gDagre.setEdge("b", "c");
gDagre.setGraph({})
.setDefaultEdgeLabel(function(){ return ; })
.setNode("a", {})
.setEdge("b", "c");
dagre.layout(gDagre);
}
+5 -5
View File
@@ -14,14 +14,14 @@ declare module Dagre{
edge(id: string): any;
nodes(): string[];
node(id: string): any;
setDefaultEdgeLabel(callback: () => void): void;
setEdge(sourceId: string, targetId: string): void;
setGraph(options: { [key: string]: any }): void;
setNode(id: string, node: { [key: string]: any }): void;
setDefaultEdgeLabel(callback: () => void): Graph;
setEdge(sourceId: string, targetId: string): Graph;
setGraph(options: { [key: string]: any }): Graph;
setNode(id: string, node: { [key: string]: any }): Graph;
}
interface GraphLib {
Graph: Graph
Graph: Graph;
}
}