Ir al contenido

ForceDirectedLayout

Defined in: layout/ForceDirectedLayout.ts:36

Force-directed layout using a simple spring-electric model. Repulsion (the O(n²) part of the naive algorithm) is approximated with a BarnesHutTree, making each iteration O(n log n) — see theta to tune the accuracy/speed trade-off.

new ForceDirectedLayout(options?): ForceDirectedLayout

Defined in: layout/ForceDirectedLayout.ts:43

ForceDirectedLayoutOptions = {}

ForceDirectedLayout

Layout.constructor

diagram: Diagram | null = null

Defined in: layout/Layout.ts:34

GoJS-compatible: the Diagram this layout is assigned to (set by Diagram.layout = ...), used by doLayout() when called with no explicit collection.

Layout.diagram

get defaultSpringLength(): number

Defined in: layout/ForceDirectedLayout.ts:53

GoJS-compatible: The default spring length between linked nodes.

number

set defaultSpringLength(value): void

Defined in: layout/ForceDirectedLayout.ts:57

number

void


get isFinal(): boolean

Defined in: layout/Layout.ts:234

GoJS-compatible: Whether this is the final layout of a cycle.

boolean

set isFinal(value): void

Defined in: layout/Layout.ts:238

boolean

void

Layout.isFinal


get isInitial(): boolean

Defined in: layout/Layout.ts:225

GoJS-compatible: Whether this is the initial layout of the diagram.

boolean

set isInitial(value): void

Defined in: layout/Layout.ts:229

boolean

void

Layout.isInitial


get isOngoing(): boolean

Defined in: layout/Layout.ts:243

GoJS-compatible: Whether the layout is ongoing (auto-layout is active).

boolean

set isOngoing(value): void

Defined in: layout/Layout.ts:247

boolean

void

Layout.isOngoing


get network(): LayoutNetwork | null

Defined in: layout/Layout.ts:200

GoJS-compatible: The current layout network (or null).

LayoutNetwork | null

set network(value): void

Defined in: layout/Layout.ts:204

LayoutNetwork | null

void

Layout.network

apply(nodes, links): void

Defined in: layout/ForceDirectedLayout.ts:61

Apply the layout to the given nodes and links.

Node[]

Link[]

void

Layout.apply


doLayout(collection?): void

Defined in: layout/Layout.ts:176

GoJS-compatible: Perform the layout on a collection of parts (or this diagram’s parts).

readonly Link[]

readonly Node[]

void

Layout.doLayout


layoutParts(parts): void

Defined in: layout/Layout.ts:183

GoJS-compatible: Perform the layout on the given parts.

readonly Part[]

void

Layout.layoutParts