partridgejiang / Kekule.js

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

Cannot render Kekule-JSON when exported KCJ is {"type": "undefined"} #44

Open AaronLlanos opened 6 years ago

AaronLlanos commented 6 years ago

When deleting a structure to a blank canvas in composer, the export of the KCJ leaves:

{"__type__":"undefined"}

But, trying to render this, throws an error in the composer when fed this KCJ. This happens in the editorEnhancement branch image

partridgejiang commented 6 years ago

I guess the exception is raised in Kekule.IO.loadFormatData? That method disallows an undefined result. Now I have fixed this and please use the new files in dist directory.

AaronLlanos commented 6 years ago

Awesome. Thanks @partridgejiang! You were a huge help, as always!