shape operations
Reference for @astrato-io/visualizations@0.6.5.
Use each schema below for the request’s payload, not for the whole operation request. Names and payloads are specific to this visualization type. An operation can still require particular fields or chart state; see its description.
Available operations
Section titled “Available operations”setShapeBackgroundColorsetShapeBackgroundTypesetShapeBorderColorsetShapeBorderEnabledsetShapeBorderRadiussetShapeBorderStylesetShapeBorderWidthsetShapeHeightBasedSizesetShapeImageFitsetShapeImageURLsetShapePreserveAspectRatiosetShapeRotationsetShapeScalesetShapeType
setShapeBackgroundColor
Section titled “setShapeBackgroundColor”Background color
Set the background color of the shape
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape background color schema", "type": "object", "properties": { "code": { "type": "string", "pattern": "^#([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$", "description": "Background color code (hex, with optional alpha)" } }, "required": ["code"], "additionalProperties": false}setShapeBackgroundType
Section titled “setShapeBackgroundType”Background type
Choose between solid color or image background
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape background type schema", "type": "string", "enum": ["color", "image"], "description": "Background type - color or image"}setShapeBorderColor
Section titled “setShapeBorderColor”Border color
Set the color of the shape border
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape border color schema", "type": "object", "properties": { "code": { "type": "string", "pattern": "^#([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$", "description": "Border color code (hex, with optional alpha)" } }, "required": ["code"], "additionalProperties": false}setShapeBorderEnabled
Section titled “setShapeBorderEnabled”Border enabled
Enable or disable the shape border
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape border enabled schema", "type": "boolean", "description": "Enable or disable the border"}setShapeBorderRadius
Section titled “setShapeBorderRadius”Border radius
Set the corner radius for rounded shape edges
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape border radius schema", "type": "number", "minimum": 0, "maximum": 50, "description": "Border radius of the shape (in pixels)"}setShapeBorderStyle
Section titled “setShapeBorderStyle”Border style
Set the border style (solid, dashed) and dash pattern properties
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "style": { "type": "string", "enum": ["line", "dashed", "dotted"], "description": "Border style - line, dashed, dotted" }, "lineThickness": { "type": "number", "minimum": 0, "maximum": 50, "description": "Border thickness (in pixels)" }, "dashSpace": { "type": "number", "minimum": 0, "maximum": 100 }, "dashWidth": { "type": "number", "minimum": 0, "maximum": 100 } }, "required": ["style", "lineThickness", "dashSpace", "dashWidth"], "additionalProperties": false, "title": "Shape border style schema"}setShapeBorderWidth
Section titled “setShapeBorderWidth”Border width
Adjust the thickness of the shape border
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape border width schema", "type": "number", "minimum": 0, "maximum": 50, "description": "Border thickness (in pixels)"}setShapeHeightBasedSize
Section titled “setShapeHeightBasedSize”Height based size
Calculate shape size based on height rather than width
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape height based size schema", "type": "boolean", "description": "Fit to vertical space instead of horizontal space, useful for line shapes"}setShapeImageFit
Section titled “setShapeImageFit”Image fit
Control how the image fits within the shape
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape image fit schema", "type": "string", "enum": ["none", "xMidYMid slice"], "description": "Image fit type"}setShapeImageURL
Section titled “setShapeImageURL”Image URL
Set the URL of the image to use as shape background
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape image URL schema", "type": "string", "description": "Image URL"}setShapePreserveAspectRatio
Section titled “setShapePreserveAspectRatio”Preserve aspect ratio
Maintain the original aspect ratio when resizing the shape
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape preserve aspect ratio schema", "type": "boolean", "description": "Preserve aspect ratio of the shape"}setShapeRotation
Section titled “setShapeRotation”Shape rotation
Rotate the shape by a specified angle
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape rotation schema", "type": "number", "minimum": 0, "maximum": 360, "description": "Rotation of the shape (in degrees)"}setShapeScale
Section titled “setShapeScale”Shape scale
Adjust the size scale of the shape
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Shape scale schema", "type": "number", "minimum": 0, "maximum": 1, "description": "Scale of the shape (defined as float between 0 and 1)"}setShapeType
Section titled “setShapeType”Shape type
Set the type of shape
Payload schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "string", "enum": ["square", "circle", "triangle", "hexagon", "line", "arrow", "elbow", "rectangle"], "description": "Shape type", "title": "Shape type schema"}