Home | D2 Documentation
D2: Declarative Diagramming A modern language that turns text to diagrams
Explore docs Create beautiful diagrams in minutes. Simple syntax. Endlessly customizable. D2 is the fastest and easiest way to get a mental model from your head onto the screen, then make edits with your team.
NETWORK USER API SERVER LOGS CELL TOWER ONLINE PORTAL DATA PROCESSOR SATELLITES TRANSMITTER UI STORAGE SEND SEND SEND PHONE LOGS MAKE CALL ACCESS DISPLAY PERSIST
Feature highlights Production-ready themes Themes by professional designers, each unique. Effortlessly ready for blogs, wikis, and presentations.
Preprocessing Multi-GPU Training Eval Inference Orchestrator Data Warehouse Processing Pipeline Note: we can replace the orchestrator with Kubernetes when we run out of things to do Full working pipeline Primary Secondary
Sketch mode Our take on a beautiful, hand-drawn aesthetic.
john wick henchman 1 henchman 2 big boss
john wick henchman 1 henchman 2 big boss shoots, misses
john wick henchman 1 henchman 2 big boss shoots, misses shoots, hits
john wick henchman 1 henchman 2 big boss shoots, misses shoots, hits shoots, misses
john wick henchman 1 henchman 2 big boss shoots, misses shoots, hits shoots, misses shoots, hits
john wick henchman 1 henchman 2 big boss shoots, misses shoots, hits shoots, misses shoots, hits injures
john wick henchman 1 henchman 2 big boss shoots, misses shoots, hits shoots, misses shoots, hits injures shoots, hits
Animations D2 is the only language that can produce animated diagrams from text.
LaTeX Perfect for academic use and research papers.
好笑的猫咪跳舞, 在月亮下欢唱。 它踩在小青蛙头上, 嘴里嚼着苹果香。 웃기는 고양이 날다, 달빛 아래 춤을 추다. 개구리 머리 밟다, 입 속 사과 향기 즐기다.
Any language Make diagrams in English, Chinese, French, or even emojis, D2 supports almost all languages.
declare function getSmallPet(): Fish | Bird;
const works = (a > 1 ) || (b < 2 )declare function getSmallPet ( ) : Fish | Bird ;
const works = ( a > 1 ) || ( b < 2 ) awsSession := From (c.Request.Context ())
client := s3.New (awsSession)
ctx, cancelFn := context.WithTimeout (c.Request.Context (), AWS_TIMEOUT)
defer cancelFn ()awsSession := From ( c . Request . Context ( ) )
client := s3 . New ( awsSession )
ctx , cancelFn := context . WithTimeout ( c . Request . Context ( ) , AWS_TIMEOUT )
defer cancelFn ( )
Code snippets Made for software diagrams. Syntax highlighted code right in the diagram.
Markdown Include longform explanations with Markdown.
cloud disks id int PK blocks id int PK disk int FK blob AWS S3 Vancouver
Tables Show structured data like SQL tables.
More features Local CLI Robust CLI with watch mode. Completely offline workflow. Most major OS's MacOS, Linux, and Windows. D2 is included in many popular package managers like Homebrew and Winget. VSCode and Vim Official editor support for VSCode and Vim, with more coming soon. Online playground Create and share diagrams quickly by going to our hosted Playground. Containers First-class support for containers (grouping shapes in other shapes). Images and Icons Import any image or icon online into your diagram Multiple layout engines Choose from 3 layout engines that uniquely handle different types of diagrams. Use any font To customize the font, simply pass in your own .ttf files. Imports Modularize your diagrams like your code. Split models from views or dice it any way you want. Variables Reuse values like colors, labels, and anything else for clean diagram code. Globs All the power of wildcard globs you're already familiar with. Autoformat Don't sweat style decisions like indentations and spacing, D2 has a built-in autoformatter. Language API Programmatically create diagrams by calling D2's language API. Interactive tooltips and links Hover over shapes to learn more, or click through to another page. Class shape UML Class diagrams are fully supported Sequence diagrams Sequence diagrams are created by setting shape: sequence_diagram Adaptive dark mode Diagrams adjust color schemes to fit user preferences automatically, anywhere on the web. Extensions Explore official and community developed plugins and extensions Exports On the CLI, you may export .d2 into SVG, PNG, PDF. More coming soon! Cheat sheet Download our handy one-pager D2 syntax cheat sheet
Get involved Chat on Discord Hangout, talk about diagrams, get help, give feedback and see early previews of what's coming next. Go to Discord Check out our blog Technical blog posts from the authors of D2 on a variety of topics from feature deep dives to how things were built. Go to blog ZW5kZW5yYWhheXU5QGdtYWlsLmNvbQ==