Skip to content

Columns And Grid Projection

This page documents 20 public symbols exported by @revolist/gantt.

function

Look up a default task-table column definition by property name.

export function createDefaultTaskTableColumn(prop: TaskTableColumnProp, labels?: GanttLabelsConfig, allowedTaskTypes?: readonly TaskType[]): ColumnRegular;
ParameterTypeRequiredDefaultDescription
propTaskTableColumnPropYes—- The column property key (e.g. "wbs", "name").
labelsGanttLabelsConfig | undefinedNo—
allowedTaskTypesreadonly TaskType[] | undefinedNo—

Returns: A cloned ColumnRegular if a default exists, or null.

Related types: GanttLabelsConfig, TaskTableColumnProp, TaskType

function

Create the pinned-end gantt column definition.

This produces a single read-only column that uses the gantt column type for rendering. Runtime timeline width is managed by the dimension store.

export function createGanttColumn(_totalWidth?: number): ColumnRegular;
ParameterTypeRequiredDefaultDescription
_totalWidthnumber | undefinedNo—

Returns: A ColumnRegular pinned to colPinEnd.

function

export function createGanttColumnPreset(preset: GanttColumnPresetName, options: GanttColumnPresetOptions = {}): ColumnRegular[];
ParameterTypeRequiredDefaultDescription
presetGanttColumnPresetNameYes—
optionsGanttColumnPresetOptionsNo{}

Related types: GanttColumnPresetName, GanttColumnPresetOptions

function

export function createGanttColumnPresets(options: GanttColumnPresetOptions = {}): Record<GanttColumnPresetName, ColumnRegular[]>;
ParameterTypeRequiredDefaultDescription
optionsGanttColumnPresetOptionsNo{}

Related types: GanttColumnPresetName, GanttColumnPresetOptions

function

Projects the full project state into an ordered array of flat grid rows ready for rendering. Combines scheduling results, WBS numbering, dependency labels, baseline overlays, resource assignments, and Gantt bar layouts into a single row model per task.

export function createGanttGridRows(project: ProjectSnapshot, scale: TimelineScale, scheduledTasksById: ReadonlyMap<TaskId, ScheduledTask>, taskStore: TaskStore = new InMemoryTaskStore(project.tasks), resourceStore: ResourceStore = new InMemoryResourceStore(project.resources), assignmentStore: AssignmentStore = new InMemoryAssignmentStore(project.assignments), options: TaskRowProjectionOptions = {}, diagnostics?: TaskRowDiagnostics): readonly GanttGridRow[];
ParameterTypeRequiredDefaultDescription
projectProjectSnapshotYes—- The current project snapshot (tasks, resources, assignments, baselines, dependencies).
scaleTimelineScaleYes—- The active timeline scale for date-to-pixel conversion.
scheduledTasksByIdReadonlyMap<string, ScheduledTask>Yes—- Map of task IDs to their engine-computed schedule results.
taskStoreTaskStoreNonew InMemoryTaskStore(project.tasks)- Task store instance (defaults to an in-memory store built from the project).
resourceStoreResourceStoreNonew InMemoryResourceStore(project.resources)- Resource store instance (defaults to an in-memory store built from the project).
assignmentStoreAssignmentStoreNonew InMemoryAssignmentStore(project.assignments)- Assignment store instance (defaults to an in-memory store built from the project).
optionsTaskRowProjectionOptionsNo{}- Optional projection options (baseline, critical path, labels, resource planning).
diagnosticsTaskRowDiagnostics | undefinedNo—

Returns: An ordered array of {@link GanttGridRow} objects.

Related types: AssignmentStore, GanttGridRow, InMemoryAssignmentStore, InMemoryResourceStore, InMemoryTaskStore, ProjectSnapshot, ResourceStore, ScheduledTask, TaskId, TaskRowDiagnostics, TaskRowProjectionOptions, TaskStore, TimelineScale

function

Create the initial set of task-table columns shown before the user supplies custom columns.

export function createInitialTaskTableColumns(labels?: GanttLabelsConfig, allowedTaskTypes?: readonly TaskType[]): ColumnRegular[];
ParameterTypeRequiredDefaultDescription
labelsGanttLabelsConfig | undefinedNo—
allowedTaskTypesreadonly TaskType[] | undefinedNo—

Returns: An array containing the Name column.

Related types: GanttLabelsConfig, TaskType

constant

export const defaultTaskTableColumns: Record<TaskTableColumnProp, ColumnRegular<ColumnProp, DataType<any, ColumnProp>>>;

Related types: TaskTableColumnProp

type

export type GanttColumnPresetName =
| 'core'
| 'schedule'
| 'dependencies'
| 'resources'
| 'baseline'
| 'cost'
| 'progress'
| 'all';

interface

export interface GanttColumnPresetOptions {
/** Built-in Gantt option label overrides applied to generated default columns. */
readonly labels?: GanttLabelsConfig;
/** Task kinds offered by the generated Task Type column. */
readonly allowedTaskTypes?: readonly TaskType[];
}
MemberType / returnRequiredDefaultDescription
labelsGanttLabelsConfig | undefinedNo—Built-in Gantt option label overrides applied to generated default columns.
allowedTaskTypesreadonly TaskType[] | undefinedNo—Task kinds offered by the generated Task Type column.

Related types: GanttLabelsConfig, TaskType

type

export type GanttColumnPresetProp = Extract<TaskTableColumnProp, TaskGridColumnProp>;

Related types: TaskTableColumnProp

constant

export const ganttColumnPresetProps: { readonly core: readonly ["wbs", "name", "type", "startDate", "endDate", "duration", "percentDone"]; readonly schedule: readonly ["wbs", "name", "taskMode", "scheduleOrigin", "startDate", "endDate", "duration", "constraintType", "constraintDate", "deadlineDate", "schedulingWarning", "totalSlackDays"]; readonly dependencies: readonly ["wbs", "name", "predecessors", "successors", "totalSlackDays"]; readonly resources: readonly ["wbs", "name", "assignees", "workHours", "effortMode", "effortDriven", "resourceRole", "resourceCapacity", "resourceLoadSummary", "canLevel", "levelingDelayDays"]; readonly baseline: readonly ["wbs", "name", "startDate", "endDate", "actualStartDate", "actualFinishDate", "startVarianceDays", "finishVarianceDays", "durationVariance", "progressVariancePercent"]; readonly cost: readonly ["wbs", "name", "type", "cost", "workHours", "assignees"]; readonly progress: readonly ["wbs", "name", "status", "statusIndicator", "percentDone", "remainingDuration", "actualStartDate", "actualFinishDate", "progressVariancePercent"]; readonly all: readonly ["wbs", "name", "type", "cost", "startDate", "endDate", "duration", "workHours", "remainingDuration", "actualStartDate", "actualFinishDate", "effortMode", "effortDriven", "inactive", "priority", "canLevel", "levelingDelayDays", "earlyStartDate", "earlyFinishDate", "lateStartDate", "lateFinishDate", "totalSlackDays", "startVarianceDays", "finishVarianceDays", "durationVariance", "progressVariancePercent", "taskMode", "scheduleOrigin", "constraintType", "constraintDate", "deadlineDate", "schedulingWarning", "percentDone", "predecessors", "successors", "status", "statusIndicator", "workflowStatus", "assignees", "resourceRole", "resourceCapacity", "resourceLoadSummary"]; };

constant

export const GanttDependencyDropdownColumn: ColumnType<DataType<any, ColumnProp>>;

interface

Flat render row produced by projecting a scheduled task onto the Gantt grid. Contains display-ready fields and computed layout, not domain/UI state.

export interface GanttGridRow {
/** Row projection kind. Omitted task rows are treated as task rows. */
readonly rowKind?: 'task' | 'resource';
/** Unique task identifier. */
readonly id: TaskId;
/** Parent task identifier, or `null` for top-level tasks. */
readonly parentId: TaskId | null;
/** Work Breakdown Structure code (e.g. "1.2.3"). */
readonly wbs: string;
/** Display name of the task. */
readonly name: string;
/** Optional authored task-bar color. */
readonly color?: string;
/** Scheduler-determined kind (task, summary, milestone). */
readonly taskKind: ScheduledTaskKind;
/** Raw authored task type used by task-table editors. */
readonly type?: ScheduledTaskKind;
/** Human-readable task type label. */
readonly taskType: string;
/** Human-readable status label. */
readonly status: string;
/** Raw calculated task status key. Omitted for non-task resource rows. */
readonly statusKey?: TaskStatus;
/** Calculated status used by the Status Indicator column. */
readonly statusIndicator?: TaskStatus;
/** Human-readable editable workflow status label. */
readonly workflowStatus?: string;
/** Raw editable workflow status key. */
readonly workflowStatusKey?: TaskWorkflowStatus;
/** Task tags. */
readonly tags: readonly string[];
/** Optional scheduling constraint type. */
readonly constraintType?: string;
/** Optional scheduling constraint date. */
readonly constraintDate?: string;
/** Optional task deadline date. */
readonly deadlineDate?: string;
/** Scheduled start date (ISO string). */
readonly startDate: string;
/** Scheduled end date (ISO string). */
readonly endDate: string;
/** Scheduled task duration. */
readonly duration: number;
/** Unit used by duration cells and editors. */
readonly durationUnit?: DurationUnit;
/** Whether duration ignores working calendars. */
readonly durationIsElapsed?: boolean;
/** Display-ready scheduled duration. */
readonly formattedDuration?: string;
/** Planned work for the task, in hours. */
readonly workHours?: number;
/** Unit used by Work cells and editors. */
readonly workUnit?: DurationUnit;
/** Display-ready planned Work value. */
readonly formattedWork?: string;
/** Remaining duration for progress-aware scheduling. */
readonly remainingDuration?: number;
/** Display-ready remaining duration. */
readonly formattedRemainingDuration?: string;
/** Date work actually started. */
readonly actualStartDate?: string;
/** Date work actually finished. */
readonly actualFinishDate?: string;
/** Task effort mode controlling work/duration/unit calculation. */
readonly effortMode?: TaskEffortMode;
/** Whether assignment changes should preserve total work where supported. */
readonly effortDriven?: boolean;
/** Whether this task is excluded from scheduling. */
readonly inactive: boolean;
/** Leveling priority from 0 to 1000. */
readonly priority?: number;
/** Whether automatic resource leveling may delay this task. */
readonly canLevel?: boolean;
/** Resource leveling delay in calendar days. */
readonly levelingDelayDays?: number;
/** Completion percentage (0-100). */
readonly percentDone: number;
/** Engine-computed critical state, independent of visual highlighting. */
readonly isCritical?: boolean;
/** Total slack (float) in days before the task delays the project. Present when critical-path projection is available. */
readonly totalSlackDays?: number;
/** Earliest scheduled start date. Present when critical-path projection is available. */
readonly earlyStartDate?: string;
/** Earliest scheduled finish date. Present when critical-path projection is available. */
readonly earlyFinishDate?: string;
/** Latest start date that preserves the project finish. Present when critical-path projection is available. */
readonly lateStartDate?: string;
/** Latest finish date that preserves the project finish. Present when critical-path projection is available. */
readonly lateFinishDate?: string;
/** Whether the task is auto- or manually scheduled. */
readonly taskMode: 'auto' | 'manual';
/** How the scheduler determined the rendered dates. */
readonly scheduleOrigin: ScheduledTask['scheduleOrigin'];
/** Scheduling warning messages associated with this task. */
readonly schedulingWarnings: readonly string[];
/** First scheduling warning, suitable for compact columns and tooltips. */
readonly schedulingWarning: string;
/** Optional inline label rendered on the Gantt bar. */
readonly taskLabel?: string;
/** Optional baseline bar layout for plan-vs-actual comparison. */
readonly baselineLayout?: GanttBaselineLayout;
/** Start variance against the selected baseline, in calendar days. */
readonly startVarianceDays?: number;
/** Finish variance against the selected baseline, in calendar days. */
readonly finishVarianceDays?: number;
/** Duration variance against the selected baseline, in canonical hours. */
readonly durationVariance?: number;
/** Display-ready duration variance in the task duration unit. */
readonly formattedDurationVariance?: string;
/** Progress variance against the selected baseline, in percentage points. */
readonly progressVariancePercent?: number;
/** Point indicators (deadlines, constraints, custom markers) on this row. */
readonly indicators: readonly GanttIndicatorLayout[];
/** Assigned resource names used by the multi-select editor. */
readonly assignees: readonly string[];
/** Comma-separated list of assigned resource names for search and tooltips. */
readonly assigneeLabels: string;
/** Display-ready resource assignment metadata. */
readonly assigneeDetails: readonly TaskGridAssignee[];
/** Estimated task cost in the project currency. */
readonly cost: number;
/** Formatted estimated task cost. */
readonly formattedCost: string;
/** Comma-separated predecessor reference tokens. */
readonly predecessors: string;
/** Comma-separated successor reference tokens. */
readonly successors: string;
/** Computed pixel layout for the Gantt bar. */
readonly ganttLayout: GanttBarLayout;
/** Reserved field for the Gantt bar cell renderer. */
readonly gantt: string;
/** Resource identifier for resource-planning rows. */
readonly resourceId?: ResourceId;
/** Optional resource profile image URL for resource-planning rows. */
readonly resourceAvatarUrl?: string;
/** Resource role for resource-planning rows. */
readonly resourceRole?: string;
/** Display-ready capacity label for resource-planning rows. */
readonly resourceCapacity?: string;
/** Display-ready load summary for resource-planning rows. */
readonly resourceLoadSummary?: string;
/** Resource planning load data rendered on the timeline. */
readonly resourcePlanning?: ResourcePlanningRowData;
}
MemberType / returnRequiredDefaultDescription
rowKind"task" | "resource" | undefinedNo—Row projection kind. Omitted task rows are treated as task rows.
idstringYes—Unique task identifier.
parentIdstring | nullYes—Parent task identifier, or null for top-level tasks.
wbsstringYes—Work Breakdown Structure code (e.g. “1.2.3”).
namestringYes—Display name of the task.
colorstring | undefinedNo—Optional authored task-bar color.
taskKindScheduledTaskKindYes—Scheduler-determined kind (task, summary, milestone).
typeScheduledTaskKind | undefinedNo—Raw authored task type used by task-table editors.
taskTypestringYes—Human-readable task type label.
statusstringYes—Human-readable status label.
statusKeyTaskStatus | undefinedNo—Raw calculated task status key. Omitted for non-task resource rows.
statusIndicatorTaskStatus | undefinedNo—Calculated status used by the Status Indicator column.
workflowStatusstring | undefinedNo—Human-readable editable workflow status label.
workflowStatusKeyTaskWorkflowStatus | undefinedNo—Raw editable workflow status key.
tagsreadonly string[]Yes—Task tags.
constraintTypestring | undefinedNo—Optional scheduling constraint type.
constraintDatestring | undefinedNo—Optional scheduling constraint date.
deadlineDatestring | undefinedNo—Optional task deadline date.
startDatestringYes—Scheduled start date (ISO string).
endDatestringYes—Scheduled end date (ISO string).
durationnumberYes—Scheduled task duration.
durationUnitDurationUnit | undefinedNo—Unit used by duration cells and editors.
durationIsElapsedboolean | undefinedNo—Whether duration ignores working calendars.
formattedDurationstring | undefinedNo—Display-ready scheduled duration.
workHoursnumber | undefinedNo—Planned work for the task, in hours.
workUnitDurationUnit | undefinedNo—Unit used by Work cells and editors.
formattedWorkstring | undefinedNo—Display-ready planned Work value.
remainingDurationnumber | undefinedNo—Remaining duration for progress-aware scheduling.
formattedRemainingDurationstring | undefinedNo—Display-ready remaining duration.
actualStartDatestring | undefinedNo—Date work actually started.
actualFinishDatestring | undefinedNo—Date work actually finished.
effortModeTaskEffortMode | undefinedNo—Task effort mode controlling work/duration/unit calculation.
effortDrivenboolean | undefinedNo—Whether assignment changes should preserve total work where supported.
inactivebooleanYes—Whether this task is excluded from scheduling.
prioritynumber | undefinedNo—Leveling priority from 0 to 1000.
canLevelboolean | undefinedNo—Whether automatic resource leveling may delay this task.
levelingDelayDaysnumber | undefinedNo—Resource leveling delay in calendar days.
percentDonenumberYes—Completion percentage (0-100).
isCriticalboolean | undefinedNo—Engine-computed critical state, independent of visual highlighting.
totalSlackDaysnumber | undefinedNo—Total slack (float) in days before the task delays the project. Present when critical-path projection is available.
earlyStartDatestring | undefinedNo—Earliest scheduled start date. Present when critical-path projection is available.
earlyFinishDatestring | undefinedNo—Earliest scheduled finish date. Present when critical-path projection is available.
lateStartDatestring | undefinedNo—Latest start date that preserves the project finish. Present when critical-path projection is available.
lateFinishDatestring | undefinedNo—Latest finish date that preserves the project finish. Present when critical-path projection is available.
taskMode"manual" | "auto"Yes—Whether the task is auto- or manually scheduled.
scheduleOriginScheduleOriginYes—How the scheduler determined the rendered dates.
schedulingWarningsreadonly string[]Yes—Scheduling warning messages associated with this task.
schedulingWarningstringYes—First scheduling warning, suitable for compact columns and tooltips.
taskLabelstring | undefinedNo—Optional inline label rendered on the Gantt bar.
baselineLayoutGanttBaselineLayout | undefinedNo—Optional baseline bar layout for plan-vs-actual comparison.
startVarianceDaysnumber | undefinedNo—Start variance against the selected baseline, in calendar days.
finishVarianceDaysnumber | undefinedNo—Finish variance against the selected baseline, in calendar days.
durationVariancenumber | undefinedNo—Duration variance against the selected baseline, in canonical hours.
formattedDurationVariancestring | undefinedNo—Display-ready duration variance in the task duration unit.
progressVariancePercentnumber | undefinedNo—Progress variance against the selected baseline, in percentage points.
indicatorsreadonly GanttIndicatorLayout[]Yes—Point indicators (deadlines, constraints, custom markers) on this row.
assigneesreadonly string[]Yes—Assigned resource names used by the multi-select editor.
assigneeLabelsstringYes—Comma-separated list of assigned resource names for search and tooltips.
assigneeDetailsreadonly TaskGridAssignee[]Yes—Display-ready resource assignment metadata.
costnumberYes—Estimated task cost in the project currency.
formattedCoststringYes—Formatted estimated task cost.
predecessorsstringYes—Comma-separated predecessor reference tokens.
successorsstringYes—Comma-separated successor reference tokens.
ganttLayoutGanttBarLayoutYes—Computed pixel layout for the Gantt bar.
ganttstringYes—Reserved field for the Gantt bar cell renderer.
resourceIdstring | undefinedNo—Resource identifier for resource-planning rows.
resourceAvatarUrlstring | undefinedNo—Optional resource profile image URL for resource-planning rows.
resourceRolestring | undefinedNo—Resource role for resource-planning rows.
resourceCapacitystring | undefinedNo—Display-ready capacity label for resource-planning rows.
resourceLoadSummarystring | undefinedNo—Display-ready load summary for resource-planning rows.
resourcePlanningResourcePlanningRowData | undefinedNo—Resource planning load data rendered on the timeline.

Related types: GanttBarLayout, GanttBaselineLayout, GanttIndicatorLayout, ResourceId, ResourcePlanningRowData, ScheduledTask, ScheduledTaskKind, TaskEffortMode, TaskGridAssignee, TaskId, TaskStatus, TaskWorkflowStatus

interface

Percent Done task-table column with an optional per-column visual override.

export interface GanttPercentDoneColumn extends ColumnRegular {
readonly prop: 'percentDone';
/** Overrides `visuals.percentDoneMode` for this column. */
readonly mode?: GanttPercentDoneColumnMode;
}
MemberType / returnRequiredDefaultDescription
prop"percentDone"Yes—
modeGanttPercentDoneColumnMode | undefinedNo—Overrides visuals.percentDoneMode for this column.

Related types: GanttPercentDoneColumnMode

type

Built-in visual modes for the managed Percent Done task-table column.

export type GanttPercentDoneColumnMode = 'number' | 'bar' | 'circle';

function

export function getGanttColumnPresetProps(preset: GanttColumnPresetName): GanttColumnPresetProp[];
ParameterTypeRequiredDefaultDescription
presetGanttColumnPresetNameYes—

Related types: GanttColumnPresetName, GanttColumnPresetProp

function

Returns the scale configuration fields for a named zoom preset.

export function getZoomPresetConfig(preset: TimelineZoomPreset): Pick<TimelineScaleConfig, 'levelId' | 'tickUnit' | 'tickCount' | 'tickWidth' | 'headerRows'>;
ParameterTypeRequiredDefaultDescription
presetTimelineZoomPresetYes—- One of the predefined zoom preset identifiers.

Returns: A partial {@link TimelineScaleConfig} with tick and header settings.

Related types: TimelineScaleConfig, TimelineZoomPreset

function

Normalize user-supplied columns for the task-table side of the gantt grid.

Strips any existing gantt column (it is managed internally), fills in missing properties from default column definitions, and falls back to the initial columns if the array is empty.

export function normalizePinnedTaskColumns(columns: Array<ColumnGrouping | ColumnRegular> | undefined, getProject: () => GanttPluginConfig | null | undefined = () => undefined, getRowOrder: () => RowOrderPluginConfig | false | undefined = () => undefined): Array<ColumnGrouping | ColumnRegular>;
ParameterTypeRequiredDefaultDescription
columns(ColumnRegular<ColumnProp, DataType<any, ColumnProp>> | ColumnGrouping<any>)[] | undefinedYes—- The raw column array from the grid or user config.
getProject() => GanttPluginConfig | null | undefinedNo() => undefined
getRowOrder() => RowOrderPluginConfig | false | undefinedNo() => undefined

