Solution
When calling indigo's functions such as layout, convert on the Canvas, new settings parameters should be processed.
List of the new settings in the JSON of the Settings:
bond-length-unit: "px"bond-length: 2.2
If possible, the size of an arrow should be the same as the size of a bond. Exceptions are when catalysts/reaction conditions/other additional context placed bellow or above the arrow. The logic is described in Ketcher issue: #5155
Default arrow size is equal to 2 default sizes of bonds (in angstrom)
(images for better understanding)
Reaction margin size should be applied both for distance between plus and component and between arrow and component structure bounding box (should be equal distance)
Structure bounding box should be calculated as atoms bounding box + default atom label margin=0.5 Default bond length
For simple atoms atoms bounding box is a dot in center of the atom
Default size of the plus element by default equals 0.5 bond-length
reaction-component-margin-size-unit: "px"reaction-component-margin-size: default value = 2.3 ptimage-resolution
bond-length-unit values can be in cm/pt/px/in
bond-length number with 1 decimal places
reaction-component-margin-size-unit values can be in cm/pt/px/in
reaction-component-margin-size number with 1 decimal places
image-resolution should be a number;
Regardless of the resolution, the size of the image should be such that one bond is ~0,5cm (0,2in/14,4pt) long when printed/100% zoom.
Additional information
1 inch = 72 pt
1 inch = 2.54 cm
1 angstrom = 1e-8 cm
PPI = pixels per inch = sqrt(w^2 + h^2) /d
where w - width in px, h - height in px, d - diagonal in inches
if PPI = 100 then 1px = 0.01 in
reactionComponentMarginSize - horizontal & vertical margins
Background Related issue: https://github.com/epam/ketcher/issues/5152 need to add new settings.
Solution When calling indigo's functions such as layout, convert on the Canvas, new settings parameters should be processed. List of the new settings in the JSON of the Settings:
bond-length-unit: "px"
bond-length: 2.2
Reaction margin size should be applied both for distance between plus and component and between arrow and component
structure bounding box
(should be equal distance)Structure bounding box
should be calculated asatoms bounding box
+ defaultatom label margin
=0.5Default bond length
For simple atoms
atoms bounding box
is a dot in center of the atomDefault size of the
plus
element by default equals 0.5bond-length
reaction-component-margin-size-unit: "px"
reaction-component-margin-size: default value = 2.3 pt
image-resolution
bond-length-unit
values can be in cm/pt/px/inbond-length
number with 1 decimal placesreaction-component-margin-size-unit
values can be in cm/pt/px/inreaction-component-margin-size
number with 1 decimal placesimage-resolution
should be a number; Regardless of the resolution, the size of the image should be such that one bond is ~0,5cm (0,2in/14,4pt) long when printed/100% zoom.Additional information 1 inch = 72 pt 1 inch = 2.54 cm 1 angstrom = 1e-8 cm PPI = pixels per inch = sqrt(w^2 + h^2) /d where w - width in px, h - height in px, d - diagonal in inches if PPI = 100 then 1px = 0.01 in reactionComponentMarginSize - horizontal & vertical margins
SMILES for testing
OC(=O)C.OCCC>>CC(=O)OCCCC.O