Home Reference Source
public class | source

Timebar

Extends:

react~React.Component → Timebar

Timebar component - displays the current time on top of the timeline

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

state: {}

Method Summary

Public Methods
public
public

On new props we check if a resolution is given, and if not we guess one

public

getPixelIncrement(date: moment, resolutionType: string): number

Gets the number of pixels per segment of the timebar section (using the resolution)

public

guessResolution(start: moment, end: moment)

Attempts to guess the resolution of the top and bottom halves of the timebar based on the viewable date range.

public

Renders the timebar

public

renderBar(resolution: string): Object[]

Renders an entire segment of the timebar (top or bottom)

public

Renderer for bottom bar.

public

Renderer for top bar.

Public Constructors

public constructor() source

Public Members

public state: {} source

Public Methods

public componentWillMount() source

public componentWillReceiveProps(nextProps: Object) source

On new props we check if a resolution is given, and if not we guess one

Params:

NameTypeAttributeDescription
nextProps Object

Props coming in

public getPixelIncrement(date: moment, resolutionType: string): number source

Gets the number of pixels per segment of the timebar section (using the resolution)

Params:

NameTypeAttributeDescription
date moment

The date being rendered. This is used to figure out how many days are in the month

resolutionType string

Timebar section resolution [Year; Month...]

Return:

number

The number of pixels per segment

public guessResolution(start: moment, end: moment) source

Attempts to guess the resolution of the top and bottom halves of the timebar based on the viewable date range. Sets resolution to state.

Params:

NameTypeAttributeDescription
start moment

Start date for the timebar

end moment

End date for the timebar

public render(): Object source

Renders the timebar

Return:

Object

Timebar component

public renderBar(resolution: string): Object[] source

Renders an entire segment of the timebar (top or bottom)

Params:

NameTypeAttributeDescription
resolution string

The resolution to render at [Year; Month...]

Return:

Object[]

A list of sections (making up a segment) to be rendered

Return Properties:

NameTypeAttributeDescription
label string

The text displayed in the section (usually the date/time)

isSelected boolean

Whether the section is being 'touched' when dragging/resizing

size number

The number of pixels the segment will take up

key number | string

Key for react

public renderBottomBar(): Object source

Renderer for bottom bar.

Return:

Object

JSX for bottom menu bar - based of time format & resolution

public renderTopBar(): Object source

Renderer for top bar.

Return:

Object

JSX for top menu bar - based of time format & resolution