
Drawio Logical Diagrams
- 1.8k installs
- 311 repo stars
- Updated June 22, 2026
- giuseppe-trisciuoglio/developer-kit
drawio-logical-diagrams generates validated logical draw.io XML diagrams for flows and abstract architecture.
About
The drawio-logical-diagrams skill outputs valid .drawio mxGraphModel XML for logical flows, system architecture, BPMN processes, UML class or sequence diagrams, data flow diagrams, and decision flowcharts using generic shapes. Workflow analyzes the request, picks diagram type, assigns sequential mxCell ids starting at two, validates closed tags, unique ids, parent references, escaped entities, and coordinate positivity before writing files. It explicitly excludes AWS, Azure, or GCP architecture diagrams covered by a separate cloud skill. Agents structure roots, vertices, edges, and connectors per draw.io conventions with validation checklist gates. Use when users need logical system diagrams, process flows, or abstract architecture docs in draw.io format.
- Writes native draw.io XML with mxGraphModel structure.
- Supports flowcharts, BPMN, UML, DFD, and logical architecture types.
- Validates unique ids, parent links, and escaped special characters.
- Uses generic shapes, not cloud provider icon libraries.
- Reserves ids 0 and 1 for root cells per draw.io rules.
Drawio Logical Diagrams by the numbers
- 1,799 all-time installs (skills.sh)
- +60 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #183 of 1,901 Documentation skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
drawio-logical-diagrams capabilities & compatibility
- Capabilities
- draw.io xml authoring · diagram validation · bpmn and uml output
- Use cases
- documentation · ui design
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill drawio-logical-diagramsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1.8k |
|---|---|
| repo stars | ★ 311 |
| Security audit | 3 / 3 scanners passed |
| Last updated | June 22, 2026 |
| Repository | giuseppe-trisciuoglio/developer-kit ↗ |
How do I create a logical system or process diagram as a .drawio file?
Create draw.io XML logical flow, architecture, BPMN, UML, and DFD diagrams without cloud-provider-specific shapes.
Who is it for?
Logical architecture and BPMN or UML documentation without cloud icons.
Skip if: AWS or Azure architecture diagrams requiring provider-specific stencils.
When should I use this skill?
User needs draw.io logical flow, BPMN, UML, or DFD diagrams.
What you get
Well-formed .drawio XML with validated cells, connectors, and diagram-type-appropriate layout.
- .drawio files
Files
Draw.io Logical Diagrams Creation
Overview
Create professional logical diagrams in draw.io's native XML format for logical flow diagrams, system architecture visualizations, and abstract process representations using generic shapes and symbols.
When to Use
- Creating logical flow diagrams showing data flow between system components
- Designing logical architecture diagrams (abstract system structure)
- Building BPMN process diagrams for business processes
- Drawing UML diagrams (class, sequence, activity, state)
- Creating data flow diagrams (DFD) for system analysis
- Making decision flowcharts with branching logic
- Visualizing system interactions and sequences
- Documenting logical system design without cloud specifics
Do NOT use for: AWS/Azure/GCP architecture diagrams (use aws-drawio-architecture-diagrams).
Instructions
Creating a Logical Diagram
1. Analyze the request: Understand the system/process to diagram 2. Choose diagram type: Flowchart, architecture, BPMN, UML, DFD, etc. 3. Identify elements: Determine actors, processes, data stores, connectors 4. Draft XML structure: Create the mxGraphModel with proper root cells 5. Add shapes: Create mxCell elements with appropriate styles 6. Add connectors: Link elements with edge elements 7. Validate XML: Verify XML is well-formed and all IDs are unique (see validation checklist below) 8. Output: Write the .drawio file for the user
XML Validation Checklist
Before outputting the file, verify:
- [ ] All tags are properly closed (no unclosed
<mxCell>,</mxGeometry>, etc.) - [ ] All cell IDs are unique (0 and 1 are reserved root cells, use sequential integers starting from 2)
- [ ] All
sourceandtargetattributes reference existing cell IDs - [ ] All
parentattributes reference existing cell IDs - [ ] All coordinates (x, y, width, height) are positive numbers
- [ ] Special characters are escaped (
<→<,>→>,&→&) - [ ] Multi-line labels use

