Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Timeline

Index

Constructors

constructor

Methods

addCustomTime

  • Add new vertical bar representing a custom time that can be dragged by the user. Parameter time can be a Date, Number, or String, and is new Date() by default. Parameter id can be Number or String and is undefined by default. The id is added as CSS class name of the custom time bar, allowing to style multiple time bars differently. The method returns id of the created bar.

    Parameters

    Returns IdType

destroy

  • destroy(): void
  • Destroy the Timeline. The timeline is removed from memory. all DOM elements and event listeners are cleaned up.

    Returns void

fit

  • Adjust the visible window such that it fits all items. See also focus(id).

    Parameters

    Returns void

focus

  • Adjust the visible window such that the selected item (or multiple items) are centered on screen. See also function fit()

    Parameters

    Returns void

  • Parameters

    • selection: any

    Returns void

getCurrentTime

  • getCurrentTime(): Date
  • Get the current time. Only applicable when option showCurrentTime is true.

    Returns Date

getCustomTime

  • Retrieve the custom time from the custom time bar with given id.

    Parameters

    • Optional id: IdType

      Id is undefined by default.

    Returns Date

getEventProperties

getItemRange

  • getItemRange(): { max: Date; min: Date }
  • Get the range of all the items as an object containing min date and max date

    Returns { max: Date; min: Date }

getSelection

  • Get an array with the ids of the currently selected items

    Returns IdType[]

getVisibleItems

  • Get an array with the ids of the currently visible items.

    Returns IdType[]

getWindow

moveTo

  • Move the window such that given time is centered on screen.

    Parameters

    • time: DateType
    • Optional options: TimelineAnimationOptions
    • Optional callback: (properties?: any) => void
        • (properties?: any): void
        • Parameters

          • Optional properties: any

          Returns void

    Returns void

off

  • off(event: TimelineEvents, callback?: (properties?: any) => void): void
  • off(event: string, callback?: (properties?: any) => void): void
  • Remove an event listener created before via function on(event[, callback]).

    Parameters

    • event: TimelineEvents
    • Optional callback: (properties?: any) => void
        • (properties?: any): void
        • Parameters

          • Optional properties: any

          Returns void

    Returns void

  • Parameters

    • event: string
    • Optional callback: (properties?: any) => void
        • (properties?: any): void
        • Parameters

          • Optional properties: any

          Returns void

    Returns void

on

  • on(event: TimelineEvents, callback?: (properties?: any) => void): void
  • on(event?: string, callback?: (properties: any) => void): void
  • Create an event listener. The callback function is invoked every time the event is triggered.

    Parameters

    • event: TimelineEvents
    • Optional callback: (properties?: any) => void
        • (properties?: any): void
        • Parameters

          • Optional properties: any

          Returns void

    Returns void

  • Parameters

    • Optional event: string
    • Optional callback: (properties: any) => void
        • (properties: any): void
        • Parameters

          • properties: any

          Returns void

    Returns void

redraw

  • redraw(): void
  • Force a redraw of the Timeline. The size of all items will be recalculated. Can be useful to manually redraw when option autoResize=false and the window has been resized, or when the items CSS has been changed.

    Returns void

removeCustomTime

  • removeCustomTime(id: IdType): void
  • Remove vertical bars previously added to the timeline via addCustomTime method.

    Parameters

    • id: IdType

      ID of the custom vertical bar returned by addCustomTime method.

    Returns void

setCurrentTime

  • Set a current time. This can be used for example to ensure that a client's time is synchronized with a shared server time. Only applicable when option showCurrentTime is true.

    Parameters

    Returns void

setCustomTime

  • Adjust the time of a custom time bar.

    Parameters

    • time: DateType

      The time the custom time bar should point to

    • Optional id: IdType

      Id of the custom time bar, and is undefined by default.

    Returns void

setCustomTimeTitle

  • setCustomTimeTitle(title: string, id?: IdType): void
  • Adjust the title attribute of a custom time bar.

    Parameters

    • title: string

      The title shown when hover over time bar

    • Optional id: IdType

      Id of the custom time bar, and is undefined by default.

    Returns void

setData

  • Set both groups and items at once. Both properties are optional. This is a convenience method for individually calling both setItems(items) and setGroups(groups). Both items and groups can be an Array with Objects, a DataSet (offering 2 way data binding), or a DataView (offering 1 way data binding).

    Parameters

    Returns void

setGroups

setItems

setOptions

  • Set or update options. It is possible to change any option of the timeline at any time. You can for example switch orientation on the fly.

    Parameters

    Returns void

setSelection

  • Select one or multiple items by their id. The currently selected items will be unselected. To unselect all selected items, call setSelection([]).

    Parameters

    Returns void

setWindow

  • Set the current visible window.

    Parameters

    • start: DateType

      If the parameter value of start is null, the parameter will be left unchanged.

    • end: DateType

      If the parameter value of end is null, the parameter will be left unchanged.

    • Optional options: TimelineAnimationOptions

      Timeline animation options. See TimelineAnimationOptions

    • Optional callback: () => void

      The callback function

        • (): void
        • Returns void

    Returns void

  • Parameters

    • start: any
    • date: any

    Returns void

toggleRollingMode

  • toggleRollingMode(): void
  • Toggle rollingMode.

    Returns void

zoomIn

  • Zoom in the current visible window.

    Parameters

    • percentage: number

      A number and must be between 0 and 1. If null, the window will be left unchanged.

    • Optional options: TimelineAnimationOptions

      Timeline animation options. See TimelineAnimationOptions

    • Optional callback: () => void

      The callback function

        • (): void
        • Returns void

    Returns void

zoomOut

  • Zoom out the current visible window.

    Parameters

    • percentage: number

      A number and must be between 0 and 1. If null, the window will be left unchanged.

    • Optional options: TimelineAnimationOptions

      Timeline animation options. See TimelineAnimationOptions

    • Optional callback: () => void

      The callback function

        • (): void
        • Returns void

    Returns void

Generated using TypeDoc