Introduction

System Layers are used in the background and foreground of each row. System Layers gets drawn in a specific order to allow full customisation of the viewport. Concerning activities, they are drawn between the BackgroundSystemLayers and the ForegroundSystemLayers while all the TransversalSystemLayers gets drawn below or above other layers. Each layer is specialised on drawing one type of information: current time, selected time intervals, grid lines, and so on. The graphics manages the layers in six lists and provides convenience methods to easily look them up.

MethodDescription
getBackgroundSystemLayers(): RowSystemLayer[]
Returns the list of system layers drawn right below the Activities.
getForegroundSystemLayers(): RowSystemLayer[]
Returns the list of system layers drawn right above the Activities.
getBelowViewTransversalSystemLayers(): ViewTransversalSystemLayer[]
Returns the list of system layers drawn below all the other layers.
getAboveViewTransversalSystemLayers(): ViewTransversalSystemLayer[]
Returns the list of system layers drawn above all the other layers.
getBelowRowTransversalSystemLayers(): ViewTransversalSystemLayer[]
Returns the list of system layers drawn right below the BackgroundSystemLayers.
getAboveRowTransversalSystemLayers(): ViewTransversalSystemLayer[]
Returns the list of system layers drawn right above the ForegroundSystemLayers.
Layers can be added / removed from the graphics view by adding / removing them from the corresponding system layers array.

Once you have looked up a layer you can set its properties to customise its appearance. The most common properties are used for line colors and widths.

System Layer Example
const graphics = this.gantt.getGraphics();
const nowLayer = graphics.getAboveViewTransversalSystemLayers().find(it => it instanceof NowLineViewTransversalSystemLayer) as NowLineViewTransversalSystemLayer<Aircraft>;
nowLayer.setStroke(Color.ORANGE);  // Orange line.
nowLayer.setLineWidth(3);          // Thick line.

System Layers vs. Model Layers

Please note that System Layers are not related in any way to Model Layers. A System Layer is basically a renderer for some graphical feedback while a model layer is used for grouping activities.

Available System Layers

The following table lists all system layers that are shipping with ScheduleJS. The last columns (Above View, Above Rows, ForeGround, BackGround, Below Rows, Below View) are used to indicate on which system layer the drawing occurs.

LayerDescriptionAVARFGBGBRBV
CalendarLayerDraws the entries returned by the calendars attached to a row or attached to the entire graphics view. The calendar layer uses pluggable renderers that are mapped to the entry types. Applications can register their own renderers by calling CalendarLayer.setCalendarActivityRenderer().


(tick)

ChartLinesLayerDraws the horizontal grid lines for a row if the row or any of its inner lines are using the chart layout.


(tick)

GridLinesLayerDraws the vertical grid lines based on the scale resolutions currently present in the dateline. The layer can be configured to display 0 to 3 grid line levels. If the dateline is, for example, showing days and weeks then a level of 2 would cause the layer to draw grid lines for days and weeks, while a grid line level of 1 would only render grid lines for days.


(tick)

HoverTimeIntervalViewTransversalSystemLayerDraws the hover time interval specified by the dateline. If the mouse cursor hovers over a week in the dateline then the layer will fill the time interval defined by this week with a highlighting color. Optimised as it doesn't use the drawing engine (carrying row data and more) and so uses less memory.




(tick)
HoverTimeIntervalLayerDraws the hover time interval specified by the dateline. If the mouse cursor hovers over a week in the dateline then the layer will fill the time interval defined by this week with a highlighting color. (Allows different timezones for each Row)




(tick)
InnerLinesLayer

Draws separator lines between inner lines.

By default the line width property of this layer is set to 0 and the lines will not be drawn at all. To change this simply set a line width greater than 0.




(tick)

LayoutLayerDraws the layout padding areas. Each layout may have some padding added to its top and bottom. This layer fills the padding area with a solid color.

(tick)


LassoViewTransversalSystemLayerDraws the lasso selection area.(tick)




LinksRowsTransversalSystemLayerDraws links between activities.
(tick)



NowLineViewTransversalSystemLayerDraws a vertical line at the location of the current time / now time. The current time is defined in the timeline model. Optimised as it doesn't use the drawing engine (carrying row data and more) and so uses less memory.(tick)




NowLineLayerDraws a vertical line at the location of the current time / now time. The current time is defined in the timeline model. (Allows different timelines for each Row)(tick)




MarkedLineViewTransversalSystemLayerDraws the marks showing the time interval when dragging an activity.(tick)




SelectedTimeIntervalsLayerDraws the time intervals that were selected by the user (or the application) in the dateline.


(tick)

ZoomTimeIntervalViewTransversalSystemLayerDraws the zoom interval as defined by the timeline. The zoom interval gets created by the user via the help of the timeline lasso. Optimised as it doesn't use the drawing engine (carrying row data and more) and so uses less memory.(tick)




ZoomTimeIntervalLayerDraws the zoom interval as defined by the timeline. The zoom interval gets created by the user via the help of the timeline lasso. (Allows different timelines for each Row)(tick)