Edge

Edge

A class representing an edge.

Constructor

new Edge(sourceId, targetId, weightopt)

Source:
Properties:
Name Type Attributes Default Description
id Number

The id of this edge.

sourceId Number

The id of the source vertex.

targetId Number

The id of the target vertex.

weight Number

The weight of this edge. That is, the degree of the bond (single bond = 1, double bond = 2, etc).

bondType String <optional>
'-'

The bond type of this edge.

isPartOfAromaticRing Boolean <optional>
false

Whether or not this edge is part of an aromatic ring.

center Boolean <optional>
false

Wheter or not the bond is centered. For example, this affects straight double bonds.

wedge String <optional>
''

Wedge direction. Either '', 'up' or 'down'

The constructor for the class Edge.

Parameters:
Name Type Attributes Default Description
sourceId Number

A vertex id.

targetId Number

A vertex id.

weight Number <optional>
1

The weight of the edge.

Members

(static) bonds

Source:

An object mapping the bond type to the number of bonds.

Methods

setBondType(bondType)

Source:

Set the bond type of this edge. This also sets the edge weight.

Parameters:
Name Type Description
bondType String