Skip to content

Shape Properties

Every shape in Diagrammer has properties that control its appearance and behavior. This reference covers all available properties.

Common Properties

These properties are available on all shapes:

Position & Size

PropertyTypeDescription
xnumberX coordinate (world space)
ynumberY coordinate (world space)
widthnumberShape width in pixels
heightnumberShape height in pixels
rotationnumberRotation angle in degrees

Appearance

PropertyTypeDescription
fillstringFill color (hex, rgb, or named color)
fillOpacitynumberFill opacity (0-1)
strokestringStroke color
strokeWidthnumberStroke width in pixels
strokeOpacitynumberStroke opacity (0-1)
strokeStyleenumsolid, dashed, dotted
strokeDashArraynumber[]Custom dash pattern

Shadow

PropertyTypeDescription
shadowEnabledbooleanWhether shadow is visible
shadowColorstringShadow color
shadowBlurnumberShadow blur radius
shadowOffsetXnumberHorizontal shadow offset
shadowOffsetYnumberVertical shadow offset

State

PropertyTypeDescription
lockedbooleanPrevent editing
visiblebooleanShape visibility
opacitynumberOverall opacity (0-1)

Rectangle

Additional properties for rectangles:

PropertyTypeDescription
cornerRadiusnumberRounded corner radius
cornerRadiinumber[4]Individual corner radii [tl, tr, br, bl]

Ellipse

Ellipses use only common properties. The shape is defined by its bounding box.

Line

PropertyTypeDescription
x1numberStart point X
y1numberStart point Y
x2numberEnd point X
y2numberEnd point Y
startArrowenumArrow at start: none, arrow, triangle, circle, square, diamond
endArrowenumArrow at end (same options)
arrowSizenumberArrow size multiplier

Text

PropertyTypeDescription
textstringText content
fontFamilystringFont family name
fontSizenumberFont size in points
fontWeightenumnormal, bold
fontStyleenumnormal, italic
textDecorationenumnone, underline, strikethrough
textAlignenumleft, center, right
verticalAlignenumtop, middle, bottom
lineHeightnumberLine height multiplier
letterSpacingnumberLetter spacing in pixels
textColorstringText color
paddingnumberInternal padding

Connector

PropertyTypeDescription
routingStyleenumorthogonal, curved, straight
startAnchorobjectStart connection: { shapeId, port }
endAnchorobjectEnd connection: { shapeId, port }
waypointsPoint[]Manual routing points
startArrowenumArrow at start
endArrowenumArrow at end
cornerRadiusnumberCorner rounding for orthogonal
labelstringConnector label text
labelPositionnumberLabel position (0-1 along path)

Connection Ports

Shapes have connection ports at these positions:

PortPosition
topTop center
rightRight center
bottomBottom center
leftLeft center
topLeftTop left corner
topRightTop right corner
bottomLeftBottom left corner
bottomRightBottom right corner
centerCenter of shape

Group

PropertyTypeDescription
childrenstring[]Array of child shape IDs
collapsedbooleanWhether group is collapsed
clipContentbooleanClip children to group bounds
backgroundFillstringGroup background color
backgroundOpacitynumberBackground opacity
paddingnumberInternal padding

Image

PropertyTypeDescription
srcstringImage source (blob:// or data:)
preserveAspectRatiobooleanMaintain proportions
objectFitenumfill, contain, cover

Flowchart Shapes

Flowchart shapes inherit common properties plus shape-specific ones:

Process

Standard rectangle with optional corner radius.

Decision

Diamond shape for yes/no branches.

PropertyTypeDescription
yesLabelstring"Yes" branch label
noLabelstring"No" branch label

Terminator

Pill shape (rounded ends).

Data (Parallelogram)

PropertyTypeDescription
skewAnglenumberParallelogram angle

Document

Rectangle with wavy bottom edge.

Database

Cylinder shape.

PropertyTypeDescription
topHeightnumberHeight of cylinder cap

UML Shapes

Class

PropertyTypeDescription
classNamestringClass name
stereotypestringUML stereotype (e.g., «interface»)
attributesAttribute[]Class attributes
methodsMethod[]Class methods
showAttributesbooleanDisplay attributes section
showMethodsbooleanDisplay methods section

Attribute Format

json
{
  "visibility": "+",  // +, -, #, ~
  "name": "attributeName",
  "type": "string",
  "default": "value"
}

Method Format

json
{
  "visibility": "+",
  "name": "methodName",
  "parameters": [{ "name": "param", "type": "string" }],
  "returnType": "void"
}

Actor

Stick figure for use case diagrams.

PropertyTypeDescription
labelstringActor name

Use Case

Ellipse with centered label.

ERD Shapes

Entity

PropertyTypeDescription
entityNamestringTable/entity name
attributesERDAttribute[]Entity attributes
isWeakbooleanWeak entity (double border)

ERD Attribute Format

json
{
  "name": "attribute_name",
  "type": "VARCHAR(255)",
  "isPrimaryKey": true,
  "isForeignKey": false,
  "isNullable": false
}

Relationship

Diamond shape for relationships.

PropertyTypeDescription
relationshipNamestringRelationship name
isIdentifyingbooleanIdentifying relationship

Property Panel Sections

The Property Panel organizes properties into sections:

  1. Transform - Position, size, rotation
  2. Fill - Fill color, gradient, opacity
  3. Stroke - Border color, width, style
  4. Text - Font, size, alignment (when applicable)
  5. Shadow - Shadow settings
  6. Effects - Opacity, blend mode
  7. Shape - Type-specific properties

Programmatic Access

Access shape properties via the document store:

javascript
// Get a shape
const shape = documentStore.getShape(shapeId);

// Read properties
console.log(shape.fill, shape.strokeWidth);

// Update properties
documentStore.updateShape(shapeId, {
  fill: '#ff0000',
  strokeWidth: 2
});