Groups and Subdomains
Organise entities into logical groups representing subdomains, bounded contexts, or categories, with convex hull rendering and group-aware physics.
Groups organise entities into logical clusters that represent subdomains, bounded contexts, or architectural categories. They provide both visual organisation (coloured hull backgrounds on the canvas) and physical organisation (group-aware force simulation that keeps related entities together). Groups are stored in the model's groups array and propagate to derived views.
Group Structure
Each group in the model is a GraphGroup with the following fields.
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier (UUID) for the group |
| name | string | Display name for the group (e.g., "Order Management", "Identity") |
| nodeIds | string[] | Array of entity node IDs belonging to this group |
| color | string | Display colour as a CSS colour value (e.g., "#3b82f6") |
| description | string | Optional description of the group's purpose or scope |
Group Features
Working with Groups
Group-aware Physics
The force simulation uses a custom forceGroupClustering function that modifies node velocities each tick. For every node that belongs to a group, the function calculates the group centroid (the average position of all member nodes) and applies a gentle pull toward it. Nodes in different groups experience a repulsive force, encouraging spatial separation between domains.
// Simplified view of group clustering force registration
if (groups && groups.length > 0) {
simulation.force('groupCluster', forceGroupClustering(groups));
}
// Per-node centre strength is reduced for grouped nodes,
// since the group clustering force handles their positioning.
Groups in Derived Views
Groups propagate from the model to derived views. Each view type handles groups differently.
Modelling Patterns
Groups map naturally to several architectural patterns.
| Pattern | Group Usage | Example |
|---|---|---|
| Domain-driven design | One group per bounded context | Order Management, Customer Identity, Inventory |
| Microservice boundaries | One group per service | Payment Service, Notification Service, Catalogue Service |
| Data domains | One group per data domain | Transactional Data, Reference Data, Analytical Data |
| Security zones | One group per trust boundary | Public API, Internal Services, Data Lake |
| Deployment regions | One group per deployment unit | EU Region, US Region, APAC Region |