[d3-sankey] Missing Iterations (#16916)

* [Fix] Adds missing `iterations` setter and getter for `SankeyLayout`
This commit is contained in:
Tom Wanzek
2017-06-02 10:35:24 -07:00
committed by Andy
parent 4b35f5c6d1
commit e353d9bc65
2 changed files with 24 additions and 0 deletions
+13
View File
@@ -162,6 +162,19 @@ slgDAG = slgDAG.size([1200, 800]);
size = slgDAG.size();
// ---------------------------------------------------------------------------
// Iterations
// ---------------------------------------------------------------------------
// Set -----------------------------------------------------------------------
// test return type for chainability
slgDAG = slgDAG.iterations(40);
// Get -----------------------------------------------------------------------
num = slgDAG.iterations();
// ---------------------------------------------------------------------------
// Nodes
// ---------------------------------------------------------------------------
+11
View File
@@ -279,6 +279,17 @@ export interface SankeyLayout<Data, N extends SankeyExtraProperties, L extends S
* @param size A two element array of [width, height] in pixels which defaults to [1, 1].
*/
size(size: [number, number]): this;
/**
* Return the current number of relaxation iterations, which defaults to 32.
*/
iterations(): number;
/**
* Set the number of relaxation iterations when generating the layout and return this Sankey layout generator.
*
* @param iterations Number of relaxation iterations, which defaluts to 32.
*/
iterations(iterations: number): this;
}
/**