0.1.31 • Published 6 years ago
react-timelinejs v0.1.31
react-timelinejs
React Timeline component
Live Demo
For examples of timeline, go to https://wizcheng.github.io/react-timelinejs
Getting Started
Install
yarn add -D react-timelinejs
Usage
import Timeline from 'react-timelinejs';
...
const data = [
{
start: new Date('2018-07-12T13:14:15'),
end: new Date('2018-07-12T15:14:15'),
label: 'My First Event 1'
},
{
start: new Date('2018-07-16:14:15'),
end: new Date('2018-07-12T17:14:15'),
label: 'My First Event 2'
},
{
start: new Date('2018-07-12T12:14:15'),
end: new Date('2018-07-12T19:14:15'),
label: 'My Second Event'
}
];
...
<Timeline data={data}/>
Properties
Props | Type | Default | Description |
---|---|---|---|
data | Array | [] | List of time line events, minimum values start,end,label |
lines | Array | [] | List of lines, minimum values date, className |
dataKey | string | null | key of data, passed to d3js, to optimize modification detection |
width | number | 700 | width of whole widget |
height | number | 400 | height of whole widget |
trackHeight | number | 20 | Max height of each track |
label | bool | true | Show label on the track or not |
tooltips | bool | true | Show tooltip on mouseover |
tooltipContent | func | TBA | function (d) => {}, to return content of tooltip |
brush | bool | false | Show brush |
brushRange | Array | null | brush range, [start, end] |
range | Array | null | range of data to focus, [start, end] |
onBrush | func | null | callback on brush change |
onMouseover | func | null | callback on mouseover event |
onClick | func | null | callback on mouse click event, (d) => {} |
Custom Styles
TBA
0.1.31
6 years ago
0.1.30
6 years ago
0.1.29
6 years ago
0.1.28
6 years ago
0.1.26
6 years ago
0.1.27
6 years ago
0.1.25
6 years ago
0.1.24
6 years ago
0.1.23
6 years ago
0.1.21
6 years ago
0.1.20
6 years ago
0.1.19
6 years ago
0.1.18
6 years ago
0.1.17
6 years ago
0.1.16
6 years ago
0.1.15
6 years ago
0.1.14
6 years ago
0.1.13
6 years ago
0.1.12
6 years ago
0.1.11
6 years ago
0.1.8
6 years ago
0.1.6
6 years ago
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago