mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 07:40:10 +00:00
Updated Force Layout nodes and links
Different layouts have different definitions for node objects and link objects. I created a new `GraphNodeForce` and `GraphLinkForce` interface for the Force Layout. See the [docs](https://github.com/mbostock/d3/wiki/Force-Layout#nodes) for more info.
This commit is contained in:
23
d3/d3.d.ts
vendored
23
d3/d3.d.ts
vendored
@@ -1237,6 +1237,21 @@ declare module D3 {
|
||||
source: GraphNode;
|
||||
target: GraphNode;
|
||||
}
|
||||
|
||||
export interface GraphNodeForce {
|
||||
index?: number;
|
||||
x?: number;
|
||||
y?: number;
|
||||
px?: number;
|
||||
py?: number;
|
||||
fixed?: boolean;
|
||||
weight?: number;
|
||||
}
|
||||
|
||||
export interface GraphLinkForce {
|
||||
source: GraphNodeForce;
|
||||
target: GraphNodeForce;
|
||||
}
|
||||
|
||||
export interface ForceLayout {
|
||||
(): ForceLayout;
|
||||
@@ -1287,14 +1302,14 @@ declare module D3 {
|
||||
};
|
||||
|
||||
links: {
|
||||
(): GraphLink[];
|
||||
(arLinks: GraphLink[]): ForceLayout;
|
||||
(): GraphLinkForce[];
|
||||
(arLinks: GraphLinkForce[]): ForceLayout;
|
||||
|
||||
};
|
||||
nodes:
|
||||
{
|
||||
(): GraphNode[];
|
||||
(arNodes: GraphNode[]): ForceLayout;
|
||||
(): GraphNodeForce[];
|
||||
(arNodes: GraphNodeForce[]): ForceLayout;
|
||||
|
||||
};
|
||||
start(): ForceLayout;
|
||||
|
||||
Reference in New Issue
Block a user