Skip to content

Timeline And Visuals

This page documents 79 public symbols exported by @revolist/revogrid-enterprise.

function

Builds a map of task IDs to WBS (Work Breakdown Structure) codes based on the canonical authored tree order and nesting depth.

export function buildWbsMap(rows: readonly TaskTreeRow[]): ReadonlyMap<TaskId, string>;
ParameterTypeRequiredDefaultDescription
rowsreadonly TaskTreeRow[]Yes- Ordered rows with depth and task identity.

Returns: A read-only map from task ID to its computed WBS string (e.g. “1.2.3”).

Related types: TaskId, TaskTreeRow

function

Clamps a level index to the allowed range defined by min/max level IDs.

export function clampLevelIndex(levels: readonly TimelineZoomLevel[], index: number, minLevelId: string, maxLevelId: string): number;
ParameterTypeRequiredDefaultDescription
levelsreadonly TimelineZoomLevel[]Yes- Available zoom levels.
indexnumberYes- Proposed level index.
minLevelIdstringYes- Finest allowed level ID.
maxLevelIdstringYes- Coarsest allowed level ID.

Returns: The clamped index.

Related types: TimelineZoomLevel

function

Computes the pixel layout for a baseline bar overlay.

export function createBaselineBarLayout(startDate: ISODateString, endDate: ISODateString, scale: TimelineScale): GanttBaselineLayout;
ParameterTypeRequiredDefaultDescription
startDateISODateStringYes- Baseline start date (ISO string).
endDateISODateStringYes- Baseline end date (ISO string).
scaleTimelineScaleYes- The active timeline scale.

Returns: A {@link GanttBaselineLayout} with x and width in pixels.

Related types: GanttBaselineLayout, TimelineScale

function

Computes the pixel layout for a scheduled task’s Gantt bar.

export function createGanttBarLayout(task: ScheduledTask, scale: TimelineScale, showCriticalPath = true): GanttBarLayout;
ParameterTypeRequiredDefaultDescription
taskScheduledTaskYes- The engine-scheduled task with dates, type, and progress.
scaleTimelineScaleYes- The active timeline scale used to convert dates to pixel positions.
showCriticalPathbooleanNotrue- Whether to mark the bar as critical when the task is on the critical path.

Returns: A {@link GanttBarLayout} with pixel coordinates and metadata.

Related types: GanttBarLayout, ScheduledTask, TimelineScale

function

Creates a layout descriptor for a point indicator on the Gantt row.

export function createIndicatorLayout(id: string, date: ISODateString, kind: GanttIndicatorLayout['kind'], scale: TimelineScale, label?: string, className?: string): GanttIndicatorLayout;
ParameterTypeRequiredDefaultDescription
idstringYes- Unique identifier for the indicator.
dateISODateStringYes- The date the indicator marks.
kind"constraint" | "deadline" | "custom"Yes- Category of the indicator (deadline, constraint, or custom).
scaleTimelineScaleYes- The active timeline scale.
labelstring | undefinedNo- Optional display label.
classNamestring | undefinedNo- Optional CSS class name.

Returns: A {@link GanttIndicatorLayout} positioned on the timeline.

Related types: GanttIndicatorLayout, TimelineScale

function

export function createTimelineDateFormatContext(project: Pick<GanttPluginConfig, 'timeZone' | 'dateFormats'> | null | undefined, timelineContext: TimelineDateFormatterContext): GanttDateFormatContext;
ParameterTypeRequiredDefaultDescription
projectPick<GanttPluginConfig, "timeZone" | "dateFormats"> | null | undefinedYes
timelineContextTimelineDateFormatterContextYes

Related types: GanttDateFormatContext, GanttPluginConfig, TimelineDateFormatterContext

function

Creates a {@link TimelineScale} from the given configuration.

export function createTimelineScale(config: TimelineScaleConfig): TimelineScale;
ParameterTypeRequiredDefaultDescription
configTimelineScaleConfigYes- Scale configuration specifying date range, tick unit, and header rows.

Returns: A fully initialized timeline scale instance.

Related types: TimelineScale, TimelineScaleConfig

constant

Pixel threshold for accumulated smooth-wheel deltas before triggering a zoom step.

export const DEFAULT_SMOOTH_WHEEL_THRESHOLD: 96;

constant

Default timeline zoom levels ordered from finest to coarsest. Minute-level zoom remains explicit/advanced.

export const DEFAULT_TIMELINE_ZOOM_LEVELS: readonly TimelineZoomLevel[];

Related types: TimelineZoomLevel

constant

Default zoom level used when no level is configured.

export const FALLBACK_ZOOM_LEVEL: TimelineZoomLevel;

Related types: TimelineZoomLevel

type

Discriminator for the visual shape of a Gantt bar.

export type GanttBarKind = 'task' | 'summary' | 'milestone';

interface

Computed pixel layout for a single Gantt task bar, including progress and critical-path metadata.

export interface GanttBarLayout {
/** Visual shape type of the bar. */
readonly kind: GanttBarKind;
/** Horizontal pixel offset from the timeline origin. */
readonly x: number;
/** Pixel width of the bar (minimum-clamped). */
readonly width: number;
/** Pixel width of the filled progress portion inside the bar. */
readonly progressWidth: number;
/** Horizontal center X used for milestone diamond rendering. */
readonly milestoneCenterX: number;
/** Whether this task lies on the critical path. */
readonly isCritical: boolean;
/** Total slack (float) available before the task delays the project. */
readonly totalSlackDays: number;
/** Visual task split gaps inside the bar. */
readonly splitGaps: readonly GanttSplitGapLayout[];
}
MemberType / returnRequiredDefaultDescription
kindGanttBarKindYesVisual shape type of the bar.
xnumberYesHorizontal pixel offset from the timeline origin.
widthnumberYesPixel width of the bar (minimum-clamped).
progressWidthnumberYesPixel width of the filled progress portion inside the bar.
milestoneCenterXnumberYesHorizontal center X used for milestone diamond rendering.
isCriticalbooleanYesWhether this task lies on the critical path.
totalSlackDaysnumberYesTotal slack (float) available before the task delays the project.
splitGapsreadonly GanttSplitGapLayout[]YesVisual task split gaps inside the bar.

Related types: GanttBarKind, GanttSplitGapLayout

interface

Layout coordinates for a baseline bar overlay.

export interface GanttBaselineLayout {
/** Horizontal pixel offset from the timeline origin. */
readonly x: number;
/** Pixel width of the baseline bar. */
readonly width: number;
}
MemberType / returnRequiredDefaultDescription
xnumberYesHorizontal pixel offset from the timeline origin.
widthnumberYesPixel width of the baseline bar.

interface

Layout descriptor for a single-point indicator (deadline, constraint, or custom marker) on the Gantt row.

export interface GanttIndicatorLayout {
/** Unique identifier for this indicator instance. */
readonly id: string;
/** Category of the indicator. */
readonly kind: 'deadline' | 'constraint' | 'custom';
/** Horizontal pixel offset from the timeline origin. */
readonly x: number;
/** Optional display label shown on hover or beside the indicator. */
readonly label?: string;
/** Optional CSS class name applied to the indicator element. */
readonly className?: string;
}
MemberType / returnRequiredDefaultDescription
idstringYesUnique identifier for this indicator instance.
kind"constraint" | "deadline" | "custom"YesCategory of the indicator.
xnumberYesHorizontal pixel offset from the timeline origin.
labelstring | undefinedNoOptional display label shown on hover or beside the indicator.
classNamestring | undefinedNoOptional CSS class name applied to the indicator element.

interface

Visual gap inside a task bar where split work is paused.

