Back to feed
Dev.to
Dev.to
7/15/2026
A diagram is data, not a drawing

A diagram is data, not a drawing

Short summary

The author tested having an LLM generate a 44-node architecture diagram as raw SVG versus typed JSON processed by a layout engine. SVG output failed on edge routing — a structural limitation of token prediction, not model quality. The solution is to let models emit typed JSON and delegate spatial math to a real layout engine like ELK, enabling validation, deterministic rendering, and scalable server-side deployment without headless browsers.

  • LLMs place boxes well but fail at edge routing in dense graphs — a structural limitation of token prediction
  • Typed JSON output + layout engine (ELK) beats raw SVG: enables validation, diffing, and deterministic re-rendering
  • Glyphic tool renders diagrams server-side in Rust without headless Chromium, deployable as a Node dependency

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more