Skip to content
Connect an agent
Language reference

Limits and quality checks

How large a diagram may be, the quality warnings that fire past the density limits, and the two suggestions that name an icon or a group type to add.

TL;DR

QuestionAnswer
How big can a diagram be?50000 characters of source. Longer source is refused.
When does a density warning start?At 15 flow nodes (one more for each group, up to 25), 6 tables, 6 actors, 40 git graph commits, 7 git graph branches, 40 Gantt chart tasks and milestones, 12 class diagram classes, 12 class diagram members in one class, 15 state states, 3 state composite nesting, 12 timeline periods on a horizontal rail, 24 timeline periods on a vertical rail, 5 timeline events in one period, 48 timeline events, 16 user journey tasks, 8 user journey actors, 40 mind map topics, 8 mind map branches, 4 mind map levels, 9 mind map topics under one topic, 80 treemap treemap items, 6 share chart slices, 3 share chart points between slices, 40 quadrant chart points, 8 layered architecture blocks in a layer, 12 C4 diagram elements, 20 matrix rows, 12 matrix columns, 30 matrix items, 8 Sankey diagram sankey columns, 6 XY chart series, 60 XY chart places, 60 tree tree rows, 8 swimlane lanes, or 40 swimlane steps.
Which warnings suggest a fix?W204 suggests an icon= and W205 suggests a type=, each with the exact text to add.
Do the suggestions change the picture?No. An icon the label names for certain is already drawn (icons=auto); W204 names the ones left for the author to confirm.

Limits