export interface GanttSplitGapLayout {
/** Stable gap id. */
readonly id: string;
/** Split index after scheduler normalization. */
readonly index: number;
/** Split start date. */
readonly startDate: ISODateString;
/** Split end date. */
readonly endDate: ISODateString;
/** Left offset relative to the task bar. */
readonly x: number;
/** Gap width in pixels. */
readonly width: number;
}
MemberType / returnRequiredDefaultDescription
idstringYesStable gap id.
indexnumberYesSplit index after scheduler normalization.
startDateISODateStringYesSplit start date.
endDateISODateStringYesSplit end date.
xnumberYesLeft offset relative to the task bar.
widthnumberYesGap width in pixels.

interface

export interface GanttTaskBarColor {
/** Optional class name applied to the rendered bar. */
readonly className?: string;
/** Main bar colour. */
readonly barColor?: string;
/** Progress fill colour. */
readonly progressColor?: string;
/** Label/content text colour. */
readonly textColor?: string;
/** Optional outline or border colour. */
readonly borderColor?: string;
}
MemberType / returnRequiredDefaultDescription
classNamestring | undefinedNoOptional class name applied to the rendered bar.
barColorstring | undefinedNoMain bar colour.
progressColorstring | undefinedNoProgress fill colour.
textColorstring | undefinedNoLabel/content text colour.
borderColorstring | undefinedNoOptional outline or border colour.

type

export type GanttTaskBarColorHook = (context: GanttTaskBarVisualContext) => GanttTaskBarColor | null | undefined;

Related types: GanttTaskBarColor, GanttTaskBarVisualContext

interface

export interface GanttTaskBarContentContext extends GanttTaskBarVisualContext {
readonly h: GanttCellTemplateCreateElement;
readonly defaultContent: readonly unknown[];
}
MemberType / returnRequiredDefaultDescription
hHyperFunc<VNode>Yes
defaultContentreadonly unknown[]Yes

Related types: GanttTaskBarVisualContext

type

export type GanttTaskBarContentHook = (context: GanttTaskBarContentContext) => unknown;

Related types: GanttTaskBarContentContext

interface

export interface GanttTaskBarVisualContext {
readonly row: GanttGridRow;
}
MemberType / returnRequiredDefaultDescription
rowGanttGridRowYes

Related types: GanttGridRow

type

export type GanttTaskLabelMode = 'none' | 'tasks' | 'all';

interface

A visual marker pinned to a specific date on a task bar. Use to flag deadlines, constraints, or custom indicators.

export interface GanttTaskMarker {
/** Unique identifier. */
readonly id: string;
/** Date the marker is pinned to. */
readonly date: ISODateString;
/** Tooltip or label text. */
readonly label?: string;
/** Optional CSS class name for custom styling. */
readonly className?: string;
}
MemberType / returnRequiredDefaultDescription
idstringYesUnique identifier.
dateISODateStringYesDate the marker is pinned to.
labelstring | undefinedNoTooltip or label text.
classNamestring | undefinedNoOptional CSS class name for custom styling.

type

Callback that produces per-task markers for the timeline. Invoked by the rendering pipeline for each visible task.

export type GanttTaskMarkerHook = (task: {
readonly id: TaskId;
readonly startDate: ISODateString;
readonly endDate: ISODateString;
readonly deadlineDate?: ISODateString;
readonly constraintType?: string;
readonly constraintDate?: ISODateString;
}) => readonly GanttTaskMarker[];

Related types: GanttTaskMarker, TaskId

type

A runtime plugin contribution rendered after the built-in header layers.

export type GanttTimelineHeaderElementRenderer = (
h: HyperFunc<VNode>,
context: Readonly<GanttTimelineHeaderRenderOptions>,
) => VNodeResponse;

Related types: GanttTimelineHeaderRenderOptions

class

Discoverable runtime coordinator for the Gantt timeline header.

It owns only ordered element contributions and native header invalidation; timeline state and geometry remain owned by the Gantt timeline tools.

export class GanttTimelineHeaderPlugin extends CorePlugin {
constructor(revogrid: HTMLRevoGridElement, providers: PluginProviders);
createColumnTemplate(getOptions: () => GanttTimelineHeaderRenderOptions | undefined): ColumnTemplateFunc;
render(h: HyperFunc<VNode>, options: GanttTimelineHeaderRenderOptions): VNode;
registerElement(id: string, renderer: GanttTimelineHeaderElementRenderer): () => void;
refresh(): void;
destroy(): void;
}
MemberType / returnRequiredDefaultDescription
elementsMap<string, TimelineHeaderElementRegistration>Yesnew Map<string, TimelineHeaderElementRegistration>()
createColumnTemplate(getOptions: () => GanttTimelineHeaderRenderOptions | undefined)ColumnTemplateFuncYes
render(h: HyperFunc<VNode>, options: GanttTimelineHeaderRenderOptions)VNodeYes
registerElement(id: string, renderer: GanttTimelineHeaderElementRenderer)() => voidYes
refresh()voidYes
destroy()voidYes

Related types: GanttTimelineHeaderElementRenderer, GanttTimelineHeaderRenderOptions

interface

Resolved, immutable geometry consumed by the timeline header renderer.

export interface GanttTimelineHeaderRenderOptions {
readonly totalWidth: number;
readonly headerRows: readonly TimelineHeaderRowModel[];
readonly nonWorkingHeaderRanges?: readonly TimelineHeaderHighlightRange[];
readonly activeTaskInteractionRange?: TimelineTaskInteractionRange | null;
readonly flagLines?: readonly TimelineFlagLine[];
}
MemberType / returnRequiredDefaultDescription
totalWidthnumberYes
headerRowsreadonly TimelineHeaderRowModel[]Yes
nonWorkingHeaderRangesreadonly TimelineHeaderHighlightRange[] | undefinedNo
activeTaskInteractionRangeTimelineTaskInteractionRange | null | undefinedNo
flagLinesreadonly TimelineFlagLine[] | undefinedNo

Related types: TimelineFlagLine, TimelineHeaderHighlightRange, TimelineHeaderRowModel, TimelineTaskInteractionRange

interface

Controls visual overlays and decorations on the Gantt timeline.

