TimelineKit

API Reference

Properties

data: HistogramDataAll resources and allocations (read-only).
sheet: HistogramSheetThe sheet (table) component (read-only).
events: ResourceHistogramEventsEvent emitters (read-only).
settings: ResourceHistogramSettingsSettings object — access theme and locale (read-only).
showThresholdLine: booleanShow/hide the capacity threshold line. Default: true.
showGridLines: booleanShow/hide grid lines on the chart. Default: true.
showTodayLine: booleanShow/hide the today indicator line. Default: true.
displayMode: HistogramDisplayModeDisplay mode: 'bar' or 'area'. Default: 'bar'.
viewMode: HistogramViewModeView mode: 'resource' or 'aggregate'. Default: 'resource'.
markers: Marker[]Timeline markers.
filter: HistogramResourceFilterFn | nullActive resource filter function.
barTooltip: HistogramBarTooltipFn | nullCustom tooltip function. Set to null for default tooltip.
projectTimeline: DateRangeProject start/end date bounds.
autoZoomToFit: booleanAutomatically zoom to fit when data is loaded. Default: true.
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(): voidFit the view to show all allocations.
scrollToDate(date: Date): voidScroll the timeline to a specific date.
scrollToResource(resource: HistogramResource): voidScroll to make a resource row visible.
goToProjectStart(): voidScroll to the project start date.
undo(): voidUndo the last action.
redo(): voidRedo the last undone action.
addMarker(marker: Marker): voidAdd a timeline marker.
removeMarker(marker: Marker): voidRemove a timeline marker.
clearMarkers(): voidRemove all timeline markers.
clearFilter(): voidClear the active resource filter.
bindToGantt(gantt: GanttChartEngine): voidBind to a Gantt Chart for live data synchronization.
unbindFromGantt(): voidDisconnect from a previously bound Gantt Chart.
saveColumns(): ColumnState[]Save column layout (widths, order, visibility).
loadColumns(states: ColumnState[]): voidRestore column layout.
exportToImage(): Promise<Blob>Export histogram as PNG.
exportToCsv(options?: HistogramCsvExportOptions): stringExport as CSV string.
exportToPdf(options?: HistogramPdfExportOptions): Promise<Blob>Export as PDF (requires jspdf).
exportToExcel(options?: HistogramExcelExportOptions): Promise<Blob>Export as Excel (requires exceljs).
destroy(): voidDestroy the histogram and release all DOM resources. Called automatically in framework wrappers.

Events

Available via histogram.events. All events are RxJS Subjects.

barClick$: Subject<HistogramBarClickArgs>Emitted when a histogram bar/row is clicked.
barDblClick$: Subject<HistogramBarClickArgs>Emitted when a histogram bar/row is double-clicked.
chartContextMenu$: Subject<HistogramChartContextMenuArgs>Emitted on right-click on the chart area.
resourceHover$: Subject<HistogramResource | null>Emitted when a resource row is hovered in the chart. Null when mouse leaves.
projectTimeline$: Subject<DateRange>Emitted when the project timeline bounds change.
undone$: Subject<void>Emitted when an undo is performed.
redone$: Subject<void>Emitted when a redo is performed.

Types & Enums

HistogramResource

id: stringUnique identifier (read-only).
name: stringDisplay name.
maxCapacity: numberMaximum capacity in percent (100 = 1 FTE). Default: 100.
filtered: booleanWhether excluded by the active filter (read-only).
changed$: Subject<HistogramResourceEventArgs>Emitted when any property changes.
toAny(): anySerialize to a plain object.
static fromAny(obj): HistogramResourceCreate from a plain object.

HistogramAllocation

id: stringUnique identifier (read-only).
resourceId: stringID of the resource this allocation belongs to.
name: stringDisplay name (typically the task name).
startTime: DateStart date/time.
endTime: DateEnd date/time.
capacity: numberAllocation capacity in percent (100 = full-time).
changed$: Subject<HistogramAllocationEventArgs>Emitted when any property changes.
toAny(): anySerialize to a plain object.
static fromAny(obj): HistogramAllocationCreate from a plain object.

