partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
251 stars 62 forks source link

openbabel.data load slow #230

Open niuzhenjiang opened 3 years ago

niuzhenjiang commented 3 years ago

When I use smiles to generate structs,i use this function: Kekule.OpenBabel.enable(() => { chemComposer.getEditor().setChemObjData('{"format": "smi", "data": "'+ smiles +'"}'); }); it will load openbabel.data and openbabel.wasm: Their memory is too large, resulting in very slow initial loading, giving users a bad experience I would like to ask if there is any way to provide a user experience that can be generated through smiles without users waiting thanks

partridgejiang commented 3 years ago

Hi @niuzhenjiang, currently OpenBabel is needed to generate the coordinates of atoms from SMILES in editor, so the wasm compilation is unavoidable for SMILES data. A workaround is to use other chemical formats (e.g., MOL or CML) to load data in editor, or to handle SMILES data at server rather than in the browser.

niuzhenjiang commented 3 years ago

okok,thank you very much~