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

Attach click event handler to hidden carbones #257

Open
ben-ikt opened this issue Nov 24, 2022 · 3 comments
Open

Attach click event handler to hidden carbones #257

ben-ikt opened this issue Nov 24, 2022 · 3 comments

Comments

@ben-ikt
Copy link

ben-ikt commented Nov 24, 2022

Is your feature request related to a problem? Please describe.

Hello, I want select atoms by clicking on them. I listen to the click events on atoms. With the css class, I could identify atom but hidden carbones aren't displayed. So I can't attach a click event handler.

Capture d’écran 2022-11-24 à 13 33 04

Describe the solution you'd like

You could display hidden carbones with a transparent . In this case, I could attach a click event handler and create interactivity.

if atom-0 is a hidden carbon I expected a svg like this:

<ellipse class="atom-0 hidden" />
<path class="bond-0 atom-0 atom-1" />
<ellipse class="atom-1" />

instead of:

<path class="bond-0 atom-0 atom-1" />
<ellipse class="atom-1" />

Describe alternatives you've considered
I need to attach the click event to the bond (svg and analyse if the user is close to the hidden carbon to trigger an event like clicking on the ellipsis would.

Thanks

@MichelML
Copy link
Collaborator

MichelML commented Nov 24, 2022

cc @ptosco , any suggestions here?

@ben-ikt
Copy link
Author

ben-ikt commented Dec 2, 2022

Hi everyone, I think it's a hidden hydrogen instead of a hidden carbon.

@najwalb
Copy link

najwalb commented Oct 19, 2023

I think it's a carbon actually, hidden hydrogens are not plotted at all (not even as unmarked ends of bonds).

The requested feature is actually quite useful. Is there any plan to include it in a future release?

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

3 participants