# What is diagram as code?

## Diagram-as-code

Diagram-as-code is a way to **quickly draw beautiful diagrams using a simple DSL** instead of dragging boxes and arrows with your mouse.

<Figure src="/assets/4e4048e21bbd03a2a96c1ff4afc2dcaaecf4679474961ea7f6f58d19e32a10cb-diagram-export-11-4-2024-9_31_28-AM.png" alt="Four diagrams generated from Eraser DSL: a cloud architecture with API gateway, Lambda and worker nodes; an entity relationship diagram; a sequence diagram; and a flow chart." width="650px" />

## Types of diagrams

* [Flow Charts](/flow-charts): Visualize process flows, user flows, logic flows
* [Entity Relationship Diagrams](/entity-relationship-diagrams): Visualize data models
* [Cloud Architecture Diagrams](/cloud-architecture-diagrams): Visualize cloud infrastructure and data flow
* [Sequence Diagrams](/sequence-diagrams): Visualize system flows and interactions

## Why Diagram-as-code?

* **Faster to draw**: Most of the time drawing a diagram is spent on getting the boxes and arrows to look just right. Diagram-as-code allows you to skip all of that.
* **Beautiful by default**: Eraser's default layout and formatting automatically outputs beautiful diagrams.
* **Easy to maintain and update**: A simple change can trigger a tedious layout update when using a GUI to diagram. Using diagram-as-code, it is often just a one-liner change to the DSL.
