Your first figure
- SHEET
- A4
- REV
- flowfig 0.8.4
- SOURCE
- README.md
- DATE
- 2026-10-06
Save this spec as first.json. The spec has 3 boxes, 2 edges and 1 step.
{ "layout": { "children": [ { "id": "browser", "label": "Browser" }, { "id": "api", "label": "API" }, { "id": "db", "label": "Database", "shape": "store" } ] }, "edges": [ { "from": "browser", "to": "api", "label": "GET /user" }, { "from": "api", "to": "db", "label": "read the user" } ], "steps": [ { "label": "Load a user", "flow": [ { "edges": "browser->api", "say": "The browser asks the API for the user." }, { "edges": "api->db", "say": "The API reads the row." }, { "edges": { "edge": "api->db", "back": true }, "say": "The row comes back." }, { "edges": { "edge": "browser->api", "back": true }, "say": "The API sends the user as JSON." } ] } ]}Render the spec:
$ npx flowfig first.json0 errors, 0 warningsfigure: 3 boxes, 0 groups, 2 edges, 1 step, 4 messagesbrowser -> api: GET /userapi -> db: read the userstep "Load a user": 4 hopsfirst.svg — 9.7 kBThe render prints the check result, the counts, one line per edge and one line per step. Read these lines to check the figure
without a second command. If a box or an edge has a source or a via, the render also prints the verify counts.
--no-verify skips them.
The command writes first.svg:
The SVG has no script and fetches no font. GitHub shows the SVG in a README, a PR or an issue. The SVG follows the light or dark color scheme of the reader.
Read and change a figure
Section titled “Read and change a figure”Each SVG from the CLI carries its own spec. These commands made the rail-only figure from docs/checkout.svg:
npx flowfig --spec docs/checkout.svg > checkout.json # print the spec in the SVG# edit checkout.json: set "props.rail" to "only"npx flowfig checkout.json docs/checkout-rail-only.svgnpx flowfig verify docs/checkout.svg # check each source and each edge against the codenpx flowfig diff old.svg docs/checkout.svg # list what changed in the spec