Skip to main content

slack

The functionality is available in PRO Edition only

PRO

Description

Optional. Enables float (slack) calculation for a task

Usage

slack?: boolean;

Parameters

  • slack - enables slack calculation for a task. Accepts the following values:
    • false - slack calculation is disabled (default)
    • true - slack is calculated

When enabled, each task receives a slack object with the following fields:

  • earliestStart - the earliest date the task can start (forward pass result)
  • latestStart - the latest possible start date without delaying the project
  • freeSlack - number of days the task can delay without affecting project end (0 = critical)
  • totalSlack - number of days the task can be delayed without affecting any successor

Notes:

  • Slack values are calculated in working days when a calendar is defined
  • Total slack is visualized directly on bars for normal scheduled tasks (not milestones or summary tasks)
  • Custom grid columns can be added to display all four slack values

Example

When a calendar is provided, slack is calculated in working days rather than calendar days:

<script>
import { Gantt } from "@svar-ui/svelte-gantt";
import { getData } from "./data";

const { tasks, links, scales } = getData();

const columns = [
{ id: "text", header: "Task name", flexgrow: 1 },
{
id: "slack",
header: "Total slack",
align: "center",
width: 100,
getter: t => t.slack.totalSlack
},
];
</script>

<Gantt {tasks} {links} {scales} {columns} slack />

Related sample: Slack

Related articles: