exports

exports

A class representing the molecular graph.

Constructor

new exports(parseTree, isomericopt)

Source:
Properties:
Name Type Description
vertices Array.<Vertex>

The vertices of the graph.

edges Array.<Edge>

The edges of this graph.

vertexIdsToEdgeId Object

A map mapping vertex ids to the edge between the two vertices. The key is defined as vertexAId + '_' + vertexBId.

elementCount Object

A map associating element symbols with the number of occurences in this graph.

isometric Boolean

A boolean indicating whether or not the SMILES associated with this graph is isometric.

The constructor of the class Graph.

Parameters:
Name Type Attributes Default Description
parseTree Object

A SMILES parse tree.

isomeric Boolean <optional>
false

A boolean specifying whether or not the SMILES is isomeric.

exports

A static class containing helper functions for math-related tasks.

exports

A class representing a vertex.

Constructor

new exports(value, xopt, yopt)

Source:
Properties:
Name Type Description
id Number

The id of this vertex.

value Atom

The atom associated with this vertex.

position Vector2

The position of this vertex.

previousPosition Vector2

The position of the previous vertex.

parentVertexId Number | null

The id of the previous vertex.

children Array.<Number>

The ids of the children of this vertex.

spanningTreeChildren Array.<Number>

The ids of the children of this vertex as defined in the spanning tree defined by the SMILES.

edges Array.<Number>

The ids of edges associated with this vertex.

positioned Boolean

A boolean indicating whether or not this vertex has been positioned.

angle Number

The angle of this vertex.

dir Number

The direction of this vertex.

neighbourCount Number

The number of neighbouring vertices.

neighbours Array.<Number>

The vertex ids of neighbouring vertices.

neighbouringElements Array.<String>

The element symbols associated with neighbouring vertices.

forcePositioned Boolean

A boolean indicating whether or not this vertex was positioned using a force-based approach.

The constructor for the class Vertex.

Parameters:
Name Type Attributes Default Description
value Atom

The value associated with this vertex.

x Number <optional>
0

The initial x coordinate of the positional vector of this vertex.

y Number <optional>
0

The initial y coordinate of the positional vector of this vertex.

exports

A class representing a ring connection.

Constructor

new exports(firstRing, secondRing)

Source:
Properties:
Name Type Description
id Number

The id of this ring connection.

firstRingId Number

A ring id.

secondRingId Number

A ring id.

vertices Set.<Number>

A set containing the vertex ids participating in the ring connection.

The constructor for the class RingConnection.

Parameters:
Name Type Description
firstRing Ring

A ring.

secondRing Ring

A ring.

exports

A static class containing helper functions for array-related tasks.

exports

A class representing a ring.

Constructor

new exports(members)

Source:
Properties:
Name Type Description
id Number

The id of this ring.

members Array.<Number>

An array containing the vertex ids of the ring members.

edges Array.<Number>

An array containing the edge ids of the edges between the ring members.

insiders Array.<Number>

An array containing the vertex ids of the vertices contained within the ring if it is a bridged ring.

neighbours Array.<Number>

An array containing the ids of neighbouring rings.

positioned Boolean

A boolean indicating whether or not this ring has been positioned.

center Vector2

The center of this ring.

rings Array.<Ring>

The rings contained within this ring if this ring is bridged.

isBridged Boolean

A boolean whether or not this ring is bridged.

isPartOfBridged Boolean

A boolean whether or not this ring is part of a bridge ring.

isSpiro Boolean

A boolean whether or not this ring is part of a spiro.

isFused Boolean

A boolean whether or not this ring is part of a fused ring.

centralAngle Number

The central angle of this ring.

canFlip Boolean

A boolean indicating whether or not this ring allows flipping of attached vertices to the inside of the ring.

The constructor for the class Ring.

Parameters:
Name Type Description
members Array.<Number>

An array containing the vertex ids of the members of the ring to be created.

exports

The main class of the application representing the smiles drawer

Constructor

new exports(options)

Source:
Properties:
Name Type Description
graph Graph

The graph associated with this SmilesDrawer.Drawer instance.

ringIdCounter Number

An internal counter to keep track of ring ids.

ringConnectionIdCounter Number

An internal counter to keep track of ring connection ids.

canvasWrapper CanvasWrapper

The CanvasWrapper associated with this SmilesDrawer.Drawer instance.

totalOverlapScore Number

The current internal total overlap score.

defaultOptions Object

The default options.

opts Object

The merged options.

theme Object

The current theme.

The constructor for the class SmilesDrawer.

Parameters:
Name Type Description
options Object

An object containing custom values for different options. It is merged with the default options.

exports

A class representing an edge.

Constructor

