Skip to content

Shape Properties

Every shape in DocuShark 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 radians (the property panel edits it in degrees)

Appearance

PropertyTypeDescription
fillstring | nullFill color (hex, rgb, or named color); null for no fill
strokestring | nullStroke color; null for no stroke
strokeWidthnumberStroke width in world units
opacitynumberOverall shape opacity, 01

Shadow

Shadows are opt-in on the shapes that support them (such as groups) via a single shadowConfig object — see ShadowConfig in src/shapes/GroupStyles.ts for its fields (color, blur, offset). It is not a flat per-shape property.

State

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

Rectangle

Additional properties for rectangles:

PropertyTypeDescription
cornerRadiusnumberRounded corner radius

Ellipse

Ellipses add radiusX and radiusY (the horizontal and vertical radii) on top of the common properties.

Line

PropertyTypeDescription
xnumberStart point X (the shape's base position)
ynumberStart point Y
x2numberEnd point X
y2numberEnd point Y
startArrowbooleanArrowhead at the start
endArrowbooleanArrowhead at the end
lineStyleenumsolid or dashed

Text

PropertyTypeDescription
textstringText content
fontFamilystringFont family name
fontSizenumberFont size
textAlignenumleft, center, right
verticalAlignenumtop, middle, bottom
widthnumberText box width
heightnumberText box height

Text colour comes from the common fill property — there is no separate textColor field.

Connector

PropertyTypeDescription
routingModeenumorthogonal, curved, straight
startShapeId / endShapeIdstringThe shapes the connector links
startAnchor / endAnchorAnchorPositionWhich anchor on each shape (top/right/bottom/left/center)
waypointsPoint[]Manual routing points
startArrowStyleenumArrowhead at start: none, triangle, open, diamond
endArrowStyleenumArrowhead at end (same options)
lineStyleenumsolid or dashed
labelstringConnector label text
labelPositionnumberLabel position (0-1 along path)
flowTypeenumcontrol (solid, default), object (dashed) — activity diagram data vs. control flow

Sequence-diagram-specific connector semantics (sync/async markers, guard conditions, message numbering, self-messages) are covered in DocuShark's Software Engineering guides, not this reference.

Connection Ports

The five standard connection anchors (STANDARD_ANCHOR_POSITIONS) are:

PortPosition
topTop center
rightRight center
bottomBottom center
leftLeft center
centerCenter of shape

Some library shapes (UML classes, ERD entities) expose extra anchors on their individual rows or compartments beyond these five.

Group

PropertyTypeDescription
childIdsstring[]Array of child shape IDs
showBackgroundbooleanDraw a background behind the children
backgroundColorstringGroup background color
backgroundPaddingnumberPadding around the children

Groups also support shadows via shadowConfig (see Shadow).

Embedded Images & Files

There is no standalone image shape. Embedded images and files use the file shape (FileShape) — dragged onto the canvas — and decorative shape icons use the common iconId property. See Embedded Files.

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.

Terminator

Pill shape (rounded ends).

Data (Parallelogram)

Parallelogram for input/output.

Document

Rectangle with wavy bottom edge.

Database

Cylinder shape.

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 these sections (the PropertySection values in src/shapes/ShapeMetadata.ts):

  • appearance — fill, stroke, opacity
  • dimensions — position, size, rotation
  • label — text content and typography
  • icon — shape icon
  • endpoints — line/connector arrowheads
  • routing — connector routing
  • custom — 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
});

Released under the AGPL-3.0 License.