Options
All
  • Public
  • Public/Protected
  • All
Menu

A specialized LinesManager used for ensuring that activities will not overlap each other. This manager will create as many inner lines as needed and will calculate the placement of all activities on these lines.

since

1.0

Type parameters

  • R: Row<Row, Row, A>

    the type of the row that will be managed

  • A: Activity

    the type of the activities that will be managed

Hierarchy

Implements

Index

Constructors

constructor

  • Constructs a new automatic lines manager. The constructor requires a reference to the graphics view to lookup various parameters that are needed when the manager queries the activity repository of the row (e.g. the currently displayed temporal unit and the list of layers).

    since

    1.0

    Parameters

    • row: R

      the managed row

    • graphics: GraphicsBase<R>

      the graphics view where the manager will be used

    Returns AutoLinesManager

Methods

getGraphics

  • Returns the graphics view where the manager will be used.

    since

    1.0

    Returns GraphicsBase<R>

    the graphics view

getLineHeight

  • getLineHeight(lineIndex: number, rowHeight: number): number
  • Returns the height of the line with the given index. In most cases the height is somewhere between 0 and Row.getHeight().

    throws

    IllegalLineIndexException - if no line with the given index exists

    since

    1.0

    Parameters

    • lineIndex: number

      the index of the line

    • rowHeight: number

      the height of the row where the line is located

    Returns number

    the height of the given line

getLineIndex

  • getLineIndex(activity: A): number
  • Returns the line index for the given activity. This method is responsible for placing activities on different lines.

    since

    1.0

    Parameters

    • activity: A

      the activity for which a line index is requested

    Returns number

    the line index of the given activity

getLineLayout

  • getLineLayout(lineIndex: number): Layout
  • Returns the layout for the line with the given line index. A row and each line within a row can have their own layout.

    throws

    IllegalLineIndexException - if no line with the given index exists

    since

    1.0

    Parameters

    • lineIndex: number

      the index of the line

    Returns Layout

    the layout of the given line

getLineLocation

  • getLineLocation(lineIndex: number, rowHeight: number): number
  • Returns the location of the line with the given index. In most cases the value of the location is somewhere between 0 and Row.getHeight(). Lines are free to overlap each other.

    throws

    IllegalLineIndexException - if no line with the given index exists

    since

    1.0

    Parameters

    • lineIndex: number

      the index of the line

    • rowHeight: number

      the height of the row where the line is located

    Returns number

    the location of the given line (y-coordinate)

getRow

  • getRow(): R
  • Returns the row for which the manager is used.

    Returns R

    the row

layout

  • layout(): void
  • Triggers a layout of the activities and calculates the line count for the row.

    since

    1.0

    Returns void

setFilter

  • setFilter(filter: function): void
  • Sets a filter that will be used in combination with a Resolver instance to figure out which activities are relevant for the calculation of overlapping activities (clusters). If the predicate returns false then the activity will not be considered when creating the clusters.

    Parameters

    • filter: function

      the filter

        • (activity: A): boolean
        • Parameters

          • activity: A

          Returns boolean

    Returns void