Merge pull request #15694 from michaelgerakis/master

@types/graphlib -- parent should be an optional parameter in setParent
This commit is contained in:
Ron Buckton
2017-04-06 15:06:18 -07:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ function test_graph() {
g.setDefaultEdgeLabel(() => 'e42');
g.setNodes(['a', 'b', 'c'], 42);
g.setParent('d', 'a');
g.setParent('d');
g.parent('d');
g.children('a');
g.filterNodes(v => true);

View File

@@ -65,7 +65,8 @@ declare module "graphlib" {
setNodes(names: string[], label?: any): Graph;
/**
* Sets node p as a parent for node v. Method throws an exception in case of
* Sets node p as a parent for node v if it is defined, or removes the
* parent for v if p is undefined. Method throws an exception in case of
* invoking it in context of noncompound graph.
* Average-case complexity: O(1).
*
@@ -73,7 +74,7 @@ declare module "graphlib" {
* @argument p - node to be parent for v.
* @returns the graph, allowing this to be chained with other functions.
*/
setParent(v: string, p: string): Graph;
setParent(v: string, p?: string): Graph;
/**
* Gets parent node for node v.