StructureEditor

Component for editing chemical structure by converting it (from term, SMILES, InChi or CSID etc.), edit it later and get entered structure as SMILES string.  This component based on some conversion services provided by ChemSpider and structure editors components.

Simple demo application available here.

Summary
StructureEditorComponent for editing chemical structure by converting it (from term, SMILES, InChi or CSID etc.)
Functions
structureeditorConvert DIV panel into StructureEditor widget.
Types
Options
Functions
smilesGet or set SMILES from/to the widget.
moleculeReturns MOL file of the structure entered in the widget.

Functions

structureeditor

Convert DIV panel into StructureEditor widget.

Parameters

optionsInitialization Options
$('#drawer').structureeditor({
    width: 300,
    height: 300,
    smiles: 'CC(=O)Oc1ccccc1C(=O)O'
});

Types

Options

Properties

smilesSMILES string of the structure that sshould be rendered during the initialization
widthWidth of the widget in pixels.  Default value - 300
heightHeight of the widget in pixels.  Default value - 300
jsdrawBool value that enable/disable JSDraw widget for entering structure.  Enabled by default
jchempaintBool value that enable/disable JChemPaint widget for entering structure.  Enabled by default
onChangeCallback function that will be called every time when the structure changed

Functions

smiles

smiles: function (smiles)

Get or set SMILES from/to the widget.  If the ‘smiles’ parameter is NULL then it returns SMILES of the chemical structure currently drawn in the widget, otherwise it sets value to the widget and draw molecule there.

Parameters

smilesSMILES string
var editor = $('#editorContainer').structureeditor({
    width: 300,
    height: 300
}).data('structureeditor');

var smiles = editor.smiles();

molecule

molecule: function ()

Returns MOL file of the structure entered in the widget.

var editor = $('#editorContainer').structureeditor({
    width: 300,
    height: 300
}).data('structureeditor');

var mol = editor.molecule();
smiles: function (smiles)
Get or set SMILES from/to the widget.
molecule: function ()
Returns MOL file of the structure entered in the widget.