tilde-lab / cifplayer

Minimalistic and fast HTML5 visualization of chemical structures in CIF, POSCAR, and OPTIMADE formats
http://nanoshow.mpds.io/
MIT License
21 stars 6 forks source link

Could we avoid parsing the incoming data without the real need? #16

Closed blokhin closed 7 months ago

blokhin commented 2 years ago

https://github.com/tilde-lab/cifplayer/blob/dac4ed2999fe2ac2464b70cf8d630e6d077cfea5/src/js/app/main.js#L558

blokhin commented 11 months ago

@stan-donarise @nin-jin please could you have a look?

nin-jin commented 11 months ago

А кто посылает это сообщение? Тут по хорошему надо поменять формат сообщений, так как сообщения могут приходить самые разные от разных источников и их надо как-то отличать.

stan-donarise commented 10 months ago

Now matinfo gets 2 args: data - can be either a string or an object. format - can be omitted, then it will be auto-detected. https://github.com/stan-donarise/cifplayer/blob/mol/matinfio/matinfio.web.ts#L89

So if the format is an OPTIMADE object, there is no redudant stringify/parse.