create_new_diagram
Create a new diagram from mxGraphModel XML, either from scratch or as a full replacement.
Instructions
Create a NEW diagram from mxGraphModel XML. Use this when creating a diagram from scratch or replacing the current diagram entirely.
CRITICAL: You MUST provide the 'xml' argument in EVERY call. Do NOT call this tool without xml.
When to use this tool:
Creating a new diagram from scratch
Replacing the current diagram with a completely different one
Major structural changes that require regenerating the diagram
When to use edit_diagram instead:
Small modifications to existing diagram
Adding/removing individual elements
Changing labels, colors, or positions
XML FORMAT - Full mxGraphModel structure:
LAYOUT CONSTRAINTS:
Keep all elements within x=0-800, y=0-600 (single page viewport)
Start from margins (x=40, y=40), keep elements grouped closely
Use unique IDs starting from "2" (0 and 1 are reserved)
Set parent="1" for top-level shapes
Space shapes 150-200px apart for clear edge routing
EDGE ROUTING RULES:
Never let multiple edges share the same path - use different exitY/entryY values
For bidirectional connections (A↔B), use OPPOSITE sides
Always specify exitX, exitY, entryX, entryY explicitly in edge style
Route edges AROUND obstacles using waypoints (add 20-30px clearance)
Use natural connection points based on flow (not corners)
COMMON STYLES:
Shapes: rounded=1; fillColor=#hex; strokeColor=#hex
Edges: endArrow=classic; edgeStyle=orthogonalEdgeStyle; curved=1
Text: fontSize=14; fontStyle=1 (bold); align=center
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | Yes | REQUIRED: The complete mxGraphModel XML. Must always be provided. |