Returns: A cleaned array of columns ready to be combined with the gantt column.

Related types: GanttPluginConfig

type

export type TaskTableColumnProp =
| 'wbs'
| 'name'
| 'type'
| 'cost'
| 'startDate'
| 'endDate'
| 'duration'
| 'workHours'
| 'remainingDuration'
| 'actualStartDate'
| 'actualFinishDate'
| 'effortMode'
| 'effortDriven'
| 'inactive'
| 'priority'
| 'canLevel'
| 'levelingDelayDays'
| 'earlyStartDate'
| 'earlyFinishDate'
| 'lateStartDate'
| 'lateFinishDate'
| 'totalSlackDays'
| 'startVarianceDays'
| 'finishVarianceDays'
| 'durationVariance'
| 'progressVariancePercent'
| 'taskMode'
| 'scheduleOrigin'
| 'constraintType'
| 'constraintDate'
| 'deadlineDate'
| 'schedulingWarning'
| 'percentDone'
| 'predecessors'
| 'successors'
| 'status'
| 'statusIndicator'
| 'workflowStatus'
| 'assignees'
| 'resourceRole'
| 'resourceCapacity'
| 'resourceLoadSummary';

type

Named presets mapping to entries in the built-in timeline preset list.

export type TimelineZoomPreset =
| 'minute-hour'
| 'hour-day'
| 'two-hour-day-wide'
| 'two-hour-day'
| 'six-hour-day-wide'
| 'six-hour-day'
| 'day-week-wide'
| 'day-month'
| 'day-week-medium'
| 'day-week'
| 'week-month'
| 'month-quarter'
| 'quarter-year'
| 'year-quarter'
| 'multi-year-quarter';