isotopo) and a Go library
(github.com/MarkovWangRR/iso-topology). Both expose the same
rendering pipeline.
CLI
isotopo render — produce SVG + embed assets
The
--layout flag is consulted only for .d2 input (YAML/JSON
already encode placement). The projection can also be set per-document
with canvas.projection (see DSL/YAML). Output structure
is documented in OUTPUTS.md.
render runs the full validator first (issues go to stderr) and returns
an exit code that mirrors validate, so an agent can gate on render
alone without a separate validate step:
Warnings alone do not fail the render. On a code-3 result the
(partial or empty) output is still written for inspection — it is simply
no longer reported as success.
Examples:
isotopo capabilities — discover supported features
Designed for agents to read once at startup so they can generate
valid DSL without consulting source code. Example:
isotopo validate — structural check before render
place/offset values that make
boxes or group slabs collide in the flat plan view, which the 3-D cross-container
lint (it requires height overlap too) and the same-container sibling check (it
ignores mere touching) would miss.
Two more geometry lints:
- label occlusion — warns when a node sits over a group label or
iso_texttitle in the rendered view. The renderer silently lifts an occluded group label on top, so this surfaces the defect as feedback instead of swallowing it. - container fit — warns when a child’s effective footprint exceeds 90% of a fixed-size group/boundary on either axis (it bursts the slab). Auto-sized containers grow to wrap their children, so they’re exempt. Effective dims honour per-shape render floors (e.g. a cloud is measured at its drawn 200×140), so a cloud crammed into a small fixed group is caught.
- rounded side band — warns when a solid
palette.rightthat is clearly different frompalette.leftis set on a rounded part (cornerRadius ≥ 6, including the default-rounded group slab). The rounded renderer collapses the two side walls into one band driven by top + left and never reads the solid right, so that colour is silently dropped. Normal same-hue iso shading is below the distance threshold and stays quiet; setcornerRadius: 0for distinct left/right faces.
In an agent loop:
isotopo evaluate — score the auto-layout connection quality
output-dir, also writes plan.svg with problems
marked in red.
The report has two halves — plan (the plan view’s preview router) and
iso (the engine’s real routes, parsed from the rendered SVG) — so
you can see both the achievable and the actual quality:
z-stacked scenes are handled: a part on another z-floor, a shared
substrate both endpoints sit on, or a flat decoration (
h ≤ 2) is not
counted as an obstacle.
EvaluatePlan / EvaluateIso / RenderPlanAnnotated
(see API reference).
isotopo repair — inspect or persist automatic fixes
--write, this prints a fix report without modifying the input. With
--write, it persists supported fixes while preserving comments. --compose
also enables bounded alignment snapping. Exit code 0 means no repairs were
found; 2 means repairs were found, including when they were written.
render applies its automatic repair pass to the rendered document by default.
Use --no-repair to inspect the authored scene without that pass, or --report
to save a report of what changed. Review the output: automatic repair does not
guarantee that every possible layout problem has been resolved.
isotopo snapshot — rasterize a scene
topology.png using the SVG viewBox as its viewport. This requires resvg
or ImageMagick. It accepts --no-repair and --report, like render.
isotopo preview — render a subset
edge:0. The subset is laid out and cropped independently. Use - as the
output path to write SVG to stdout.
isotopo serve — the Studio
The interactive page has a name and its own guide: isotopo Studio — feature tour, design rationale, endpoints, and how it is tested. Quick reference below.
http://localhost:8731:
- the YAML editor (line numbers, Tab inserts indent, drag the splitter
to resize the pane) edits an in-browser copy — the input file on
disk is never written; unsaved edits persist across a reload as a
local draft, with a one-click
revert - hovering a node in the SVG highlights its source block; the filetab shows the absolute source path with a copy-path button
- scroll to zoom, drag to pan, double-click to reset
- edits re-render automatically (debounced) or with Cmd/Ctrl+Enter; validation errors show under the editor with fix suggestions, and the canvas keeps the last good render (with a badge) while the source is broken
↓ SVG/↓ PNGexport whatever the canvas currently shows — unsaved edits included — as<name>.edited.svg/.png(2x);Downloadsaves the edited YAML copyBrowse nodesopens the per-part gallery, served live from the current file content
GET / viewer · GET /topology.svg fresh
render of the file on disk · GET /nodes/_index.html and
/nodes/<id>.svg|.yaml|.html gallery · POST /api/render renders the
posted source, returns {"svg", "issues"} · GET /api/ping health.
The same interactive page is written to out/topology.html by
isotopo render; opened as a static file it keeps everything except
live re-render (the toolbar tells you to start isotopo serve).
Go library
The CLI is a thin wrapper over the Go engine. The full library API — parsing, rendering, the stateless edit contract (ApplyOp /
EditOp), types, and the yamledit / iso25d sub-packages — lives in
the single API reference.