jsme-editor / jsme-editor.github.io

79 stars 20 forks source link

how to send a smiles to the editor in javascript ? #19

Closed thegodone closed 1 year ago

thegodone commented 2 years ago

I wonder if I can send a SMILES in the editor for rendering. If I have already an instance of the editor how can I change molecule display ? I don't see an example except the openchemlib is it the only solution ?

radusuciu commented 2 years ago

I think what you're looking for is the readGenericMolecularInput function. Example:

const jsmeApplet = new window.JSApplet.JSME(id, '300px', '300px')
jsmeApplet.readGenericMolecularInput('CC')