Options
All
  • Public
  • Public/Protected
  • All
Menu

A repository implementation that utilizes binary interval trees to store its activities. A binary tree provides the best performance when searching for activities within a given time interval when the total number of activities is very large. The repository manages one binary tree per layer.

paramtype

A - the activity type

since

1.0

see

```Row.setRepository(ActivityRepository)``

Type parameters

Hierarchy

Implements

Index

Methods

addActivity

clearActivities

  • clearActivities(layer?: Layer): void
  • Removes the activities on the given layer from the repository. If no layer is provided, removes all activities from all layers from the repository

    since

    1.0

    Parameters

    • Optional layer: Layer

      the layer to clear or nothing to clear all activities

    Returns void

getActivities

  • getActivities(layer: Layer, startTime: number, endTime: number, temporalUnit: TemporalUnit, zoneId: ZoneId): A[]
  • Returns an array for iterating over all activities found for the given layer and time interval. This method has to return very fast as it gets called many times during rendering of the chart. A slow implementation will have a direct impact on scrolling / rendering performance.

    since

    1.0

    Parameters

    • layer: Layer

      the layer for which to return the activities

    • startTime: number

      the start time of the time interval for which to return the activities

    • endTime: number

      the end time of the time interval for which to return the activities

    • temporalUnit: TemporalUnit

      the temporal unit currently displayed in the dateline

    • zoneId: ZoneId

      the timezone currently displayed in the dateline

    Returns A[]

    the activities on the given layer and in the given time interval

getAllActivities

  • getAllActivities(): A[]
  • Returns all activities for all layers.

    since

    1.0

    Returns A[]

    all activities

getEarliestTimeUsed

  • getEarliestTimeUsed(): number | null
  • Returns the earliest time used by the activities stored in this repository / on this row. This method gets used for navigation (e.g. "scroll to earliest time used in the Gantt chart", "zoom out to show all activities").

    since

    1.0

    Returns number | null

    the earliest time used by the activities in this repository / row (null if no activities found)

getLatestTimeUsed

  • getLatestTimeUsed(): number | null
  • Returns the latest time used by the activities stored in this repository / on this row. This method gets used for navigation (e.g. "scroll to latest time used in the Gantt chart", "zoom out to show all activities").

    since

    1.0

    Returns number | null

    the latest time used by the activities in this repository / row (null if no activities found)

registerRepositoryEventCallback

removeActivity