or<br>withhtml=1in style
Key XML Components
| Component | Description |
|---|---|
mxfile | Root element with host and version |
diagram | Contains the diagram definition |
mxGraphModel | Canvas settings (grid, page size) |
root | Container for all cells (must include id="0" and id="1") |
mxCell | Individual shapes (vertices) or connectors (edges) |
Draw.io XML Structure
<mxfile host="app.diagrams.net" agent="Claude" version="24.7.17">
<diagram id="logical-flow-1" name="Logical Flow">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1"
tooltips="1" connect="1" arrows="1" fold="1" page="1"
pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- Shapes and connectors here -->
</root>
</mxGraphModel>
</diagram>
</mxfile>Key rules:
- IDs "0" and "1" are reserved for root cells
- Use sequential integer IDs starting from "2"
- Use landscape orientation for architecture diagrams
- All coordinates must be positive and aligned to grid (multiples of 10)
Generic Shapes and Styles
Basic Shape Types
| Shape | Style |
|---|---|
| Rectangle | rounded=0;whiteSpace=wrap;html=1; |
| Rounded Rectangle | rounded=1;whiteSpace=wrap;html=1; |
| Ellipse/Circle | ellipse;whiteSpace=wrap;html=1; |
| Diamond | rhombus;whiteSpace=wrap;html=1; |
| Cylinder | shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1; |
| Hexagon | shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1; |
| Parallelogram | shape=ext;double=1;rounded=0;whiteSpace=wrap;html=1; |
Standard Color Palette
| Element Type | Fill Color | Border Color | Usage |
|---|---|---|---|
| Process | #dae8fc | #6c8ebf | Operations/actions |
| Decision | #fff2cc | #d6b656 | Conditional branches |
| Start/End | #d5e8d4 | #82b366 | Terminal states |
| Data/Store | #e1f5fe | #0277bd | Databases/files |
| Entity | #f3e5f5 | #7b1fa2 | External systems |
| Error/Stop | #f8cecc | #b85450 | Error states |
| Actor/User | #ffe0b2 | #f57c00 | Users/actors |
| Container | #f5f5f5 | #666666 | Grouping areas |
Connector Styles
Standard flow:
edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;Dashed (alternative/optional):
edgeStyle=orthogonalEdgeStyle;dashed=1;dashPattern=5 5;strokeColor=#666666;Arrow head styles:
endArrow=classic;endFill=1- Filled triangleendArrow=open;endFill=0- Open arrowendArrow=blockThin;endFill=1- Block arrow
Diagram Types
| Type | Key Elements |
|---|---|
| Logical Flow | Actors (orange), Services (blue), Data Stores (cyan), External Systems (purple) |
| Logical Architecture | Layered containers with nested components |
| BPMN | Circle (Start/End), Rounded Rectangle (Activity), Diamond (Gateway) |
| UML Sequence | Vertical lifelines with message arrows |
| DFD | Square (Entity), Circle (Process), Open Rectangle (Data Store) |
Reference Files
For detailed shape examples and style references, see:
- shape-styles.md - Complete shape examples and style reference
- diagram-templates.md - Ready-to-use templates
Examples
Example 1: Order Processing Flow
Request: "Create a logical flow diagram showing order processing: customer submits order, system validates, if valid then processes payment and ships, if invalid notifies customer."
<mxfile host="app.diagrams.net" agent="Claude" version="24.7.17">
<diagram id="order-flow-1" name="Order Processing">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0"/><mxCell id="1" parent="0"/>
<mxCell id="2" value="Start" style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;" vertex="1" parent="1"><mxGeometry x="80" y="50" width="80" height="40" as="geometry"/></mxCell>
<mxCell id="3" value="Submit Order" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" vertex="1" parent="1"><mxGeometry x="60" y="130" width="120" height="60" as="geometry"/></mxCell>
<mxCell id="4" value="Validate
Order?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;" vertex="1" parent="1"><mxGeometry x="80" y="230" width="80" height="80" as="geometry"/></mxCell>
<mxCell id="5" value="Notify
Customer" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;" vertex="1" parent="1"><mxGeometry x="220" y="240" width="100" height="50" as="geometry"/></mxCell>
<mxCell id="6" value="Process
Payment" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" vertex="1" parent="1"><mxGeometry x="60" y="350" width="120" height="60" as="geometry"/></mxCell>
<mxCell id="7" value="Ship Order" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" vertex="1" parent="1"><mxGeometry x="60" y="450" width="120" height="60" as="geometry"/></mxCell>
<mxCell id="8" value="End" style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;" vertex="1" parent="1"><mxGeometry x="80" y="550" width="80" height="40" as="geometry"/></mxCell>
<mxCell id="10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="2" target="3"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="3" target="4"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="12" value="No" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#b85450;strokeWidth=2;fontSize=11;" edge="1" parent="1" source="4" target="5"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="13" value="Yes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;fontSize=11;" edge="1" parent="1" source="4" target="6"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="6" target="7"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="7" target="8"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="16" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#b85450;strokeWidth=2;" edge="1" parent="1" source="5" target="8"><mxGeometry relative="1" as="geometry"/></mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>Example 2: Three-Tier Logical Architecture
Request: "Create a logical architecture diagram for a web application with presentation, business logic, and data tiers."
<mxfile host="app.diagrams.net" agent="Claude" version="24.7.17">
<diagram id="three-tier-1" name="Three-Tier Architecture">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0"/><mxCell id="1" parent="0"/>
<mxCell id="2" value="User" style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#f57c00;fontSize=12;" vertex="1" parent="1"><mxGeometry x="40" y="340" width="60" height="40" as="geometry"/></mxCell>
<mxCell id="3" value="Presentation Layer" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;fontStyle=1;" vertex="1" parent="1"><mxGeometry x="160" y="40" width="300" height="180" as="geometry"/></mxCell>
<mxCell id="4" value="Web
Browser" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" vertex="1" parent="3"><mxGeometry x="20" y="30" width="80" height="50" as="geometry"/></mxCell>
<mxCell id="5" value="Mobile
App" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" vertex="1" parent="3"><mxGeometry x="120" y="30" width="80" height="50" as="geometry"/></mxCell>
<mxCell id="7" value="Application Layer" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;fontStyle=1;" vertex="1" parent="1"><mxGeometry x="160" y="260" width="300" height="180" as="geometry"/></mxCell>
<mxCell id="8" value="API
Gateway" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;" vertex="1" parent="7"><mxGeometry x="20" y="30" width="80" height="50" as="geometry"/></mxCell>
<mxCell id="9" value="Business
Logic" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" vertex="1" parent="7"><mxGeometry x="110" y="30" width="80" height="50" as="geometry"/></mxCell>
<mxCell id="11" value="Data Layer" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;fontStyle=1;" vertex="1" parent="1"><mxGeometry x="160" y="480" width="300" height="180" as="geometry"/></mxCell>
<mxCell id="12" value="Primary
Database" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;" vertex="1" parent="11"><mxGeometry x="20" y="30" width="60" height="80" as="geometry"/></mxCell>
<mxCell id="13" value="Cache" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#fff3e0;strokeColor=#e65100;fontSize=12;" vertex="1" parent="11"><mxGeometry x="100" y="30" width="60" height="80" as="geometry"/></mxCell>
<mxCell id="20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="2" target="4"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="4" target="8"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="8" target="9"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="9" target="12"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="24" value="query" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=open;endFill=0;strokeColor=#666666;strokeWidth=1;fontSize=10;dashed=1;" edge="1" parent="1" source="9" target="13"><mxGeometry relative="1" as="geometry"/></mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>For additional templates (microservice architecture, event-driven, decision tree, sequence, DFD), see diagram-templates.md.
Constraints and Warnings
Critical Constraints
1. XML validity: Always close tags properly and escape special characters 2. Unique IDs: All cell IDs must be unique (except parent "0" and "1") 3. Valid references: Source/target must reference existing cell IDs 4. Positive coordinates: All x, y values must be >= 0
Warnings
- XML files must be well-formed or will fail to open in draw.io
- Invalid parent references cause elements to disappear
- Negative coordinates place elements outside visible canvas
Best Practices
1. Use consistent colors per element type across all diagrams 2. Keep arrows straight with minimal bends 3. Place labels at least 20px from arrow lines 4. Group related elements in containers 5. Use 12-14px font for labels, 10-11px for annotations 6. Align all coordinates to grid (multiples of 10) 7. Use high contrast colors and don't rely solely on color for meaning
Color Palette for Draw.io Logical Diagrams
Standard Color Palette
| Element Type | Fill Color | Border Color | Usage |
|---|---|---|---|
| Process | #dae8fc (light blue) | #6c8ebf | Operations/actions |
| Decision | #fff2cc (light yellow) | #d6b656 | Conditional branches |
| Start/End | #d5e8d4 (light green) | #82b366 | Terminal states |
| Data/Store | #e1f5fe (light cyan) | #0277bd | Databases/files |
| Entity | #f3e5f5 (light purple) | #7b1fa2 | External systems |
| Error/Stop | #f8cecc (light red) | #b85450 | Error states |
| Actor/User | #ffe0b2 (light orange) | #f57c00 | Users/actors |
| Container | #f5f5f5 (light gray) | #666666 | Grouping areas |
Usage Guidelines
- Consistency: Use the same colors for the same element types throughout a diagram
- Contrast: Ensure border colors provide sufficient contrast with fill colors
- Accessibility: Don't rely solely on color to convey meaning - use labels and symbols
- Professionalism: Stick to the standard palette for consistent, professional-looking diagrams
Custom Colors
When creating custom colors:
- Use light, pastel shades for fills (easier on the eyes)
- Use darker, saturated shades for borders (better definition)
- Test color combinations for readability
- Consider color blindness accessibility (avoid red/green as only distinction)
Constraints and Warnings for Draw.io Logical Diagrams
Critical Constraints
1. XML Validity
Rule: All XML tags must be properly closed and escaped.
What to check:
- Every
<mxCell>has a closing</mxCell>tag - Special characters in values are escaped:
&for&,<for<,>for> - All attributes are quoted:
attribute="value" - Proper nesting of elements
Example of proper escaping:
<!-- Good -->
<mxCell value="A & B Process" />
<!-- Bad -->
<mxCell value="A & B Process" />2. Unique IDs
Rule: All cell IDs must be unique (except parent cells "0" and "1").
ID assignment:
- ID "0" is reserved for root container
- ID "1" is reserved for main parent
- Use sequential integers starting from "2" for all other cells
- Never duplicate an ID within the same diagram
Example:
<!-- Good -->
<mxCell id="2" ... />
<mxCell id="3" ... />
<mxCell id="4" ... />
<!-- Bad -->
<mxCell id="2" ... />
<mxCell id="2" ... /> <!-- Duplicate! -->3. Valid References
Rule: Source and target attributes must reference existing cell IDs.
What to check:
- Every
source="X"must have a corresponding cell withid="X" - Every
target="Y"must have a corresponding cell withid="Y" - Parent references must point to valid parent cells
Example:
<!-- Good -->
<mxCell id="2" value="Box A" vertex="1" parent="1" />
<mxCell id="3" value="Box B" vertex="1" parent="1" />
<mxCell id="10" edge="1" parent="1" source="2" target="3" />
<!-- Bad -->
<mxCell id="10" edge="1" parent="1" source="99" target="100" />
<!-- IDs 99 and 100 don't exist! -->4. Positive Coordinates
Rule: All x, y values must be >= 0.
What to check:
xattribute in mxGeometry: must be >= 0yattribute in mxGeometry: must be >= 0- Width and height must be > 0
Example:
<!-- Good -->
<mxGeometry x="100" y="200" width="120" height="60" />
<!-- Bad -->
<mxGeometry x="-50" y="100" width="120" height="60" />
<!-- Negative x will place element off-screen -->Warnings
1. XML Well-Formedness
Warning: XML files must be well-formed or will fail to open in draw.io.
Symptoms:
- File won't open in draw.io
- Error message about invalid XML
- Missing elements or corrupted layout
Prevention:
- Use XML validation tools
- Check for proper tag closure
- Escape special characters
- Validate structure before saving
2. Invalid Parent References
Warning: Invalid parent references cause elements to disappear.
Symptoms:
- Some elements don't appear in diagram
- Elements appear in wrong location
- Hierarchy is broken
Prevention:
- Ensure parent="1" for top-level elements
- For child elements, parent should match container's ID
- Verify parent IDs exist in the diagram
3. Negative Coordinates
Warning: Negative coordinates place elements outside visible canvas.
Symptoms:
- Elements not visible when diagram opens
- Need to zoom out or pan to find elements
- Layout appears broken
Prevention:
- Always use x >= 0, y >= 0
- Set canvas size appropriately
- Check element positions before saving
4. ID Conflicts
Warning: Duplicate IDs cause unpredictable behavior.
Symptoms:
- Connectors attach to wrong elements
- Elements appear/disappear randomly
- Saving/loading corrupts the diagram
Prevention:
- Use sequential integers: 2, 3, 4, 5, ...
- Never reuse an ID
- Track used IDs in complex diagrams
5. Missing Required Attributes
Warning: Missing required attributes causes rendering issues.
Required for vertices (shapes):
id- Unique identifiervalue- Display text (can be empty)style- Visual stylingvertex="1"- Marks as vertexparent- Parent cell IDmxGeometry- Position and size
Required for edges (connectors):
id- Unique identifierstyle- Connector stylingedge="1"- Marks as edgeparent- Parent cell IDsource- Starting cell IDtarget- Ending cell IDmxGeometry- Path information
6. Style String Errors
Warning: Malformed style strings prevent proper rendering.
Common errors:
- Missing semicolons between style properties
- Invalid property names
- Misspelled values
Example:
<!-- Good -->
<style>rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;</style>
<!-- Bad -->
<style>rounded=1 whiteSpace=wrap</style> <!-- Missing semicolons -->
<style>rounded=1;invalidProperty=value;</style> <!-- Invalid property -->7. Canvas Size Issues
Warning: Elements placed outside canvas bounds may be clipped.
Prevention:
- Set appropriate
pageWidthandpageHeightin mxGraphModel - Ensure all elements fit within canvas
- Leave margin around edges (at least 50px)
Example:
<mxGraphModel dx="1200" dy="800"
pageWidth="1169" pageHeight="827"
...>Validation Checklist
Before finalizing a diagram, verify:
- [ ] All XML tags properly closed
- [ ] Special characters escaped (&, <, >)
- [ ] All cell IDs unique (sequential 2, 3, 4...)
- [ ] All source/target IDs reference existing cells
- [ ] All coordinates >= 0
- [ ] All required attributes present
- [ ] Style strings properly formatted
- [ ] Elements fit within canvas bounds
- [ ] Parent references are valid
- [ ] No duplicate IDs
Troubleshooting
Problem: Diagram won't open
- Check XML well-formedness
- Verify all tags are closed
- Check for special characters that need escaping
Problem: Elements missing
- Verify parent references are valid
- Check for negative coordinates
- Ensure elements are within canvas bounds
Problem: Connectors broken
- Verify source and target IDs exist
- Check for duplicate IDs
- Ensure edge has proper geometry
Problem: Layout appears wrong
- Check all element coordinates
- Verify canvas size is adequate
- Ensure consistent spacing and alignment
Diagram Templates
Ready-to-use XML templates for common logical diagram types.
1. Microservice Architecture Template
Complete microservice architecture with API gateway, services, message queue, and databases.
<mxfile host="app.diagrams.net" agent="Claude" version="24.7.17">
<diagram id="microservice-1" name="Microservice Architecture">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1400" pageHeight="900" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- Users -->
<mxCell id="2" value="Users"
style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#f57c00;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="40" y="350" width="60" height="40" as="geometry" />
</mxCell>
<!-- API Gateway -->
<mxCell id="3" value="API
Gateway"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="160" y="330" width="100" height="60" as="geometry" />
</mxCell>
<!-- Service Layer -->
<mxCell id="4" value="Service Layer"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;fontStyle=1;"
vertex="1" parent="1">
<mxGeometry x="320" y="200" width="500" height="300" as="geometry" />
</mxCell>
<mxCell id="5" value="Order
Service"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="4">
<mxGeometry x="20" y="30" width="100" height="50" as="geometry" />
</mxCell>
<mxCell id="6" value="User
Service"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="4">
<mxGeometry x="140" y="30" width="100" height="50" as="geometry" />
</mxCell>
<mxCell id="7" value="Payment
Service"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="4">
<mxGeometry x="260" y="30" width="100" height="50" as="geometry" />
</mxCell>
<mxCell id="8" value="Notification
Service"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="4">
<mxGeometry x="380" y="30" width="100" height="50" as="geometry" />
</mxCell>
<!-- Message Queue -->
<mxCell id="9" value="Message
Queue"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=12;"
vertex="1" parent="4">
<mxGeometry x="20" y="130" width="100" height="60" as="geometry" />
</mxCell>
<!-- Data Layer -->
<mxCell id="10" value="Data Layer"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;fontStyle=1;"
vertex="1" parent="1">
<mxGeometry x="320" y="550" width="500" height="200" as="geometry" />
</mxCell>
<mxCell id="11" value="Order
DB"
style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;"
vertex="1" parent="10">
<mxGeometry x="20" y="30" width="60" height="80" as="geometry" />
</mxCell>
<mxCell id="12" value="User
DB"
style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;"
vertex="1" parent="10">
<mxGeometry x="120" y="30" width="60" height="80" as="geometry" />
</mxCell>
<mxCell id="13" value="Payment
DB"
style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;"
vertex="1" parent="10">
<mxGeometry x="220" y="30" width="60" height="80" as="geometry" />
</mxCell>
<mxCell id="14" value="Cache"
style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#fff3e0;strokeColor=#e65100;fontSize=12;"
vertex="1" parent="10">
<mxGeometry x="380" y="30" width="60" height="80" as="geometry" />
</mxCell>
<!-- External Systems -->
<mxCell id="15" value="Payment
Provider"
style="shape=cloud;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="900" y="280" width="100" height="60" as="geometry" />
</mxCell>
<mxCell id="16" value="Email
Service"
style="shape=cloud;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="900" y="380" width="100" height="60" as="geometry" />
</mxCell>
<!-- Connectors -->
<mxCell id="20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="2" target="3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="3" target="5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="5" target="6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="7" target="9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="9" target="8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="5" target="11">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="26" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="6" target="12">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="7" target="13">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="28" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;dashed=1;" edge="1" parent="1" source="5" target="14">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="29" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="7" target="15">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="30" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="8" target="16">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>2. Event-Driven Architecture Template
<mxfile host="app.diagrams.net" agent="Claude" version="24.7.17">
<diagram id="event-driven-1" name="Event-Driven Architecture">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1200" pageHeight="800" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- Event Producer -->
<mxCell id="2" value="Event
Producer"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="100" y="300" width="100" height="60" as="geometry" />
</mxCell>
<!-- Event Bus -->
<mxCell id="3" value="Event Bus
(Kafka/EventGrid)"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="280" y="290" width="120" height="80" as="geometry" />
</mxCell>
<!-- Event Consumers -->
<mxCell id="4" value="Consumer 1"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="480" y="150" width="100" height="60" as="geometry" />
</mxCell>
<mxCell id="5" value="Consumer 2"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="480" y="290" width="100" height="60" as="geometry" />
</mxCell>
<mxCell id="6" value="Consumer 3"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="480" y="430" width="100" height="60" as="geometry" />
</mxCell>
<!-- Connectors -->
<mxCell id="10" value="Events" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#7b1fa2;strokeWidth=2;" edge="1" parent="1" source="2" target="3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;" edge="1" parent="1" source="3" target="4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;" edge="1" parent="1" source="3" target="5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;" edge="1" parent="1" source="3" target="6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>3. Decision Tree Template
<mxfile host="app.diagrams.net" agent="Claude" version="24.7.17">
<diagram id="decision-tree-1" name="Decision Tree">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1000" pageHeight="800" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- Root Decision -->
<mxCell id="2" value="Valid
Input?"
style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="400" y="50" width="100" height="100" as="geometry" />
</mxCell>
<!-- Yes branch -->
<mxCell id="3" value="Check
Auth?"
style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="250" y="200" width="100" height="100" as="geometry" />
</mxCell>
<!-- No branch -->
<mxCell id="4" value="Return
Error"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="550" y="220" width="100" height="50" as="geometry" />
</mxCell>
<!-- Auth Yes -->
<mxCell id="5" value="Process
Request"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="150" y="360" width="100" height="60" as="geometry" />
</mxCell>
<!-- Auth No -->
<mxCell id="6" value="Return
401"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="350" y="360" width="100" height="50" as="geometry" />
</mxCell>
<!-- Process Yes -->
<mxCell id="7" value="Return
Success"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="150" y="480" width="100" height="50" as="geometry" />
</mxCell>
<!-- Process No -->
<mxCell id="8" value="Retry?"
style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="300" y="460" width="80" height="80" as="geometry" />
</mxCell>
<!-- Retry Yes -->
<mxCell id="9" value="Max
Retries?"
style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="250" y="590" width="90" height="90" as="geometry" />
</mxCell>
<!-- Retry No -->
<mxCell id="10" value="Return
500"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="420" y="590" width="100" height="50" as="geometry" />
</mxCell>
<!-- Connectors -->
<mxCell id="20" value="Yes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;fontSize=11;" edge="1" parent="1" source="2" target="3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="21" value="No" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#b85450;strokeWidth=2;fontSize=11;" edge="1" parent="1" source="2" target="4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="22" value="Yes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;fontSize=11;" edge="1" parent="1" source="3" target="5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="23" value="No" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#b85450;strokeWidth=2;fontSize=11;" edge="1" parent="1" source="3" target="6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="24" value="Yes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;fontSize=11;" edge="1" parent="1" source="5" target="7">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="25" value="No" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#d6b656;strokeWidth=2;fontSize=11;" edge="1" parent="1" source="5" target="8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="26" value="Yes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;fontSize=11;" edge="1" parent="1" source="8" target="9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="27" value="No" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#b85450;strokeWidth=2;fontSize=11;" edge="1" parent="1" source="8" target="10">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>4. Sequence Diagram Template
<mxfile host="app.diagrams.net" agent="Claude" version="24.7.17">
<diagram id="sequence-1" name="Sequence Diagram">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1000" pageHeight="700" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- Actors -->
<mxCell id="2" value="Client"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#f57c00;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="80" y="40" width="80" height="40" as="geometry" />
</mxCell>
<mxCell id="3" value="API Gateway"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="250" y="40" width="100" height="40" as="geometry" />
</mxCell>
<mxCell id="4" value="Auth Service"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="420" y="40" width="100" height="40" as="geometry" />
</mxCell>
<mxCell id="5" value="Business Logic"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="590" y="40" width="100" height="40" as="geometry" />
</mxCell>
<mxCell id="6" value="Database"
style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="760" y="40" width="60" height="50" as="geometry" />
</mxCell>
<!-- Vertical lines (lifelines) -->
<mxCell id="10" style="edgeStyle=elbowEdgeStyle;strokeColor=#cccccc;strokeWidth=1;dashed=1;dashPattern=3 3;" edge="1" parent="1" source="2" target="100">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="11" style="edgeStyle=elbowEdgeStyle;strokeColor=#cccccc;strokeWidth=1;dashed=1;" edge="1" parent="1" source="3" target="100">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="12" style="edgeStyle=elbowEdgeStyle;strokeColor=#cccccc;strokeWidth=1;dashed=1;" edge="1" parent="1" source="4" target="100">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="13" style="edgeStyle=elbowEdgeStyle;strokeColor=#cccccc;strokeWidth=1;dashed=1;" edge="1" parent="1" source="5" target="100">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="14" style="edgeStyle=elbowEdgeStyle;strokeColor=#cccccc;strokeWidth=1;dashed=1;" edge="1" parent="1" source="6" target="100">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<!-- Messages -->
<mxCell id="20" value="1. POST /resource" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="2" target="3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="21" value="2. Validate Token" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="3" target="4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="22" value="3. Token OK" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="4" target="3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="23" value="4. Process Request" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="3" target="5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="24" value="5. Save Data" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="5" target="6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="25" value="6. Data Saved" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="6" target="5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="26" value="7. Response" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="5" target="3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="27" value="8. 201 Created" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="3" target="2">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>5. Data Flow Diagram (DFD) Template
<mxfile host="app.diagrams.net" agent="Claude" version="24.7.17">
<diagram id="dfd-1" name="Data Flow Diagram">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1100" pageHeight="800" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- External Entities -->
<mxCell id="2" value="Customer"
style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#f57c00;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="50" y="300" width="80" height="50" as="geometry" />
</mxCell>
<mxCell id="3" value="Supplier"
style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#f57c00;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="900" y="300" width="80" height="50" as="geometry" />
</mxCell>
<!-- Processes -->
<mxCell id="4" value="Order
Processing"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="300" y="150" width="100" height="60" as="geometry" />
</mxCell>
<mxCell id="5" value="Inventory
Management"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="500" y="150" width="100" height="60" as="geometry" />
</mxCell>
<mxCell id="6" value="Payment
Processing"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="400" y="350" width="100" height="60" as="geometry" />
</mxCell>
<!-- Data Stores -->
<mxCell id="7" value="Orders"
style="shape=document;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="300" y="500" width="80" height="60" as="geometry" />
</mxCell>
<mxCell id="8" value="Products"
style="shape=document;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="500" y="500" width="80" height="60" as="geometry" />
</mxCell>
<mxCell id="9" value="Customers"
style="shape=document;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="100" y="500" width="80" height="60" as="geometry" />
</mxCell>
<!-- Connectors -->
<mxCell id="20" value="Order" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="2" target="4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="21" value="Request" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="4" target="5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="22" value="Payment Info" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="4" target="6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="23" value="Order Conf." style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#82b366;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="4" target="2">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="24" value="Product Info" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="5" target="8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="25" value="Update" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="8" target="5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="26" value="Confirmation" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="6" target="3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="27" value="Save Order" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="4" target="7">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="28" value="Customer Data" style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;fontSize=10;" edge="1" parent="1" source="2" target="9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>Diagram Types - Detailed Reference
1. Logical Flow Diagram
Shows the logical flow of data or processes through system components.
Key elements:
- Actors/Users (orange)
- Services/Processes (blue)
- Data Stores (cyan)
- External Systems (purple)
- Data flows (solid arrows)
Example structure:
┌─────────┐ ┌─────────┐ ┌─────────┐
│ User │────▶│ Service │────▶│ Data │
└─────────┘ └─────────┘ └─────────┘2. Logical Architecture Diagram
Abstract representation of system components without cloud provider specifics.
Typical layers:
- Presentation Layer (UI, Web, Mobile)
- Application Layer (API Gateway, Business Logic)
- Data Layer (Database, Cache)
Example structure:
┌─────────────────────────────────────────┐
│ Presentation Layer │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Web UI │ │ Mobile │ │
│ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────┘
│
┌─────────────────────────────────────────┐
│ Application Layer │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ API │ │ Business │ │
│ │ Gateway │ │ Logic │ │
│ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────┘
│
┌─────────────────────────────────────────┐
│ Data Layer │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Database │ │ Cache │ │
│ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────┘3. BPMN Process Diagram
Business process modeling using standard BPMN symbols.
| Symbol | Shape | Meaning |
|---|---|---|
| Start Event | Circle (green border) | Process start point |
| End Event | Circle (red border) | Process end point |
| Activity/Task | Rounded Rectangle | Work to be performed |
| Gateway/Decision | Diamond | Branching based on conditions |
| Sequence Flow | Solid arrow | Order of activities |
4. UML Sequence Diagram
Shows interaction between components over time.
Structure:
- Vertical lifelines for each component
- Horizontal arrows for messages
- Time flows downward
- Activation bars show when a component is active
Example:
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Actor │ │Service A│ │Service B│
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
│─────────────▶│ │
│ │─────────────▶│
│ │◀─────────────│
│◀─────────────│ │5. Data Flow Diagram (DFD)
Shows system data movement and transformation.
Components:
- External Entity (square) - Sources/destinations outside system
- Process (circle/rounded rectangle) - Data transformation
- Data Store (open-ended rectangle) - Data storage
- Data Flow (arrow) - Movement of data
Levels:
- Context Diagram (Level 0) - Shows system as one process
- Level 1 DFD - Major processes and data flows
- Level 2+ DFD - Decompose complex processes
6. Decision Flowchart
Visualizes branching logic and decision points.
Elements:
- Start/End points (ovals)
- Process steps (rectangles)
- Decision points (diamonds)
- Connectors with labels (Yes/No)
- Error handling paths (red)
7. System Interaction Diagram
Shows how different systems or components interact.
Focus:
- API calls and responses
- Event flows
- Message passing
- Synchronous vs asynchronous interactions
Choosing the Right Diagram Type
| Need | Best Diagram Type |
|---|---|
| Show data flow through system | Logical Flow Diagram |
| Show system structure | Logical Architecture Diagram |
| Document business process | BPMN Process Diagram |
| Show component interactions over time | UML Sequence Diagram |
| Analyze data movement | Data Flow Diagram (DFD) |
| Visualize decision logic | Decision Flowchart |
| Show system-to-system communication | System Interaction Diagram |
Layout Best Practices for Draw.io Diagrams
Flow Direction
1. Consistent direction: Choose left-to-right OR top-to-bottom and stick with it 2. Primary flow: Main process flows left-to-right or top-to-bottom 3. Return loops: Route return paths below (for L-R) or to the right (for T-B)
Example:
Left-to-Right: Top-to-Bottom:
A → B → C A
│ ↓ │ ↓ B
└───D───┘ ↓ C
↓ DSpacing Guidelines
| Element | Spacing |
|---|---|
| Between elements (horizontal) | 40-60px |
| Between elements (vertical) | 40-60px |
| Inside containers | 20px margin from edges |
| Between grouped elements | 20-30px |
| Label from arrow | 15-20px |
Grid Alignment
1. Snap to grid: All coordinates in multiples of 10 2. Center alignment: Center elements on their midpoint 3. Edge alignment: Align edges of related elements
Example:
Good: Bad:
┌────┐ ┌────┐ ┌────┐
│ A │ │ B │ │ A │ ┌────┐
└────┘ └────┘ └────┘ │ B │
└────┘Label Placement
| Arrow Direction | Label Position |
|---|---|
| Horizontal (→) | Above the arrow |
| Vertical (↓) | Right of the arrow |
| Diagonal | At the midpoint, offset slightly |
Tips:
- Use white background for labels on arrows:
labelBackgroundColor=#ffffff - Keep labels short (1-3 words)
- Use fontSize 10-11 for connector labels
Container Grouping
1. Purpose: Group related elements visually 2. Style: Use rounded rectangles with gray fill 3. Hierarchy: Nest containers for sub-groups
Example:
┌─────────────────────────────────┐
│ Service Layer │
│ ┌──────────┐ ┌──────────┐ │
│ │ Service A│ │ Service B│ │
│ └──────────┘ └──────────┘ │
└─────────────────────────────────┘Balance and Composition
1. Center the diagram: Keep main flow centered on canvas 2. Avoid extreme whitespace: Don't leave large empty areas 3. Symmetry: Use symmetrical layouts for parallel processes 4. Weight distribution: Balance elements visually
Connector Routing
1. Minimize bends: Use straight lines when possible 2. Orthogonal routing: Use right-angle bends (orthogonalEdgeStyle) 3. Avoid crossings: Route connectors to minimize crossings 4. Clear direction: Arrowheads should clearly show flow direction
Visual Hierarchy
1. Size hierarchy: Important elements can be slightly larger 2. Color coding: Use consistent colors for element types 3. Font sizing: 12-14px for primary labels, 10-11px for annotations 4. Bold for emphasis: Use fontStyle=1 for important elements
Accessibility
1. High contrast: Ensure text is readable against background 2. Don't rely on color alone: Use symbols and labels 3. Text size: Minimum 10-11px for readability 4. Labels on all shapes: Every shape should have a clear label
Common Layout Patterns
Sequential Flow
A → B → C → DSimple left-to-right or top-to-bottom flow.
Branching Flow
A
↓
┌──┴──┐
B C
└──┬──┘
↓
DDiamond decision point with branches.
Parallel Processes
A
┌─┴─┐
B C
└─┬─┘
DParallel activities that converge.
Layered Architecture
┌───────────┐
│ Layer 1 │
├───────────┤
│ Layer 2 │
├───────────┤
│ Layer 3 │
└───────────┘Horizontal layers with vertical flow.
Hub and Spoke
┌─B─┐
│ │
A-─HUB─┐D
│ │
└─C─┘Central component with connections.
Canvas Size
Standard sizes:
- A4 Landscape: 1169 x 827 px
- A4 Portrait: 827 x 1169 px
- A3 Landscape: 1654 x 1169 px
- Letter Landscape: 1100 x 850 px
Tip: Set pageWidth and pageHeight in mxGraphModel to match your needs.
Common Mistakes to Avoid
1. ❌ Inconsistent flow direction 2. ❌ Elements too close together 3. ❌ Misaligned connectors 4. ❌ Labels overlapping elements 5. ❌ Too many crossing connectors 6. ❌ Inconsistent element sizes 7. ❌ Poor color contrast 8. ❌ Missing labels on shapes
Shape Examples - XML Reference
Complete XML examples for common shapes in draw.io format.
Simple Process Box
<mxCell id="2" value="Process Name"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="200" y="100" width="120" height="60" as="geometry" />
</mxCell>Attributes:
rounded=1- Rounded corners (use 0 for square corners)whiteSpace=wrap- Text wraps within shapehtml=1- Enable HTML formattingfillColor- Background colorstrokeColor- Border colorfontSize- Text size in pixels
Decision Diamond
<mxCell id="3" value="Decision?"
style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="280" y="200" width="80" height="80" as="geometry" />
</mxCell>Note: Diamonds should be square (width = height) for best appearance.
Start/End Oval
<mxCell id="4" value="Start"
style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="200" y="300" width="80" height="40" as="geometry" />
</mxCell>Style tip: Use green for start points, red for end points.
Data Store (Cylinder)
<mxCell id="5" value="Database"
style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="400" y="100" width="60" height="80" as="geometry" />
</mxCell>Shape-specific attributes:
shape=cylinder3- Use cylinder shapeboundedLbl=1- Keep label within cylinder bounds
Process/Document (Parallelogram)
<mxCell id="6" value="Input Data"
style="shape=ext;double=1;rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="200" y="200" width="120" height="60" as="geometry" />
</mxCell>Attributes:
shape=ext- Extended shapedouble=1- Creates parallelogram effect
Container (Grouping Box)
<mxCell id="7" value="Subsystem"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;fontStyle=1;"
vertex="1" parent="1">
<mxGeometry x="100" y="50" width="400" height="300" as="geometry" />
</mxCell>Usage: Groups related elements together.
Connector/Arrow (Standard Flow)
<mxCell id="10"
style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;"
edge="1" parent="1" source="2" target="3">
<mxGeometry relative="1" as="geometry" />
</mxCell>Attributes:
edgeStyle=orthogonalEdgeStyle- Right-angle bendsendArrow=classic- Filled triangle arrowheadendFill=1- Solid arrowheadstrokeWidth=2- Line thickness
Dashed Connector (Alternative Flow)
<mxCell id="11"
style="edgeStyle=orthogonalEdgeStyle;dashed=1;dashPattern=5 5;strokeColor=#666666;"
edge="1" parent="1" source="2" target="4">
<mxGeometry relative="1" as="geometry" />
</mxCell>Usage: Shows optional or alternative flows.
Label on Connector
<mxCell id="12" value="Data"
style="text;html=1;align=center;verticalAlign=middle;fontSize=11;fontColor=#333333;labelBackgroundColor=#ffffff;"
vertex="1" parent="1">
<mxGeometry x="250" y="160" width="40" height="20" as="geometry" />
</mxCell>Tip: Position labels near the midpoint of connectors for clarity.
Actor/User Symbol
<mxCell id="13" value="User"
style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#f57c00;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="40" y="340" width="60" height="40" as="geometry" />
</mxCell>Color: Orange indicates external actors/users.
Error/Stop Symbol
<mxCell id="14" value="Error"
style="ellipse;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;"
vertex="1" parent="1">
<mxGeometry x="400" y="300" width="80" height="40" as="geometry" />
</mxCell>Color: Red indicates errors or exceptional conditions.
Style Quick Reference
| Purpose | Style String |
|---|---|
| Basic rectangle | rounded=0;whiteSpace=wrap;html=1; |
| Rounded rectangle | rounded=1;whiteSpace=wrap;html=1; |
| Circle/Ellipse | ellipse;whiteSpace=wrap;html=1; |
| Diamond | rhombus;whiteSpace=wrap;html=1; |
| Cylinder | shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1; |
| Parallelogram | shape=ext;double=1;rounded=0;whiteSpace=wrap;html=1; |
| Hexagon | shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1; |
Geometry Tips
Positioning:
- Always use positive coordinates (x, y >= 0)
- Align to grid (multiples of 10)
- Allow 40-60px spacing between elements
Sizing:
- Process boxes: 100-140px wide, 50-70px high
- Diamonds: square (width = height)
- Cylinders: 60-80px wide, 80-100px high
- Labels on connectors: 30-50px wide, 20px high
Shape Styles Reference
Complete reference for draw.io shapes and styles used in logical diagrams.
Basic Shapes
Rectangle
style="rounded=0;whiteSpace=wrap;html=1;"Rounded Rectangle
style="rounded=1;whiteSpace=wrap;html=1;"Ellipse (Circle/Oval)
style="ellipse;whiteSpace=wrap;html=1;"Diamond (Rhombus)
style="rhombus;whiteSpace=wrap;html=1;"Cylinder (Database)
style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;"Hexagon
style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;"Parallelogram
style="shape=ext;double=1;rounded=0;whiteSpace=wrap;html=1;"Cloud (External System)
style="shape=cloud;whiteSpace=wrap;html=1;"Folder
style="shape=folder;whiteSpace=wrap;html=1;"Style Properties
Fill Colors
| Color Name | Hex Code | Usage |
|---|---|---|
| Light Blue | #dae8fc | Process/Service |
| Light Yellow | #fff2cc | Decision/Gateway |
| Light Green | #d5e8d4 | Start/End/Success |
| Light Cyan | #e1f5fe | Data Store |
| Light Purple | #f3e5f5 | External System |
| Light Red | #f8cecc | Error/Stop |
| Light Orange | #ffe0b2 | Actor/User |
| Light Gray | #f5f5f5 | Container |
Border Colors
| Color Name | Hex Code | Usage |
|---|---|---|
| Blue | #6c8ebf | Process border |
| Yellow | #d6b656 | Decision border |
| Green | #82b366 | Start/End border |
| Cyan | #0277bd | Data store border |
| Purple | #7b1fa2 | External system border |
| Red | #b85450 | Error/Stop border |
| Orange | #f57c00 | Actor border |
| Gray | #666666 | Container border |
Font Settings
fontFamily=Segoe UI
fontSize=10-14
fontColor=#333333
fontStyle=0 (normal), 1 (bold), 2 (italic)Complete Shape Examples
Process Box
<mxCell id="2" value="Process Name"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;fontFamily=Segoe UI;"
vertex="1" parent="1">
<mxGeometry x="200" y="100" width="120" height="60" as="geometry" />
</mxCell>Decision Diamond
<mxCell id="3" value="Decision?"
style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;fontFamily=Segoe UI;"
vertex="1" parent="1">
<mxGeometry x="280" y="200" width="80" height="80" as="geometry" />
</mxCell>Start/End Oval
<mxCell id="4" value="Start"
style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;fontFamily=Segoe UI;"
vertex="1" parent="1">
<mxGeometry x="200" y="300" width="80" height="40" as="geometry" />
</mxCell>Data Store (Cylinder)
<mxCell id="5" value="Database"
style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;fontFamily=Segoe UI;"
vertex="1" parent="1">
<mxGeometry x="400" y="100" width="60" height="80" as="geometry" />
</mxCell>External System (Cloud)
<mxCell id="6" value="External API"
style="shape=cloud;whiteSpace=wrap;html=1;fillColor=#f3e5f5;strokeColor=#7b1fa2;fontSize=12;fontFamily=Segoe UI;"
vertex="1" parent="1">
<mxGeometry x="400" y="100" width="100" height="60" as="geometry" />
</mxCell>Actor/User
<mxCell id="7" value="User"
style="ellipse;whiteSpace=wrap;html=1;fillColor=#ffe0b2;strokeColor=#f57c00;fontSize=12;fontFamily=Segoe UI;"
vertex="1" parent="1">
<mxGeometry x="50" y="200" width="60" height="40" as="geometry" />
</mxCell>Error State
<mxCell id="8" value="Error"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;fontFamily=Segoe UI;"
vertex="1" parent="1">
<mxGeometry x="300" y="200" width="100" height="50" as="geometry" />
</mxCell>Connector Styles
Standard Arrow
style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;"Dashed Arrow
style="edgeStyle=orthogonalEdgeStyle;rounded=0;dashed=1;dashPattern=5 5;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;"Open Arrow
style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=open;endFill=0;strokeColor=#666666;strokeWidth=2;"Block Arrow
style="edgeStyle=orthogonalEdgeStyle;rounded=0;endArrow=blockThin;endFill=1;strokeColor=#666666;strokeWidth=2;"Curved Arrow
style="edgeStyle=curvedEdgeStyle;rounded=0;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;"Edge with Label
<mxCell id="10" value="Label"
style="text;html=1;align=center;verticalAlign=middle;fontSize=11;fontColor=#333333;labelBackgroundColor=#ffffff;"
vertex="1" parent="1">
<mxGeometry x="250" y="160" width="40" height="20" as="geometry" />
</mxCell>Container Styles
Simple Container
<mxCell id="20" value="Container Name"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;fontStyle=1;"
vertex="1" parent="1">
<mxGeometry x="100" y="50" width="400" height="300" as="geometry" />
</mxCell>Dashed Container (Boundary)
<mxCell id="21" value="Boundary"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;dashed=1;dashPattern=8 4;fontSize=14;fontStyle=1;"
vertex="1" parent="1">
<mxGeometry x="100" y="50" width="400" height="300" as="geometry" />
</mxCell>Child Elements in Containers
When placing elements inside a container, reference the container ID in the parent attribute:
<!-- Container -->
<mxCell id="20" value="Layer"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;"
vertex="1" parent="1">
<mxGeometry x="100" y="50" width="400" height="300" as="geometry" />
</mxCell>
<!-- Child element inside container -->
<mxCell id="21" value="Service"
style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;"
vertex="1" parent="20">
<mxGeometry x="20" y="30" width="100" height="50" as="geometry" />
</mxCell>Special Characters
| Character | Entity |
|---|---|
< | < |
> | > |
& | & |
| Line break | 
 or <br> with html=1 |
