Skip to content

Check a figure

SHEET
C1
REV
flowfig 0.8.4
SOURCE
README.md
DATE
2026-10-06

flowfig check reads a spec and lists the faults. The input is - (stdin), a .json file, a .ts module or an SVG from the CLI. A .ts module needs a Node version that strips types, such as Node 22.18 or later.

$ npx flowfig check docs/checkout.svg
0 errors, 0 warnings
figure: 5 boxes, 3 groups, 4 edges, 2 steps, 6 messages

The last line gives the counts of the parts of the figure. Compare the counts with the parts that you planned.

flowfig check has 23 rules: 11 errors and 12 warnings.

Rule Severity What it finds
unknown-id error An edge, step or beat names a box, group or edge that does not exist.
duplicate-id error Two boxes, two groups or two edges have the same id.
hidden-edge error A quiet edge that no beat uses, so the figure never shows it.
text-overflow error Text that needs more width than its box has.
edge-crosses-box error An edge that goes through a box that is not one of its ends.
label-overlap error Two edge labels overlap, or a label covers a box or an edge, or a stub label crosses a lane border.
low-contrast error A text and background pair below 4.5:1, in the light, dark or custom theme, or on a tone tint.
lanes-need-column error The layout of a lanes or timeline figure is not a column group of labeled groups.
bad-at error An at value that is not an integer of 0 or more.
timeline-need-from error A box in a timeline has no from date.
bad-date error A from, to or today value is not a real YYYY-MM-DD date, or a to is before its from.
empty-step warning A step with no beats.
small-text warning At the page width, the smallest text is below the minimum size.
bad-source warning A source that is not path or path#symbol.
mark-count warning A lifecycle has more than one start mark, or a start mark and no end mark.
lane-column-taken warning Two boxes in one lane share a time column.
lane-end-block warning In wrapped lanes, an edge ends at a lane that no block on its side shows.
stub-crosses-edge warning In wrapped lanes, a stub line crosses another edge.
timeline-dependency-order warning In a timeline, an item does not start after the item that it depends on ends.
timeline-and-lanes warning The figure sets timeline and lanes. The renderers draw the timeline and ignore lanes.
font-estimated warning theme.font is set. The SVG check estimates text width for the system font.
color-not-checked warning A color that the check cannot read, so its contrast is not checked.
plain-text warning Text with a code name, a filler word, or a say or caption over 20 words.
Option Effect
--strict Every warning becomes an error.
--json Print the findings as a JSON array, for scripts. Each finding has rule, severity, ids and message.
--width <px> The page width for small-text and for the lanes wrap. Default: 830.
--min-text <px> The smallest text size the reader must get. Default: 10.

The exit code is 0 with no errors, 1 with one or more errors, and 2 for bad use, such as a missing input, an unknown flag, or a --width value that is not a number.

A render runs the same check first. If the check finds an error, the render writes nothing. --no-check skips the check.

In React, <Flow check /> runs the same rules on the layout that the browser drew. The player prints each fault with console.warn.