An activity link can be used to model any kind of dependency between two activities. In project planning applications a link would express a predecessor / successor relationship between two tasks, for example task A has to be finished before task B could begin. In other domains a link might simply express that two or more activities need to be scheduled together and that moving one of them requires all others to be moved, too.

A link can be added to the Gantt chart by calling this.gantt.getLinks().add(link: ActivityLink)

The link can be built using the ActivityLink constructor. It accepts an optional type field for a specific ActivityLink type.

ActivityLink types: "END_TO_START" | "START_TO_END" | "START_TO_START" | "END_TO_END"

Here is an example of how to create an ActivityLink.

Create an ActivityLink
const sourceRef = new ActivityRef(sourceActivityRow, sourceLayer, sourceActivity);      // Reference to the source.
const targetRef = new ActivityRef(targetActivityRow, targetLayer, targetActivity);      // Reference to the target.
const link = new ActivityLink(sourceRef, targetRef, ActivityLinkTypeEnum.END_TO_START); // Create the link.
this.gantt.getLinks().add(link);                                                        // Register the link.

ActivityRefs are available in events callbacks and observables.