ngl
ngl copied to clipboard
Be able to select atoms and move them around
This pull request adds the following:
- Being able to select or deselect atoms with shift+click, which is indicated by a transparent white VdW structure
- Being able to deselect all atoms with shift+double click
- Being able to drag selected atoms with shift+right-drag to alter their coordinates
There is room for other transformations, e.g. rotation (which I started on but isn't working very well). Being able to select by clicking is very convenient.
Thanks @lilyminium, this sounds great! I'll have a proper look at it as soon as I can.
Thanks for the thoughtful and comprehensive review, @ppillot! The roadmap you suggested looks great and practical. Unfortunately it has been a while since I looked at NGLViewer or Javascript in general, so it would take some time for me to get my head back into this. I don't want to hold up any plans -- would it be better to close this PR and eventually work towards the two divided functionalities?
No worries! I'll leave it open for now as it's a useful starting point. I've opened the discussion with @fredludlow and we'll see how we advance starting from there. Since then, I've already started working on more flexible selections which will accept BitArrays as their definitions. Once this is in, we'll hopefully be in a better position for the next steps.