export interface GanttVisualConfig {
/** Percent Done task-table rendering. Defaults to `'bar'`. */
readonly percentDoneMode?: GanttPercentDoneColumnMode;
/** Show dependency arrows between task bars. Enabled by default. */
readonly showDependencies?: boolean;
/** Show baseline bars beneath task bars for comparison. */
readonly showBaseline?: boolean;
/** Highlight tasks on the critical path. */
readonly showCriticalPath?: boolean;
/**
* Display task names as labels on timeline bars.
* Omit for regular task/milestone labels only, set `false` to hide built-in labels,
* and set `true` or `'all'` to include summary labels.
*/
readonly showTaskLabels?: boolean | 'tasks' | 'all';
/** Which baseline snapshot to display (defaults to the latest). */
readonly baselineId?: BaselineId;
/** Vertical "today" or status-date line on the timeline. */
readonly projectLineDate?: ISODateString;
/** Highlighted date ranges on the timeline background. */
readonly timeRanges?: readonly GanttTimeRange[];
/** Shade non-working days (weekends, holidays) on the timeline. */
readonly shadeNonWorkingTime?: boolean;
/**
* Show a "today" flag line on the timeline.
* Set to `false` to disable. Enabled by default when not specified.
*/
readonly showTodayLine?: boolean;
/** Custom vertical flag lines on the timeline (e.g. sprint starts, release dates). */
readonly milestoneLines?: readonly GanttMilestoneLine[];
/** Hook to produce custom markers on individual task bars. */
readonly taskMarkerHook?: GanttTaskMarkerHook;
/** Hook to provide per-task bar colours and classes. */
readonly taskBarColorHook?: GanttTaskBarColorHook;
/** Hook to replace or extend the inner content rendered inside task bars. */
readonly taskBarContentHook?: GanttTaskBarContentHook;
/**
* Ordered list of built-in fields shown in task-bar tooltips.
* Omit to show Start, End, Duration, and Complete under the task title.
* An empty array intentionally renders only the task title.
* Use `taskTooltipHook` to replace the body under the title.
*/
readonly taskTooltipFields?: readonly GanttTaskTooltipField[];
/** Hook to override the tooltip content shown for task bars. */
readonly taskTooltipHook?: GanttTaskTooltipHook;
/** Hook to override the tooltip content shown for dependency arrows. */
readonly dependencyTooltipHook?: GanttDependencyTooltipHook;
}
MemberType / returnRequiredDefaultDescription
percentDoneModeGanttPercentDoneColumnMode | undefinedNoPercent Done task-table rendering. Defaults to 'bar'.
showDependenciesboolean | undefinedNoShow dependency arrows between task bars. Enabled by default.
showBaselineboolean | undefinedNoShow baseline bars beneath task bars for comparison.
showCriticalPathboolean | undefinedNoHighlight tasks on the critical path.
showTaskLabelsboolean | "all" | "tasks" | undefinedNoDisplay task names as labels on timeline bars. Omit for regular task/milestone labels only, set false to hide built-in labels, and set true or 'all' to include summary labels.
baselineIdstring | undefinedNoWhich baseline snapshot to display (defaults to the latest).
projectLineDateISODateString | undefinedNoVertical “today” or status-date line on the timeline.
timeRangesreadonly GanttTimeRange[] | undefinedNoHighlighted date ranges on the timeline background.
shadeNonWorkingTimeboolean | undefinedNoShade non-working days (weekends, holidays) on the timeline.
showTodayLineboolean | undefinedNoShow a “today” flag line on the timeline. Set to false to disable. Enabled by default when not specified.
milestoneLinesreadonly GanttMilestoneLine[] | undefinedNoCustom vertical flag lines on the timeline (e.g. sprint starts, release dates).
taskMarkerHookGanttTaskMarkerHook | undefinedNoHook to produce custom markers on individual task bars.
taskBarColorHookGanttTaskBarColorHook | undefinedNoHook to provide per-task bar colours and classes.
taskBarContentHookGanttTaskBarContentHook | undefinedNoHook to replace or extend the inner content rendered inside task bars.
taskTooltipFieldsreadonly GanttTaskTooltipField[] | undefinedNoOrdered list of built-in fields shown in task-bar tooltips. Omit to show Start, End, Duration, and Complete under the task title. An empty array intentionally renders only the task title. Use taskTooltipHook to replace the body under the title.
taskTooltipHookGanttTaskTooltipHook | undefinedNoHook to override the tooltip content shown for task bars.
dependencyTooltipHookGanttDependencyTooltipHook | undefinedNoHook to override the tooltip content shown for dependency arrows.

Related types: BaselineId, GanttDependencyTooltipHook, GanttMilestoneLine, GanttPercentDoneColumnMode, GanttTaskBarColorHook, GanttTaskBarContentHook, GanttTaskMarkerHook, GanttTaskTooltipField, GanttTaskTooltipHook, GanttTimeRange

interface

Detail payload for zoom-set-level events.

export interface GanttZoomSetLevelDetail {
/** The zoom level id to jump to. */
readonly levelId: string;
}
MemberType / returnRequiredDefaultDescription
levelIdstringYesThe zoom level id to jump to.

function

Computes the viewport-relative anchor offset based on the active anchor mode.

export function getAnchorOffset(anchorMode: string, context: TimelineZoomAnchorContext): number;
ParameterTypeRequiredDefaultDescription
anchorModestringYes- The anchor strategy (‘pointer’, ‘center’, or ‘start’).
contextTimelineZoomAnchorContextYes- Current viewport and pointer context.

Returns: Pixel offset from the viewport left edge.

Related types: TimelineZoomAnchorContext

function

Finds a zoom level by its ID.

export function getLevelById(levels: readonly TimelineZoomLevel[], levelId: string | undefined): TimelineZoomLevel | null;
ParameterTypeRequiredDefaultDescription
levelsreadonly TimelineZoomLevel[]Yes- Available zoom levels.
levelIdstring | undefinedYes- ID to search for.

Returns: The matching level, or null if not found.

Related types: TimelineZoomLevel

function

Returns the index of a zoom level by ID, or 0 if not found.

export function getLevelIndex(levels: readonly TimelineZoomLevel[], levelId: string): number;
ParameterTypeRequiredDefaultDescription
levelsreadonly TimelineZoomLevel[]Yes- Available zoom levels.
levelIdstringYes- ID to search for.

Returns: Zero-based index into the levels array.

Related types: TimelineZoomLevel

function

Computes the scroll-left position that places an anchor date at a given viewport offset.

export function getNextScrollLeft(scale: TimelineScale, anchorDate: ISODateString, anchorOffset: number): number;
ParameterTypeRequiredDefaultDescription
scaleTimelineScaleYes- The timeline scale instance.
anchorDateISODateStringYes- ISO date string to anchor.
anchorOffsetnumberYes- Desired pixel offset from the viewport left edge.

Returns: The scroll-left value (minimum 0).

Related types: TimelineScale

function

Computes a start/end date range that encloses all provided dates with padding appropriate for the given zoom level or preset.

export function getProjectTimelineRange(dates: readonly ISODateString[], zoomLevelOrPreset: TimelineZoomLevel | TimelineZoomPreset, options: Pick<TimelineScaleConfig, 'weekStartsOn'> = {}): Pick<TimelineScaleConfig, 'startDate' | 'endDate'>;
ParameterTypeRequiredDefaultDescription
datesreadonly ISODateString[]Yes- Array of ISO date strings to encompass.
zoomLevelOrPresetTimelineZoomLevel | TimelineZoomPresetYes- A zoom level object or preset identifier.
optionsPick<TimelineScaleConfig, "weekStartsOn">No{}

Returns: A { startDate, endDate } range with timeline padding.

Related types: TimelineScaleConfig, TimelineZoomLevel, TimelineZoomPreset

function

Resolves the nearest date-only zoom anchor while preserving existing scale snapping semantics for non-zoom interactions.

export function getZoomAnchorDate(scale: TimelineScale, anchorX: number): ISODateString;
ParameterTypeRequiredDefaultDescription
scaleTimelineScaleYes- The active timeline scale.
anchorXnumberYes- Pixel offset from the timeline origin.

Returns: ISO date string to preserve during zoom.

Related types: TimelineScale

function

Normalizes a header label to the structured {@link TimelineHeaderLabelParts} form.

export function normalizeTimelineHeaderLabel(label: TimelineHeaderLabel): TimelineHeaderLabelParts;
ParameterTypeRequiredDefaultDescription
labelTimelineHeaderLabelYes- A plain string or structured label.

Returns: The label as a { label, subLabel } object.

Related types: TimelineHeaderLabel, TimelineHeaderLabelParts

function

Normalizes a partial zoom config into a fully resolved configuration with defaults applied.

export function normalizeTimelineZoomConfig(config: TimelineZoomConfig | undefined, fallbackLevelId = FALLBACK_ZOOM_LEVEL.id): ResolvedTimelineZoomConfig;
ParameterTypeRequiredDefaultDescription
configTimelineZoomConfig | undefinedYes- Optional user-supplied zoom configuration.
fallbackLevelIdstringNoFALLBACK_ZOOM_LEVEL.id- Level ID to use as the default when the config does not specify one.

Returns: A {@link ResolvedTimelineZoomConfig} with all fields populated.

Related types: ResolvedTimelineZoomConfig, TimelineZoomConfig

function

Projects viewport-relative anchor points for every task bar visible in the current viewport. Used to position dependency arrow endpoints.

export function projectVisibleTaskBarAnchors(projection: VisibleTaskBarProjection): readonly VisibleTaskBarAnchors[];
ParameterTypeRequiredDefaultDescription
projectionVisibleTaskBarProjectionYes- Viewport state and row data needed for the projection.

Returns: An array of {@link VisibleTaskBarAnchors} for each visible task bar.

Related types: VisibleTaskBarAnchors, VisibleTaskBarProjection

function

Render the complete Gantt timeline header with RevoGrid’s native VNode factory.

The caller owns scale calculation, viewport slicing, and state. This function only projects already-resolved geometry into the existing Gantt header DOM.

export function renderGanttTimelineHeader(h: HyperFunc<VNode>, options: GanttTimelineHeaderRenderOptions, additionalElements: readonly VNodeResponse[] = []): VNode;
ParameterTypeRequiredDefaultDescription
hHyperFunc<VNode>Yes
optionsGanttTimelineHeaderRenderOptionsYes
additionalElementsreadonly VNodeResponse[]No[]

Related types: GanttTimelineHeaderRenderOptions

interface

Fully resolved zoom configuration with all defaults applied.

export interface ResolvedTimelineZoomConfig {
/** Whether zoom functionality is enabled. */
readonly enabled: boolean;
/** Ordered list of available zoom levels. */
readonly levels: readonly TimelineZoomLevel[];
/** Active default level ID. */
readonly defaultLevelId: string;
/** Finest allowed level ID. */
readonly minLevelId: string;
/** Coarsest allowed level ID. */
readonly maxLevelId: string;
/** Resolved locale string. */
readonly locale: string;
/** Whether non-working time shading is enabled. */
readonly shadeNonWorkingTime: boolean | undefined;
/** Whether wheel zoom is enabled. */
readonly wheelZoomEnabled: boolean;
/** Required modifier key for wheel zoom. */
readonly wheelZoomTrigger: WheelZoomTrigger;
/** Zoom transition mode. */
readonly wheelZoomMode: TimelineZoomMode;
/** Anchor strategy during zoom. */
readonly zoomAnchorMode: ZoomAnchorMode;
/** Whether wheel direction is inverted. */
readonly invertWheelDirection: boolean;
/** Default header date formatter, if any. */
readonly defaultHeaderFormatter: TimelineDateFormatter | undefined;
}
MemberType / returnRequiredDefaultDescription
enabledbooleanYesWhether zoom functionality is enabled.
levelsreadonly TimelineZoomLevel[]YesOrdered list of available zoom levels.
defaultLevelIdstringYesActive default level ID.
minLevelIdstringYesFinest allowed level ID.
maxLevelIdstringYesCoarsest allowed level ID.
localestringYesResolved locale string.
shadeNonWorkingTimeboolean | undefinedYesWhether non-working time shading is enabled.
wheelZoomEnabledbooleanYesWhether wheel zoom is enabled.
wheelZoomTriggerWheelZoomTriggerYesRequired modifier key for wheel zoom.
wheelZoomModeTimelineZoomModeYesZoom transition mode.
zoomAnchorModeZoomAnchorModeYesAnchor strategy during zoom.
invertWheelDirectionbooleanYesWhether wheel direction is inverted.
defaultHeaderFormatterTimelineDateFormatter | undefinedYesDefault header date formatter, if any.

Related types: TimelineDateFormatter, TimelineZoomLevel, TimelineZoomMode, WheelZoomTrigger, ZoomAnchorMode

function

export function resolveGanttTimelineDateFormatter(project: Pick<GanttPluginConfig, 'timeZone' | 'dateFormats'> | null | undefined, fallbackLocale: string, fallbackFormatter?: TimelineDateFormatter): TimelineDateFormatter | undefined;
ParameterTypeRequiredDefaultDescription
projectPick<GanttPluginConfig, "timeZone" | "dateFormats"> | null | undefinedYes
fallbackLocalestringYes
fallbackFormatterTimelineDateFormatter | undefinedNo

Related types: GanttPluginConfig, TimelineDateFormatter

function

export function resolveHighlightVisibility(zoom: TimelineZoomLevel): Required<TimelineHighlightVisibility>;
ParameterTypeRequiredDefaultDescription
zoomTimelineZoomLevelYes

Related types: TimelineHighlightVisibility, TimelineZoomLevel

interface

export interface ResourceLoadSegment {
readonly id: string;
readonly startDate: string;
readonly endDate: string;
readonly x: number;
readonly width: number;
readonly allocatedUnits: number;
readonly capacityUnits: number;
readonly loadRatio: number;
readonly taskIds: readonly TaskId[];
readonly isOverallocated: boolean;
}
MemberType / returnRequiredDefaultDescription
idstringYes
startDatestringYes
endDatestringYes
xnumberYes
widthnumberYes
allocatedUnitsnumberYes
capacityUnitsnumberYes
loadRationumberYes
taskIdsreadonly string[]Yes
isOverallocatedbooleanYes

Related types: TaskId

interface

export interface ResourcePlanningRowData {
readonly capacityUnits: number;
readonly maxAllocatedUnits: number;
readonly capacityDisplay: 'line' | 'none';
readonly overAllocationDisplay: 'highlight' | 'none';
readonly loadGranularity: 'day' | 'week';
readonly segments: readonly ResourceLoadSegment[];
}
MemberType / returnRequiredDefaultDescription
capacityUnitsnumberYes
maxAllocatedUnitsnumberYes
capacityDisplay"line" | "none"Yes
overAllocationDisplay"none" | "highlight"Yes
loadGranularity"day" | "week"Yes
segmentsreadonly ResourceLoadSegment[]Yes

Related types: ResourceLoadSegment

function

Determines whether a wheel event should trigger a zoom action based on the configured modifier key.

export function shouldHandleWheelTrigger(trigger: WheelZoomTrigger, input: TimelineWheelInput): boolean;
ParameterTypeRequiredDefaultDescription
triggerWheelZoomTriggerYes- The required modifier key.
inputTimelineWheelInputYes- Raw wheel event data.

Returns: true if the trigger condition is met.

Related types: TimelineWheelInput, WheelZoomTrigger

interface

A 2D point in viewport-relative coordinates.

export interface TaskBarAnchorPoint {
/** Horizontal pixel coordinate. */
readonly x: number;
/** Vertical pixel coordinate. */
readonly y: number;
}
MemberType / returnRequiredDefaultDescription
xnumberYesHorizontal pixel coordinate.
ynumberYesVertical pixel coordinate.

interface

export interface TaskGridAssignee {
readonly id: ResourceId;
readonly name: string;
readonly initials: string;
readonly role: string;
readonly allocationUnits: number;
readonly color: string;
}
MemberType / returnRequiredDefaultDescription
idstringYes
namestringYes
initialsstringYes
rolestringYes
allocationUnitsnumberYes
colorstringYes

Related types: ResourceId

type

export type TaskRowDiagnostics = Pick<SchedulingResult, 'conflicts' | 'issues'>;

Related types: SchedulingResult

interface

Options controlling which optional data layers are included in the task row projection.

export interface TaskRowProjectionOptions {
/** Show baseline overlay bars when baseline data is available. */
readonly showBaseline?: boolean;
/** Highlight tasks on the critical path. */
readonly showCriticalPath?: boolean;
/** Render inline task name labels on Gantt bars. Defaults to regular task/milestone labels only. */
readonly showTaskLabels?: GanttTaskLabelMode;
/** Specific baseline snapshot to compare against. Uses the latest baseline when omitted. */
readonly baselineId?: BaselineId;
/** Hook to inject custom point markers onto task rows. */
readonly taskMarkerHook?: GanttTaskMarkerHook;
/** Resource filter ids are applied as grid trims, not during projection. */
readonly resourceFilterIds?: readonly ResourceId[];
/** When enabled, project resource rows and allocation load bars instead of task rows. */
readonly resourcePlanning?: GanttResourcePlanningConfig;
}
MemberType / returnRequiredDefaultDescription
showBaselineboolean | undefinedNoShow baseline overlay bars when baseline data is available.
showCriticalPathboolean | undefinedNoHighlight tasks on the critical path.
showTaskLabelsGanttTaskLabelMode | undefinedNoRender inline task name labels on Gantt bars. Defaults to regular task/milestone labels only.
baselineIdstring | undefinedNoSpecific baseline snapshot to compare against. Uses the latest baseline when omitted.
taskMarkerHookGanttTaskMarkerHook | undefinedNoHook to inject custom point markers onto task rows.
resourceFilterIdsreadonly string[] | undefinedNoResource filter ids are applied as grid trims, not during projection.
resourcePlanningGanttResourcePlanningConfig | undefinedNoWhen enabled, project resource rows and allocation load bars instead of task rows.

Related types: BaselineId, GanttResourcePlanningConfig, GanttTaskLabelMode, GanttTaskMarkerHook, ResourceId

constant

Built-in set of zoom presets ordered from finest (15-minute) to coarsest (multi-year).

export const TIMELINE_ZOOM_PRESET_LEVELS: readonly TimelineZoomLevel[];

Related types: TimelineZoomLevel

interface

A grouping band cell on an upper row of the timeline header.

export interface TimelineBand {
/** Unique key for reconciliation. */
readonly key: string;
/** Start date of the band interval (ISO string). */
readonly startDate: ISODateString;
/** End date of the band interval (ISO string). */
readonly endDate: ISODateString;
/** Horizontal pixel offset from the timeline origin. */
readonly x: number;
/** Pixel width of the band cell. */
readonly width: number;
/** Display label. */
readonly label: string;
}
MemberType / returnRequiredDefaultDescription
keystringYesUnique key for reconciliation.
startDateISODateStringYesStart date of the band interval (ISO string).
endDateISODateStringYesEnd date of the band interval (ISO string).
xnumberYesHorizontal pixel offset from the timeline origin.
widthnumberYesPixel width of the band cell.
labelstringYesDisplay label.

type

Calendar unit used for the grouping band row (excludes ‘day’).

export type TimelineBandUnit = Exclude<TimelineUnit, 'minute'>;

type

Custom formatter function used to produce the label for a single timeline header cell.

export type TimelineDateFormatter = (
startDate: ISODateString,
endDate: ISODateString,
context: TimelineDateFormatterContext,
) => TimelineHeaderLabel;

Returns: A label string or structured label parts.

Related types: TimelineDateFormatterContext, TimelineHeaderLabel

interface

Context passed to a custom date formatter when rendering a timeline header cell.

export interface TimelineDateFormatterContext {
/** Zoom level identifier that owns this header. */
readonly levelId: string;
/** Identifier of the header row being rendered. */
readonly rowId: string;
/** Calendar unit of this header row. */
readonly unit: TimelineUnit;
/** Number of units each cell spans. */
readonly count: number;
/** Active locale string (e.g. "en-US"). */
readonly locale: string;
/** Zero-based index of this row within the header stack. */
readonly rowIndex: number;
/** Whether this is the bottom (leaf / tick) row. */
readonly isLeafRow: boolean;
}
MemberType / returnRequiredDefaultDescription
levelIdstringYesZoom level identifier that owns this header.
rowIdstringYesIdentifier of the header row being rendered.
unitTimelineUnitYesCalendar unit of this header row.
countnumberYesNumber of units each cell spans.
localestringYesActive locale string (e.g. “en-US”).
rowIndexnumberYesZero-based index of this row within the header stack.
isLeafRowbooleanYesWhether this is the bottom (leaf / tick) row.

interface

A flag label positioned inside the timeline header.

export interface TimelineFlagLine {
readonly id: string;
/** Absolute X position in the full timeline (px from timeline start). */
readonly dateX: number;
readonly label: string;
readonly color?: string;
readonly kind: 'today' | 'milestone';
}
MemberType / returnRequiredDefaultDescription
idstringYes
dateXnumberYesAbsolute X position in the full timeline (px from timeline start).
labelstringYes
colorstring | undefinedNo
kind"milestone" | "today"Yes

interface

A single rendered cell within a timeline header row.

export interface TimelineHeaderCell {
/** Unique key for React/framework reconciliation. */
readonly key: string;
/** Start date of the interval this cell covers (ISO string). */
readonly startDate: ISODateString;
/** End date (inclusive) of the interval this cell covers (ISO string). */
readonly endDate: ISODateString;
/** Horizontal pixel offset from the timeline origin. */
readonly x: number;
/** Pixel width of the cell. */
readonly width: number;
/** Primary display text. */
readonly label: string;
/** Secondary display text (may be empty). */
readonly subLabel: string;
}
MemberType / returnRequiredDefaultDescription
keystringYesUnique key for React/framework reconciliation.
startDateISODateStringYesStart date of the interval this cell covers (ISO string).
endDateISODateStringYesEnd date (inclusive) of the interval this cell covers (ISO string).
xnumberYesHorizontal pixel offset from the timeline origin.
widthnumberYesPixel width of the cell.
labelstringYesPrimary display text.
subLabelstringYesSecondary display text (may be empty).

interface

Date interval marked as non-working for timeline header cells.

export interface TimelineHeaderHighlightRange {
readonly id: string;
readonly startDate: ISODateString;
readonly endDate: ISODateString;
readonly left: number;
readonly width: number;
}
MemberType / returnRequiredDefaultDescription
idstringYes
startDateISODateStringYes
endDateISODateStringYes
leftnumberYes
widthnumberYes

type

A header cell label — either a plain string or a structured label with sub-text.

export type TimelineHeaderLabel = string | TimelineHeaderLabelParts;

Related types: TimelineHeaderLabelParts

interface

Structured label with an optional secondary line for timeline header cells.

export interface TimelineHeaderLabelParts {
/** Primary display text. */
readonly label: string;
/** Optional secondary text rendered below or beside the label. */
readonly subLabel?: string;
}
MemberType / returnRequiredDefaultDescription
labelstringYesPrimary display text.
subLabelstring | undefinedNoOptional secondary text rendered below or beside the label.

interface

Configuration for a single row in the timeline header stack.

export interface TimelineHeaderRowConfig {
/** Unique identifier for this header row. */
readonly id: string;
/** Calendar unit this row represents. */
readonly unit: TimelineUnit;
/** Number of units each cell spans (defaults to 1). */
readonly count?: number;
/** Optional custom formatter overriding the default label logic. */
readonly formatter?: TimelineDateFormatter;
}
MemberType / returnRequiredDefaultDescription
idstringYesUnique identifier for this header row.
unitTimelineUnitYesCalendar unit this row represents.
countnumber | undefinedNoNumber of units each cell spans (defaults to 1).
formatterTimelineDateFormatter | undefinedNoOptional custom formatter overriding the default label logic.

Related types: TimelineDateFormatter

interface

Fully resolved model for a single header row, including its computed cells.

export interface TimelineHeaderRowModel {
/** Identifier matching the originating {@link TimelineHeaderRowConfig.id}. */
readonly id: string;
/** Calendar unit of this row. */
readonly unit: TimelineUnit;
/** Number of units each cell spans. */
readonly count: number;
/** Ordered array of rendered header cells. */
readonly cells: readonly TimelineHeaderCell[];
}
MemberType / returnRequiredDefaultDescription
idstringYesIdentifier matching the originating {@link TimelineHeaderRowConfig.id}.
unitTimelineUnitYesCalendar unit of this row.
countnumberYesNumber of units each cell spans.
cellsreadonly TimelineHeaderCell[]YesOrdered array of rendered header cells.

Related types: TimelineHeaderCell, TimelineHeaderRowConfig

interface

export interface TimelineHighlightVisibility {
weekends?: boolean;
holidays?: boolean;
}
MemberType / returnRequiredDefaultDescription
weekendsboolean | undefinedNo
holidaysboolean | undefinedNo

interface

Core abstraction for converting between dates and pixel positions on the Gantt timeline. Provides tick/band generation and header row models.

export interface TimelineScale {
/** First date of the timeline range (ISO string). */
readonly startDate: ISODateString;
/** Last date of the timeline range (ISO string). */
readonly endDate: ISODateString;
/** Zoom level configuration that produced this scale. */
readonly zoomLevel: TimelineZoomLevel;
/** Calendar unit of the leaf tick row. */
readonly tickUnit: TimelineTickUnit;
/** Number of calendar units per tick cell. */
readonly tickCount: number;
/** Pixel width of a single tick cell. */
readonly tickWidth: number;
/** Total pixel width of the entire timeline. */
readonly totalWidth: number;
/**
* Converts a date to a horizontal pixel offset.
* @param date - ISO date string.
*/
dateToX(date: ISODateString): number;
/**
* Converts a horizontal pixel offset to the nearest date.
* @param x - Pixel offset from the timeline origin.
*/
xToDate(x: number): ISODateString;
/** Returns all tick cells across the full timeline range. */
getTicks(): readonly TimelineTick[];
/**
* Returns tick cells visible within the given horizontal viewport slice.
* @param startX - Left edge pixel offset.
* @param viewportWidth - Width of the visible area.
*/
getVisibleTicks(startX: number, viewportWidth: number, overscanPx?: number): readonly TimelineTick[];
/** Returns all band (grouping) cells. */
getBands(): readonly TimelineBand[];
/** Returns the computed header row models for rendering. */
getHeaderRows(): readonly TimelineHeaderRowModel[];
/**
* Returns header row models intersecting the given viewport slice.
* @param startX - Left edge pixel offset.
* @param viewportWidth - Width of the visible area.
* @param overscanPx - Extra pixels to include on both sides.
*/
getVisibleHeaderRows(startX: number, viewportWidth: number, overscanPx?: number): readonly TimelineHeaderRowModel[];
/**
* Returns the date range visible within the given horizontal viewport slice.
* @param startX - Left edge pixel offset.
* @param viewportWidth - Width of the visible area.
*/
getVisibleRange(startX: number, viewportWidth: number): TimelineVisibleDateRange;
}
MemberType / returnRequiredDefaultDescription
startDateISODateStringYesFirst date of the timeline range (ISO string).
endDateISODateStringYesLast date of the timeline range (ISO string).
zoomLevelTimelineZoomLevelYesZoom level configuration that produced this scale.
tickUnitTimelineUnitYesCalendar unit of the leaf tick row.
tickCountnumberYesNumber of calendar units per tick cell.
tickWidthnumberYesPixel width of a single tick cell.
totalWidthnumberYesTotal pixel width of the entire timeline.
dateToX(date: ISODateString)numberYesConverts a date to a horizontal pixel offset.
xToDate(x: number)ISODateStringYesConverts a horizontal pixel offset to the nearest date.
getTicks()readonly TimelineTick[]YesReturns all tick cells across the full timeline range.
getVisibleTicks(startX: number, viewportWidth: number, overscanPx?: number)readonly TimelineTick[]YesReturns tick cells visible within the given horizontal viewport slice.
getBands()readonly TimelineBand[]YesReturns all band (grouping) cells.
getHeaderRows()readonly TimelineHeaderRowModel[]YesReturns the computed header row models for rendering.
getVisibleHeaderRows(startX: number, viewportWidth: number, overscanPx?: number)readonly TimelineHeaderRowModel[]YesReturns header row models intersecting the given viewport slice.
getVisibleRange(startX: number, viewportWidth: number)TimelineVisibleDateRangeYesReturns the date range visible within the given horizontal viewport slice.

Related types: TimelineBand, TimelineHeaderRowModel, TimelineTick, TimelineTickUnit, TimelineVisibleDateRange, TimelineZoomLevel

interface

Configuration used to construct a {@link TimelineScale} instance.

export interface TimelineScaleConfig {
/** Project timeline start date (ISO string). */
readonly startDate: ISODateString;
/** Project timeline end date (ISO string). */
readonly endDate: ISODateString;
/** Optional zoom level identifier to look up in the default levels. */
readonly levelId?: string;
/** Calendar unit for the leaf tick row (overrides zoom level when set). */
readonly tickUnit?: TimelineTickUnit;
/** Number of tick units each cell spans. */
readonly tickCount?: number;
/** Calendar unit for the grouping band row. */
readonly bandUnit?: TimelineBandUnit;
/** Pixel width of a single tick cell. */
readonly tickWidth: number;
/** Header row definitions (overrides zoom level rows when set). */
readonly headerRows?: readonly TimelineHeaderRowConfig[];
/** Per-scale highlight overrides inherited by the resolved zoom level. */
readonly highlightVisibility?: TimelineHighlightVisibility;
/** Locale string for date formatting (defaults to "en-US"). */
readonly locale?: string;
/** Fallback date formatter applied when no row-level formatter is set. */
readonly defaultHeaderFormatter?: TimelineDateFormatter;
/** First day of week for weekly timeline cells. `0` is Sunday and `1` is Monday. Defaults to Sunday. */
readonly weekStartsOn?: TimelineWeekStartsOn;
}
MemberType / returnRequiredDefaultDescription
startDateISODateStringYesProject timeline start date (ISO string).
endDateISODateStringYesProject timeline end date (ISO string).
levelIdstring | undefinedNoOptional zoom level identifier to look up in the default levels.
tickUnitTimelineUnit | undefinedNoCalendar unit for the leaf tick row (overrides zoom level when set).
tickCountnumber | undefinedNoNumber of tick units each cell spans.
bandUnitTimelineBandUnit | undefinedNoCalendar unit for the grouping band row.
tickWidthnumberYesPixel width of a single tick cell.
headerRowsreadonly TimelineHeaderRowConfig[] | undefinedNoHeader row definitions (overrides zoom level rows when set).
highlightVisibilityTimelineHighlightVisibility | undefinedNoPer-scale highlight overrides inherited by the resolved zoom level.
localestring | undefinedNoLocale string for date formatting (defaults to “en-US”).
defaultHeaderFormatterTimelineDateFormatter | undefinedNoFallback date formatter applied when no row-level formatter is set.
weekStartsOnTimelineWeekStartsOn | undefinedNoFirst day of week for weekly timeline cells. 0 is Sunday and 1 is Monday. Defaults to Sunday.

Related types: TimelineBandUnit, TimelineDateFormatter, TimelineHeaderRowConfig, TimelineHighlightVisibility, TimelineTickUnit

interface

Absolute timeline range occupied by an active task-bar focus/move/resize state.

export interface TimelineTaskInteractionRange {
readonly taskId: TaskId;
readonly interaction: 'focus' | 'move' | 'resize';
readonly kind: 'task' | 'summary' | 'milestone';
readonly left: number;
readonly width: number;
readonly valid: boolean;
}
MemberType / returnRequiredDefaultDescription
taskIdstringYes
interaction"move" | "resize" | "focus"Yes
kind"summary" | "task" | "milestone"Yes
leftnumberYes
widthnumberYes
validbooleanYes

Related types: TaskId

interface

A single tick cell on the leaf row of the timeline.

export interface TimelineTick {
/** Unique key for reconciliation. */
readonly key: string;
/** Start date of the tick interval (ISO string). */
readonly startDate: ISODateString;
/** End date of the tick interval (ISO string). */
readonly endDate: ISODateString;
/** Horizontal pixel offset from the timeline origin. */
readonly x: number;
/** Pixel width of the tick cell. */
readonly width: number;
/** Primary display label. */
readonly label: string;
/** Secondary display label. */
readonly subLabel: string;
}
MemberType / returnRequiredDefaultDescription
keystringYesUnique key for reconciliation.
startDateISODateStringYesStart date of the tick interval (ISO string).
endDateISODateStringYesEnd date of the tick interval (ISO string).
xnumberYesHorizontal pixel offset from the timeline origin.
widthnumberYesPixel width of the tick cell.
labelstringYesPrimary display label.
subLabelstringYesSecondary display label.

