Design Format

FigureElement

Documentation for the FigureElement type in the Polotno design JSON Schema.

Type Information

Base Type: object

Properties

PropertyTypeDescription
bindingsobjectVariable names bound to element properties.
idstringUnique identifier for the element.
type"figure"Element type identifier.
namestringDisplay name for the element.
hrefstringClick destination: an http(s), mailto: or tel: URL, or # and a page ID. A group's link applies to each child without one.
customunknownCustom data attached to the element.
xnumberX position in pixels.
ynumberY position in pixels.
widthnumberWidth in pixels. A value of 0 or less reads as 1.
heightnumberHeight in pixels. A value of 0 or less reads as 1.
rotationnumberRotation angle in degrees.
opacitynumberOpacity level (0-1).
blendMode"normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "color" | "luminosity"How the element composites with the content beneath it. Omitted means normal.
animationsArray<Animation>The element's animations, at most one of each type, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.
blurEnabledbooleanWhether blur effect is enabled.
blurRadiusnumberBlur radius in pixels.
brightnessEnabledbooleanWhether brightness effect is enabled.
brightnessnumberBrightness level (-1 to 1).
sepiaEnabledbooleanWhether sepia effect is enabled.
grayscaleEnabledbooleanWhether grayscale effect is enabled.
filtersobjectApplied image filters keyed by filter name.
shadowEnabledbooleanWhether shadow is enabled.
shadowBlurnumberShadow blur radius in pixels.
shadowOffsetXnumberShadow horizontal offset in pixels.
shadowOffsetYnumberShadow vertical offset in pixels.
shadowColorstringShadow color.
shadowOpacitynumberShadow opacity (0-1).
visiblebooleanWhether the element is visible.
draggablebooleanWhether the element can be dragged.
resizablebooleanWhether the element can be resized.
selectablebooleanWhether the element can be selected.
removablebooleanWhether the element can be removed.
contentEditablebooleanWhether the element content can be edited.
styleEditablebooleanWhether the element style can be edited.
alwaysOnTopbooleanWhether the element stays on top of others.
showInExportbooleanWhether the element appears in exports.
subTypestringFigure subtype: rect, ellipse, triangle, etc.
fillstringFill color.
dashArray<number>Dash pattern array.
strokeWidthnumberStroke width in pixels.
strokestringStroke color.
cornerRadiusnumberCorner radius in pixels.

JSON Schema

