Arg0/Docs

Design Canvas

Visual design and planning interface in Arg0 Desktop.

Overview

The Design Canvas provides a visual interface for designing and planning applications, workflows, and system architectures. It offers drag-and-drop components, visual connections, and real-time collaboration features.

Canvas Features

Visual Components

  • Nodes: Represent components, services, or entities
  • Connections: Visual lines showing relationships
  • Groups: Organize related components
  • Annotations: Add notes and labels
  • Layers: Manage multiple design layers

Interaction

  • Drag and Drop: Move components freely
  • Zoom and Pan: Navigate large canvases
  • Selection: Select single or multiple items
  • Connection Mode: Create connections between nodes
  • Context Menu: Quick actions and options

Canvas Elements

Nodes

Nodes represent system components:

typescript
interface Node {
  id: string
  type: 'service' | 'database' | 'api' | 'component'
  label: string
  position: { x: number, y: number }
  size: { width: number, height: number }
  properties: Record<string, any>
}

Node Types:

  • Service: Microservices or applications
  • Database: Data storage systems
  • API: API endpoints or gateways
  • Component: UI components or modules

Connections

Connections show relationships between nodes:

typescript
interface Connection {
  id: string
  source: string
  target: string
  type: 'data' | 'control' | 'dependency'
  label?: string
  properties: Record<string, any>
}

Connection Types:

  • Data: Data flow between components
  • Control: Control flow or triggers
  • Dependency: Component dependencies

Groups

Groups organize related components:

typescript
interface Group {
  id: string
  label: string
  nodes: string[]
  position: { x: number, y: number }
  size: { width: number, height: number }
  color?: string
}

Using the Design Canvas

Creating a Design

  1. Navigate to Design Page
  2. Click "New Canvas"
  3. Add nodes from the component palette
  4. Connect nodes to show relationships
  5. Add groups to organize components
  6. Add annotations for documentation
  7. Save the design

Adding Components

From Palette:

  1. Open component palette
  2. Select component type
  3. Drag onto canvas
  4. Position as needed
  5. Configure properties

From Context Menu:

  1. Right-click on canvas
  2. Select "Add Node"
  3. Choose component type
  4. Configure properties

Creating Connections

  1. Select connection mode
  2. Click source node
  3. Click target node
  4. Configure connection type
  5. Add label if needed
  6. Adjust connection path

Organizing Components

Groups:

  1. Select multiple nodes
  2. Right-click and select "Group"
  3. Name the group
  4. Customize group appearance
  5. Resize group as needed

Layers:

  1. Open layer panel
  2. Create new layer
  3. Assign components to layer
  4. Toggle layer visibility
  5. Lock layers to prevent changes

Canvas Tools

Selection Tool

Select and manipulate components:

  • Click to select single component
  • Shift+click for multi-select
  • Drag to select area
  • Arrow keys for precise movement

Connection Tool

Create connections between components:

  • Click source component
  • Click target component
  • Adjust connection path
  • Configure connection properties

Pan Tool

Navigate the canvas:

  • Click and drag to pan
  • Scroll wheel to zoom
  • Double-click to reset view
  • Fit to canvas option

Text Tool

Add text annotations:

  • Click to add text
  • Type annotation
  • Format text
  • Position as needed

Canvas Properties

Node Properties

Configure individual nodes:

  • Label: Display name
  • Type: Component type
  • Icon: Visual representation
  • Color: Custom color
  • Size: Dimensions
  • Custom Properties: Key-value pairs

Connection Properties

Configure connections:

  • Type: Connection type
  • Label: Display label
  • Style: Line style
  • Color: Custom color
  • Arrow: Arrow style
  • Custom Properties: Key-value pairs

Canvas Properties

Configure overall canvas:

  • Name: Canvas name
  • Description: Canvas description
  • Background: Background color
  • Grid: Grid settings
  • Snap: Snap to grid
  • Dimensions: Canvas size

Export and Import

Export Options

  • Image: Export as PNG or SVG
  • JSON: Export as JSON for import
  • PDF: Export as PDF document
  • Code: Generate code from design

Import Options

  • JSON: Import from JSON file
  • Template: Import from template
  • Backup: Restore from backup

Collaboration

Real-time Collaboration

  • Multi-user: Multiple users can edit simultaneously
  • Cursors: See other users' cursors
  • Changes: Real-time change synchronization
  • Comments: Add comments to components

Version Control

  • History: View change history
  • Revert: Revert to previous version
  • Branch: Create design branches
  • Merge: Merge design changes

Best Practices

Design Organization

  • Use consistent naming conventions
  • Group related components
  • Use color coding for types
  • Add annotations for clarity
  • Keep designs focused

Connection Design

  • Use appropriate connection types
  • Label important connections
  • Avoid crossing connections
  • Use orthogonal routing
  • Group related connections

Performance

  • Limit canvas size for large designs
  • Use layers for complex designs
  • Optimize node count
  • Use efficient connections
  • Regularly save designs

Troubleshooting

Canvas Not Responding

  1. Check if canvas is loading
  2. Refresh the page
  3. Check browser console for errors
  4. Clear browser cache
  5. Restart application

Components Not Connecting

  1. Verify connection mode is active
  2. Check component types
  3. Ensure components are not locked
  4. Check canvas permissions
  5. Try recreating connection

Export Failing

  1. Check canvas size
  2. Verify export format
  3. Check available disk space
  4. Try different export format
  5. Check browser permissions