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

Add arrows #7

Open
lpatiny opened this issue Feb 28, 2021 · 0 comments
Open

Add arrows #7

lpatiny opened this issue Feb 28, 2021 · 0 comments

Comments

@lpatiny
Copy link
Contributor

lpatiny commented Feb 28, 2021

Currently it is possible in the SvgRenderer to highlight some bonds and atoms.

Internally it use 'useHighlight' in order to change the style.

We would need the possibility to annotate the molecule using 'arrows'.

This means:

  • SvgRenderer (and also SmilesSvgRenderer, IdcodeSvgRenderer and MolfileSvgRenderer) should allow a new property 'arrows'
  • arrows is an array of object that contains 'atom1', 'atom2' and svg 'style' property (allows to change color, thickness, from, to), 'kind' (either a straight 'line' or 'curved' (an arc) , default 'line')

The coordinates of the center of the atoms can be found by searching the resulting SVG for the corresponding id and searching the cx and cy properties like in :

Once you have based on atom1 and atom2 the from / to of the arraw you should add it in the renderer

New properties in the storybook should be added in order to debug / test this new feature.

NB: Many arrows can be added at the same time

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

1 participant