-
Notifications
You must be signed in to change notification settings - Fork 61
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
Interact with chemViewer objects/molecules #314
Comments
The molecule can be retrieved by accessing the chemViewer.addEventListener('hotTrackOnObjects', e => {
let hotTrackedMolecules = [];
e.objects.forEach(obj => {
if (obj.getStandaloneAncestor)
Kekule.ArrayUtils.pushUnique(hotTrackedMolecules, obj.getStandaloneAncestor());
});
chemViewer.setHotTrackedObjects(hotTrackedMolecules);
}); |
getStandaloneAncestor did the trick. Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to hover over a molecule in a chemViewer, have it highlighted and then run some code based on the molecule hovered over. I have been playing with hot tracking event but it seems to focus on atoms and bonds, not molecules.
Kekule.X.Event.addListener(chemViewer, 'hotTrackOnObjects', function(e) {
console.log(e]);
// if molecule A is selected run code
});
Thank you for your help!
Carl
The text was updated successfully, but these errors were encountered: