1.0.2 • Published 3 years ago

bose-gantt-react v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Bose Gantt React Wrapper

It's a React Component, a Wrapper for the awesome Gantt chart library from Liuhao

Install

npm install bose-gantt-react

or

yarn add bose-gantt-react

Usage

Import it to your project

Using ES6 modules

import { BoseGantt } from 'bose-gantt-react

Or using CommonJS

const { BoseGantt } = require('bose-gantt-react')

Then you can use it in your react app:

class App extends React.Component {

    ...

    render() {

        return (
            ...
            <div>
                <BoseGantt
                    tasks={tasks}
                    viewMode={this.state.mode}
                    onClick={task => console.log(task)}
                    onDateChange={(task, start, end) => console.log(task, start, end)}
                    onProgressChange={(task, progress) => console.log(task, progress)}
                    onTasksChange={tasks => console.log(tasks)}
                />
            </div>
            ...

        )

    }

}

The API

The component props

PropertyDescription
tasksAccepts array of class Task
onTasksChangeAccepts a (tasks: Task[]) => void, where tasks is the new copy —manipulated— of array of tasks
onClickAccepts a (task: Task) => void, where task is the clicked task
onDateChangeAccepts a (task: Task, start: Moment, end: Moment) => void, both start and end are Moment objects
onProgressChangeAccepts a (task: Task, progress: number) => void
onViewChangeAccepts a (mode: ViewMode) => void