Skip to Content
DocumentationDiagram Configs

Diagram Configs

What this page covers

This page explains the diagram-level settings that affect the whole rendered output. Use these options when you want to control the title and overall presentation of a DiagramFlow diagram.

Mental model

Diagram configs are global directives. They do not define services, queues, databases, or connections. Instead, they control how the full diagram is presented after DiagramFlow generates it.

In practice, these settings are useful when you want cleaner architecture docs, better screenshots for reviews, or a diagram that fits a specific document background.

Basic syntax

The smallest diagram config is a title:

title "Title Basic Example" source = EKS("source") queue = SQS("queue") source -> queue

If you omit title, DiagramFlow still renders the diagram:

source = EKS("source") queue = SQS("queue") source -> queue

Attributes and options

title

Use title to add a diagram title.

title "Orders Service Flow"

Use a short, descriptive title that helps a teammate understand the diagram at a glance.

graph_bgcolor

Use graph_bgcolor to set the background color for the whole diagram.

Transparent background:

title "Transparent Background" graph_bgcolor "transparent"

Hex color background:

title "Hex Background" graph_bgcolor "#F8FAFC"

graph_title_position

Use graph_title_position to control where the title appears.

Top title:

title "Top Title Position" graph_title_position "top"

Bottom title:

title "Bottom Title Position" graph_title_position "bottom"

graph_title_font_size

Use graph_title_font_size to make the diagram title smaller or larger.

Small title:

title "Small Title Font" graph_title_font_size 18

Large title:

title "Large Title Font" graph_title_font_size 48

Common patterns

Combine multiple diagram configs

You can combine multiple graph_* directives at the top of the file before your nodes and connections:

title "Combined Graph Styles" graph_bgcolor "#EEF6FF" graph_title_position "top" graph_title_font_size 30 source = EKS("source") queue = SQS("queue") store = S3("store") source -> queue -> store

Full diagram-level style setup

This pattern is useful when you want a presentation-ready diagram for docs, ADRs, or architecture reviews:

title "Diagram Full Style" graph_bgcolor "transparent" graph_title_position "bottom" graph_title_font_size 42 source = EKS("source") queue = SQS("queue") handler = Lambda("handler") store = S3("store") source -> queue -> handler -> store

Use diagram configs sparingly. They work best when they improve clarity, not when they make the diagram feel over-designed.

  • Add a title when the diagram will be shared outside the editor.
  • Use graph_bgcolor "transparent" when the diagram will be embedded into docs or slides.
  • Increase graph_title_font_size for overview diagrams and reduce it for compact technical references.
  • Keep config directives together at the top of the file so the diagram source is easy to scan.

Common mistakes

  • Treating diagram configs like nodes or connections. They change the whole canvas, not one element.
  • Scattering graph_* directives throughout the file instead of grouping them at the top.
  • Using large font sizes or strong background colors when the goal is readability, not decoration.
Last updated on