Options
All
  • Public
  • Public/Protected
  • All
Menu

A specialized timeline model for the ChronoUnit temporal unit. This model is the default model used by the Gantt chart.

since

1.0

Hierarchy

Index

Constructors

constructor

  • Constructs a new model with the lowest unit set to minutes and the highest unit set to months. The start time gets set to ```TimeUtil.now()``.

    since

    1.0

    Returns ChronoUnitTimelineModel

Properties

timeLineModelChangeProcessHolder

timeLineModelChangeProcessHolder: ProcessHolder = new ProcessHolder(() => this._timelineModelChangeES.next())

Methods

calculateLocationForTime

  • calculateLocationForTime(time: number): number
  • Returns the pixel location of the given time.

    Parameters

    • time: number

      the time for which to return the pixel location

    Returns number

    the location of the given time

calculateTimeForLocation

  • calculateTimeForLocation(location: number): number
  • Returns the time for the given location.

    Parameters

    • location: number

      the location in pixels

    Returns number

    the location time

getHorizonEndTime

  • getHorizonEndTime(): number
  • Returns the end time of the horizon.

    Returns number

    the horizon end time

getHorizonStartTime

  • getHorizonStartTime(): number
  • Returns the start time of the horizon.

    Returns number

    the horizon start time

getMaximumMillisPerPixel

  • getMaximumMillisPerPixel(): number
  • Returns the maximum number of milliseconds that will be represented by a single pixel on the screen. Zoom-Out operations will be limited by this value.

    since

    1.0

    Returns number

    the maximum MPP value

getMillisPerPixel

  • getMillisPerPixel(): number
  • Returns the millis per pixel value. This value determines how much time is represented by a single pixel in the user interface. Changing the value of this property will cause the control to show more or less time within the visible timeline area, meaning zooming can be controlled by this value.

    Returns number

getMinimumMillisPerPixel

  • getMinimumMillisPerPixel(): number
  • Returns the minimum number of milliseconds that will be represented by a single pixel on the screen. Zoom-In operations will be limited by this value.

    since

    1.0

    Returns number

    the minimum MPP value

getNow

  • getNow(): number
  • Returns "now", the current time, e.g. the current system time.

    Returns number

    the "now" time

getNowLocation

  • getNowLocation(): number
  • Returns the location of the "now" time. The location can be computed based on the millis per pixel and the start time value.

    Returns number

    the pixel location of "now"

getSmallestTemporalUnit

getStartTime

  • getStartTime(): number
  • Returns the first visible time point.

    Returns number

    the start time

getTimelineModelChangeObs

requestToRedrawTimeline

  • requestToRedrawTimeline(): void

setHorizonEndTime

  • setHorizonEndTime(time: number): void
  • Sets the value of horizonEndTimeProperty().

    Parameters

    • time: number

      the horizon end time

    Returns void

setHorizonStartTime

  • setHorizonStartTime(time: number): void
  • Sets the start time of the horizon.

    Parameters

    • time: number

      the horizon start time

    Returns void

setMaximumMillisPerPixel

  • setMaximumMillisPerPixel(max: number): void
  • Sets the maximum MPP value.

    since

    1.0

    see

    setZoomRange(TemporalUnit, int, double, TemporalUnit, int, double)

    Parameters

    • max: number

      the maximum MPP value

    Returns void

setMillisPerPixel

  • setMillisPerPixel(millis: number): void
  • Sets the millis represented by a pixel().

    Parameters

    • millis: number

      the millis represented by a pixel

    Returns void

setMinimumMillisPerPixel

  • setMinimumMillisPerPixel(min: number): void
  • Sets the minimum MPP value.

    since

    1.0

    see

    setZoomRange(TemporalUnit, int, double, TemporalUnit, int, double)

    Parameters

    • min: number

      the minimum MPP value

    Returns void

setNow

  • setNow(now: number): void
  • Sets "now", the current time, e.g. the current system time.

    Parameters

    • now: number

      the "now" time

    Returns void

setStartTime

  • setStartTime(newTime: number): void
  • Sets the first visible time point.

    Parameters

    • newTime: number

      the start time

    Returns void

setStartTimeAndMillisPerPixel

  • setStartTimeAndMillisPerPixel(newTime: number, millis: number): void
  • Sets the first visible time point and the millis represented by a pixel() holding time line model change process holder.

    see

    setStartTime(newTime), setMillisPerPixel(millis)

    Parameters

    • newTime: number

      the start time

    • millis: number

      the millis represented by a pixel

    Returns void

setZoomRange

  • setZoomRange(smallestUnit: ChronoUnit, smallestUnitCount: number, smallestUnitWidth: number, largestUnit: ChronoUnit, largestUnitCount: number, largestUnitWidth: number): void
  • Sets the range in which the user can zoom in and out of the timeline.

    since

    1.0

    see

    ``setMinimumMillisPerPixel(double),setMaximumMillisPerPixel(double)```

    Parameters

    • smallestUnit: ChronoUnit

      the smallest unit to which the user can zoom (e.g. "MINUTES")

    • smallestUnitCount: number

      the number of smallest units (e.g. "5" MINUTES)

    • smallestUnitWidth: number

      the width of the unit in pixels, must be larger than 10 (e.g. "30")

    • largestUnit: ChronoUnit

      the largest unit to which the user can zoom (e.g. "YEARS")

    • largestUnitCount: number

      the number of largest units (e.g. "1" YEAR)

    • largestUnitWidth: number

      the width of the unit in pixels, must be larger than 10 (e.g. "30")

    Returns void

Static computeMillisPerPixel

  • computeMillisPerPixel(targetPixelsCount: number, durationUnit?: ChronoUnit, durationScalar?: number): number
  • Computes the millis per pixel for a given target pixels count and its corresponding duration.

    since

    1.0

    Parameters

    • targetPixelsCount: number
    • Default value durationUnit: ChronoUnit = ChronoUnit.DAYS
    • Default value durationScalar: number = 1

    Returns number