type

Calendar unit used for the leaf-level tick grid.

export type TimelineTickUnit = TimelineUnit;

interface

A start/end date range representing the currently visible portion of the timeline.

export interface TimelineVisibleDateRange {
/** First visible date (ISO string). */
readonly startDate: ISODateString;
/** Last visible date (ISO string). */
readonly endDate: ISODateString;
}
MemberType / returnRequiredDefaultDescription
startDateISODateStringYesFirst visible date (ISO string).
endDateISODateStringYesLast visible date (ISO string).

interface

Describes a time span used for minimum/maximum visible range constraints.

export interface TimelineVisibleSpan {
/** Calendar unit of the span. */
readonly unit: 'minute' | 'hour' | 'day' | 'month' | 'year';
/** Number of units. */
readonly value: number;
}
MemberType / returnRequiredDefaultDescription
unit"minute" | "hour" | "day" | "month" | "year"YesCalendar unit of the span.
valuenumberYesNumber of units.

interface

Raw wheel event data used to determine zoom direction and trigger eligibility.

export interface TimelineWheelInput {
/** Vertical scroll delta from the wheel event. */
readonly deltaY: number;
/** Whether the Ctrl key was held. */
readonly ctrlKey?: boolean;
/** Whether the Meta (Cmd) key was held. */
readonly metaKey?: boolean;
/** Whether the Alt key was held. */
readonly altKey?: boolean;
/** Whether the Shift key was held. */
readonly shiftKey?: boolean;
}
MemberType / returnRequiredDefaultDescription
deltaYnumberYesVertical scroll delta from the wheel event.
ctrlKeyboolean | undefinedNoWhether the Ctrl key was held.
metaKeyboolean | undefinedNoWhether the Meta (Cmd) key was held.
altKeyboolean | undefinedNoWhether the Alt key was held.
shiftKeyboolean | undefinedNoWhether the Shift key was held.

interface

Viewport and pointer context used to calculate the zoom anchor position.

export interface TimelineZoomAnchorContext {
/** Active timeline scale instance. */
readonly scale: TimelineScale;
/** Current horizontal scroll offset in pixels. */
readonly scrollLeft: number;
/** Width of the visible viewport in pixels. */
readonly viewportWidth: number;
/** Left edge of the viewport element in client coordinates (for pointer anchor). */
readonly viewportClientLeft?: number;
/** Pointer X position in client coordinates (for pointer anchor). */
readonly pointerClientX?: number;
}
MemberType / returnRequiredDefaultDescription
scaleTimelineScaleYesActive timeline scale instance.
scrollLeftnumberYesCurrent horizontal scroll offset in pixels.
viewportWidthnumberYesWidth of the visible viewport in pixels.
viewportClientLeftnumber | undefinedNoLeft edge of the viewport element in client coordinates (for pointer anchor).
pointerClientXnumber | undefinedNoPointer X position in client coordinates (for pointer anchor).

Related types: TimelineScale

interface

User-facing zoom configuration. All fields are optional and fall back to sensible defaults.

export interface TimelineZoomConfig {
/** Whether zoom functionality is enabled. */
readonly enabled?: boolean;
/** Ordered list of zoom levels from finest to coarsest. */
readonly levels?: readonly TimelineZoomLevel[];
/** Level ID to activate initially. */
readonly defaultLevelId?: string;
/** Finest (most detailed) level ID allowed. */
readonly minLevelId?: string;
/** Coarsest level ID allowed. */
readonly maxLevelId?: string;
/** Locale string for date formatting (e.g. "en-US"). */
readonly locale?: string;
/** Whether to shade non-working time columns. */
readonly shadeNonWorkingTime?: boolean;
/** Whether mouse wheel zoom is enabled. */
readonly wheelZoomEnabled?: boolean;
/** Modifier key required for wheel zoom. */
readonly wheelZoomTrigger?: WheelZoomTrigger;
/** Zoom transition mode. */
readonly wheelZoomMode?: TimelineZoomMode;
/** Anchor strategy during zoom transitions. */
readonly zoomAnchorMode?: ZoomAnchorMode;
/** Whether to invert the wheel scroll direction for zoom. */
readonly invertWheelDirection?: boolean;
/** Fallback date formatter for header cells. */
readonly defaultHeaderFormatter?: TimelineDateFormatter;
}
MemberType / returnRequiredDefaultDescription
enabledboolean | undefinedNoWhether zoom functionality is enabled.
levelsreadonly TimelineZoomLevel[] | undefinedNoOrdered list of zoom levels from finest to coarsest.
defaultLevelIdstring | undefinedNoLevel ID to activate initially.
minLevelIdstring | undefinedNoFinest (most detailed) level ID allowed.
maxLevelIdstring | undefinedNoCoarsest level ID allowed.
localestring | undefinedNoLocale string for date formatting (e.g. “en-US”).
shadeNonWorkingTimeboolean | undefinedNoWhether to shade non-working time columns.
wheelZoomEnabledboolean | undefinedNoWhether mouse wheel zoom is enabled.
wheelZoomTriggerWheelZoomTrigger | undefinedNoModifier key required for wheel zoom.
wheelZoomModeTimelineZoomMode | undefinedNoZoom transition mode.
zoomAnchorModeZoomAnchorMode | undefinedNoAnchor strategy during zoom transitions.
invertWheelDirectionboolean | undefinedNoWhether to invert the wheel scroll direction for zoom.
defaultHeaderFormatterTimelineDateFormatter | undefinedNoFallback date formatter for header cells.

Related types: TimelineDateFormatter, TimelineZoomLevel, TimelineZoomMode, WheelZoomTrigger, ZoomAnchorMode

class

Manages the active zoom level and zoom transitions for the Gantt timeline. Provides discrete zoom-in/out operations, level selection, and anchor-based scroll position computation to maintain visual continuity across zoom changes.

export class TimelineZoomController {
constructor(config?: TimelineZoomConfig, fallbackLevelId?: string);
setConfig(config?: TimelineZoomConfig, fallbackLevelId?: string): void;
getConfig(): ResolvedTimelineZoomConfig;
getZoomLevel(): TimelineZoomLevel;
getVisibleRange(): { startDate: ISODateString; endDate: ISODateString } | null;
updateVisibleRange(scale: TimelineScale, scrollLeft: number, viewportWidth: number): { startDate: ISODateString; endDate: ISODateString };
canZoomIn(): boolean;
canZoomOut(): boolean;
zoomIn(): boolean;
zoomOut(): boolean;
setZoomLevel(levelId: string): boolean;
createZoomTransition(nextLevelId: string, context: TimelineZoomAnchorContext): TimelineZoomTransition | null;
resolveAnchoredScrollLeft(scale: TimelineScale, anchorDate: ISODateString, anchorOffset: number): number;
}
MemberType / returnRequiredDefaultDescription
configResolvedTimelineZoomConfigYes
activeLevelIdstringYes
visibleRange{ startDate: ISODateString; endDate: ISODateString; } | nullYesnull
setConfig(config?: TimelineZoomConfig, fallbackLevelId?: string)voidYesReplaces the zoom configuration, preserving the current level when possible.
getConfig()ResolvedTimelineZoomConfigYesReturns the resolved zoom configuration.
getZoomLevel()TimelineZoomLevelYesReturns the currently active zoom level.
getVisibleRange(){ startDate: ISODateString; endDate: ISODateString } | nullYesReturns the last computed visible date range, or null if not yet updated.
updateVisibleRange(scale: TimelineScale, scrollLeft: number, viewportWidth: number){ startDate: ISODateString; endDate: ISODateString }YesRecalculates and caches the visible date range from the current scroll position.
canZoomIn()booleanYesReturns true if zooming in (finer detail) is possible.
canZoomOut()booleanYesReturns true if zooming out (coarser detail) is possible.
zoomIn()booleanYesZooms in one level. Returns true if the level changed.
zoomOut()booleanYesZooms out one level. Returns true if the level changed.
setZoomLevel(levelId: string)booleanYesJumps to a specific zoom level by ID.
createZoomTransition(nextLevelId: string, context: TimelineZoomAnchorContext)TimelineZoomTransition | nullYesPrepares a zoom transition descriptor that can be applied to update the scroll position so the anchor date stays visually stable.
resolveAnchoredScrollLeft(scale: TimelineScale, anchorDate: ISODateString, anchorOffset: number)numberYesComputes the scroll-left position that keeps an anchor date at a fixed viewport offset.
setLevelByIndex(index: number)booleanYes

