ngl icon indicating copy to clipboard operation
ngl copied to clipboard

Select the entire molecule by clicking on its atom

Open hellhorse123 opened this issue 10 months ago • 1 comments

How to implement the behavior: highlight a molecule and display information about all its atoms when you click on an atom in this molecule?

I guess what I need to use:

stage.signals.clicked.add((pickingProxy: any) => {
      if (pickingProxy && (pickingProxy.atom || pickingProxy.bond)) {
        const atom = pickingProxy.atom || pickingProxy.closestBondAtom;
        console.log(atom); // Update selected residues
      }
});

but I don’t understand the implementation

hellhorse123 avatar Apr 16 '24 07:04 hellhorse123

Right, with this code atom will be a reference to an AtomProxy object. This object has many properties which are useful to get the element name, the corresponding residue and chain, etc...

papillot avatar Apr 25 '24 12:04 papillot