partridgejiang / Kekule.js

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

Feature Request: Default location of atom charge and explicit atom labels #134

Open cleblond opened 5 years ago

cleblond commented 5 years ago

When I add a charge to an atom the charge sometimes is hidden behind the atom. acetylide I understand that we can drag the charge to a different location, but is there anyway to automatically position the charge so the drag is not required?

Also it would be great if I could show the carbon label (C) explicitly on any carbons I wish. For example the acetylide anion above looks goofy since there is no atom label on the charged carbon. In fact the non-charged carbon also looks goofy. Maybe you could have a "smart" hydrogen display level that would automatically show labels on atoms with charge or if they are terminal.

partridgejiang commented 5 years ago

Actually, there existed a small bug in set the default position of charge markers on a chain-terminal atom. Now the bug has been fixed and the charge marker should be at the proper position during insertion now. Thanks a lot for the feedback. As for the label of a terminal atom... Since different chemists have different appetites on the label styles of atoms, it is quite hard to fix one automatic pattern on the molecules. However, now an additional select box is added in the text format modifier of composer, as shown in the following figure. It should be helpful to control the label style of atoms, enjoy. image

cleblond commented 5 years ago

Awesome! I'll give it a try soon.

cleblond commented 5 years ago

The only problem I see now is when the label is explicit, the charge is on top of the label. See the following. Thanks again for the great software!

latest_labels

cleblond commented 5 years ago

Seems OK now.