Edit on the canvas

Add shapes, draw arrows, move things and check a flowchart on the canvas.

This page covers what's particular to editing a flowchart on the canvas. Everything else works as in every kind: moving around, selecting, renaming, colour, comments and undo. See Edit on the canvas for how editing works.

The app lays the chart out for you, in the direction it reads: top to bottom or left to right. A shape you move by hand stays where you put it. Every edit is a small, named change that shows in the version history and can be undone.

Add shapes

The palette along the bottom of the canvas has Process, Decision, Start or end, Input or output, Subroutine, Database, Document, Note and Frame.

A new shape goes after the one you've selected, joined to it by an arrow. After a decision, the first way out is labelled "yes". With a frame selected, the shape goes inside the frame.

The new shape opens for naming straight away. Type its label and press Enter.

From the keyboard:

KeyAdds
PProcess
DDecision
EStart or end
IInput or output
USubroutine
BDatabase
ODocument
FA frame round the selection

To add a shape at a spot of your choosing, right-click empty canvas. The menu offers Add process, Add decision, Add start or end, Add input or output and Add frame, each where you clicked.

Draw arrows

Move the pointer over a shape and a handle shows on each side. Drag from a handle to another shape, or to a frame, to join them. Esc cancels.

Let go on empty canvas to add a step there, joined to the shape.

An arrow out of a decision is labelled "yes" if it's the first and "no" if it's the second.

Move shapes

Drag a shape or a frame to move it. It stays where you let it go, on the grid. Its arrows follow, routed round the shapes in their way.

A frame takes what's inside it along. A shape moved on its own makes its frame grow to fit.

  • Let a shape go over a frame to move it into the frame.
  • Let a shape with no arrows go on an arrow to put it in between.

To put everything back where the automatic layout places it, choose Tidy up in the canvas's right-click menu. To put back one shape or frame, choose Back to its place in its right-click menu. See Layout and spacing.

Move the selection with the keys

⌘ A (Ctrl A on Windows and Linux) selects every shape and frame.

The arrow keys move the selection along the flow. In a chart that reads down, ↓ goes to the shape the selected one leads to, and ↑ to the one before it. ← and → go through the shapes in reading order.

In a chart that reads across, it's the other way round.

Use the selection bar

When you select something, a bar of tools floats above it. What's on it depends on what you selected:

SelectedTools
ShapeChange shape, Rename, its frame (or Frame it), Add after, Colour
ArrowLine, with the arrowheads, Rename (or Add label), Flip direction, Add step on it, Colour
FrameRename, its frame, Add step inside, Colour

Every element then has Ask assistant and Comment. The bar ends with More (⋯), which has the same tools plus Properties and Delete. See Select for More and the right-click menu.

Line offers Solid, Dotted, Thick and Hidden. Its arrowheads are One way, Both ways or No arrowhead.

Rename, delete and comment

These work as in every kind. See Rename and style text and Comments. What's particular to a flowchart:

  • A shape's label can run to several lines. ⇧ Enter starts a new one.
  • An arrow with no label gets one where its label goes when you rename it.
  • Deleting a shape deletes its arrows.
  • A frame's Unframe removes the frame and keeps what was in it.

⌫ or Delete deletes. M comments. ⌘ L (Ctrl L) asks the assistant about the selection.

The canvas menu

Right-click empty canvas for the canvas's own menu. After the Add items above, it has:

  • Direction, how the chart reads: Top to bottom, Left to right, Bottom to top or Right to left
  • Select all and Select an area
  • Tidy up
  • Set spacing: Compact, Standard (the default), Roomy or Spacious
  • Snap to grid
  • Walk through, to step through the chart one shape at a time. See Walk through.
  • Fit to view

The spacing is saved with the chart but isn't written in the Mermaid code. See Layout and spacing.

Read a chart

These work in every kind. In a flowchart:

  • Trace follows the arrows, upstream, downstream or both. With two shapes selected, it shows the paths between them.
  • Walk through steps through the chart one shape at a time. At a shape with several arrows out, you pick the arrow.
  • Any shape can link to another diagram, such as a subroutine to the chart that draws it in full.

A flowchart has one detail level.

See and change every property

The Properties panel shows every field the chart stores for what you've selected. Open it from More (⋯), or press ⌥ ⌘ P (Alt Ctrl P).

SelectedFields
Nothing (the chart)Title, Direction, what's In it, and Also in the code
ShapeLabel, Shape, Frame, Colour, and the arrows that Lead to and Come from it
ArrowFrom and To, Label, Line, Arrowheads (One way, Both ways or None), Colour and Flip direction
FrameTitle, the frame it's Inside, Direction inside, Colour, and what's In it

Also in the code lists lines of the code the canvas doesn't draw, such as a click link, kept as written. A shape has its own Also in the code when its @{ … } block says more than the canvas draws, such as an icon.

Each element shows its id at the bottom, with Copy. A shape's id is how the code names it. To change it, edit the code.

Check your chart

The Problems panel checks a flowchart every time it changes. See Modeling checks for how the panel works.

Flowcharts are informal, so the checks are light:

LevelWhat it finds
ErrorAn arrow joins a shape that isn't in the chart.
WarningA decision has a way out with no label.
To finishA shape is joined to nothing. A decision has only one way out. A shape has no label. A frame is empty. A chart of more than two steps has no start or end shape yet.

On this page