Diagrams
Create and manage technical diagrams using the integrated Excalidraw whiteboard.
Overview
C# Dev Tools includes Excalidraw integration for creating diagrams, flowcharts, and technical illustrations directly in VS Code.
Diagram Types
Global Diagrams
Stored in your user profile, available across all workspaces:
- Reusable diagrams
- Personal reference
- Cross-project documentation
- Architecture diagrams
Workspace Diagrams
Stored per workspace:
- Project-specific diagrams
- Team collaboration
- Version controlled
- Context-specific
Creating Diagrams
New Global Diagram
- Open Solution Explorer
- Expand "Tools" → "Diagrams"
- Click "Create Global Diagram"
- Enter diagram name
- Diagram opens in Excalidraw
New Workspace Diagram
- Open Solution Explorer
- Expand "Tools" → "Diagrams"
- Click "Create Workspace Diagram"
- Enter diagram name
- Diagram opens in editor
Excalidraw Features
Drawing Tools
- Shapes: Rectangle, circle, diamond, ellipse
- Lines: Straight, arrows, curves
- Text: Labels and annotations
- Freehand: Hand-drawn elements
Styling
- Colors and fills
- Stroke styles
- Opacity
- Font sizes
- Line types
Organization
- Grouping elements
- Layers
- Alignment tools
- Distribution
- Z-order management
Managing Diagrams
Opening Diagrams
- Expand "Diagrams" in Tools section
- View global and workspace diagrams
- Click to open
- Edits save automatically
Renaming Diagrams
- Right-click diagram in tree
- Select "Rename"
- Enter new name
- File is renamed
Deleting Diagrams
- Right-click diagram in tree
- Select "Delete"
- Confirm deletion
- File is removed
Exporting Diagrams
Export diagrams in various formats:
- PNG: Raster image
- SVG: Vector graphics
- JSON: Excalidraw format
To export:
- Open diagram
- Use Excalidraw export menu
- Choose format
- Save file
Version Control
Workspace Diagrams
Workspace diagrams can be version controlled:
- Stored in
.vscode-csharp-dev-tools/diagrams
- JSON format for diffing
- Commit with code changes
- Share with team
Ignoring Diagrams
Add to .gitignore
if needed:
.vscode-csharp-dev-tools/diagrams/
Use Cases
Architecture Documentation
- System architecture
- Component diagrams
- Deployment diagrams
- Network topology
Flow Charts
- Process flows
- Decision trees
- Algorithm visualization
- Workflow documentation
Class Diagrams
- Class relationships
- Inheritance hierarchies
- Interface contracts
- Design patterns
Wireframes
- UI layouts
- Screen flows
- User journeys
- Mockups
Collaboration
Sharing Diagrams
Share diagrams with team:
- Commit workspace diagrams to repo
- Export as PNG/SVG for docs
- Use global diagrams as templates
- Share JSON files directly
Team Standards
Establish conventions:
- Naming patterns
- Color schemes
- Symbol meanings
- Diagram types
Tips and Tricks
Keyboard Shortcuts
Excalidraw supports:
Ctrl+Z
: UndoCtrl+Y
: RedoCtrl+D
: DuplicateCtrl+G
: Group- Arrow keys: Move elements
Quick Workflows
- Double-click to add text
- Hold Shift for straight lines
- Alt+drag to duplicate
- Ctrl+drag for constrained movement
Organization
- Use layers for complex diagrams
- Group related elements
- Name elements for clarity
- Use consistent colors
Best Practices
- Keep diagrams focused and simple
- Use clear labels
- Maintain consistent style
- Version control workspace diagrams
- Export for documentation
- Update diagrams with code changes
Troubleshooting
Diagram Won't Open
If diagram doesn't open:
- Check file exists
- Verify file permissions
- Try creating new diagram
- Check VS Code output for errors
Can't Save Diagram
If save fails:
- Check disk space
- Verify write permissions
- Check file isn't locked
- Try exporting instead
Diagram Corrupted
If diagram appears corrupted:
- Check JSON file syntax
- Restore from version control
- Create new diagram
- Report issue if persistent