partridgejiang / Kekule.js

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

LoadFormatData .cdxml #284

Open keeper1030 opened 2 years ago

keeper1030 commented 2 years ago

Could I load data of .cdxml format? Addtionally, When I load .cdx format data, it generates the error.

스크린샷 2022-07-11 오후 5 31 43

Also. .smi generates error too.

스크린샷 2022-07-11 오후 5 32 57
partridgejiang commented 1 year ago

The OpenBabel wasm compliation is used to load CDX format data. From the error message, the OpenBabel lib failed to load the data itself. By the way, even when OpenBabel loading CDX data successfully, all objects expect molecules will also be discarded.

OpenBabel does support CDXML format but relies some external XML libraries. When compiling to wasm, those external libs are stripped to reduce the compilation size and avoid some other problems. So currently, CDXML can not be used in Kekule.js yet.

And the error in loading SMILES seems to be caused by same-origin policy of browser?