Open AaronLlanos opened 6 years ago
Actually the radical buttons are designed to set the radical orders of an atom (following the MDL MOL strategy) instead of to add multiple lone pairs. I'll investigate that request and may implement it soon.
@partridgejiang thank you. Please let me know. I don't mind trying to help out when/where I can!
@partridgejiang Any updates towards having lone pairs? I also don't mind trying to help out! ^_^
@partridgejiang would it also work if we took advantage of custom elements that kekule already has enabled? For example using a custom element (L) to represent lone pairs?
Or also (LL) for lone pairs and (L) for radicals that you could set custom coordinates on?
Hi @AaronLlanos, I am still working on it. In our current design, the lone pairs in editor are implemented as attached markers to atoms (and other types of nodes). After the full implementation, not only the lone pairs but also the charge, radical markers, and even text/image notes can be attached and can be movable and changeable (with font, size, etc.).
@AaronLlanos & @ragnerrok, now the lone pair support has been added to the composer, you can download the latest js files in dist directory of editorEnhancement branch to try it, :). We also add the ability to move positions of lone pairs and charge markers, just as any other objects in editor. Defaultly, the distance between marker and the atom is restrained during moving, but you can press Alt key to break such a constraint. If you find any bug, please do let me know, thanks.
@partridgejiang it looks awesome! I have tried with the setup of using kekule.min.js and the kekule.css on a basic html file. I have a couple notes:
Messing with the position of the lone pairs on an element, I am able to change distance from the element without pressing the "alt" key. Is this different from your requirements of Defaultly, the distance between marker and the atom is restrained during moving, but you can press Alt key to break such a constraint
?
I am using Molfiles for structure comparisons and I noticed that the molfile is not changing when I update a molecule with lone pairs. Should I be using a different export type for comparing structures with lone pairs?
@AaronLlanos Forgot to say, if you select the lone pair first (surrounding with a blue rectangle mark) then move it, distance will not be retained too. To start a constraint moving, just mouse down directly on a deselected lone pair and then move the mouse. The second question, MOL data format does not support recording of lone pairs (but does support charge and radical). So to save it, you have to switch to KCJ or KCX.
Ah perfect. I have been testing this out over the last few days and noticed that if I compare two structures with different number of lone pairs, say CH2 with one loan pair vs CH2 with 4 lone pairs, they are in fact returned as the same structure. I was wondering if this was an intentional update, or if it was a overlook?
Thank you so much for your continued support and implementing this so quickly!
@AaronLlanos , now an additional option for lone pairs is enabled in structure comparison, e.g.:
var isSame = molecule1.isSameStructureWith(molecule2, {'lonePair': true});
Just download the files in dist directory of editorEnhancement branch for testing, :).
@partridgejiang thank you so much for that! I think the functionality is awesome. Follow up questions I had are:
Hi @AaronLlanos,
Messing with the charge button, it gives me the option to add radicals, but I can't draw out lone pairs. Other libraries have similar functionality to add multiple lone pairs to an atom. Similar to how Kekule bonds work, with evenly spacing out lone pairs and radicals around an atom. Is this an intended feature for Kekule? Or would I have to build something out like that myself? I don't mind either approach but some beginning steps on how to attack the problem might help me out.
Thanks!