partridgejiang / Kekule.js

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

Set wedge and dash bond size on autoFit #247

Closed akulmehta closed 3 years ago

akulmehta commented 3 years ago

I have set autoFit on the chem viewer 2D which scales as described in the following issue 33: https://github.com/partridgejiang/Kekule.js/issues/33#issuecomment-593766313

The main issue now is that the wedge and dash bond sizes are too big or invisible respectively. See structure as example: image

Anyways I can adjust the sizes for the wedges and dashed when it does do the autofit?

Alternatively is it possible to ignore wedge/dash when autofit is performed?

Thank you so much for creating this wonderful package.

partridgejiang commented 3 years ago

Hi @akulmehta, you can always adjust the width of wedge bonds with the following codes:

chemViewer.getRenderConfigs().getLengthConfigs().setBondWedgeWidth(3);  // use custom width of wedge end
chemViewer.repaint();
akulmehta commented 3 years ago

@partridgejiang but what about the dash bonds?

partridgejiang commented 3 years ago

The hash bond width shares the same setting to wedge bond. By the way, spacing between dashes is also settable:

chemViewer.getRenderConfigs().getLengthConfigs().setHashSpacing(2);