Home Reference Source

Function

Static Public Summary
public

Default group (row) renderer class

public

Default item renderer class

public

Marker(props: *): *

public

getDurationFromPixels(pixels: number, vis_start: moment, vis_end: moment, total_width: number): moment

Returns the duration from the vis_start

public

Use to find the height of a row, given a set of items

public

Gets the row number for a given x and y pixel location

public

Gets the row object for a given x and y pixel location

public

getPixelAtTime(time: objects, vis_start: moment, vis_end: moment, total_width: number): number

Get the pixel location at a specific time

public

Gets the row number for a given row object

public

getSnapPixelFromDelta(delta: number, vis_start: moment, vis_end: moment, total_width: number, snapMinutes: number): *

public

getTimeAtPixel(pixel_location: number, vis_start: moment, vis_end: moment, total_width: number, snapMinutes: number): moment

Get the time at a pixel location

public

Gets the true bottom location given an object

public

Gets the vertical margins and borders given an object

public

Convert integer to pixel string.

public

Converts a pixel string to an int

public

pixelsPerMinute(vis_start: moment, vis_end: moment, total_width: number): float

Get the pixels per minute

public

rowLayerRenderer(layers: Object[], vis_start: moment, vis_end: moment, total_width: number, itemHeight: number): *

Render row layers

public

sumStyle(style: string, diff: number): string

Add int pixels to a css style (left or top generally)

public

timeSnap(time: moment, snapSeconds: number): moment

Snaps a moment object to the given resolution

Static Public

public DefaultGroupRenderer(props: object): * source

import {DefaultGroupRenderer} from 'react-timeline-9000/src/components/renderers.js'

Default group (row) renderer class

Params:

NameTypeAttributeDescription
props object

Component props

props.group object

The group to be rendered

props.group.title string

The group's title

props.group.id string

The group's id

props.rest ...object
  • nullable: true

Any other arguments for the span tag

Return:

*

public DefaultItemRenderer(props: object): * source

import {DefaultItemRenderer} from 'react-timeline-9000/src/components/renderers.js'

Default item renderer class

Params:

NameTypeAttributeDescription
props object

Component props

props.item object

The item to be rendered

props.item.title string

The item's title

props.rest ...object
  • nullable: true

Any other arguments for the span tag

Return:

*

public Marker(props: *): * source

Params:

NameTypeAttributeDescription
props *

Return:

*

public getDurationFromPixels(pixels: number, vis_start: moment, vis_end: moment, total_width: number): moment source

import {getDurationFromPixels} from 'react-timeline-9000/src/utils/timeUtils.js'

Returns the duration from the vis_start

Params:

NameTypeAttributeDescription
pixels number
vis_start moment

The visible start of the timeline

vis_end moment

The visible end of the timeline

total_width number

The width in pixels of the grid

Return:

moment

Moment duration

public getMaxOverlappingItems(items: Object[]): number source

import {getMaxOverlappingItems} from 'react-timeline-9000/src/utils/itemUtils.js'

Use to find the height of a row, given a set of items

Params:

NameTypeAttributeDescription
items Object[]

List of items

Return:

number

Max row height

public getNearestRowNumber(x: number, y: number, topDiv: Object): number source

import {getNearestRowNumber} from 'react-timeline-9000/src/utils/itemUtils.js'

Gets the row number for a given x and y pixel location

Params:

NameTypeAttributeDescription
x number

The x coordinate of the pixel location

y number

The y coordinate of the pixel location

topDiv Object

Div to search under

Return:

number

The row number

public getNearestRowObject(x: number, y: number, topDiv: Object): Object source

import {getNearestRowObject} from 'react-timeline-9000/src/utils/itemUtils.js'

Gets the row object for a given x and y pixel location

Params:

NameTypeAttributeDescription
x number

The x coordinate of the pixel location

y number

The y coordinate of the pixel location

topDiv Object

Div to search under

Return:

Object

The row object at that coordinate

public getPixelAtTime(time: objects, vis_start: moment, vis_end: moment, total_width: number): number source

