Shape constraints
Shape constraints allow the shape to define limits that prevent the shape from going below a minimum size or above a maximum size. For both minimum and maximum size, both width and height are optional, so it is possible to have a shape that is limited in only one dimension in either direction or has different limits for height and width. Shape constraints also allow locking controls on the shape. The shapes horizontal or vertical resizing can be limited to prevent the shape from being resized in that dimension. Minimum size can be specified using a formula, which allows the minimum dimensions of the shape to be dynamically updated based on formula values. If resizing is also locked for that dimension, the shape's dimension will be fully dynamic. Lastly, you are able to alter the image that represents your shape in the shapes panel. This is useful if you have many shapes that look the same or have the same structure, but serve a different purpose.
ShapeDefinition schema
Property | Type | Description |
---|---|---|
minSize | ConstraintSizeFormula (optional) | A constraint that limits the minimum size of the shape. |
maxSize | ConstraintSizeFormula (optional) | A constraint that limits the minimum size of the shape. |
locked | string\[] (optional) | A list of fields to lock. Options are aspectRatio , horizontalResize , and verticalResize |
thumbnail | string (SVG) (optional) | An SVG that replaces the thumbnail image of the shape in the toolbar. |
If you include
aspectRatio
in thelocked
list without having a default aspect ratio, the width and height will be used to calculate it.
ConstraintSizeFormula schema
Property | Type | Description |
---|---|---|
width | number, formula (optional) | |
height | number, formula (optional) |
ConstraintSize schema
Property | Type | Description |
---|---|---|
width | number (optional) | If present, constrains the width to this number |
height | number (optional) | If present, constrains the height to this number |
Updated 7 months ago