forked from dalibo/pev2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd3-flextree.d.ts
More file actions
54 lines (47 loc) · 1.33 KB
/
Copy pathd3-flextree.d.ts
File metadata and controls
54 lines (47 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
declare module "d3-flextree" {
import * as d3 from "d3"
export function flextree<Datum>(opts: {
nodeSize?: (node: FlexHierarchyPointNode<Datum>) => [number, number]
spacing?:
| number
| ((
nodeA: FlexHierarchyPointNode<Datum>,
nodeB: FlexHierarchyPointNode<Datum>
) => number)
}): FlexTreeLayout<Datum>
export interface FlexHierarchyPointLink<Datum> {
/**
* The source of the link.
*/
source: FlexHierarchyPointNode<Datum>
/**
* The target of the link.
*/
target: FlexHierarchyPointNode<Datum>
}
export interface FlexHierarchyPointNode<Datum>
extends d3.HierarchyPointNode<Datum> {
/**
* The horizontal size
*/
xSize: number
/**
* The vertical size
*/
ySize: number
links(): Array<FlexHierarchyPointLink<Datum>>
}
export interface FlexTreeLayout<Datum> extends d3.TreeLayout<Datum> {
/**
* Lays out the specified root hierarchy.
* You may want to call `root.sort` before passing the hierarchy to the tree layout.
*
* @param root The specified root hierarchy.
*/
(root: FlexHierarchiePointNode<Datum>): FlexHierarchyPointNode<Datum>
hierarchy<Datum>(
data: Datum,
children?: (d: Datum) => Iterable<Datum> | null | undefined
): FlexHierarchiePointNode<Datum>
}
}