TimelineKit

API Reference

For full TypeScript definitions and detailed signatures, see the generated API documentation.

Properties

list: TaskListAll tasks and links (read-only).
resources: ResourceListAll resources (read-only).
sheet: GanttSheetThe sheet (table) component (read-only).
selectedTasks: Task[]Currently selected tasks (read-only).
locale: TimelineKitLocaleShorthand for settings.locale.
settings: GanttChartSettingsSettings object — access theme, locale, currency (read-only).
events: GanttChartEventsEvent emitters (read-only).
canEdit: booleanEnable/disable editing. Default: true.
autoZoomToFit: booleanAutomatically zoom to fit when projectTimeline is set or data is loaded. Default: true.
showGridLines: booleanShow/hide grid lines on the chart. Default: true.
showCriticalPath: booleanEnable/disable critical path highlighting. Default: false.
showBaseline: booleanShow/hide baseline overlay. Default: false.
showTodayLine: booleanShow/hide today indicator line. Default: true.
allowTaskSplitting: booleanAllow splitting tasks into multiple parts via mouse. Default: true.
hasBaseline: booleanWhether a baseline has been saved (read-only).
markers: Marker[]Timeline markers.
filter: TaskFilterFn | nullActive task filter function.
projectTimeline: DateRangeProject start/end date bounds.
workingCalendar: WorkingCalendarWorking calendar (get/set).
canUndo$: BehaviorSubject<boolean>Whether undo is available (observable, read-only).
canRedo$: BehaviorSubject<boolean>Whether redo is available (observable, read-only).

Methods

load(json: string): voidLoad data from a JSON string.
save(): stringSerialize current state to a JSON string.
zoomIn(): booleanZoom in. Returns false if already at max zoom.
zoomOut(): booleanZoom out. Returns false if already at min zoom.
zoomToFit(tasks?: Task[]): voidFit the view to show all (or specified) tasks.
scrollToDate(date: Date): voidScroll the timeline to a specific date.
scrollToTask(task: Task): voidScroll to make a task visible (horizontal + vertical).
goToProjectStart(): voidScroll to the project start date.
indent(): voidIndent selected tasks (make subtasks).
outdent(): voidOutdent selected tasks (promote level).
moveUp(): voidMove selected tasks up.
moveDown(): voidMove selected tasks down.
undo(): voidUndo the last action.
redo(): voidRedo the last undone action.
copy(): Promise<void>Copy selected tasks to clipboard.
cut(): Promise<void>Cut selected tasks to clipboard.
paste(): Promise<TasksPastedEventArgs | null>Paste tasks from clipboard.
addMarker(marker: Marker): voidAdd a timeline marker.
removeMarker(marker: Marker): voidRemove a timeline marker.
clearMarkers(): voidRemove all timeline markers.
clearFilter(): voidClear the active task filter.
saveBaseline(): voidSave current schedule as baseline.
clearBaseline(): voidClear the saved baseline.
saveColumns(): ColumnState[]Save column layout (widths, order, visibility).
loadColumns(states: ColumnState[]): voidRestore column layout.
exportToImage(): Promise<Blob>Export chart as PNG.
exportToCsv(options?: GanttCsvExportOptions): stringExport as CSV string.
exportToPdf(options?: GanttPdfExportOptions): Promise<Blob>Export as PDF (requires jspdf).
exportToExcel(options?: GanttExcelExportOptions): Promise<Blob>Export as Excel (requires exceljs).
destroy(): voidDestroy the chart and release all DOM resources. Called automatically in React and Angular; required for vanilla/direct core usage.

TaskList Methods

Available via gantt.list.

createTask(id?: string): TaskCreate a new Task wired to the chart's calendar and project timeline, without adding it to the list. Use addTask() to insert it.
addTask(task: Task): TaskAdd a task to the end of the list.
insertTask(index: number, task: Task): TaskInsert a task at a specific position.
addEmptyTask(): TaskAppend an empty placeholder row at the end.
insertEmptyTask(index: number): TaskInsert an empty placeholder row at a specific position.
getTask(index: number): TaskGet a task by flat index.
getTaskById(id: string): Task | nullFind a task by ID.
length: numberTotal number of tasks (read-only).
removeTask(task: Task): voidRemove a single task.
removeTasks(tasks: Task[]): voidRemove multiple tasks.
clear(): voidRemove all tasks and links.
addLink(from: Task, to: Task, type: TaskLinkType, lag?: Lag): TaskLinkAdd a dependency link.
removeLink(link: TaskLink): voidRemove a dependency link.
existsLinkBetween(from: Task, to: Task): booleanCheck if a link already exists.
wouldCreateCycle(from: Task, to: Task): booleanCheck if adding a link would create a cycle.
getTasksUsingResource(resource: Resource): Task[]Find all tasks assigned to a resource.
indent(tasks: Task[]): voidIndent tasks (make subtasks of preceding task).
outdent(tasks: Task[]): voidOutdent tasks (promote one level).
moveUp(tasks: Task[]): voidMove tasks up in the list.
moveDown(tasks: Task[]): voidMove tasks down in the list.

Events

All events are RxJS Subject instances. Subscribe via gantt.events.eventName$.subscribe(callback).

taskAdded$: Subject<TaskEventArgs>A task was added.
taskChanged$: Subject<TaskEventArgs>A task property changed.
taskRemoved$: Subject<TaskEventArgs>A task was removed.
taskClick$: Subject<TaskEventArgs>A task bar was clicked.
taskDblClick$: Subject<TaskEventArgs>A task bar was double-clicked.
taskContextMenu$: Subject<TaskContextMenuArgs>Right-click on task bar.
chartContextMenu$: Subject<ChartContextMenuArgs>Right-click on chart area.
sheetRowContextMenu$: Subject<TableRowContextMenuEventArgs>Right-click on sheet row.
sheetColumnHeaderContextMenu$: Subject<TableColumnHeaderEventArgs>Right-click on column header.
sheetColumnResized$: Subject<TableColumnEventArgs>A column was resized.
sheetColumnReordered$: Subject<TableColumnEventArgs>A column was reordered.
sheetCellEditing$: Subject<TableCellEditing | null>Cell editing started (payload) or ended (null).
sheetCellDialogEdit$: Subject<DialogEditorArgs>A cell requires dialog editing (e.g. resources).
sheetCellInputEdit$: Subject<InputEditorArgs>A cell requires input editing.
sheetCellInvalidValue$: Subject<void>An invalid value was entered.
linkAdded$: Subject<TaskLinkEventArgs>A dependency link was added.
linkRemoved$: Subject<TaskLinkEventArgs>A dependency link was removed.
tasksPasted$: Subject<TasksPastedEventArgs>Tasks were pasted from clipboard.
projectTimeline$: Subject<DateRange>Project timeline bounds changed.
undone$: Subject<void>An undo was performed.
redone$: Subject<void>A redo was performed.

Types & Enums

Task

A schedulable item in the Gantt chart. Can be a Task, Milestone, Summary, or Empty row.

id: stringUnique identifier (read-only, auto-generated).
name: string | nullDisplay name. Setting a name on an Empty row converts it to a Task.
type: TaskTypeCurrent type: 'task' | 'milestone' | 'summary' | 'empty'.
startTime: Date | nullStart date/time. Computed from subtasks for Summary tasks.
endTime: Date | nullEnd date/time. Computed from subtasks for Summary tasks.
length: Length | nullComputed duration (read-only for Summary). Null for Empty tasks.
customLengthUnit: LengthUnit | nullOverride for the length display unit. When null, the calendar's default unit is used.
progress: number | nullCompletion percentage (0–100). Computed for Summary tasks. Null for Empty/Milestone.
color: ColorValueColor index into the theme's taskColors array, or a custom ColorDefinition. Default: 0.
note: string | nullFree-form text note.
parent: Task | nullParent summary task (read-only). Null for top-level tasks.
collapsed: booleanWhether a Summary task's subtasks are collapsed. Default: false.
level: numberNesting depth (read-only). 0 for top-level, 1 for first-level subtasks, etc.
constraintType: ConstraintTypeScheduling constraint. Default: 'asap'.
constraintDate: Date | nullDate for the scheduling constraint. Null for ASAP/ALAP.
work: Work | nullTotal work effort. Computed from resources, or set manually when none assigned.
cost: number | nullTotal cost. Computed from resource rates, or set manually.
baselineStartTime: Date | nullBaseline start time for variance tracking.
baselineEndTime: Date | nullBaseline end time for variance tracking.
warnings: string[]Active warning messages (e.g. behind schedule).
filtered: booleanWhether excluded by the active filter (read-only).
hidden: booleanWhether hidden (filtered out or inside a collapsed Summary, read-only).
isCritical: booleanWhether this task is on the critical path (read-only, computed).
earlyStart: Date | nullCPM early start (read-only, computed).
earlyFinish: Date | nullCPM early finish (read-only, computed).
lateStart: Date | nullCPM late start (read-only, computed).
lateFinish: Date | nullCPM late finish (read-only, computed).
totalFloat: number | nullTotal float in working hours (read-only, computed).
freeFloat: number | nullFree float in working hours (read-only, computed).

Task also supports custom properties via addProperty(), getPropertyValue(), setPropertyValue(), and removeProperty().

Resource

A named resource (person, equipment, etc.) that can be assigned to tasks.

id: stringUnique identifier (read-only).
name: stringDisplay name.
type: ResourceType'unique' | 'generic'.
rate: Rate | nullHourly or daily cost rate.
fixedCostPerUse: numberFixed cost charged each time this resource is used. Default: 0.
fixedCostPerResource: numberFixed cost per resource assignment. Default: 0.
avatarIconUrl: string | nullURL to an avatar image. Default: null.

TaskResource

Assignment of a resource to a task with a capacity percentage.

id: stringUnique identifier (read-only).
resource: ResourceThe underlying resource definition (read-only).
capacity: numberAllocation percentage (100 = full-time, 200 = double allocation).

TaskPart

A contiguous time segment of a split task.

startTime: DateStart date/time of this part.
endTime: DateEnd date/time of this part.
length: LengthDuration of this part.

WorkingCalendar

Defines working days, shifts, and holidays for scheduling calculations.

workingDays: DayOfWeek[]Days of the week that are working days. Default: Mon–Fri.
nationalHolidays: Date[]Dates that are non-working regardless of the day. Default: [].
shifts: WorkingShift[]Working time ranges within each day. Default: 8:00–12:00, 13:00–17:00.
startOfWeek: DayOfWeekFirst day of the week for calendar display. Default: 'sunday'.
defaultLengthUnit: LengthUnitDefault unit for new task durations. Default: 'day'.

Methods

isWorkingDay(date: Date): booleanCheck whether a date falls on a working day.
getHoursPerDay(): numberTotal working hours in a day based on configured shifts.
getHoursBetween(time1: Date, time2: Date): numberWorking hours between two dates, respecting shifts and non-working days.
addHours(date: Date, hours: number): DateAdd/subtract working hours, skipping non-working time.

WorkingShift

A working time range within a day (e.g. 8:00–12:00).

start: TimeOfDayStart time of the shift.
end: TimeOfDayEnd time of the shift.

TimeOfDay

A time of day represented as hour and minute.

hour: numberHour (0–23).
minute: numberMinute (0–59).

DateRange

Project timeline bounds.

startDate: DateStart date of the range.
endDate: DateEnd date of the range.

Length

Represents a task duration with a time unit. Create via Length.parse('5d') or new Length('day', 5).

value: numberNumeric amount (read-only).
unit: LengthUnitTime unit (read-only).

Static methods

parse(value: string): LengthParse a length string (e.g. '5d', '2w'). Throws on invalid input.
tryParse(value: string): Length | nullParse a length string. Returns null if invalid.
getLength(start: Date, end: Date, unit: LengthUnit, calendar: WorkingCalendar): LengthCalculate duration between two dates.

Lag

Time offset (positive or negative) applied to a dependency link. Create via Lag.parse('+2d').

value: numberNumeric amount — positive = lag, negative = lead (read-only).
unit: LengthUnitTime unit (read-only).

Static methods

parse(value: string): LagParse a lag string (e.g. '+2d', '-1h'). Throws on invalid input.
tryParse(value: string): Lag | nullParse a lag string. Returns null if invalid.
zero(): LagCreate a zero lag (0 days).

Work

Represents a work effort amount with a time unit. Create via Work.tryParse('40h').

value: numberNumeric amount (read-only).
unit: WorkUnitTime unit (read-only).

Rate

Cost rate associated with a resource.

value: numberMonetary value of the rate (read-only).
type: RateType'perDay' | 'perHour' (read-only).

Marker

A vertical date marker displayed on the chart.

date: DateDate position of the marker line.
label?: stringOptional text label.
color?: stringCSS color string.
lineWidth?: numberWidth of the marker line in pixels.
lineStyle?: 'solid' | 'dashed' | 'dotted'Dash style of the marker line.

CustomProperty

Custom task property (name + value).

name: stringProperty name.
value: anyProperty value.

GanttChartSettings

Gantt chart settings — theme, locale, and currency configuration.

theme: GanttChartThemeCurrent theme.
locale: TimelineKitLocaleCurrent locale.
currencySymbol: stringCurrency symbol used in cost columns. Default: '$'.
currencySymbolDisplayMode: CurrencySymbolDisplayModeHow the currency symbol is positioned relative to the amount. Default: 'beforeAmountWithSpace'.

ColumnState

Saved column layout state.

code: stringColumn identifier.
width: numberColumn width in pixels.
isVisible: booleanWhether the column is visible.

ColorDefinition

Custom color definition that can be used instead of a theme color index. All properties except color1 and color2 are optional — unspecified values are inherited from the first theme palette entry.

color1: stringPrimary fill color (top of gradient).
color2: stringSecondary fill color (bottom of gradient).
highlightColor?: stringHover/highlight overlay color.
borderColor?: string | nullBorder color. Null = no border.
progressColor1?: stringPrimary progress bar fill color (top of gradient).
progressColor2?: stringSecondary progress bar fill color (bottom of gradient).
progressHighlightColor?: stringProgress bar hover/highlight overlay color.

Event args types

TaskEventArgs

task: TaskThe task that triggered the event.

TaskLinkEventArgs

link: TaskLinkThe link that was added or removed.

TaskContextMenuArgs

task: TaskThe task that was right-clicked.
mouseEvent: MouseEventThe native mouse event.

ChartContextMenuArgs

date: DateDate at the click position.
area: 'header' | 'content'Whether the click was on the header or the content area.
task: Task | nullTask at the click position, or null.
mouseEvent: MouseEventThe native mouse event.

TasksPastedEventArgs

tasks: Task[]The pasted tasks.
links: TaskLink[]The pasted links.
taskIdMap: Map<string, Task>Maps original task ID → pasted task.
droppedLinks: DroppedLinkInfo[]Links that could not be recreated.

DroppedLinkInfo

type: TaskLinkTypeOriginal link type.
fromId: stringOriginal predecessor task ID.
toId: stringOriginal successor task ID.
externalSide: 'from' | 'to'Which end is outside the pasted set.

Export options

GanttCsvExportOptions

delimiter?: ',' | ';' | '\t'Column delimiter. Default: ','.
includeHeaders?: booleanInclude column headers. Default: true.
columns?: string[]Which columns to export (by code). Default: all visible.
includeLinks?: booleanAppend dependency links as a separate section. Default: false.

GanttPdfExportOptions

pageSize?: 'A4' | 'A3' | 'Letter' | 'Legal'Page format. Default: 'A4'.
orientation?: 'portrait' | 'landscape'Page orientation. Default: 'landscape'.
margin?: { top, right, bottom, left }Page margins in mm. Default: 10mm on all sides.
header?: string | ((page, total) => string)Header text on each page.
footer?: string | ((page, total) => string)Footer text on each page.
includeSheet?: booleanInclude the sheet (left panel). Default: true.
includeChart?: booleanInclude the chart (timeline). Default: true.
quality?: numberImage quality (0–1). Default: 1.
fitToSinglePage?: booleanExport as a single page. Default: false.

GanttExcelExportOptions

sheetName?: stringName of the tasks sheet. Default: 'Tasks'.
includeLinksSheet?: booleanInclude a sheet with dependency links. Default: true.
includeResourcesSheet?: booleanInclude a sheet with resources. Default: true.
includeFormatting?: booleanApply cell formatting (bold summaries, column widths). Default: true.
columns?: string[]Which columns to export (by code). Default: all visible.

TaskFilters

Built-in filter predicates. Each is a TaskFilterFn or a factory that returns one.

criticalPathTasks on the critical path.
incompleteTasks with progress below 100%.
completeTasks with 100% progress.
behindScheduleTasks past their end date with incomplete progress.
milestonesMilestone tasks only.
byResource(resource: Resource)Tasks assigned to a specific resource.
byDateRange(start: Date, end: Date)Tasks overlapping a date range.
byName(search: string)Tasks whose name contains the search string (case-insensitive).
combine(...filters: TaskFilterFn[])Combines multiple filters with AND logic.

Enums

TaskType

'task'A regular schedulable task with start, end, and duration.
'milestone'A zero-duration event marking a key date.
'summary'A parent task whose dates and progress are computed from subtasks.
'empty'An empty row placeholder.

TaskLinkType

'finishToStart'Successor starts after predecessor finishes (most common).
'startToStart'Both tasks start at the same time.
'finishToFinish'Both tasks finish at the same time.
'startToFinish'Successor finishes when predecessor starts.

ConstraintType

'asap'As Soon As Possible (default).
'alap'As Late As Possible.
'mso'Must Start On — task must start on the constraint date.
'mfo'Must Finish On — task must finish on the constraint date.
'snet'Start No Earlier Than — task cannot start before the constraint date.
'snlt'Start No Later Than — task cannot start after the constraint date.
'fnet'Finish No Earlier Than — task cannot finish before the constraint date.
'fnlt'Finish No Later Than — task cannot finish after the constraint date.

LengthUnit

'minute'Duration in minutes.
'hour'Duration in hours.
'day'Duration in working days (default).
'week'Duration in weeks.
'month'Duration in months.

WorkUnit

'minute'Work effort in minutes.
'hour'Work effort in hours.
'day'Work effort in days.

DayOfWeek

'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday'Day of the week.

ResourceType

'unique'A unique resource (e.g. a specific person).
'generic'A generic resource (e.g. 'Developer' role).

RateType

'perDay'Cost rate per working day.
'perHour'Cost rate per working hour.

ConnectorSide

'start' | 'finish'Which end of a task a link connects to.

ColorValue

number | ColorDefinitionA theme color index (number) or a custom color definition.

TaskFilterFn

(task: Task) => booleanPredicate function used to filter tasks.

TaskLabelPosition

'none'No label.
'inside'Label inside the task bar.
'right'Label to the right of the task bar.
'insideOrRight'Inside if it fits, otherwise to the right.

TaskLabelContent

'name'Display task name.
'resource'Display assigned resource names.
'progress'Display progress percentage.
'nameAndProgress'Display name and progress.
'nameAndResource'Display name and resource names.

SummaryMarkType

'full'Full triangle marks at both ends.
'half'Half-height marks at both ends.

CurrencySymbolDisplayMode

'beforeAmount'Symbol directly before amount ($100).
'afterAmount'Symbol directly after amount (100$).
'beforeAmountWithSpace'Symbol before amount with space ($ 100).
'afterAmountWithSpace'Symbol after amount with space (100 $).

Utility functions

getLinkType(from: ConnectorSide, to: ConnectorSide): TaskLinkTypeDetermine the link type from which sides of the tasks are connected.