Shape Examples
Process Box
<mxCell id="2" value="Process Name" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" vertex="1" parent="1"><mxGeometry x="200" y="100" width="120" height="60" as="geometry"/></mxCell>Decision Diamond
<mxCell id="3" value="Decision?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;" vertex="1" parent="1"><mxGeometry x="280" y="200" width="80" height="80" as="geometry"/></mxCell>Start/End Oval
<mxCell id="4" value="Start" style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;" vertex="1" parent="1"><mxGeometry x="200" y="300" width="80" height="40" as="geometry"/></mxCell>Data Store (Cylinder)
<mxCell id="5" value="Database" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;fillColor=#e1f5fe;strokeColor=#0277bd;fontSize=12;" vertex="1" parent="1"><mxGeometry x="400" y="100" width="60" height="80" as="geometry"/></mxCell>Connector/Arrow
<mxCell id="10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;strokeColor=#666666;strokeWidth=2;" edge="1" parent="1" source="2" target="3"><mxGeometry relative="1" as="geometry"/></mxCell>Coordinate Guidelines
Element Sizes
| Element Type | Width | Height |
|---|---|---|
| Process Box | 100-150 | 50-70 |
| Decision Diamond | 70-100 | 70-100 |
| Start/End | 70-100 | 35-50 |
| Data Store | 50-70 | 70-90 |
| Actor | 50-70 | 40-50 |
Spacing
- Between elements: 40-60px
- Inside containers: 15-25px
- Connector to element: 10-15px
Related skills
Forks & variants (1)
Drawio Logical Diagrams has 1 known copy in the catalog totaling 23 installs. They canonicalize to this original listing.
- giuseppe-trisciuoglio - 23 installs
How it compares
Pick drawio-logical-diagrams for vendor-neutral logical diagrams; pick aws-drawio-architecture-diagrams when stencils must reflect a specific cloud provider.
FAQ
Can this skill draw AWS architecture?
No. Use aws-drawio-architecture-diagrams for cloud-specific diagrams.
What validation is required?
Unique ids, closed tags, valid parent and source or target refs, and escaped XML entities.
Which id numbers are reserved?
Cells 0 and 1 are reserved root containers; shapes start at id 2.
Is Drawio Logical Diagrams safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.