Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-gantt-timeline

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-gantt-timeline

[![npm](https://img.shields.io/npm/v/react-gantt-timeline.svg?style=flat-square)](http://npm.im/react-gantt-timeline) [![MIT License](https://img.shields.io/npm/l/react-list.svg?style=flat-square)](http://opensource.org/licenses/MIT) [![Travis](https://tr

  • 0.3.1
  • npm
  • Socket score

Version published
Weekly downloads
531
increased by27.64%
Maintainers
1
Weekly downloads
 
Created
Source

react-gantt-timeline

npm MIT License Travis codecov Codacy Badge

A react timeline gantt component.

alt text

About

React-timeline-gantt is a component built to display and manage calendar gantt charts. It use virtual rendering to be reactive an efficient.

The component is capable of:

  • Can handle 100 thousands
  • Infinite calendar scrolling
  • Three Zoom levels : day, week, month
  • Fully customizable.
  • Support all CRUD operations.
  • Task and Link creation.
  • Support Paging.
  • Can be easily integrated with Redux

To watch a demo take a look at video that shows how to use the component.

To play with a live demo .

Installation

npm install react-gantt-timeline

The component has the following dependencies: moment, react-sizeme

Getting started

The first thing to once the component has been install and all it dependencies is create the data that the timeline component consume.The time line has two data providers data and links.

Data :is an array of objects that contains the task to be shown. Each one of the object that are part of the array need to have the following compulsory fields

PropertyvalueDescriptions
idString/NumberAn unique identifier for the class
startDateThe start date of the task
endDateThe end date of the task
nameStringThe name of the task to be diplayed
color (optional)StringThe color of the task to be diplayed

An example of data definition:

 let data=[ {id:1,start:new Date(), end:new Date()+1 ,name:'Demo Task 1'},
			{id:2,start:new Date(), end:new Date()+1 ,name:'Demo Task 2'}]

Links :is also an array of objects that contains links between task. Each one of the object that are part of the array need to have the following compulsory fields:

PropertyvalueDescriptions
idString/NumberAn unique identifier for the class
startString/NumberThe id of the start task
endString/NumberThe id of the end task

An example of data definition:

 let links=[ {id:1,start:1, end:2},
			{id:2,start:1, end:3}]

Once the data is define we just need to declare the component and populate it with both data providers.


<TimeLine  data={data} links={links}/>);

Here is the demo code:

Edit 1y2on87jj

Timeline Events

nameparamsDescriptions
onNeedDatastart:Date,end :dateIs trigger every time the timeline load a new period, provide the start and end date of the period to load, this method is useful for implementing paging or filter your data to only show tasks for the relevant period
onSelectItemitem:ObjectThis even is trigger when a item is selected by the time line
onUpdateItemitem:Object,props:ObjectThis even is trigger when a item has been updated, it receive the item to be updated and the properties and values to by apply

Other properties

PropertyvalueDescriptions
modestringset the zoom lever of the timeline.The possible values are:"month","week","day"
itemHeigthnumberThe height of the row 30px by default

Some Demo Code

  • Edit n09l7m400j Crud Demo.
  • Coming up a redux demo.

Keywords

FAQs

Package last updated on 19 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc