render_diagram
Convert ASCII/Unicode box diagrams to SVG or HTML with exact cell alignment. Includes layout verification and repair for misaligned diagrams.
Instructions
Render an ASCII/Unicode box diagram as SVG (or a web page), keeping every character in its exact cell. Writes output_path and returns a JSON report: read 'status' (ok | warnings | self_check_failed | bad_input) and 'summary'. For warnings, apply each 'hint' (it names the row/col to fix) and render again. Pick 'preset' from where the diagram is going. Run check_diagram first on a new diagram.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| font | No | Font family to try first, e.g. JetBrains Mono | |
| color | No | Tint boxes by group and colour the arrows | |
| style | No | ||
| theme | No | ||
| title | No | Accessible title stored in the output | |
| width | No | Scale the output to this width in pixels | |
| accent | No | Accent colour for arrows and animation, e.g. #0969da | |
| preset | No | readme: GitHub/docs, animated, follows dark mode · slides · chat · print · dark · page: a web page that reveals as you scroll (needs a .html path) | |
| repair | No | Fix typical misalignment first (ragged walls, drifting connectors, short arrows); the fixed text is in report.repair.text | |
| square | No | Square box corners | |
| animate | No | ||
| diagram | Yes | The diagram as plain text with real line breaks (a markdown code block is fine). Boxes: +--+ / | | / +--+ or ┌─┐ │ │ └─┘. Arrows end in v ^ < > or ▼ ▲ ▶ ◀ touching (or one space from) the box they point at. | |
| describe | No | Also return boxes and edges (which box each arrow connects) | |
| output_path | No | File to write: .svg, or .html for a web page. Prefer an absolute path. Omit to get the markup back. |