Why Section-by-Section?
There are three reasons this approach is mandatory:- Token limits: Claude has a ~32,000 token output limit per response. A comprehensive diagram easily exceeds that in one shot.
- Quality: Generating everything at once leads to rushed decisions and inconsistent spacing.
- Maintainability: Section-by-section JSON with descriptive IDs is far easier to debug and modify.
The Three-Phase Workflow
Planning Section Boundaries
Plan your sections around natural visual groupings from your diagram plan. A typical large diagram might split into:Example: Section-by-Section Workflow
Here’s a concrete example of building a 4-section diagram:Multi-Zoom Architecture
Comprehensive diagrams operate at multiple zoom levels simultaneously. For large diagrams, ensure you include all three levels:Level 1: Summary Flow
A simplified overview showing the full pipeline at a glance. Often placed at the top or bottom. Example:Input → Processing → Output or Client → Server → Database
Level 2: Section Boundaries
Labeled regions that group related components. These create visual “rooms” that help viewers understand what belongs together. Example: Grouping by responsibility (Backend / Frontend), by phase (Setup / Execution / Cleanup), or by team (User / System / External)Level 3: Detail Inside Sections
Evidence artifacts, code snippets, and concrete examples within each section. This is where the educational value lives. Example: Inside a “Backend” section, show the actual API response format, not just a box labeled “API Response”Troubleshooting
Arrow not connecting across sections
Arrow not connecting across sections
Check:
- Arrow’s
endBinding.elementIdmatches the target element’sid - Target element’s
boundElementsincludes{"id": "arrow_id", "type": "arrow"} - Both elements exist in the
elementsarray
Sections feel unbalanced
Sections feel unbalanced
After adding all sections, adjust:
- Element sizes (width/height) to rebalance visual weight
- Spacing between sections (200-400px recommended)
- Font sizes for hierarchy consistency
Can't find where an element is defined
Can't find where an element is defined
Use descriptive IDs! Search for the ID string in your JSON. If using random IDs like
"x7k2m9", you’ll waste time hunting.Next Steps
Render & Validate
Learn the mandatory render-view-fix loop
Element Templates
Copy-paste templates for all element types