partridgejiang / Kekule.js

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

Atom panel periodic table #192

Open cleblond opened 3 years ago

cleblond commented 3 years ago

Is it possible to skip the atom panel and go directly to the periodic table, without the use of the "..."?

partridgejiang commented 3 years ago

Hi @cleblond, do you mean clicking on the atom button in the image below? Instead of current atom panel, a periodic table should be directly popped up? http://kylixjiang.xicp.net/~partridge/temp/02.png Sorry that I failed to uploads image to GitHub's server.

cleblond commented 3 years ago

Sorry but that png link is broken. Currently, you activate the "C" tool and then you can type in an atom symbol, and/or click on the down arrow and then click on the "..." to open the periodic table. My goal is after activating the "C" tool if you click on an atom the periodic table would pop open to select an atom. Thanks much!

partridgejiang commented 3 years ago

Please check the attached demo here. In the demo, a custom atom setter widget is created (in customAtomSetters.js) and register to the composer by composer.getEditor().getIaController('MolAtomIaController').setAtomSetter(new CustomAtomSetter(composer.getEditor())) to replace the default one. btw, please run the demo with the latest dist files. customAtomSetter.zip

partridgejiang commented 3 years ago

Please check the attached demo here. In the demo, a custom atom setter widget is created (in customAtomSetters.js) and register to the composer by composer.getEditor().getIaController('MolAtomIaController').setAtomSetter(new CustomAtomSetter(composer.getEditor())) to replace the default one. btw, please run the demo with the latest dist files. customAtomSetter.zip

cleblond commented 3 years ago

Works awesome! Thanks much!