import {getPixelAtTime} from 'react-timeline-9000/src/utils/timeUtils.js'

Get the pixel location at a specific time

Params:

NameTypeAttributeDescription
time objects

The time (moment) object

vis_start moment

The visible start of the timeline

vis_end moment

The visible end of the timeline

total_width number

The width in pixels of the grid

Return:

number

The pixel offset

public getRowObjectRowNumber(elem: Object): number source

import {getRowObjectRowNumber} from 'react-timeline-9000/src/utils/itemUtils.js'

Gets the row number for a given row object

Params:

NameTypeAttributeDescription
elem Object

The row object

Return:

number

The row number

public getSnapPixelFromDelta(delta: number, vis_start: moment, vis_end: moment, total_width: number, snapMinutes: number): * source

import {getSnapPixelFromDelta} from 'react-timeline-9000/src/utils/timeUtils.js'

Params:

NameTypeAttributeDescription
delta number

the delta distance in pixels

vis_start moment

the visible start of the timeline

vis_end moment

the visible end of the timeline

total_width number

the pixel width of the timeline

snapMinutes number

the number of minutes to snap to

Return:

*

public getTimeAtPixel(pixel_location: number, vis_start: moment, vis_end: moment, total_width: number, snapMinutes: number): moment source

import {getTimeAtPixel} from 'react-timeline-9000/src/utils/timeUtils.js'

Get the time at a pixel location

Params:

NameTypeAttributeDescription
pixel_location number

the pixel location (generally from left css style)

vis_start moment

The visible start of the timeline

vis_end moment

The visible end of the timeline

total_width number

The pixel width of the timeline (row portion)

snapMinutes number

The snap resolution (in mins)

Return:

moment

Moment object

public getTrueBottom(elem: Object): number source

import {getTrueBottom} from 'react-timeline-9000/src/utils/itemUtils.js'

Gets the true bottom location given an object

Params:

NameTypeAttributeDescription
elem Object

an element

Return:

number

the pixel position of the bottom of the element

public getVerticalMarginBorder(elem: Object): number source

import {getVerticalMarginBorder} from 'react-timeline-9000/src/utils/itemUtils.js'

Gets the vertical margins and borders given an object

Params:

NameTypeAttributeDescription
elem Object

The row object

Return:

number

the pixel position of the bottom of the element

public intToPix(int: number): string source

Convert integer to pixel string. If not an integer the input is returned as is

Params:

NameTypeAttributeDescription
int number

Integer value

Return:

string

Pixel string

public pixToInt(pix: string): number source

Converts a pixel string to an int

Params:

NameTypeAttributeDescription
pix string

Pixel string

Return:

number

Integer value of the pixel string

public pixelsPerMinute(vis_start: moment, vis_end: moment, total_width: number): float source

import {pixelsPerMinute} from 'react-timeline-9000/src/utils/timeUtils.js'

Get the pixels per minute

Params:

NameTypeAttributeDescription
vis_start moment

The moment specifying the start of the visible timeline range

vis_end moment

The moment specifying the end of the visible timeline range

total_width number

The width of the timeline in pixels

Return:

float

The pixels per minute

public rowLayerRenderer(layers: Object[], vis_start: moment, vis_end: moment, total_width: number, itemHeight: number): * source

import {rowLayerRenderer} from 'react-timeline-9000/src/utils/itemUtils.js'

Render row layers

Params:

NameTypeAttributeDescription
layers Object[]

List of layers to render for this row

vis_start moment

The visible start of the timeline

vis_end moment

The visible end of the timeline

total_width number

pixel width of the timeline

itemHeight number

The layer height in px

Return:

*

public sumStyle(style: string, diff: number): string source

Add int pixels to a css style (left or top generally)

Params:

NameTypeAttributeDescription
style string

Style string in css format

diff number

The pixels to add/subtract

Return:

string

Style as string for css use

public timeSnap(time: moment, snapSeconds: number): moment source

Snaps a moment object to the given resolution

Params:

NameTypeAttributeDescription
time moment

The moment to snap

snapSeconds number

The snap time in seconds

Return:

moment

Snapped moment