{
  "type": "object",
  "properties": {
    "bindings": {
      "description": "Variable names bound to element properties.",
      "type": "object",
      "properties": {
        "fill": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"
        },
        "visible": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$"
        }
      },
      "additionalProperties": false
    },
    "id": {
      "type": "string",
      "description": "Unique identifier for the element."
    },
    "type": {
      "type": "string",
      "const": "figure",
      "description": "Element type identifier."
    },
    "name": {
      "default": "",
      "description": "Display name for the element.",
      "type": "string"
    },
    "href": {
      "description": "Click destination: an http(s), `mailto:` or `tel:` URL, or `#` and a page ID. A group's link applies to each child without one.",
      "type": "string"
    },
    "custom": {
      "description": "Custom data attached to the element."
    },
    "x": {
      "default": 0,
      "description": "X position in pixels.",
      "type": "number"
    },
    "y": {
      "default": 0,
      "description": "Y position in pixels.",
      "type": "number"
    },
    "width": {
      "default": 100,
      "description": "Width in pixels. A value of 0 or less reads as 1.",
      "type": "number"
    },
    "height": {
      "default": 100,
      "description": "Height in pixels. A value of 0 or less reads as 1.",
      "type": "number"
    },
    "rotation": {
      "default": 0,
      "description": "Rotation angle in degrees.",
      "type": "number"
    },
    "opacity": {
      "default": 1,
      "description": "Opacity level (0-1).",
      "type": "number"
    },
    "blendMode": {
      "description": "How the element composites with the content beneath it. Omitted means normal.",
      "type": "string",
      "enum": [
        "normal",
        "multiply",
        "screen",
        "overlay",
        "darken",
        "lighten",
        "color-dodge",
        "color-burn",
        "hard-light",
        "soft-light",
        "difference",
        "exclusion",
        "hue",
        "saturation",
        "color",
        "luminosity"
      ]
    },
    "animations": {
      "default": [],
      "description": "The element's animations, at most one of each `type`, so an 'enter', an 'exit' and a 'loop' can play together. A group's animations play on top of its children's.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Animation"
      }
    },
    "blurEnabled": {
      "default": false,
      "description": "Whether blur effect is enabled.",
      "type": "boolean"
    },
    "blurRadius": {
      "default": 10,
      "description": "Blur radius in pixels.",
      "type": "number"
    },
    "brightnessEnabled": {
      "default": false,
      "description": "Whether brightness effect is enabled.",
      "type": "boolean"
    },
    "brightness": {
      "default": 0,
      "description": "Brightness level (-1 to 1).",
      "type": "number"
    },
    "sepiaEnabled": {
      "default": false,
      "description": "Whether sepia effect is enabled.",
      "type": "boolean"
    },
    "grayscaleEnabled": {
      "default": false,
      "description": "Whether grayscale effect is enabled.",
      "type": "boolean"
    },
    "filters": {
      "default": {},
      "description": "Applied image filters keyed by filter name.",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "intensity": {
            "default": 1,
            "description": "Filter intensity (-1 to 1).",
            "type": "number"
          }
        }
      }
    },
    "shadowEnabled": {
      "default": false,
      "description": "Whether shadow is enabled.",
      "type": "boolean"
    },
    "shadowBlur": {
      "default": 5,
      "description": "Shadow blur radius in pixels.",
      "type": "number"
    },
    "shadowOffsetX": {
      "default": 0,
      "description": "Shadow horizontal offset in pixels.",
      "type": "number"
    },
    "shadowOffsetY": {
      "default": 0,
      "description": "Shadow vertical offset in pixels.",
      "type": "number"
    },
    "shadowColor": {
      "default": "black",
      "description": "Shadow color.",
      "type": "string"
    },
    "shadowOpacity": {
      "default": 1,
      "description": "Shadow opacity (0-1).",
      "type": "number"
    },
    "visible": {
      "default": true,
      "description": "Whether the element is visible.",
      "type": "boolean"
    },
    "draggable": {
      "default": true,
      "description": "Whether the element can be dragged.",
      "type": "boolean"
    },
    "resizable": {
      "default": true,
      "description": "Whether the element can be resized.",
      "type": "boolean"
    },
    "selectable": {
      "default": true,
      "description": "Whether the element can be selected.",
      "type": "boolean"
    },
    "removable": {
      "default": true,
      "description": "Whether the element can be removed.",
      "type": "boolean"
    },
    "contentEditable": {
      "default": true,
      "description": "Whether the element content can be edited.",
      "type": "boolean"
    },
    "styleEditable": {
      "default": true,
      "description": "Whether the element style can be edited.",
      "type": "boolean"
    },
    "alwaysOnTop": {
      "default": false,
      "description": "Whether the element stays on top of others.",
      "type": "boolean"
    },
    "showInExport": {
      "default": true,
      "description": "Whether the element appears in exports.",
      "type": "boolean"
    },
    "subType": {
      "default": "rect",
      "description": "Figure subtype: rect, ellipse, triangle, etc.",
      "type": "string"
    },
    "fill": {
      "default": "rgb(0, 161, 255)",
      "description": "Fill color.",
      "type": "string"
    },
    "dash": {
      "default": [],
      "description": "Dash pattern array.",
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "strokeWidth": {
      "default": 0,
      "description": "Stroke width in pixels.",
      "type": "number"
    },
    "stroke": {
      "default": "rgba(98, 197, 255, 1)",
      "description": "Stroke color.",
      "type": "string"
    },
    "cornerRadius": {
      "default": 0,
      "description": "Corner radius in pixels.",
      "type": "number"
    }
  },
  "required": [
    "id",
    "type"
  ]
}

On this page