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 50 diagram types across 16 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 (Schematex slate/blue dark palette).
Override any token via CSS custom properties injected into each SVG's <style> block:
--schematex-stroke: #1a1a1a;
--schematex-fill: #f5f5f5;Found this useful?
Schematex is free, fully open source, and zero-dependency. A star helps other developers discover it.