HistogramData

resourcesLength: numberTotal number of resources.
getResource(index): HistogramResourceGet a resource by index.
getResourceById(id): HistogramResource | nullFind a resource by ID.
createResource(id?): HistogramResourceCreate a new resource instance (not yet added).
addResource(resource): voidAdd a resource.
removeResource(resource): voidRemove a resource and all its allocations.
removeResourceById(id): booleanRemove a resource by ID. Returns true if found.
assignResources(resources): voidReplace all resources.
allocationsLength: numberTotal number of allocations.
getAllocation(index): HistogramAllocationGet an allocation by index.
getAllocationById(id): HistogramAllocation | nullFind an allocation by ID.
getAllocationsForResource(resourceId): HistogramAllocation[]Get all allocations for a resource.
createAllocation(resourceId, start, end, id?): HistogramAllocationCreate a new allocation instance (not yet added).
addAllocation(allocation): voidAdd an allocation.
removeAllocation(allocation): voidRemove an allocation.
removeAllocationById(id): booleanRemove an allocation by ID. Returns true if found.
assignAllocations(allocations): voidReplace all allocations.
clearAll(): voidRemove all resources and allocations.
getUtilization(resourceId, bucketStart, bucketEnd): numberCompute utilization for a resource in a time bucket.
getPeakUtilization(resourceId): numberGet peak utilization across all time.
getAggregateUtilization(bucketStart, bucketEnd): numberCompute aggregate utilization across all visible resources.
aggregateMaxCapacity: numberTotal max capacity across all visible resources.
minStartTime: Date | nullEarliest allocation start time.
maxEndTime: Date | nullLatest allocation end time.
orderedResources: HistogramResource[]Visible resources in order (filtered excluded).
filter: HistogramResourceFilterFn | nullActive resource filter function.

HistogramBarClickArgs

resource: HistogramResourceThe clicked resource.
date: DateThe start date of the clicked time bucket.
utilization: numberTotal utilization percentage in this bucket.

HistogramChartContextMenuArgs

resource: HistogramResource | nullThe right-clicked resource, or null.
date: DateThe date at the click position.
area: 'header' | 'content'Whether the click was on the header or content area.
mouseEvent: MouseEventThe original browser mouse event.

HistogramBarTooltipArgs

resource: HistogramResourceThe hovered resource.
date: DateThe start date of the hovered time bucket.
utilization: numberTotal utilization percentage in this bucket.

HistogramBarTooltipContent

title: stringTooltip title text.
lines: TooltipLine[]Array of { name: string, value: string } pairs.

HistogramBarTooltipFn

(args: HistogramBarTooltipArgs) => HistogramBarTooltipContent | nullCustom tooltip function. Return null to suppress the tooltip.

HistogramDisplayMode

'bar'Bar chart display (default).
'area'Area chart display.

HistogramViewMode

'resource'Per-resource rows (default).
'aggregate'Combined single row showing total utilization.

HistogramResourceFilterFn

(resource: HistogramResource) => booleanReturn true to show the resource, false to hide it.

HistogramCsvExportOptions

delimiter?: ',' | ';' | '\t'Column delimiter. Default: ','.
includeHeaders?: booleanInclude column headers. Default: true.

HistogramExcelExportOptions

allocationsSheetName?: stringName of the allocations sheet. Default: 'Allocations'.
includeResourcesSheet?: booleanInclude a sheet with resources. Default: true.
includeFormatting?: booleanApply formatting (bold headers, column widths, frozen header). Default: true.

HistogramPdfExportOptions

orientation?: 'portrait' | 'landscape'Page orientation. Default: 'landscape'.
pageSize?: 'a4' | 'letter' | 'legal'Page size. Default: 'a4'.

HistogramTheme

extends BaseThemeInherits all base theme properties (sheet, chart, rowHeight, etc.).
histogram: HistogramStyleHistogram-specific bar and area chart styling.

ResourceHistogramSettings

locale: TimelineKitLocaleCurrent locale (get/set).
theme: HistogramThemeCurrent theme (get/set).
changed$: Subject<void>Emitted when settings change.