new ReactionDrawer(options, moleculeOptions)
- Source:
The constructor for the class ReactionDrawer.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | An object containing reaction drawing specitic options. |
moleculeOptions |
Object | An object containing molecule drawing specific options. |
Methods
draw(reaction, target, themeName, weightsnullable, textAbove, textBelow, weightsnullable, infoOnly) → {SVGElement}
- Source:
Draws the parsed reaction smiles data to a canvas element.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
reaction |
Object | The reaction object returned by the reaction smiles parser. |
||
target |
String | SVGElement | 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'. |
|
weights |
Object |
<nullable> |
null
|
The weights for reactants, agents, and products. |
textAbove |
String |
'{reagents}'
|
The text above the arrow. |
|
textBelow |
String |
''
|
The text below the arrow. |
|
weights |
Object |
<nullable> |
null
|
The weights for reactants, agents, and products. |
infoOnly |
Boolean |
false
|
Only output info on the molecule without drawing anything to the canvas. |
Returns:
The svg element
- Type
- SVGElement