GanttRow
The row model the chart builds from the tasks it renders
GanttRow is the row model the chart renders, one entry per rendered row in screen order. The
package root exports the type.
import type { GanttRow } from '@jaeungkim/gantt-chart';A lane packs tasks that never overlap onto one row. See Lanes.
Fields
/** One rendered row: one task, or several sharing a `lane` */
export interface GanttRow {
/** Stable key - the ids on the row, joined with "+" */
id: string;
tasks: TaskTransformed[];
/** Indentation level, 0-based */
depth: number;
/** `aria-level`, 1-based */
level: number;
/** `aria-posinset` among the rows that share a parent */
posinset: number;
/** `aria-setsize` for that same set */
setsize: number;
}| Field | Type | Notes |
|---|---|---|
id | string | The row's task ids joined with "+", in the order the tasks appear on the row. A one-task row uses that task's id. |
tasks | TaskTransformed[] | One entry on a plain row, several when tasks share a lane. Every row is built from at least one task, so the array is never empty. |
depth | number | 0-based indentation level, taken from the row's first task and equal to that task's depth. |
level | number | aria-level, always depth + 1. |
posinset | number | aria-posinset among the rows sharing this row's parent. A row's parent is the nearest row above it one depth shallower. |
setsize | number | aria-setsize for that same set. Counts visible rows only, because collapsing is applied before the rows are built. |
Internal helpers
src/features/rows/utils/rows.ts also defines buildGanttRows, packLanes and isRowExpandable. These
three stay internal to the package, and the headless core does not include them. Lane packing runs
on the render side.
Notes
- No prop or callback passes a
GanttRow. The type is exported so host code can name the shape the chart renders. - A plain row's id is its task's id, so a
collapsedIdsentry names a row. Those props are covered in Task list and hierarchy.
TaskTransformed is described in Task and task types. The prop index is
GanttProps.