# Class LayoutEdge

GoJS® Diagramming Components
version 3.0.13
by Northwoods Software®

#### Hierarchy

- LayoutEdge
  - CircularEdge
  - ForceDirectedEdge
  - LayeredDigraphEdge
  - TreeEdge

An edge represents a Link in a LayoutNetwork, along with its fromVertex and toVertex. The link property may be null for edges that represent "dummy" links, when the layout wants to work with a network that is not isomorphic with the collection of Nodes and Links being laid out.

It holds layout-specific data for the link. For each kind of layout that uses a LayoutNetwork there is a subclass of LayoutVertex and a subclass of LayoutEdge:

- CircularLayout: CircularVertex and CircularEdge
- ForceDirectedLayout: ForceDirectedVertex and ForceDirectedEdge
- LayeredDigraphLayout: LayeredDigraphVertex and LayeredDigraphEdge
- TreeLayout: TreeVertex and TreeEdge

Modifying a LayoutNetwork or a LayoutVertex or a LayoutEdge does not invalidate the Layout or raise any changed events.

#####
Index

### Constructors

constructor

### Accessors

data
fromVertex
link
network
toVertex

### Methods

commit
getOtherVertex

## Constructors

### constructor

- new LayoutEdge(network: LayoutNetwork): LayoutEdge

- This constructs an edge that does not know about any Link.

  #### Parameters

  - ##### network: LayoutNetwork

  #### Returns LayoutEdge

## Accessors

### data
: ObjectData

- For virtualized layouts working on model data instead of a Link.

### fromVertex
: LayoutVertex

- Gets or sets the LayoutVertex that this edge comes from. Setting this property does not change any LayoutVertex.destinationEdges collection.

### link
: Link

- Gets or sets the Link associated with this edge, if any. The value may be null if this edge is a "dummy" edge, not represented by a real Link in the Diagram.

### `Readonly` network
: LayoutNetwork

- Gets the LayoutNetwork that owns this edge. The default value is null. It is set automatically for you in LayoutNetwork.createEdge.

### toVertex
: LayoutVertex

- Gets or sets the LayoutVertex that this edge goes to. Setting this property does not change any LayoutVertex.sourceEdges collection.

## Methods

### `Virtual` commit

- commit(): void

- Commits the route of this edge to the corresponding Link, if any. By default this does nothing. Please read the Introduction page on Extensions for how to override methods and how to call this base method.

  #### Returns void

### getOtherVertex

- getOtherVertex(v: LayoutVertex): LayoutVertex

- Returns the edge's vertex at the other of this edge from the given vertex.

  #### Parameters

  - ##### v: LayoutVertex

  #### Returns LayoutVertex

Copyright © 1998-2024 by Northwoods Software Corporation.