From e52779e5dcb4cedf4e410e9ff0ece319e26c9673 Mon Sep 17 00:00:00 2001 From: Gildor Date: Wed, 8 Apr 2015 17:44:40 +0800 Subject: [PATCH] Add definition for D3 chargeDistance --- d3/d3.d.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 5d1fbcfea5..c44346b905 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1373,7 +1373,20 @@ declare module D3 { (number:number): ForceLayout; (accessor: (d: any, index: number) => number): ForceLayout; }; - + /** + * If distance is specified, sets the maximum distance over which + * charge forces are applied. If distance is not specified, returns + * the current maximum charge distance, which defaults to infinity. + * Specifying a finite charge distance improves the performance of + * the force layout and produces a more localized layout; + * distance-limited charge forces are especially useful in + * conjunction with custom gravity. + */ + chargeDistance: { + (): number; + (distance: number): ForceLayout; + (accessor: (d: any, index: number) => number): ForceLayout; + }; theta: { (): number; (number:number): ForceLayout;