LimitValueEffect
Source length50000Longer source is refused.
Flow nodes15, plus 1 for each group, up to 25More nodes produce a density warning. Groups break a diagram into parts, so each one allows a node more.
Schema tables6More tables produce a density warning.
Sequence actors6More actors produce a density warning.
Git graph commits40More commits than this draws warning W200: a picture shows a release or a feature well, not a whole repository. More than 300 is refused with error E140.
Git graph branches7More branches than this draws warning W200, because the lane colors then repeat. More than 24 is refused with error E140.
Gantt chart tasks and milestones40One row each. More than this reads as a wall of bars: split the plan into charts by phase or team. A chart of more than 300 rows, 60 sections, or 3660 days is refused with E140.
Class diagram classes12More classes than this in one diagram is a wall of boxes. Each package allows 2 more, up to 24. Past 200 classes or 400 relations a diagram is refused with E140, before any layout work. Split it along a package.
Class diagram members in one class12A class box taller than this crowds the diagram around it. Show the members that matter to the design. A class of more than 60 members is refused with E140.
State states15More states than this in one diagram, plus one for each composite state up to 25, draw a warning. Group related states into composite states, or split the diagram. Past 300 nodes, 600 transitions, or 6 levels of nesting, the diagram is refused.
State composite nesting3Composite states nested deeper than this draw a warning. Draw the inner state machine as a diagram of its own.
Timeline periods on a horizontal rail12More periods than this run past the width of a page and shrink the text. Set direction=down or split the timeline by era. More than 200 periods are refused.
Timeline periods on a vertical rail24More periods than this make a picture too tall to take in. Split the timeline by era.
Timeline events in one period5A stack taller than this outweighs its neighbours. Split the period in two, or keep the events that matter. More than 12 events in one period are refused.
Timeline events48More events than this are a history, not a diagram. Split the timeline by era. More than 500 events are refused.
User journey tasks16More tasks than this in one journey is more than a reader takes in at once (W200). Draw one journey for each stage.
User journey actors8More actors than this share a tone, so some chips look alike (W351). Merge actors who always act together.
Mind map topics40More topics than this draw a density warning, and more than 300 are refused. Split a big map by branch.
Mind map branches8More branches round the root than this draw a warning. The branch tones repeat after seven.
Mind map levels4More levels below the root than this draw a warning, and more than 10 are refused.
Mind map topics under one topic9More topics branching from one topic than this draw a warning. Group them.
Treemap treemap items80More than this reads as a field of unlabeled tiles: group the small ones into one "Other" item, or split the treemap by group. More than 300 items or 100 groups is refused with E140. Many tiles too small for a label also warn.
Share chart slices6More slices than this in one ring draw a warning: the colours stop being easy to tell apart. Use fold= or a bar chart. More than 30 are refused with E140.
Share chart points between slices3Slices whose shares are within this many percentage points of each other, and within a quarter of each other in size, draw a warning: a ring cannot show which is larger. Use a bar chart to rank them.
Quadrant chart points40One mark each. More than this and a reader cannot weigh them: split the items by theme or team. A chart of more than 120 points is refused with E140.
Layered architecture blocks in a layer8More than this wraps the layer to several rows and it stops reading as one tier: split the layer. More than 12 layers, 80 blocks, or 80 links is refused with E140. More than 20 links warns.
C4 diagram elements12More elements than this in one diagram, plus 2 for each boundary up to 20, draw a warning. Split the diagram by level. Past 80 elements, 160 relationships, 40 boundaries, or 4 levels of nesting, the diagram is refused.
Matrix rows20One strip each. More than this and a reader cannot weigh them: split by theme or team. More than 40 rows is refused with E140.
Matrix columns12The most that can be drawn, refused with E140 past it. More than about 8 are wider than a Markdown column and shrink their text (W202).
Matrix items30Risks on one grid. More than 60 is refused with E140.
Sankey diagram sankey columns8More columns than this make a picture wider than a Markdown column. More than 12 columns, 60 nodes, or 150 flows is refused with E140. A node whose flows in and out differ, ribbons thinner than 2px, and more than 40 nodes or 100 flows also warn.
XY chart series6More than this draws a warning: the colours stop being easy to tell apart. More than 8 is refused with E140.
XY chart places60Places on the x axis; more is refused with E140. The labels of a crowded axis are thinned, with a warning.
Tree tree rows60More rows than this in a file tree or an outline reads as a wall: draw one tree for each top-level folder, or fold the small ones into an omitted line. Past 6 levels also warns. More than 300 entries or 8 levels is refused with E140.
Swimlane lanes8More lanes than this draw a warning. Past 12 lanes, 80 steps, or 160 transitions the diagram is refused.
Swimlane steps40More steps than this draw a warning. Split a long process into one diagram for each phase.
Stack marks3A node carries at most this many marks in stack=; one more is an error.
Column width880pxA diagram wider than this shrinks to fit; if text would drop below readable size, a width warning appears.

Suggestions

Two warnings are suggestions for architecture diagrams. They change nothing in the diagram: each gives the exact text to add, and an author who disagrees leaves it out or writes icon=none. The rules are fixed, so the same source always gets the same suggestions.

CodeFires whenThe suggestion
W204A node has no icon=, and its label (or, when the label names nothing, its sub text) names exactly one product that the node does not draw. With the default icons=auto that is only a brand whose name is also an everyday word, such as Vault; with icons=off it is every match.The exact icon=provider:name to add.
W205A group has no type=, and its name matches exactly one group type, such as Subnet or App Service Plan.The exact type= to add, with provider= when the name names one provider.
  • A phrase counts only as whole words, so Slambda is not Lambda.
  • The longest matching phrase wins: Azure Key Vault beats Key Vault.
  • A label that fits two products, or two group types, gets no suggestion.
  • A generic phrase such as SQL database counts only inside a group, or a diagram, whose provider owns that product.
  • A technology brand such as Redis counts only when it is the whole label.
  • A decision, terminal, or step node, a phrase shorter than three characters, and a provider name on its own never get a suggestion.

See also

DocWhy
Language referenceEvery page of the reference and what each covers
Diagnostic codesEvery code, including the density warnings
Tool referenceThe bounds each tool applies to its own input
How a diagram is drawnWhat layout does with a diagram that is large