new exports(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.

exports

A class representing an atom.

Constructor

new exports(element, bondTypeopt)

Source:
Properties:
Name Type Description
element String

The element symbol of this atom. Single-letter symbols are always uppercase. Examples: H, C, F, Br, Si, ...

drawExplicit Boolean

A boolean indicating whether or not this atom is drawn explicitly (for example, a carbon atom). This overrides the default behaviour.

ringbonds Array.<Object>

An array containing the ringbond ids and bond types as specified in the original SMILE.

branchBond String

The branch bond as defined in the SMILES.

ringbonds[].id Number

The ringbond id as defined in the SMILES.

ringbonds[].bondType String

The bond type of the ringbond as defined in the SMILES.

rings Array.<Number>

The ids of rings which contain this atom.

bondType String

The bond type associated with this array. Examples: -, =, #, ...

isBridge Boolean

A boolean indicating whether or not this atom is part of a bridge in a bridged ring (contained by the largest ring).

isBridgeNode Boolean

A boolean indicating whether or not this atom is a bridge node (a member of the largest ring in a bridged ring which is connected to a bridge-atom).

originalRings Array.<Number>

Used to back up rings when they are replaced by a bridged ring.

bridgedRing Number

The id of the bridged ring if the atom is part of a bridged ring.

anchoredRings Array.<Number>

The ids of the rings that are anchored to this atom. The centers of anchored rings are translated when this atom is translated.

bracket Object

If this atom is defined as a bracket atom in the original SMILES, this object contains all the bracket information. Example: { hcount: {Number}, charge: ['--', '-', '+', '++'], isotope: {Number} }.

plane Number

Specifies on which "plane" the atoms is in stereochemical deptictions (-1 back, 0 middle, 1 front).

attachedPseudoElements Array.<Object>

A map with containing information for pseudo elements or concatinated elements. The key is comprised of the element symbol and the hydrogen count.

attachedPseudoElement[].element String

The element symbol.

attachedPseudoElement[].count Number

The number of occurences that match the key.

attachedPseudoElement[].hyrogenCount Number

The number of hydrogens attached to each atom matching the key.

hasAttachedPseudoElements Boolean

A boolean indicating whether or not this attom will be drawn with an attached pseudo element or concatinated elements.

isDrawn Boolean

A boolean indicating whether or not this atom is drawn. In contrast to drawExplicit, the bond is drawn neither.

isConnectedToRing Boolean

A boolean indicating whether or not this atom is directly connected (but not a member of) a ring.

neighbouringElements Array.<String>

An array containing the element symbols of neighbouring atoms.

isPartOfAromaticRing Boolean

A boolean indicating whether or not this atom is part of an explicitly defined aromatic ring. Example: c1ccccc1.

bondCount Number

The number of bonds in which this atom is participating.

chirality String

The chirality of this atom if it is a stereocenter (R or S).

priority Number

The priority of this atom acording to the CIP rules, where 0 is the highest priority.

mainChain Boolean

A boolean indicating whether or not this atom is part of the main chain (used for chirality).

hydrogenDirection String

The direction of the hydrogen, either up or down. Only for stereocenters with and explicit hydrogen.

subtreeDepth Number

The depth of the subtree coming from a stereocenter.

The constructor of the class Atom.

Parameters:
Name Type Attributes Default Description
element String

The one-letter code of the element.

bondType String <optional>
'-'

The type of the bond associated with this atom.

exports

A class wrapping a canvas element.

Constructor

new exports(target, theme, options)

Source:
Properties:
Name Type Description
canvas HTMLElement

The HTML element for the canvas associated with this CanvasWrapper instance.

ctx CanvasRenderingContext2D

The CanvasRenderingContext2D of the canvas associated with this CanvasWrapper instance.

colors Object

The colors object as defined in the SmilesDrawer options.

opts Object

The SmilesDrawer options.

drawingWidth Number

The width of the canvas.

drawingHeight Number

The height of the canvas.

offsetX Number

The horizontal offset required for centering the drawing.

offsetY Number

The vertical offset required for centering the drawing.

fontLarge Number

The large font size in pt.

fontSmall Number

The small font size in pt.

The constructor for the class CanvasWrapper.

Parameters:
Name Type Description
target String | HTMLElement

The canvas id or the canvas HTMLElement.

theme Object

A theme from the smiles drawer options.

options Object

The smiles drawer options object.

exports

A class representing a 2D vector.

Constructor

new exports(x, y)

Source:
Properties:
Name Type Description
x Number

The x component of the vector.

y Number

The y component of the vector.

The constructor of the class Vector2.

Parameters:
Name Type Description
x Number | Vector2

The initial x coordinate value or, if the single argument, a Vector2 object.

y Number

The initial y coordinate value.

exports

A class encapsulating the functionality to find the smallest set of smallest rings in a graph.

exports

A class representing a line.

Constructor

new exports(fromopt, toopt, elementFromopt, elementToopt, chiralFromopt, chiralToopt)

Source:
Properties:
Name Type Description
from Vector2

The Vector2 defining the start of the line.

to Vector2

The Vector2 defining the end of the line.

elementFrom String

The element symbol associated with the start of the line.

elementTo String

The element symbol associated with the end of the line.

chiralFrom Boolean

A boolean indicating whether or not the source atom is a chiral center.

chiralTo Boolean

A boolean indicating whether or tno the target atom is a chiral center.

The constructor for the class Line.

Parameters:
Name Type Attributes Default Description
from Vector2 <optional>
new Vector2(0, 0)

A vector marking the beginning of the line.

to Vector2 <optional>
new Vector2(0, 0)

A vector marking the end of the line.

elementFrom string <optional>
null

A one-letter representation of the element associated with the vector marking the beginning of the line.

elementTo string <optional>
null

A one-letter representation of the element associated with the vector marking the end of the line.

chiralFrom Boolean <optional>
false

Whether or not the from atom is a chiral center.

chiralTo Boolean <optional>
false

Whether or not the to atom is a chiral center.