Home Reference Source
public class | source

Timeline

Extends:

react~React.Component → Timeline

Timeline class

Static Member Summary

Static Public Members
public static
public static

The types of interactions - see onInteraction

public static
public static

no_op: *

Alias for no op function

public static

Static Method Summary

Static Public Methods
public static

isBitSet(bit: number, mask: number): boolean

Checks if the given bit is set in the given mask

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public

refreshGrid(config: Object): *

re-computes the grid's row sizes

public
public
public
public
public

state: {"selection": *, "cursorTime": *}

Private Members
private

_grid: *

private
private
private
private
private

Method Summary

Public Methods
public

cellRenderer(width: number): *

public

changeGroup(item: object, curRow: number, newRow: number)

Move an item from one row to another

public

Clears the currently selected time range state

public
public

componentDidUpdate(prevProps: *, prevState: *)

public
public
public

getCursor(): *

public

Gets an item given its ID

public

Get the width of the timeline NOT including the left group list

public

grid_ref_callback(reactComponent: Object)

Set the grid ref.

public

Returns an item given its DOM element

public
public

render(): *

public

rowHeight(objectPattern: {"index": *}): *

Helper for react virtuaized to get the row height given a row index

public

select_ref_callback(reactComponent: Object)

Set the select box ref.

public

setSelection(selections: Object[])

Set the currently selected time ranges (for the timebar to display)

public

setTimeMap(items: Object[], startDate: moment, endDate: moment)

Sets the internal maps used by the component for looking up item & row data

public

setUpDragging(canSelect: *, canDrag: *, canResize: *)

public

Event handler for onMouseMove.

public

Re-renders the grid when the window or container is resized

Static Public Members

public static TIMELINE_MODES: object source

public static changeTypes: * source

The types of interactions - see onInteraction

public static defaultProps: * source

public static no_op: * source

Alias for no op function

public static propTypes: * source

Static Public Methods

public static isBitSet(bit: number, mask: number): boolean source

Checks if the given bit is set in the given mask

Params:

NameTypeAttributeDescription
bit number

Bit to check

mask number

Mask to check against

Return:

boolean

True if bit is set; else false

Public Constructors

public constructor() source

Public Members

public itemRowMap: {} source

public mouse_snapped_time: * source

public refreshGrid(config: Object): * source

re-computes the grid's row sizes

public resizeTimeout: * source

public rowHeightCache: {} source

public rowItemMap: {} source

public selecting: boolean source

public state: {"selection": *, "cursorTime": *} source

Private Members

private _grid: * source

private _gridDomNode: * source

private _handleItemRowEvent: * source

private _itemInteractable: * source

private _selectBox: * source

private _selectRectangleInteractable: * source

Public Methods

public cellRenderer(width: number): * source

Params:

NameTypeAttributeDescription
width number

container width (in px)

Return:

*

public changeGroup(item: object, curRow: number, newRow: number) source

Move an item from one row to another

Params:

NameTypeAttributeDescription
item object

The item object whose groups is to be changed

curRow number

The item's current row index

newRow number

The item's new row index

public clearSelection() source

Clears the currently selected time range state

public componentDidMount() source

public componentDidUpdate(prevProps: *, prevState: *) source

Params:

NameTypeAttributeDescription
prevProps *
prevState *

public componentWillReceiveProps(nextProps: *) source

Params:

NameTypeAttributeDescription
nextProps *

public componentWillUnmount() source

public getCursor(): * source

Return:

*

public getItem(id: number): Object source

Gets an item given its ID

Params:

NameTypeAttributeDescription
id number

item id

Return:

Object

Item object

public getTimelineWidth(totalWidth: number): number source

Get the width of the timeline NOT including the left group list

Params:

NameTypeAttributeDescription
totalWidth number
  • nullable: true

Total timeline width. If not supplied we use the timeline ref

Return:

number

The width in pixels

public grid_ref_callback(reactComponent: Object) source

Set the grid ref.

Params:

NameTypeAttributeDescription
reactComponent Object

Grid react element

public itemFromElement(e: Object): Object source

Returns an item given its DOM element

Params:

NameTypeAttributeDescription
e Object

the DOM element of the item

Return:

Object

Item details

public mouseMoveFunc(e: *) source

Params:

NameTypeAttributeDescription
e *

public render(): * source

Return:

*

public rowHeight(objectPattern: {"index": *}): * source

Helper for react virtuaized to get the row height given a row index

Params:

NameTypeAttributeDescription
objectPattern {"index": *}
  • default: {"index":null}

Return:

*

public select_ref_callback(reactComponent: Object) source

Set the select box ref.

Params:

NameTypeAttributeDescription
reactComponent Object

Selectbox react element

public setSelection(selections: Object[]) source

Set the currently selected time ranges (for the timebar to display)

Params:

NameTypeAttributeDescription
selections Object[]

Of the form [[start, end], [start, end], ...]

public setTimeMap(items: Object[], startDate: moment, endDate: moment) source

Sets the internal maps used by the component for looking up item & row data

Params:

NameTypeAttributeDescription
items Object[]

The items to be displayed in the grid

startDate moment

The visible start date of the timeline

endDate moment

The visible end date of the timeline

public setUpDragging(canSelect: *, canDrag: *, canResize: *) source

Params:

NameTypeAttributeDescription
canSelect *
canDrag *
canResize *

public throttledMouseMoveFunc(e: *) source

Event handler for onMouseMove. Only calls back if a new snap time is reached

Params:

NameTypeAttributeDescription
e *

public updateDimensions() source

Re-renders the grid when the window or container is resized