Flowgraph Studio vs D2: Choosing a diagram language your team will maintain

D2 is a diagram language and toolchain; Flowgraph Studio is an editor built around Mermaid. How to choose for architecture docs, with layout engines and existing diagrams in mind.

Comparisons · · 4 min read

Flowgraph Studio is our product. We've tried to describe the other tools fairly, from their own documentation as of November 2026.

A diagram language becomes part of a documentation system long before anyone calls it a standard. One team adds a flowchart to a README. Another copies the pattern. Soon there are dozens of diagrams, and changing the tool means changing how people contribute.

That's the setting for comparing D2 and Flowgraph Studio. D2 is a diagram language with its own toolchain. Flowgraph Studio is an editor built around Mermaid. They aren't interchangeable layers of the same stack.

A diagram-language decision branches between adopting D2 in a build pipeline and continuing with Mermaid plus visual editing.
The language choice affects the next author, the build, and where the diagram gets reviewed.

Start with the documentation you already have

Suppose a handbook already has Mermaid diagrams for request routing, background jobs and onboarding. Authors know the notation, and the places it's published either draw Mermaid themselves (GitHub and GitLab both do) or accept exported images.

A new service map needs clearer boundaries and better spacing. Before bringing in another language, ask whether the problem is the language, the editor, or the scope of the diagram. Removing two unrelated subsystems might do more for the explanation than a new toolchain.

On a new documentation project, the sums are different. There's little to migrate, and the team can choose the language and the renderer together.

D2 makes layout part of the toolchain decision

D2 is a text-based diagram language. Its layout documentation lists three engines: Dagre (the default), ELK, and TALA, an engine the D2 team wrote for software architecture diagrams. The same page notes that some features only work with certain engines: locking positions with top and left works only in TALA, for example, and so does setting a direction per container.

That suits a team that wants to judge the language, the layout behaviour and the build as one system. Judge it on a representative diagram, not a two-node example.

Take a service map with groups, a return path and one long label. Here's one in Mermaid, as a baseline:

flowchart TD
  CLIENT([Web client])
  subgraph ENTRY["Entry"]
    GW[API gateway]
  end
  subgraph ORDERS["Order service"]
    API[Orders API]
    DB[(Orders database)]
  end
  subgraph WORK["Background work"]
    Q[[Job queue]]
    W[Fulfilment worker]
  end
  CLIENT --> GW --> API
  API --> DB
  API -->|publishes OrderPlaced once the transaction commits| Q
  Q --> W
  W -.->|updates the order status| API
  GW -.->|response with the order id| CLIENT

Write the same map in D2 and look at the result with the engine and export path you'd really use. If it meets the documentation's needs and the authors are happy with the notation, D2 may be a sound foundation.

Flowgraph Studio keeps your Mermaid

Flowgraph Studio lets a team stay with Mermaid and adds a visual editing surface. Its Layout tab offers several engines, including ELK layered, ELK tree, ELK stress, ELK radial, a grid, and Mermaid's own Dagre. When automatic layout isn't enough, Manual mode lets you drag nodes, move where connections attach and place labels, for flowcharts, state, sequence, ER and class diagrams. The code panel stays open, so every change lands in the text.

For the existing handbook, that's a smaller change. Keep the language, fix the difficult view, and publish an export when the exact arrangement matters.

Be clear about one limit. Mermaid has no syntax for positions, so Flowgraph Studio saves them in a comment line at the end of the code. Other Mermaid renderers ignore that line and lay the diagram out automatically. Flowgraph's exports, render API and shared links keep the arrangement, so publish from one of those when the layout is part of the message.

For the build, flowgraph-cli validates Mermaid in CI, and the render API turns source and a theme file into SVG or PNG.

Count the maintenance steps honestly

Changing language affects more than the first diagram. Authors need examples, reviewers need enough fluency to catch mistakes, and the build needs a supported way to render. Old diagrams may stay in the old format for a long time.

Staying with Mermaid has costs too. Some diagrams are awkward to express in it, and a hand-placed layout may need attention after a large structural change. Familiarity shouldn't stop you seeing a better fit.

Write down one normal revision, such as adding a queue, moving a boundary or splitting a service, and follow it through authoring, review, export and publication in each option. Compare the whole cycle.

Choose once you know what's changing

Use D2 when the team wants to adopt its language and toolchain, and has checked that they suit the diagrams it will maintain. Use Flowgraph Studio when Mermaid already fits the documentation system and the missing piece is a visual way to edit and publish it. For a comparison with another long-standing graph tool, see Flowgraph Studio vs Graphviz.

The best decision is usually the modest one: solve the specific problem without creating a new one for every future contributor.

More from the blog

Follow the blog by RSS