JSDraw

Wrapper for the chemical 2D structure editor based on JSDraw HTML5 widget.

Simple demo application available here.

Summary
JSDrawWrapper for the chemical 2D structure editor based on JSDraw HTML5 widget.
Functions
jsdrawConvert DIV panel into JSDraw widget.
Types
Options
Functions
smilesGet or set SMILES from/to the widget.
moleculeGet or set MOL file from/to the widget.

Functions

jsdraw

Convert DIV panel into JSDraw widget.

Parameters

optionsInitialization Options
$('#drawer').jsdraw({
width: 900,
height: 500
});

Types

Options

Properties

widthWidth of the widget in pixels.  Default value - 650
heightHeight of the widget in pixels.  Default value - 350
modeMode that should be used.  Possible values are: Mobile|Classic.  Default value - Mobile.

Functions

smiles

smiles: function (value)

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

Parameters

valueSMILES
var editor = $('#editorContainer').jsdraw({
width: 900,
height: 520
}).data('jsdraw');

var smiles = editor.smiles();

molecule

molecule: function (value)

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

Parameters

valueMOL file
var editor = $('#editorContainer').jsdraw({
width: 900,
height: 520
}).data('jsdraw');

var mol = editor.molecule();
smiles: function (value)
Get or set SMILES from/to the widget.
molecule: function (value)
Get or set MOL file from/to the widget.