Skip to content

Nodes and Shapes

Draph supports seven node types, each suited for different purposes.

The standard node for most diagrams. Use for processes, steps, actions.

  • Default size: 120 × 44 px
  • Keyboard: 1
  • Mermaid: A[Label]

Rounded rectangle. Often used for start/end states or softer visual style.

  • Default size: 120 × 44 px
  • Keyboard: 2
  • Mermaid: A(Label)

Decision or condition node. Classic flowchart “if/else” shape.

  • Default size: 80 × 60 px
  • Keyboard: 3
  • Mermaid: A{Label}

Terminal, event, or state node. Good for start/end points.

  • Default size: 80 × 80 px
  • Keyboard: 4
  • Mermaid: A((Label))

A dashed-border group box for visually organizing related nodes. The label appears in the top-left corner.

  • Default size: 280 × 180 px
  • Keyboard: 5
  • Mermaid: A[["Label"]]

Tip: Create containers before the nodes they contain, so they render behind.

Free-form text annotation. No border, no background - just text.

  • Default size: 100 × 24 px
  • Keyboard: 6

Standalone arrow or line, not connected to nodes. Useful for annotations or custom layouts.

  • Keyboard: 7
  • Styles: Solid or dashed

Every node has these properties:

PropertyTypeDescription
idstringUnique identifier (auto-generated)
typestringrect, pill, diamond, circle, container, text, line
labelstringDisplay text
xnumberX position (pixels)
ynumberY position (pixels)
widthnumberWidth in pixels
heightnumberHeight in pixels
colorhexFill color (omit for no fill)
outlineColorhexBorder/stroke color
fillStylestringFill pattern
StyleDescription
outlineTransparent fill, border only
infillSolid color fill (default)
stripeDiagonal stripe pattern
gridDot grid pattern

Note: Use fillStyle: "outline" for transparent nodes. Do NOT set color: "transparent".

Select a node to see the floating toolbar:

From left to right:

  1. Shape changer - Switch between node types
  2. Fill style - Outline, infill, stripe, grid
  3. Fill color - Color palette
  4. Border color - Stroke color
  5. Delete - Remove node
  6. Close - Deselect
ColorHexSuggested Use
Blue#7aa2f7Primary accent
Cyan#7dcfffSecondary accent
Green#9ece6aSuccess, start states
Red#f7768eError, danger
Yellow#e0af68Warning, decisions
Magenta#bb9af7Special, highlights
Orange#ff9e64Attention, output
Gray#414868Borders, muted

For sequence diagrams, nodes can have lifelines:

PropertyTypeDescription
isParticipantbooleanMark as sequence participant
hasLifelinebooleanShow vertical dashed line below
isActorbooleanRender as stick figure

For UML class diagrams:

PropertyTypeDescription
isClassbooleanRender as UML class box
propertiesstring[]List of properties
methodsstring[]List of methods

Visibility prefixes: + public, - private, # protected, ~ package

Example:

{
"id": "user",
"type": "rect",
"label": "User",
"x": 100,
"y": 100,
"width": 150,
"height": 120,
"isClass": true,
"properties": ["+name: string", "-password: string"],
"methods": ["+login()", "+logout()"]
}
  • Move - Drag the node
  • Resize - Drag the corner handles
  • Edit label - Double-click the node
  • Delete - Select and press Delete
  • Duplicate - Ctrl+C, Ctrl+V