Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select the entire molecule by clicking on its atom #1039

Open
hellhorse123 opened this issue Apr 16, 2024 · 1 comment
Open

Select the entire molecule by clicking on its atom #1039

hellhorse123 opened this issue Apr 16, 2024 · 1 comment

Comments

@hellhorse123
Copy link

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

@papillot
Copy link
Contributor

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants