Skip to content

shape operations

1 min read · Updated 29 Oct 2026

Reference for @astrato-io/visualizations@0.6.5.

All visualization types

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.

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
}

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"
}

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
}

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"
}

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)"
}

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"
}

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)"
}

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"
}

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"
}

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"
}

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"
}

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)"
}

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)"
}

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"
}