Introduction
Every diagram a doctor, engineer, or lawyer would actually use. Free. Fully open source. Made for AI. Industry-standard diagrams — genogram to fault tree — from a text DSL.
Schematex renders every diagram a doctor, engineer, or lawyer would actually use — clinical genograms, IEC 61131-3 ladder logic, NSGC pedigrees, IEEE 315 single-line diagrams, cap tables, and many more. A tiny text DSL in; standards-compliant SVG out.
Free. Fully open source. Made for AI. AGPL-3.0, zero runtime dependencies, and a DSL designed around how LLMs actually write text — paste output from ChatGPT or Claude and get a professional diagram back on the first try.
What can I draw?
Schematex draws 45 diagram types across 14 domains — each built to a published standard:
Quick example
Use with AI
Schematex ships a tool layer built for LLMs. Connect Claude.ai to the hosted MCP server in 10 seconds and let it generate validated diagrams in any conversation — no install, no setup.
Or build your own AI feature on top of the Vercel AI SDK. See Use Schematex with AI.
Next steps
- Getting started — install, import, render
- Use Schematex with AI — MCP + Vercel AI SDK + agent loop
- Playground — try any diagram type live
- API reference
How it works
Each diagram type follows the same pipeline:
Text DSL ──→ Parser ──→ AST ──→ Layout Engine ──→ LayoutResult ──→ SVG Renderer ──→ SVG stringEvery diagram implements a DiagramPlugin with four methods:
interface DiagramPlugin {
detect(text: string): boolean; // auto-detects diagram type
parse(text: string): DiagramAST; // text → typed AST
layout(ast, config): LayoutResult; // AST → positioned nodes/edges
render(layout, config): string; // LayoutResult → SVG string
}Layout algorithms are domain-specific by design — genogram uses a generation-based layered layout, ecomap uses radial/polar, logic gates use DAG topological sort, ladder logic uses a fixed power-rail layout. Generic layout engines (dagre, ELK) cannot produce standards-compliant output for these diagram types.
Design principles
- Diagrams professionals actually use — each diagram type implements a published domain specification: McGoldrick 2020 (genogram), Hartman 1978 (ecomap), Bennett 2022 (pedigree), Moreno 1934 (sociogram), IEEE Std 91 (logic gates), IEC 61131-3 (ladder logic), IEEE 315 (SLD), and more.
- Free & fully open source — AGPL-3.0, zero runtime dependencies (no D3, no dagre, no parser generators), everything hand-written. Small bundle, no supply-chain risk. Commercial license available for closed-source use.
- Made for AI — the DSL is designed around how LLMs actually write text (CJK quotes, nesting ambiguity, AI-readable errors). Paste output from ChatGPT or Claude and get a professional diagram back on the first try.
- Semantic SVG output — every SVG includes
<title>and<desc>for accessibility, CSS classes for theming, anddata-*attributes for interactivity.
Theming
Three built-in presets: default (blue-gray), monochrome (black-and-white / print), dark (Catppuccin Mocha).
Override any token via CSS custom properties injected into each SVG's <style> block:
--schematex-stroke: #1a1a1a;
--schematex-fill: #f5f5f5;