DEV Community

Felix Madden
Felix Madden

Posted on

Best Program for Graphs? A Practical Guide

A recent Ask HN thread asked which program is best for making graphs. Replies split into familiar camps: Graphviz fans, Mermaid pragmatists, Excalidraw sketchers, draw.io realists, and people who use Figma for everything. Anyone trying to pick “the best” diagram tool knows that thread could not settle on one answer.

After years of making flowcharts, architecture diagrams, network graphs, and incident timelines, my conclusion is simple: there is no single best program. There is a best default for each kind of diagram—and a second-best choice for whoever maintains it after you leave. If your work needs a canvas, a browser-streamed full drawing program can run a complete drawing app in a live session with an assistant beside it.

Here is the framework I use.

Separate four things people call “graphs”

  • Data charts: bar charts, line charts, dashboards. Use a charting library or BI tool, not a diagram editor.
  • Flowcharts: processes, decisions, handoffs. They need speed and readability.
  • Architecture/network diagrams: services, queues, boundaries. They need precision and review.
  • Concept maps / whiteboard sketches: thinking tools. They need zero friction.

Most bad tool choices happen when one program is forced to handle all four. A whiteboard tool is great for a discovery session and poor as a source of truth. A diagram-as-code tool is great for review and painful when a product manager wants to move one box.

A two-axis landscape of diagram tools
I sort tools by how fast they are to start versus how precise and repeatable they are to maintain.

My default stack

If I had to give one answer, I would say: start with Mermaid inside Markdown, use Excalidraw for thinking, and use D2 or Graphviz when the diagram becomes infrastructure. But the stack matters less than the rules.

Use Mermaid for diagrams that live next to code. It is not the prettiest renderer, and its layout engine can make a simple flowchart look like a subway map drawn by a committee. But it wins on the thing that matters: the diagram is text in the same pull request as the code. It can be reviewed, diffed, fixed by anyone who can edit Markdown, and it does not rot silently in a proprietary canvas. I use it for sequence diagrams, simple flowcharts, state machines, and deployment docs—not pixel-perfect customer-facing architecture posters.

Use Excalidraw for thinking and workshops. It is my favorite tool for the messy phase: fast, keyboard-friendly, and the hand-drawn style signals “this is a sketch, not a contract.” A diagram that looks too polished too early invites nitpicking instead of ideas. I use it for incident retrospectives, whiteboard sessions, rough system sketches, and explaining a flow on a call. Then I usually redraw the final version in Mermaid or D2 if it needs to live in the repo.

Use D2 or Graphviz when layout is the hard part. For dependency graphs, network topology, service meshes, or state machines with many edges, manual layout stops scaling. Graphviz is the elder statesman: ugly in the way a Unix tool is ugly, but it will still be running in 2040. D2 is friendlier, has better defaults, and produces diagrams I am more willing to put in front of a team. I reach for one of them when the graph has more than a dozen nodes or needs to be generated from data.

Use draw.io or Figma when the artifact is the deliverable. Sometimes the diagram is the product: a sales architecture poster, a compliance flowchart, a conference slide. draw.io remains the pragmatic default because it is free, local-friendly, and exports well. Figma/FigJam is great when the diagram lives inside a design process and the team already pays for it.

If you want that canvas without installing a desktop app, browser-streamed diagram canvas runs a full drawing program in a live session, with an agent beside it that can inspect the current document, add and edit shapes and connectors, align complex systems, and prepare focused exported views. The trap is assuming a canvas tool is a documentation system. It is not. If a diagram only exists as a PNG in a slide deck, it is already decaying.

The best program is a workflow, not a file format

The HN thread asked for a program, but the real problem is the lifecycle. A diagram has three phases: sketch, publish, and maintain. Most teams optimize for publish and ignore maintain. That is why the “best” tool often becomes the worst tool six months later.

My workflow is simple: whiteboard or Excalidraw for the sketch; Mermaid/D2/Graphviz for the source of truth if it belongs in the repo; export to SVG/PNG only for places that cannot render Markdown; put the source link next to the image; add a small “last reviewed” date. If a diagram cannot be updated in less time than it takes to argue about it, it will not be updated.

A flowchart for choosing a diagram tool
My decision tree is boring on purpose: maintenance cost beats first-render beauty.

The answer I’d post in the thread

Best program? For me: Mermaid for docs, Excalidraw for thinking, D2/Graphviz for real graphs, and draw.io/Figma when the canvas is the point. But if you need one program to standardize on across a dev team, pick the one that keeps the diagram close to the work. A slightly ugly Mermaid diagram in a pull request beats a beautiful canvas that nobody opens. The best diagram program is the one that makes the next update cheap.

Top comments (0)