Principle:777genius Agent teams ai Kanban Layout
| Knowledge Sources | |
|---|---|
| Domains | Visualization, Layout |
| Last Updated | 2026-10-22 00:00 GMT |
Overview
Layout algorithm that positions task nodes in kanban columns (review, approved) relative to their owner member nodes, with stable slot geometry and zone metadata for rendering.
Description
Kanban Layout is the process of computing screen positions for task nodes based on their kanban column status and their owner's position. After a force simulation settles member node positions, the layout engine positions task nodes in columns beneath their owner, with each column (review, approved) offset horizontally.
Key mechanisms:
- Post-simulation positioning: Layout runs after d3-force settles member positions and before canvas drawing. Members are positioned by physics; tasks are positioned by layout.
- Slot frames: Each owner has a `SlotFrame` defining the geometry (ownerX, width, slots) for task placement. The lead has its own slot frame.
- Column offset: Tasks in the 'review' column are positioned to the left of the owner; 'approved' tasks to the right.
- Unassigned tasks: Tasks without an owner are placed in a designated `unassignedTaskRect`.
- Zone metadata: `KanbanZoneInfo[]` records the column zones for rendering headers.
- Static reuse: Internal collections (nodeMap, tasksByOwner, unassigned) are cleared and reused per call, avoiding GC pressure.
Usage
Use this principle when positioning nodes in a hierarchical column layout after a force simulation has settled parent positions. Applicable to any kanban-style visualization where tasks must appear under their owner in ordered columns.
Theoretical Basis
# Abstract algorithm (NOT real implementation)
def layout(nodes, options):
node_map = {n.id: n for n in nodes}
# Group tasks by owner
tasks_by_owner = defaultdict(list)
unassigned = []
for node in nodes:
if node.kind == 'task':
owner = node_map.get(node.ownerId)
if owner and has_slot_frame(owner, options):
tasks_by_owner[owner.id].append(node)
else:
unassigned.append(node)
# Position tasks in columns relative to owner
for owner_id, tasks in tasks_by_owner.items():
owner = node_map[owner_id]
for i, task in enumerate(tasks):
column_offset = COLUMN_WIDTH if task.column == 'approved' else -COLUMN_WIDTH
task.x = owner.x + column_offset
task.y = owner.y + TASK_HEIGHT * i
# Position unassigned tasks
if options.unassigned_rect:
for i, task in enumerate(unassigned):
task.x = unassigned_rect.x
task.y = unassigned_rect.y + TASK_HEIGHT * i