Introduction

A lines manager is used to control the layout of lines inside a row. Activities located on different lines do not overlap each other, except if the lines themselves overlap each other. Each line can have its own height and a location within the row. Each line can also have its own Layout. By using lines and layouts it is possible to display activities that belong to the same row in different ways (see ChartLayout, GanttLayout).

Line Count

The actual number of lines on a row is stored on the lineCountĀ of the row. Use row.setLineCount(value: number) to change its value. If the line count is larger than 0 the row will call back on its line manager to figure out where each line is located, how high it is, and which activity will be placed on which row. Also the type of layout to use for each line will be retrieved from the manager.

Interface

To access the LinesManager of a row use row.getLinesManager() The following table describes the interface methods.

MethodDescription
linesManager.getLineHeight(lineIndex: number, rowHeight: number)

Returns the height of the line with the given index. The height can be computed on-the-fly based on the given available row height.

linesManager.getLineIndex(activity: Activity)

Returns the line index for the given activity. This method places activities on different lines.

linesManager.getLineLayout(lineIndex: number)

Returns the layout for the line with the given line index. Each line can have its own layout.

linesManager.getLineLocation(lineIndex: number, rowHeight: number)
Returns the location of the line with the given index. The location can be computed on-the-fly based on the given available row height.

Equal Lines Manager

The EqualLinesManager can be used to equally distribute line locations and line heights on a row. Each line will have the same height and the lines will not overlap each other. While this behaviour will be provided by the manager it is still the responsibility of the application to place the activities on different rows and to specify the layout for each line. This is also the reason why the methods linesManager.getLineHeight() and linesManager.getLineLocation() should not be overridden while the methods linesManager.getLineLayout() and linesManager.getLineIndex().

Auto Lines Manager

The AutoLinesManager can be used to create a dynamic number of lines based on all activities inside a repository. This lines manager detects clusters of intersecting activities (start / end time intervals) and ensures that enough lines are available to place the activities in a non-overlapping way. Please note that the manager's layout() method needs to be invoked from the outside. A good way to do this is to listen to ACTIVITY_CHANGE_FINISHED events or even more fine grained START/END_TIME_CHANGE_FINISHED events.

const autoLinesManager = new AutoLinesManager(Aircraft, Flight);