Critical path analysis is a PRO feature. See licensing and trial info.
criticalPath prop is set.
The criticalPath Prop
| Property | Type | Description |
|---|---|---|
type | "strict" | "flexible" | Selects the calculation algorithm used to identify critical tasks. |
Strict vs Flexible Modes
- Flexible (default)
- Strict
In
"flexible" mode, a task is considered critical if it has zero total slack relative to the project end date. This means any delay to the task would push the project end date out.This is the most common interpretation and matches the standard CPM (Critical Path Method) definition. Gaps in task chains are permitted as long as the chain still reaches the project end.How Critical Path is Calculated
The algorithm requiresprojectStart and projectEnd to be defined on the <Gantt> component:
- A forward pass computes the earliest start and earliest finish for each task.
- A backward pass computes the latest start and latest finish working from
projectEnd. - Total slack = latest start − earliest start. Tasks with zero total slack are on the critical path.
- Critical tasks and their connecting links are marked and rendered in a distinct style (typically red).
Basic Example
Switching Modes at Runtime
BecausecriticalPath is a reactive prop, you can switch between "strict" and "flexible" at runtime — for example, from a toolbar control — and the chart updates immediately:
Slack Visualization
Alongside the critical path, the PRO edition can display slack — the amount of scheduling float each non-critical task has before it would become critical. Enable it with theslack prop:
freeSlack, totalSlack, earliestStart, latestStart) are accessible on each task via task.slack and can be displayed as custom grid columns: