partridgejiang / Kekule.js

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

Adding buttons in composer widget for common atoms and changing displayed answer in chemviewer #299

Closed kwen1510 closed 1 year ago

kwen1510 commented 1 year ago

Hi,

Thank you very much for creating this amazing tool!

Is there a way for me to add a few buttons at the side of the composer widget that corresponds to common elements such as O, N, P etc instead of just the "atomAndFormula" button?

In addition, is it possible to show the condensed formula of the groups attached? E.g. Show NO2 instead of O=N=O, or show COOH instead of C=O(OH)?

Thank you!

partridgejiang commented 1 year ago

Hi @kwen1510, for the custom button (O, N, P...), there used to be some related discussions, please refer to issue #209 and #265. The composer customization demo (http://partridgejiang.github.io/Kekule.js/demos/items/chemEditor/composerCustomization.html) may also help you to some degree.

As for the second question, when using the atom tool, typing in the group abbrievations or formulas of some common used groups (Me, Et, COOH, CHO...) will automatically create collapse sub groups displaying only the abbrievations or formulas. Using the atom modifier at the bottom of the composer may do the same job as well.

kwen1510 commented 1 year ago

Hi @partridgejiang, thank you very much for the reply! Will try them out.