What are Areas?
Areas are rectangular regions on the canvas that help you visually group related tables together. They act as containers that provide visual organization and structure to your database diagrams.Areas are purely visual organizational tools—they don’t affect the actual database schema or SQL exports. However, they make complex diagrams much easier to understand.
Creating Areas
Using the Context Menu
Right-click on Canvas
Right-click on any empty space on the canvas where you want to create the area.
Area Properties
Unique identifier for the area.
The area name, displayed at the top of the area.Examples:
- “User Management”
- “E-commerce”
- “Authentication & Authorization”
- “Reporting Tables”
Horizontal position on the canvas.
Vertical position on the canvas.
Width of the area in pixels.
Height of the area in pixels.
Background color of the area. Choose colors that provide good contrast with table colors.Available colors:
#b067e9(Purple)#ff6b8a(Pink)#4dee8a(Green)#ffe374(Yellow)#7175fa(Blue)#42e0c0(Teal)#ff6363(Red)#8a61f5(Violet)
Z-index for layering areas. Higher numbers appear on top.
Editing Areas
Renaming an Area
Alternatively:
- Right-click on the area
- Select Edit Area Name
- Enter the new name
Resizing an Area
Areas can be resized by dragging their edges or corners:Hover Over Edge
Move your cursor to any edge or corner of the area.The cursor will change to a resize indicator.
Click and Drag
Click and drag to resize:
- Drag edges to resize in one direction
- Drag corners to resize in two directions simultaneously
Tables inside the area are not automatically repositioned when you resize. You may need to rearrange tables after resizing an area.
Moving an Area
To reposition an area:Changing Area Color
Managing Tables in Areas
Adding Tables to an Area
There are two ways to associate tables with an area:- Automatic Assignment
- Manual Assignment
When you create or move a table so that it’s visually inside an area’s boundaries:
- The table’s
parentAreaIdis automatically set - The table becomes associated with that area
- Moving the area will move the table
Removing Tables from an Area
To remove a table from an area:- Drag the table outside the area boundaries
- The
parentAreaIdis set tonull - The table is no longer associated with any area
When a table is inside an area, it maintains a 20px padding from the area edges to ensure clear visual separation.
Area Context Menu
Right-click on an area to access:Deleting Areas
To delete an area:Area Layout and Positioning
Auto-Layout for Areas
When tables are repositioned using auto-layout:- Tables are grouped by their
parentAreaId - Each area’s tables are laid out within the area boundaries
- Tables outside areas are positioned separately
- Area overlap is avoided
Overlapping Areas
Areas can overlap, and theorder property determines layering:
- Higher
ordervalues appear on top - Tables can only belong to one area at a time
- The topmost area at a position gets the table
Common Use Cases
Organizing by Domain
Group tables by business domain or bounded context:Organizing by Schema
For databases with multiple schemas, create areas for each schema:Area: schema
Organizing by Entity Lifecycle
Area:
Organizing by Data Sensitivity
Area: (Red)
Visual Design Tips
Color Coding
Color Coding
Use consistent colors to indicate purpose:
- Red for critical/sensitive data
- Green for public/safe data
- Blue for core business entities
- Yellow for auxiliary/support tables
- Purple for authentication/security
Size Appropriately
Size Appropriately
- Make areas large enough to contain tables with padding
- Leave room for growth (additional tables)
- Avoid making areas too large (wastes canvas space)
- Typical size: 800-1200px wide, 600-1000px tall
Naming Conventions
Naming Conventions
- Use clear, descriptive names
- Use title case: “User Management”
- Include context: “Orders & Payments”
- Avoid abbreviations unless universally understood
Logical Grouping
Logical Grouping
Group tables that:
- Share a common purpose
- Are frequently queried together
- Belong to the same microservice
- Represent a bounded context
- Have similar access patterns
Advanced Techniques
Nested Conceptual Grouping
While ChartDB doesn’t support nested areas, you can simulate hierarchy with naming:Color-Coded Microservices
For microservice architectures, use areas to represent service boundaries:Migration Planning
Use areas to plan database migrations:Best Practices
Create Areas First
Create Areas First
When starting a new diagram, create your areas before adding tables. This helps you think about organization from the beginning.
Maintain Clear Boundaries
Maintain Clear Boundaries
Avoid having tables that straddle area boundaries. Each table should clearly belong to one area or none.
Document Area Purpose
Document Area Purpose
In complex diagrams, consider adding a note near each area explaining its purpose and what types of tables it contains.
Review and Refactor
Review and Refactor
As your diagram grows:
- Periodically review area organization
- Split large areas into smaller, focused ones
- Merge small areas that don’t add value
- Update names to reflect current purpose
Consistent Sizing
Consistent Sizing
Try to keep areas of similar importance at similar sizes. This creates visual balance and makes the diagram easier to scan.
Troubleshooting
Table Won't Stay in Area
Table Won't Stay in Area
Issue: Table moves outside area when diagram is saved/reloaded.Cause: Table position may be at the edge of the area boundary.Solution: Ensure table is fully inside area with padding. Reposition table more centrally within the area.
Can't Resize Area
Can't Resize Area
Issue: Resize handles not appearing or not working.Cause: May be in readonly mode or area is selected incorrectly.Solution: Ensure diagram is editable. Click directly on area edge or corner.
Areas Overlapping Unintentionally
Areas Overlapping Unintentionally
Issue: Areas are layered in unexpected ways.Cause: The
order property determines z-index.Solution: Adjust the order property to control which area appears on top.Examples from Templates
Here are real examples of how areas are used in ChartDB templates:Employee Database
No areas used—small, focused schema where all tables are closely related.Pokemon Database
Uses color-coded tables without areas—tables are distinguished by color alone:- Yellow: Type-related tables
- Blue: Move-related tables
- Purple: Pokemon core tables
- Pink: Ability-related tables
- Teal: Habitat and evolution tables
Next Steps
Adding Notes
Document your schema with notes
Editing Schema
Learn how to create and modify tables
Managing Relationships
Connect tables with relationships
Export Diagram
Export your organized diagram
