Timeline And Visuals
This page documents 79 public symbols exported by @revolist/revogrid-enterprise.
buildWbsMap
Section titled “buildWbsMap”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>;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
rows | readonly 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
clampLevelIndex
Section titled “clampLevelIndex”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;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
levels | readonly TimelineZoomLevel[] | Yes | — | - Available zoom levels. |
index | number | Yes | — | - Proposed level index. |
minLevelId | string | Yes | — | - Finest allowed level ID. |
maxLevelId | string | Yes | — | - Coarsest allowed level ID. |
Returns: The clamped index.
Related types: TimelineZoomLevel
createBaselineBarLayout
Section titled “createBaselineBarLayout”function
Computes the pixel layout for a baseline bar overlay.
export function createBaselineBarLayout(startDate: ISODateString, endDate: ISODateString, scale: TimelineScale): GanttBaselineLayout;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
startDate | ISODateString | Yes | — | - Baseline start date (ISO string). |
endDate | ISODateString | Yes | — | - Baseline end date (ISO string). |
scale | TimelineScale | Yes | — | - The active timeline scale. |
Returns: A {@link GanttBaselineLayout} with x and width in pixels.
Related types: GanttBaselineLayout, TimelineScale
createGanttBarLayout
Section titled “createGanttBarLayout”function
Computes the pixel layout for a scheduled task’s Gantt bar.
export function createGanttBarLayout(task: ScheduledTask, scale: TimelineScale, showCriticalPath = true): GanttBarLayout;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
task | ScheduledTask | Yes | — | - The engine-scheduled task with dates, type, and progress. |
scale | TimelineScale | Yes | — | - The active timeline scale used to convert dates to pixel positions. |
showCriticalPath | boolean | No | true | - 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
createIndicatorLayout
Section titled “createIndicatorLayout”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;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | - Unique identifier for the indicator. |
date | ISODateString | Yes | — | - The date the indicator marks. |
kind | "constraint" | "deadline" | "custom" | Yes | — | - Category of the indicator (deadline, constraint, or custom). |
scale | TimelineScale | Yes | — | - The active timeline scale. |
label | string | undefined | No | — | - Optional display label. |
className | string | undefined | No | — | - Optional CSS class name. |
Returns: A {@link GanttIndicatorLayout} positioned on the timeline.
Related types: GanttIndicatorLayout, TimelineScale
createTimelineDateFormatContext
Section titled “createTimelineDateFormatContext”function
export function createTimelineDateFormatContext(project: Pick<GanttPluginConfig, 'timeZone' | 'dateFormats'> | null | undefined, timelineContext: TimelineDateFormatterContext): GanttDateFormatContext;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project | Pick<GanttPluginConfig, "timeZone" | "dateFormats"> | null | undefined | Yes | — | |
timelineContext | TimelineDateFormatterContext | Yes | — |
Related types: GanttDateFormatContext, GanttPluginConfig, TimelineDateFormatterContext
createTimelineScale
Section titled “createTimelineScale”function
Creates a {@link TimelineScale} from the given configuration.
export function createTimelineScale(config: TimelineScaleConfig): TimelineScale;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
config | TimelineScaleConfig | Yes | — | - Scale configuration specifying date range, tick unit, and header rows. |
Returns: A fully initialized timeline scale instance.
Related types: TimelineScale, TimelineScaleConfig
DEFAULT_SMOOTH_WHEEL_THRESHOLD
Section titled “DEFAULT_SMOOTH_WHEEL_THRESHOLD”constant
Pixel threshold for accumulated smooth-wheel deltas before triggering a zoom step.
export const DEFAULT_SMOOTH_WHEEL_THRESHOLD: 96;DEFAULT_TIMELINE_ZOOM_LEVELS
Section titled “DEFAULT_TIMELINE_ZOOM_LEVELS”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
FALLBACK_ZOOM_LEVEL
Section titled “FALLBACK_ZOOM_LEVEL”constant
Default zoom level used when no level is configured.
export const FALLBACK_ZOOM_LEVEL: TimelineZoomLevel;Related types: TimelineZoomLevel
GanttBarKind
Section titled “GanttBarKind”type
Discriminator for the visual shape of a Gantt bar.
export type GanttBarKind = 'task' | 'summary' | 'milestone';GanttBarLayout
Section titled “GanttBarLayout”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[];}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
kind | GanttBarKind | Yes | — | Visual shape type of the bar. |
x | number | Yes | — | Horizontal pixel offset from the timeline origin. |
width | number | Yes | — | Pixel width of the bar (minimum-clamped). |
progressWidth | number | Yes | — | Pixel width of the filled progress portion inside the bar. |
milestoneCenterX | number | Yes | — | Horizontal center X used for milestone diamond rendering. |
isCritical | boolean | Yes | — | Whether this task lies on the critical path. |
totalSlackDays | number | Yes | — | Total slack (float) available before the task delays the project. |
splitGaps | readonly GanttSplitGapLayout[] | Yes | — | Visual task split gaps inside the bar. |
Related types: GanttBarKind, GanttSplitGapLayout
GanttBaselineLayout
Section titled “GanttBaselineLayout”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
x | number | Yes | — | Horizontal pixel offset from the timeline origin. |
width | number | Yes | — | Pixel width of the baseline bar. |
GanttIndicatorLayout
Section titled “GanttIndicatorLayout”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | Unique identifier for this indicator instance. |
kind | "constraint" | "deadline" | "custom" | Yes | — | Category of the indicator. |
x | number | Yes | — | Horizontal pixel offset from the timeline origin. |
label | string | undefined | No | — | Optional display label shown on hover or beside the indicator. |
className | string | undefined | No | — | Optional CSS class name applied to the indicator element. |
GanttSplitGapLayout
Section titled “GanttSplitGapLayout”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | Stable gap id. |
index | number | Yes | — | Split index after scheduler normalization. |
startDate | ISODateString | Yes | — | Split start date. |
endDate | ISODateString | Yes | — | Split end date. |
x | number | Yes | — | Left offset relative to the task bar. |
width | number | Yes | — | Gap width in pixels. |
GanttTaskBarColor
Section titled “GanttTaskBarColor”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
className | string | undefined | No | — | Optional class name applied to the rendered bar. |
barColor | string | undefined | No | — | Main bar colour. |
progressColor | string | undefined | No | — | Progress fill colour. |
textColor | string | undefined | No | — | Label/content text colour. |
borderColor | string | undefined | No | — | Optional outline or border colour. |
GanttTaskBarColorHook
Section titled “GanttTaskBarColorHook”type
export type GanttTaskBarColorHook = (context: GanttTaskBarVisualContext) => GanttTaskBarColor | null | undefined;Related types: GanttTaskBarColor, GanttTaskBarVisualContext
GanttTaskBarContentContext
Section titled “GanttTaskBarContentContext”interface
export interface GanttTaskBarContentContext extends GanttTaskBarVisualContext { readonly h: GanttCellTemplateCreateElement; readonly defaultContent: readonly unknown[];}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
h | HyperFunc<VNode> | Yes | — | |
defaultContent | readonly unknown[] | Yes | — |
Related types: GanttTaskBarVisualContext
GanttTaskBarContentHook
Section titled “GanttTaskBarContentHook”type
export type GanttTaskBarContentHook = (context: GanttTaskBarContentContext) => unknown;Related types: GanttTaskBarContentContext
GanttTaskBarVisualContext
Section titled “GanttTaskBarVisualContext”interface
export interface GanttTaskBarVisualContext { readonly row: GanttGridRow;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
row | GanttGridRow | Yes | — |
Related types: GanttGridRow
GanttTaskLabelMode
Section titled “GanttTaskLabelMode”type
export type GanttTaskLabelMode = 'none' | 'tasks' | 'all';GanttTaskMarker
Section titled “GanttTaskMarker”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | Unique identifier. |
date | ISODateString | Yes | — | Date the marker is pinned to. |
label | string | undefined | No | — | Tooltip or label text. |
className | string | undefined | No | — | Optional CSS class name for custom styling. |
GanttTaskMarkerHook
Section titled “GanttTaskMarkerHook”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
GanttTimelineHeaderElementRenderer
Section titled “GanttTimelineHeaderElementRenderer”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
GanttTimelineHeaderPlugin
Section titled “GanttTimelineHeaderPlugin”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
elements | Map<string, TimelineHeaderElementRegistration> | Yes | new Map<string, TimelineHeaderElementRegistration>() | |
createColumnTemplate(getOptions: () => GanttTimelineHeaderRenderOptions | undefined) | ColumnTemplateFunc | Yes | — | |
render(h: HyperFunc<VNode>, options: GanttTimelineHeaderRenderOptions) | VNode | Yes | — | |
registerElement(id: string, renderer: GanttTimelineHeaderElementRenderer) | () => void | Yes | — | |
refresh() | void | Yes | — | |
destroy() | void | Yes | — |
Related types: GanttTimelineHeaderElementRenderer, GanttTimelineHeaderRenderOptions
GanttTimelineHeaderRenderOptions
Section titled “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[];}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
totalWidth | number | Yes | — | |
headerRows | readonly TimelineHeaderRowModel[] | Yes | — | |
nonWorkingHeaderRanges | readonly TimelineHeaderHighlightRange[] | undefined | No | — | |
activeTaskInteractionRange | TimelineTaskInteractionRange | null | undefined | No | — | |
flagLines | readonly TimelineFlagLine[] | undefined | No | — |
Related types: TimelineFlagLine, TimelineHeaderHighlightRange, TimelineHeaderRowModel, TimelineTaskInteractionRange
GanttVisualConfig
Section titled “GanttVisualConfig”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
percentDoneMode | GanttPercentDoneColumnMode | undefined | No | — | Percent Done task-table rendering. Defaults to 'bar'. |
showDependencies | boolean | undefined | No | — | Show dependency arrows between task bars. Enabled by default. |
showBaseline | boolean | undefined | No | — | Show baseline bars beneath task bars for comparison. |
showCriticalPath | boolean | undefined | No | — | Highlight tasks on the critical path. |
showTaskLabels | boolean | "all" | "tasks" | undefined | No | — | 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. |
baselineId | string | undefined | No | — | Which baseline snapshot to display (defaults to the latest). |
projectLineDate | ISODateString | undefined | No | — | Vertical “today” or status-date line on the timeline. |
timeRanges | readonly GanttTimeRange[] | undefined | No | — | Highlighted date ranges on the timeline background. |
shadeNonWorkingTime | boolean | undefined | No | — | Shade non-working days (weekends, holidays) on the timeline. |
showTodayLine | boolean | undefined | No | — | Show a “today” flag line on the timeline. Set to false to disable. Enabled by default when not specified. |
milestoneLines | readonly GanttMilestoneLine[] | undefined | No | — | Custom vertical flag lines on the timeline (e.g. sprint starts, release dates). |
taskMarkerHook | GanttTaskMarkerHook | undefined | No | — | Hook to produce custom markers on individual task bars. |
taskBarColorHook | GanttTaskBarColorHook | undefined | No | — | Hook to provide per-task bar colours and classes. |
taskBarContentHook | GanttTaskBarContentHook | undefined | No | — | Hook to replace or extend the inner content rendered inside task bars. |
taskTooltipFields | readonly GanttTaskTooltipField[] | undefined | No | — | 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. |
taskTooltipHook | GanttTaskTooltipHook | undefined | No | — | Hook to override the tooltip content shown for task bars. |
dependencyTooltipHook | GanttDependencyTooltipHook | undefined | No | — | Hook to override the tooltip content shown for dependency arrows. |
Related types: BaselineId, GanttDependencyTooltipHook, GanttMilestoneLine, GanttPercentDoneColumnMode, GanttTaskBarColorHook, GanttTaskBarContentHook, GanttTaskMarkerHook, GanttTaskTooltipField, GanttTaskTooltipHook, GanttTimeRange
GanttZoomSetLevelDetail
Section titled “GanttZoomSetLevelDetail”interface
Detail payload for zoom-set-level events.
export interface GanttZoomSetLevelDetail { /** The zoom level id to jump to. */ readonly levelId: string;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
levelId | string | Yes | — | The zoom level id to jump to. |
getAnchorOffset
Section titled “getAnchorOffset”function
Computes the viewport-relative anchor offset based on the active anchor mode.
export function getAnchorOffset(anchorMode: string, context: TimelineZoomAnchorContext): number;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
anchorMode | string | Yes | — | - The anchor strategy (‘pointer’, ‘center’, or ‘start’). |
context | TimelineZoomAnchorContext | Yes | — | - Current viewport and pointer context. |
Returns: Pixel offset from the viewport left edge.
Related types: TimelineZoomAnchorContext
getLevelById
Section titled “getLevelById”function
Finds a zoom level by its ID.
export function getLevelById(levels: readonly TimelineZoomLevel[], levelId: string | undefined): TimelineZoomLevel | null;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
levels | readonly TimelineZoomLevel[] | Yes | — | - Available zoom levels. |
levelId | string | undefined | Yes | — | - ID to search for. |
Returns: The matching level, or null if not found.
Related types: TimelineZoomLevel
getLevelIndex
Section titled “getLevelIndex”function
Returns the index of a zoom level by ID, or 0 if not found.
export function getLevelIndex(levels: readonly TimelineZoomLevel[], levelId: string): number;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
levels | readonly TimelineZoomLevel[] | Yes | — | - Available zoom levels. |
levelId | string | Yes | — | - ID to search for. |
Returns: Zero-based index into the levels array.
Related types: TimelineZoomLevel
getNextScrollLeft
Section titled “getNextScrollLeft”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;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
scale | TimelineScale | Yes | — | - The timeline scale instance. |
anchorDate | ISODateString | Yes | — | - ISO date string to anchor. |
anchorOffset | number | Yes | — | - Desired pixel offset from the viewport left edge. |
Returns: The scroll-left value (minimum 0).
Related types: TimelineScale
getProjectTimelineRange
Section titled “getProjectTimelineRange”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'>;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
dates | readonly ISODateString[] | Yes | — | - Array of ISO date strings to encompass. |
zoomLevelOrPreset | TimelineZoomLevel | TimelineZoomPreset | Yes | — | - A zoom level object or preset identifier. |
options | Pick<TimelineScaleConfig, "weekStartsOn"> | No | {} |
Returns: A { startDate, endDate } range with timeline padding.
Related types: TimelineScaleConfig, TimelineZoomLevel, TimelineZoomPreset
getZoomAnchorDate
Section titled “getZoomAnchorDate”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;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
scale | TimelineScale | Yes | — | - The active timeline scale. |
anchorX | number | Yes | — | - Pixel offset from the timeline origin. |
Returns: ISO date string to preserve during zoom.
Related types: TimelineScale
normalizeTimelineHeaderLabel
Section titled “normalizeTimelineHeaderLabel”function
Normalizes a header label to the structured {@link TimelineHeaderLabelParts} form.
export function normalizeTimelineHeaderLabel(label: TimelineHeaderLabel): TimelineHeaderLabelParts;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
label | TimelineHeaderLabel | Yes | — | - A plain string or structured label. |
Returns: The label as a { label, subLabel } object.
Related types: TimelineHeaderLabel, TimelineHeaderLabelParts
normalizeTimelineZoomConfig
Section titled “normalizeTimelineZoomConfig”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;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
config | TimelineZoomConfig | undefined | Yes | — | - Optional user-supplied zoom configuration. |
fallbackLevelId | string | No | FALLBACK_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
projectVisibleTaskBarAnchors
Section titled “projectVisibleTaskBarAnchors”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[];| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
projection | VisibleTaskBarProjection | Yes | — | - Viewport state and row data needed for the projection. |
Returns: An array of {@link VisibleTaskBarAnchors} for each visible task bar.
Related types: VisibleTaskBarAnchors, VisibleTaskBarProjection
renderGanttTimelineHeader
Section titled “renderGanttTimelineHeader”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;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
h | HyperFunc<VNode> | Yes | — | |
options | GanttTimelineHeaderRenderOptions | Yes | — | |
additionalElements | readonly VNodeResponse[] | No | [] |
Related types: GanttTimelineHeaderRenderOptions
ResolvedTimelineZoomConfig
Section titled “ResolvedTimelineZoomConfig”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
enabled | boolean | Yes | — | Whether zoom functionality is enabled. |
levels | readonly TimelineZoomLevel[] | Yes | — | Ordered list of available zoom levels. |
defaultLevelId | string | Yes | — | Active default level ID. |
minLevelId | string | Yes | — | Finest allowed level ID. |
maxLevelId | string | Yes | — | Coarsest allowed level ID. |
locale | string | Yes | — | Resolved locale string. |
shadeNonWorkingTime | boolean | undefined | Yes | — | Whether non-working time shading is enabled. |
wheelZoomEnabled | boolean | Yes | — | Whether wheel zoom is enabled. |
wheelZoomTrigger | WheelZoomTrigger | Yes | — | Required modifier key for wheel zoom. |
wheelZoomMode | TimelineZoomMode | Yes | — | Zoom transition mode. |
zoomAnchorMode | ZoomAnchorMode | Yes | — | Anchor strategy during zoom. |
invertWheelDirection | boolean | Yes | — | Whether wheel direction is inverted. |
defaultHeaderFormatter | TimelineDateFormatter | undefined | Yes | — | Default header date formatter, if any. |
Related types: TimelineDateFormatter, TimelineZoomLevel, TimelineZoomMode, WheelZoomTrigger, ZoomAnchorMode
resolveGanttTimelineDateFormatter
Section titled “resolveGanttTimelineDateFormatter”function
export function resolveGanttTimelineDateFormatter(project: Pick<GanttPluginConfig, 'timeZone' | 'dateFormats'> | null | undefined, fallbackLocale: string, fallbackFormatter?: TimelineDateFormatter): TimelineDateFormatter | undefined;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project | Pick<GanttPluginConfig, "timeZone" | "dateFormats"> | null | undefined | Yes | — | |
fallbackLocale | string | Yes | — | |
fallbackFormatter | TimelineDateFormatter | undefined | No | — |
Related types: GanttPluginConfig, TimelineDateFormatter
resolveHighlightVisibility
Section titled “resolveHighlightVisibility”function
export function resolveHighlightVisibility(zoom: TimelineZoomLevel): Required<TimelineHighlightVisibility>;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
zoom | TimelineZoomLevel | Yes | — |
Related types: TimelineHighlightVisibility, TimelineZoomLevel
ResourceLoadSegment
Section titled “ResourceLoadSegment”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | |
startDate | string | Yes | — | |
endDate | string | Yes | — | |
x | number | Yes | — | |
width | number | Yes | — | |
allocatedUnits | number | Yes | — | |
capacityUnits | number | Yes | — | |
loadRatio | number | Yes | — | |
taskIds | readonly string[] | Yes | — | |
isOverallocated | boolean | Yes | — |
Related types: TaskId
ResourcePlanningRowData
Section titled “ResourcePlanningRowData”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[];}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
capacityUnits | number | Yes | — | |
maxAllocatedUnits | number | Yes | — | |
capacityDisplay | "line" | "none" | Yes | — | |
overAllocationDisplay | "none" | "highlight" | Yes | — | |
loadGranularity | "day" | "week" | Yes | — | |
segments | readonly ResourceLoadSegment[] | Yes | — |
Related types: ResourceLoadSegment
shouldHandleWheelTrigger
Section titled “shouldHandleWheelTrigger”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;| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
trigger | WheelZoomTrigger | Yes | — | - The required modifier key. |
input | TimelineWheelInput | Yes | — | - Raw wheel event data. |
Returns: true if the trigger condition is met.
Related types: TimelineWheelInput, WheelZoomTrigger
TaskBarAnchorPoint
Section titled “TaskBarAnchorPoint”interface
A 2D point in viewport-relative coordinates.
export interface TaskBarAnchorPoint { /** Horizontal pixel coordinate. */ readonly x: number; /** Vertical pixel coordinate. */ readonly y: number;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
x | number | Yes | — | Horizontal pixel coordinate. |
y | number | Yes | — | Vertical pixel coordinate. |
TaskGridAssignee
Section titled “TaskGridAssignee”interface
export interface TaskGridAssignee { readonly id: ResourceId; readonly name: string; readonly initials: string; readonly role: string; readonly allocationUnits: number; readonly color: string;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | |
name | string | Yes | — | |
initials | string | Yes | — | |
role | string | Yes | — | |
allocationUnits | number | Yes | — | |
color | string | Yes | — |
Related types: ResourceId
TaskRowDiagnostics
Section titled “TaskRowDiagnostics”type
export type TaskRowDiagnostics = Pick<SchedulingResult, 'conflicts' | 'issues'>;Related types: SchedulingResult
TaskRowProjectionOptions
Section titled “TaskRowProjectionOptions”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
showBaseline | boolean | undefined | No | — | Show baseline overlay bars when baseline data is available. |
showCriticalPath | boolean | undefined | No | — | Highlight tasks on the critical path. |
showTaskLabels | GanttTaskLabelMode | undefined | No | — | Render inline task name labels on Gantt bars. Defaults to regular task/milestone labels only. |
baselineId | string | undefined | No | — | Specific baseline snapshot to compare against. Uses the latest baseline when omitted. |
taskMarkerHook | GanttTaskMarkerHook | undefined | No | — | Hook to inject custom point markers onto task rows. |
resourceFilterIds | readonly string[] | undefined | No | — | Resource filter ids are applied as grid trims, not during projection. |
resourcePlanning | GanttResourcePlanningConfig | undefined | No | — | When enabled, project resource rows and allocation load bars instead of task rows. |
Related types: BaselineId, GanttResourcePlanningConfig, GanttTaskLabelMode, GanttTaskMarkerHook, ResourceId
TIMELINE_ZOOM_PRESET_LEVELS
Section titled “TIMELINE_ZOOM_PRESET_LEVELS”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
TimelineBand
Section titled “TimelineBand”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
key | string | Yes | — | Unique key for reconciliation. |
startDate | ISODateString | Yes | — | Start date of the band interval (ISO string). |
endDate | ISODateString | Yes | — | End date of the band interval (ISO string). |
x | number | Yes | — | Horizontal pixel offset from the timeline origin. |
width | number | Yes | — | Pixel width of the band cell. |
label | string | Yes | — | Display label. |
TimelineBandUnit
Section titled “TimelineBandUnit”type
Calendar unit used for the grouping band row (excludes ‘day’).
export type TimelineBandUnit = Exclude<TimelineUnit, 'minute'>;TimelineDateFormatter
Section titled “TimelineDateFormatter”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
TimelineDateFormatterContext
Section titled “TimelineDateFormatterContext”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
levelId | string | Yes | — | Zoom level identifier that owns this header. |
rowId | string | Yes | — | Identifier of the header row being rendered. |
unit | TimelineUnit | Yes | — | Calendar unit of this header row. |
count | number | Yes | — | Number of units each cell spans. |
locale | string | Yes | — | Active locale string (e.g. “en-US”). |
rowIndex | number | Yes | — | Zero-based index of this row within the header stack. |
isLeafRow | boolean | Yes | — | Whether this is the bottom (leaf / tick) row. |
TimelineFlagLine
Section titled “TimelineFlagLine”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';}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | |
dateX | number | Yes | — | Absolute X position in the full timeline (px from timeline start). |
label | string | Yes | — | |
color | string | undefined | No | — | |
kind | "milestone" | "today" | Yes | — |
TimelineHeaderCell
Section titled “TimelineHeaderCell”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
key | string | Yes | — | Unique key for React/framework reconciliation. |
startDate | ISODateString | Yes | — | Start date of the interval this cell covers (ISO string). |
endDate | ISODateString | Yes | — | End date (inclusive) of the interval this cell covers (ISO string). |
x | number | Yes | — | Horizontal pixel offset from the timeline origin. |
width | number | Yes | — | Pixel width of the cell. |
label | string | Yes | — | Primary display text. |
subLabel | string | Yes | — | Secondary display text (may be empty). |
TimelineHeaderHighlightRange
Section titled “TimelineHeaderHighlightRange”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | |
startDate | ISODateString | Yes | — | |
endDate | ISODateString | Yes | — | |
left | number | Yes | — | |
width | number | Yes | — |
TimelineHeaderLabel
Section titled “TimelineHeaderLabel”type
A header cell label — either a plain string or a structured label with sub-text.
export type TimelineHeaderLabel = string | TimelineHeaderLabelParts;Related types: TimelineHeaderLabelParts
TimelineHeaderLabelParts
Section titled “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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
label | string | Yes | — | Primary display text. |
subLabel | string | undefined | No | — | Optional secondary text rendered below or beside the label. |
TimelineHeaderRowConfig
Section titled “TimelineHeaderRowConfig”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | Unique identifier for this header row. |
unit | TimelineUnit | Yes | — | Calendar unit this row represents. |
count | number | undefined | No | — | Number of units each cell spans (defaults to 1). |
formatter | TimelineDateFormatter | undefined | No | — | Optional custom formatter overriding the default label logic. |
Related types: TimelineDateFormatter
TimelineHeaderRowModel
Section titled “TimelineHeaderRowModel”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[];}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | Identifier matching the originating {@link TimelineHeaderRowConfig.id}. |
unit | TimelineUnit | Yes | — | Calendar unit of this row. |
count | number | Yes | — | Number of units each cell spans. |
cells | readonly TimelineHeaderCell[] | Yes | — | Ordered array of rendered header cells. |
Related types: TimelineHeaderCell, TimelineHeaderRowConfig
TimelineHighlightVisibility
Section titled “TimelineHighlightVisibility”interface
export interface TimelineHighlightVisibility { weekends?: boolean; holidays?: boolean;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
weekends | boolean | undefined | No | — | |
holidays | boolean | undefined | No | — |
TimelineScale
Section titled “TimelineScale”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
startDate | ISODateString | Yes | — | First date of the timeline range (ISO string). |
endDate | ISODateString | Yes | — | Last date of the timeline range (ISO string). |
zoomLevel | TimelineZoomLevel | Yes | — | Zoom level configuration that produced this scale. |
tickUnit | TimelineUnit | Yes | — | Calendar unit of the leaf tick row. |
tickCount | number | Yes | — | Number of calendar units per tick cell. |
tickWidth | number | Yes | — | Pixel width of a single tick cell. |
totalWidth | number | Yes | — | Total pixel width of the entire timeline. |
dateToX(date: ISODateString) | number | Yes | — | Converts a date to a horizontal pixel offset. |
xToDate(x: number) | ISODateString | Yes | — | Converts a horizontal pixel offset to the nearest date. |
getTicks() | readonly TimelineTick[] | Yes | — | Returns all tick cells across the full timeline range. |
getVisibleTicks(startX: number, viewportWidth: number, overscanPx?: number) | readonly TimelineTick[] | Yes | — | Returns tick cells visible within the given horizontal viewport slice. |
getBands() | readonly TimelineBand[] | Yes | — | Returns all band (grouping) cells. |
getHeaderRows() | readonly TimelineHeaderRowModel[] | Yes | — | Returns the computed header row models for rendering. |
getVisibleHeaderRows(startX: number, viewportWidth: number, overscanPx?: number) | readonly TimelineHeaderRowModel[] | Yes | — | Returns header row models intersecting the given viewport slice. |
getVisibleRange(startX: number, viewportWidth: number) | TimelineVisibleDateRange | Yes | — | Returns the date range visible within the given horizontal viewport slice. |
Related types: TimelineBand, TimelineHeaderRowModel, TimelineTick, TimelineTickUnit, TimelineVisibleDateRange, TimelineZoomLevel
TimelineScaleConfig
Section titled “TimelineScaleConfig”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
startDate | ISODateString | Yes | — | Project timeline start date (ISO string). |
endDate | ISODateString | Yes | — | Project timeline end date (ISO string). |
levelId | string | undefined | No | — | Optional zoom level identifier to look up in the default levels. |
tickUnit | TimelineUnit | undefined | No | — | Calendar unit for the leaf tick row (overrides zoom level when set). |
tickCount | number | undefined | No | — | Number of tick units each cell spans. |
bandUnit | TimelineBandUnit | undefined | No | — | Calendar unit for the grouping band row. |
tickWidth | number | Yes | — | Pixel width of a single tick cell. |
headerRows | readonly TimelineHeaderRowConfig[] | undefined | No | — | Header row definitions (overrides zoom level rows when set). |
highlightVisibility | TimelineHighlightVisibility | undefined | No | — | Per-scale highlight overrides inherited by the resolved zoom level. |
locale | string | undefined | No | — | Locale string for date formatting (defaults to “en-US”). |
defaultHeaderFormatter | TimelineDateFormatter | undefined | No | — | Fallback date formatter applied when no row-level formatter is set. |
weekStartsOn | TimelineWeekStartsOn | undefined | No | — | First day of week for weekly timeline cells. 0 is Sunday and 1 is Monday. Defaults to Sunday. |
Related types: TimelineBandUnit, TimelineDateFormatter, TimelineHeaderRowConfig, TimelineHighlightVisibility, TimelineTickUnit
TimelineTaskInteractionRange
Section titled “TimelineTaskInteractionRange”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
taskId | string | Yes | — | |
interaction | "move" | "resize" | "focus" | Yes | — | |
kind | "summary" | "task" | "milestone" | Yes | — | |
left | number | Yes | — | |
width | number | Yes | — | |
valid | boolean | Yes | — |
Related types: TaskId
TimelineTick
Section titled “TimelineTick”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
key | string | Yes | — | Unique key for reconciliation. |
startDate | ISODateString | Yes | — | Start date of the tick interval (ISO string). |
endDate | ISODateString | Yes | — | End date of the tick interval (ISO string). |
x | number | Yes | — | Horizontal pixel offset from the timeline origin. |
width | number | Yes | — | Pixel width of the tick cell. |
label | string | Yes | — | Primary display label. |
subLabel | string | Yes | — | Secondary display label. |
TimelineTickUnit
Section titled “TimelineTickUnit”type
Calendar unit used for the leaf-level tick grid.
export type TimelineTickUnit = TimelineUnit;TimelineVisibleDateRange
Section titled “TimelineVisibleDateRange”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
startDate | ISODateString | Yes | — | First visible date (ISO string). |
endDate | ISODateString | Yes | — | Last visible date (ISO string). |
TimelineVisibleSpan
Section titled “TimelineVisibleSpan”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
unit | "minute" | "hour" | "day" | "month" | "year" | Yes | — | Calendar unit of the span. |
value | number | Yes | — | Number of units. |
TimelineWheelInput
Section titled “TimelineWheelInput”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
deltaY | number | Yes | — | Vertical scroll delta from the wheel event. |
ctrlKey | boolean | undefined | No | — | Whether the Ctrl key was held. |
metaKey | boolean | undefined | No | — | Whether the Meta (Cmd) key was held. |
altKey | boolean | undefined | No | — | Whether the Alt key was held. |
shiftKey | boolean | undefined | No | — | Whether the Shift key was held. |
TimelineZoomAnchorContext
Section titled “TimelineZoomAnchorContext”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
scale | TimelineScale | Yes | — | Active timeline scale instance. |
scrollLeft | number | Yes | — | Current horizontal scroll offset in pixels. |
viewportWidth | number | Yes | — | Width of the visible viewport in pixels. |
viewportClientLeft | number | undefined | No | — | Left edge of the viewport element in client coordinates (for pointer anchor). |
pointerClientX | number | undefined | No | — | Pointer X position in client coordinates (for pointer anchor). |
Related types: TimelineScale
TimelineZoomConfig
Section titled “TimelineZoomConfig”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
enabled | boolean | undefined | No | — | Whether zoom functionality is enabled. |
levels | readonly TimelineZoomLevel[] | undefined | No | — | Ordered list of zoom levels from finest to coarsest. |
defaultLevelId | string | undefined | No | — | Level ID to activate initially. |
minLevelId | string | undefined | No | — | Finest (most detailed) level ID allowed. |
maxLevelId | string | undefined | No | — | Coarsest level ID allowed. |
locale | string | undefined | No | — | Locale string for date formatting (e.g. “en-US”). |
shadeNonWorkingTime | boolean | undefined | No | — | Whether to shade non-working time columns. |
wheelZoomEnabled | boolean | undefined | No | — | Whether mouse wheel zoom is enabled. |
wheelZoomTrigger | WheelZoomTrigger | undefined | No | — | Modifier key required for wheel zoom. |
wheelZoomMode | TimelineZoomMode | undefined | No | — | Zoom transition mode. |
zoomAnchorMode | ZoomAnchorMode | undefined | No | — | Anchor strategy during zoom transitions. |
invertWheelDirection | boolean | undefined | No | — | Whether to invert the wheel scroll direction for zoom. |
defaultHeaderFormatter | TimelineDateFormatter | undefined | No | — | Fallback date formatter for header cells. |
Related types: TimelineDateFormatter, TimelineZoomLevel, TimelineZoomMode, WheelZoomTrigger, ZoomAnchorMode
TimelineZoomController
Section titled “TimelineZoomController”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
config | ResolvedTimelineZoomConfig | Yes | — | |
activeLevelId | string | Yes | — | |
visibleRange | { startDate: ISODateString; endDate: ISODateString; } | null | Yes | null | |
setConfig(config?: TimelineZoomConfig, fallbackLevelId?: string) | void | Yes | — | Replaces the zoom configuration, preserving the current level when possible. |
getConfig() | ResolvedTimelineZoomConfig | Yes | — | Returns the resolved zoom configuration. |
getZoomLevel() | TimelineZoomLevel | Yes | — | Returns the currently active zoom level. |
getVisibleRange() | { startDate: ISODateString; endDate: ISODateString } | null | Yes | — | Returns the last computed visible date range, or null if not yet updated. |
updateVisibleRange(scale: TimelineScale, scrollLeft: number, viewportWidth: number) | { startDate: ISODateString; endDate: ISODateString } | Yes | — | Recalculates and caches the visible date range from the current scroll position. |
canZoomIn() | boolean | Yes | — | Returns true if zooming in (finer detail) is possible. |
canZoomOut() | boolean | Yes | — | Returns true if zooming out (coarser detail) is possible. |
zoomIn() | boolean | Yes | — | Zooms in one level. Returns true if the level changed. |
zoomOut() | boolean | Yes | — | Zooms out one level. Returns true if the level changed. |
setZoomLevel(levelId: string) | boolean | Yes | — | Jumps to a specific zoom level by ID. |
createZoomTransition(nextLevelId: string, context: TimelineZoomAnchorContext) | TimelineZoomTransition | null | Yes | — | Prepares 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) | number | Yes | — | Computes the scroll-left position that keeps an anchor date at a fixed viewport offset. |
setLevelByIndex(index: number) | boolean | Yes | — |
Related types: ResolvedTimelineZoomConfig, TimelineScale, TimelineZoomAnchorContext, TimelineZoomConfig, TimelineZoomLevel, TimelineZoomTransition
TimelineZoomLevel
Section titled “TimelineZoomLevel”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | Unique level identifier (e.g. “day-week”). |
tickUnit | TimelineUnit | Yes | — | Calendar unit for the leaf tick row. |
tickCount | number | undefined | No | — | Number of tick units per cell (defaults to 1). |
tickWidth | number | Yes | — | Pixel width of a single tick cell. |
headerRows | readonly TimelineHeaderRowConfig[] | Yes | — | Header row definitions for this level. |
minVisibleSpan | TimelineVisibleSpan | undefined | No | — | Optional minimum visible time span constraint. |
maxVisibleSpan | TimelineVisibleSpan | undefined | No | — | Optional maximum visible time span constraint. |
label | string | undefined | No | — | Human-readable label for UI display. |
highlightVisibility | TimelineHighlightVisibility | undefined | No | — | Per-zoom-level highlight overrides. |
Related types: TimelineHeaderRowConfig, TimelineHighlightVisibility, TimelineVisibleSpan
TimelineZoomMode
Section titled “TimelineZoomMode”type
Strategy for transitioning between zoom levels.
export type TimelineZoomMode = 'discrete' | 'smooth-discrete';TimelineZoomTransition
Section titled “TimelineZoomTransition”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
previousLevel | TimelineZoomLevel | Yes | — | Zoom level before the transition. |
nextLevel | TimelineZoomLevel | Yes | — | Zoom level after the transition. |
anchorDate | ISODateString | Yes | — | Date that should remain at the anchor offset after zoom. |
anchorOffset | number | Yes | — | Pixel offset from the viewport left where the anchor date should appear. |
scrollLeft | number | Yes | — | Scroll-left at the time the transition was initiated. |
Related types: TimelineZoomLevel
VisibleTaskBarAnchors
Section titled “VisibleTaskBarAnchors”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
taskId | string | Yes | — | Identifier of the task this anchor set belongs to. |
rowIndex | number | Yes | — | Row index of the task within the data source. |
top | number | Yes | — | Top edge of the row in viewport pixels. |
bottom | number | Yes | — | Bottom edge of the row in viewport pixels. |
left | number | Yes | — | Left edge of the bar in viewport pixels. |
right | number | Yes | — | Right edge of the bar in viewport pixels. |
start | TaskBarAnchorPoint | Yes | — | Anchor point at the start (left) side of the bar, offset for dependency arrows. |
end | TaskBarAnchorPoint | Yes | — | Anchor point at the end (right) side of the bar, offset for dependency arrows. |
topCenter | TaskBarAnchorPoint | Yes | — | Anchor point centered above the bar. |
bottomCenter | TaskBarAnchorPoint | Yes | — | Anchor point centered below the bar. |
Related types: TaskBarAnchorPoint, TaskId
VisibleTaskBarProjection
Section titled “VisibleTaskBarProjection”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;}| Member | Type / return | Required | Default | Description |
|---|---|---|---|---|
rows | readonly GanttGridRow[] | Yes | — | All task grid rows (full dataset). |
viewportRows | readonly VirtualPositionItem[] | Yes | — | Virtual position items describing which rows are currently visible. |
scrollLeft | number | Yes | — | Current horizontal scroll offset in pixels. |
scrollTop | number | Yes | — | Current vertical scroll offset in pixels. |
viewportWidth | number | Yes | — | Width of the visible viewport in pixels. |
viewportHeight | number | Yes | — | Height of the visible viewport in pixels. |
includeOffscreenRows | boolean | undefined | No | — | Keep 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 | undefined | No | — | Optional transient task-bar geometry while a visible bar is actively moved or resized. |
Related types: GanttGridRow, TaskId
WheelZoomTrigger
Section titled “WheelZoomTrigger”type
Modifier key that must be held to trigger wheel-based zoom.
export type WheelZoomTrigger = 'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey' | 'none';ZoomAnchorMode
Section titled “ZoomAnchorMode”type
Anchor strategy determining which viewport position stays fixed during zoom.
export type ZoomAnchorMode = 'pointer' | 'center' | 'start';