A collection of diagrams-as-code examples across 15 languages and tools. Each folder contains sample diagram source files you can use as starting points for your own projects.
| Format | Description |
|---|---|
| Mermaid | Flowcharts, sequence diagrams, class diagrams, Gantt charts, and more. Renders natively on GitHub. |
| PlantUML | UML diagrams including sequence, use case, class, activity, and component diagrams. |
| C4 | Architecture diagrams using the C4 model (Context, Container, Component, Code). |
| Draw.io | General-purpose diagrams editable in the Draw.io desktop or web app. |
| Graphviz | Graph and network visualizations using the DOT language. |
| D2 | A modern declarative diagramming language with auto-layout. |
| DBML | Database markup language for documenting entity-relationship schemas. |
| ERD | Entity-relationship diagrams from a simple text format. |
| Vega | Data visualizations and charts defined as JSON specifications. |
| Vega-Lite | A higher-level grammar for quick statistical charts, built on Vega. |
| BPMN | Business process models in the standard BPMN 2.0 XML format. |
| Bytefield | Protocol and byte-level data structure diagrams. |
| Blockdiag | Simple block diagrams, sequence diagrams, and network diagrams. |
| Excalidraw | and-drawn style diagrams stored as JSON, editable in the Excalidraw app. |
| TikZ | Programmatic diagrams and figures via LaTeX's TikZ/PGF package. |
- Browse the folder for the format you're interested in.
- Open a source file to see the diagram syntax.
- Copy and adapt it for your own use.
Most formats can be previewed with their respective CLI tools or web editors. Mermaid diagrams render directly in GitHub Markdown files.
Contributions are welcome - open a PR to add new examples or improve existing ones.
Using Atlassian Jira or Confluence? Capable Diagrams you create, edit, and embed diagrams using all the languages in this repo - directly inside your issues and pages. No context-switching, no exporting.
Both apps include visual editors (Excalidraw, Draw.io-compatible, BPMN) alongside the code-based formats, so the whole team can contribute regardless of technical background.