Skip to main content

transformLabel

Apply geometric transformations to a label (rotate, flip, scale, translate).

Parameter

KeyTypeDescription
labelNamestringName of the label in the database. Mutually exclusive with labelData.
labelDataobjectA Label object. Mutually exclusive with labelName.
scalenumberScale factor. Default is 1.0.
flipXbooleanMirror horizontally. Default is false.
flipYbooleanMirror vertically. Default is false.
transposebooleanSwap X and Y axes. Default is false.
rotationnumberRotation in degrees. Must be 0, 90, 180, or 270. Default is 0.
dxnumberHorizontal translation in millimeters.
dynumberVertical translation in millimeters.
newLabelNamestringIf provided, saves the transformed label to the database under this name and returns null.

Return value

If newLabelName is provided, the transformed label is saved to the database and null is returned. Otherwise, the transformed Label object is returned.

Example

Rotate a label 90 degrees and save under a new name:

transformLabel {"labelName": "MyLabel", "rotation": 90, "newLabelName": "MyLabel-Rotated"}