Constructor
new Drawer(options)
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. |
Methods
draw(data, target, themeName, infoOnly)
Draws the parsed smiles data to a canvas element.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
data |
Object | The tree returned by the smiles parser. |
|
target |
String | HTMLCanvasElement | The id of the HTML canvas element the structure is drawn to - or the element itself. |
|
themeName |
String |
'dark'
|
The name of the theme to use. Built-in themes are 'light' and 'dark'. |
infoOnly |
Boolean |
false
|
Only output info on the molecule without drawing anything to the canvas. |
getMolecularFormula() → {String}
Returns the molecular formula of the loaded molecule as a string.
Returns:
The molecular formula.
- Type
- String
getTotalOverlapScore() → {Number}
Returns the total overlap score of the current molecule.
Returns:
The overlap score.
- Type
- Number