Related types: ResolvedTimelineZoomConfig, TimelineScale, TimelineZoomAnchorContext, TimelineZoomConfig, TimelineZoomLevel, TimelineZoomTransition

interface

Definition of a single zoom level, specifying tick granularity and header layout.

export interface TimelineZoomLevel {
/** Unique level identifier (e.g. "day-week"). */
readonly id: string;
/** Calendar unit for the leaf tick row. */
readonly tickUnit: TimelineUnit;
/** Number of tick units per cell (defaults to 1). */
readonly tickCount?: number;
/** Pixel width of a single tick cell. */
readonly tickWidth: number;
/** Header row definitions for this level. */
readonly headerRows: readonly TimelineHeaderRowConfig[];
/** Optional minimum visible time span constraint. */
readonly minVisibleSpan?: TimelineVisibleSpan;
/** Optional maximum visible time span constraint. */
readonly maxVisibleSpan?: TimelineVisibleSpan;
/** Human-readable label for UI display. */
readonly label?: string;
/**
* Per-zoom-level highlight overrides.
*/
highlightVisibility?: TimelineHighlightVisibility;
}
MemberType / returnRequiredDefaultDescription
idstringYesUnique level identifier (e.g. “day-week”).
tickUnitTimelineUnitYesCalendar unit for the leaf tick row.
tickCountnumber | undefinedNoNumber of tick units per cell (defaults to 1).
tickWidthnumberYesPixel width of a single tick cell.
headerRowsreadonly TimelineHeaderRowConfig[]YesHeader row definitions for this level.
minVisibleSpanTimelineVisibleSpan | undefinedNoOptional minimum visible time span constraint.
maxVisibleSpanTimelineVisibleSpan | undefinedNoOptional maximum visible time span constraint.
labelstring | undefinedNoHuman-readable label for UI display.
highlightVisibilityTimelineHighlightVisibility | undefinedNoPer-zoom-level highlight overrides.

Related types: TimelineHeaderRowConfig, TimelineHighlightVisibility, TimelineVisibleSpan

type

Strategy for transitioning between zoom levels.

export type TimelineZoomMode = 'discrete' | 'smooth-discrete';

interface

Describes a pending zoom level transition, including the anchor date used to preserve scroll position.

export interface TimelineZoomTransition {
/** Zoom level before the transition. */
readonly previousLevel: TimelineZoomLevel;
/** Zoom level after the transition. */
readonly nextLevel: TimelineZoomLevel;
/** Date that should remain at the anchor offset after zoom. */
readonly anchorDate: ISODateString;
/** Pixel offset from the viewport left where the anchor date should appear. */
readonly anchorOffset: number;
/** Scroll-left at the time the transition was initiated. */
readonly scrollLeft: number;
}
MemberType / returnRequiredDefaultDescription
previousLevelTimelineZoomLevelYesZoom level before the transition.
nextLevelTimelineZoomLevelYesZoom level after the transition.
anchorDateISODateStringYesDate that should remain at the anchor offset after zoom.
anchorOffsetnumberYesPixel offset from the viewport left where the anchor date should appear.
scrollLeftnumberYesScroll-left at the time the transition was initiated.

Related types: TimelineZoomLevel

interface

Viewport-relative anchor points and bounds for a visible task bar, used for dependency line routing.

export interface VisibleTaskBarAnchors {
/** Identifier of the task this anchor set belongs to. */
readonly taskId: TaskId;
/** Row index of the task within the data source. */
readonly rowIndex: number;
/** Top edge of the row in viewport pixels. */
readonly top: number;
/** Bottom edge of the row in viewport pixels. */
readonly bottom: number;
/** Left edge of the bar in viewport pixels. */
readonly left: number;
/** Right edge of the bar in viewport pixels. */
readonly right: number;
/** Anchor point at the start (left) side of the bar, offset for dependency arrows. */
readonly start: TaskBarAnchorPoint;
/** Anchor point at the end (right) side of the bar, offset for dependency arrows. */
readonly end: TaskBarAnchorPoint;
/** Anchor point centered above the bar. */
readonly topCenter: TaskBarAnchorPoint;
/** Anchor point centered below the bar. */
readonly bottomCenter: TaskBarAnchorPoint;
}
MemberType / returnRequiredDefaultDescription
taskIdstringYesIdentifier of the task this anchor set belongs to.
rowIndexnumberYesRow index of the task within the data source.
topnumberYesTop edge of the row in viewport pixels.
bottomnumberYesBottom edge of the row in viewport pixels.
leftnumberYesLeft edge of the bar in viewport pixels.
rightnumberYesRight edge of the bar in viewport pixels.
startTaskBarAnchorPointYesAnchor point at the start (left) side of the bar, offset for dependency arrows.
endTaskBarAnchorPointYesAnchor point at the end (right) side of the bar, offset for dependency arrows.
topCenterTaskBarAnchorPointYesAnchor point centered above the bar.
bottomCenterTaskBarAnchorPointYesAnchor point centered below the bar.

Related types: TaskBarAnchorPoint, TaskId

interface

Input data required to project visible task bar anchors within the current viewport.

export interface VisibleTaskBarProjection {
/** All task grid rows (full dataset). */
readonly rows: readonly GanttGridRow[];
/** Virtual position items describing which rows are currently visible. */
readonly viewportRows: readonly VirtualPositionItem[];
/** Current horizontal scroll offset in pixels. */
readonly scrollLeft: number;
/** Current vertical scroll offset in pixels. */
readonly scrollTop: number;
/** Width of the visible viewport in pixels. */
readonly viewportWidth: number;
/** Height of the visible viewport in pixels. */
readonly viewportHeight: number;
/** Keep anchors outside the viewport for overlay routes that cross the visible frame. */
readonly includeOffscreenRows?: boolean;
/** Optional transient task-bar geometry while a visible bar is actively moved or resized. */
readonly activeTaskInteractionRange?: {
readonly taskId: TaskId;
readonly kind: 'task' | 'summary' | 'milestone';
readonly left: number;
readonly width: number;
} | null;
}
MemberType / returnRequiredDefaultDescription
rowsreadonly GanttGridRow[]YesAll task grid rows (full dataset).
viewportRowsreadonly VirtualPositionItem[]YesVirtual position items describing which rows are currently visible.
scrollLeftnumberYesCurrent horizontal scroll offset in pixels.
scrollTopnumberYesCurrent vertical scroll offset in pixels.
viewportWidthnumberYesWidth of the visible viewport in pixels.
viewportHeightnumberYesHeight of the visible viewport in pixels.
includeOffscreenRowsboolean | undefinedNoKeep anchors outside the viewport for overlay routes that cross the visible frame.
activeTaskInteractionRange{ readonly taskId: TaskId; readonly kind: "task" | "summary" | "milestone"; readonly left: number; readonly width: number; } | null | undefinedNoOptional transient task-bar geometry while a visible bar is actively moved or resized.

Related types: GanttGridRow, TaskId

type

Modifier key that must be held to trigger wheel-based zoom.

export type WheelZoomTrigger = 'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey' | 'none';

type

Anchor strategy determining which viewport position stays fixed during zoom.

export type ZoomAnchorMode = 'pointer' | 'center' | 'start';