partridgejiang / Kekule.js

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

Request for aromatic benzene ring #264

Closed kwen1510 closed 2 years ago

kwen1510 commented 2 years ago

Hi partridgejiang,

Thank you so much for this! It's amazing work!

Would it be possible for you to include the aromatic structure of benzene in the chem widget? I am able to draw the kekule structure, but I cannot draw one with a ring in it.

Thank you!

partridgejiang commented 2 years ago

Hi @kuaaangwen, this feature may be added in the future, but it did require some time. Drawing a hexagon and a circle for benzene is simple, but in some situations, the behavior may be quite complex when the benzene ring being modified in the editor (e.g., adding another benzene ring side by side to create naphthalin, changing one carbon atom to nitrogen to create pyridine, deleting one bond on the ring, etc). Currently, as a alternate, you may create a Kekule structure in the composer widget first, then select the whole ring, click on the "Set bond" button at the bottom of composer and in the drop down panel, select the "Hucklize" tool. Afterward, six explicit "aromatic bond" will be displayed inside the ring.

kwen1510 commented 2 years ago

@partridgejiang thank you so much for the response! I look forward to the day the function is built! Let me know if I can help in any way. And thanks for the suggestion!