partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
248 stars 61 forks source link

Spacing between curved arrow anchors and targets #182

Closed mmartinez-macmillan closed 4 years ago

mmartinez-macmillan commented 4 years ago

Is there a way to control the spacing between the curved arrows and their connected targets?

image

partridgejiang commented 4 years ago

Yes, it can be customized globally by the following code:

composer.getRenderConfigs().getLengthConfigs().setGlyphStickOffsetRelLength(0.5);  // set the space to half of default bond length

or individually by setting the render option of the curved arrow connector:

arrow.getConnectorAt(0).setRenderOption('glyphStickOffsetRelLength', 0.5);
mmartinez-macmillan commented 4 years ago

Thank you!