D2 Editor

Diagramming AI supports D2 as a first-class diagram language. You can generate D2 diagrams from prompts, refine them in the editor, and manage them in the same project workflow used for Mermaid, PlantUML, Graphviz, and Excalidraw.

What You Can Do with D2

D2 is well suited for architecture overviews, data and model relationships, interaction flows, and presentation-friendly system maps. In Diagramming AI, D2 is available in template mode and in free-form generation mode, so you can start from a curated structure or from plain text instructions.

D2 Workflow in Diagramming AI

Select D2 in the language selector, then create a new diagram from AI prompts or from a template. Generated D2 code appears in the Code tab, where you can make direct edits and immediately review the rendered output.

You can also continue iterating through Chat and Update flows, save multiple versions in a project, and restore previous snapshots from history.

Syntax Reliability and Guardrails

Diagramming AI applies D2-focused syntax guardrails during generation and auto-fix. These guardrails are designed to reduce common formatting mistakes and keep output easier to compile and edit, especially for nested objects and edge labels.

Current Scope

D2 support currently focuses on text-based generation, rendering, template usage, and project save/restore flows. Visual examples and advanced D2-specific tutorials will be expanded in future updates.