2.3.0 • Published 11 months ago

react-gantt-month v2.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

react-gantt

npm npm GitHub stars

Gantt chart react component

Please ★ this repo if you found it useful ★ ★ ★

Submit your ReactGantt use cases and I will feature them in the in the used by section

Built by Silicon Hills LLC

index

Silicon Hills offers premium Node and React develpoment and support services. Get in touch at nuevesolutions.com.

Features

  • Multiple steps
  • Custom styles
  • Dynamic bounds

Demo

See a demo

Installation

npm install --save react-gantt

Dependencies

Usage

import ReactGantt, { GanttRow } from 'react-gantt';

class Demo extends Component {
  render() {
    return (
      <ReactGantt
        templates={{
          myTasks: {
            title: 'My Tasks',
            steps: [
              {
                name: 'Task Phase One',
                color: '#0099FF'
              },
              {
                name: 'Task Phase Two',
                color: '#FF9900'
              }
            ]
          }
        }}
        leftBound={moment().set({hour: 0, date: 30, month: 5, year: 2016}).toDate()}
        rightBound={moment().set({hour: 0, date: 29, month: 8, year: 2016}).toDate()}
      >
        <GanttRow
          title="Task 1"
          templateName="myTasks"
          steps={[
            moment().set({hour: 0, date: 1, month: 6, year: 2016}).toDate(),
            moment().set({hour: 0, date: 4, month: 8, year: 2016}).toDate(),
            moment().set({hour: 0, date: 17, month: 8, year: 2016}).toDate()
          ]}
        />
        <GanttRow
          title="Task 1"
          templateName="myTasks"
          steps={[
            moment().set({hour: 0, date: 27, month: 2, year: 2016}).toDate(),
            moment().set({hour: 0, date: 9, month: 7, year: 2016}).toDate(),
            moment().set({hour: 0, date: 22, month: 7, year: 2016}).toDate()
          ]}
        />
      </ReactGantt>
    );
  }
}

Props

ReactGantt

Prop NameTypeBehavior
childrenGanttRowGantt Rows initialized by you
dateFormatStringString format to display dates
dayFormatStringFormat used when timeline is in 'day' window
debugBooleanIncludes extra detailed outputs to show calculated values
hourFormatStringFormat used when timeline is in 'hourly' window
leftBoundObjectDate representation of the chart 'beginning' (left-most) date
minuteFormatStringFormat used when timeline is in 'minute' window
monthFormatStringFormat used when timeline is in 'monthly' window
rightBoundObjectDate representation of chart's ending (right-most) date
secondFormatStringFormat used when timeline is in 'seconds' window
styleObjectCSS object for chart customization
templatesObjectObject with keys representing potential states and values for state title and style
timeFormatStringIs this used?
timelineStyleObjectObject for styles to be used in timeline component, namely the allowed width between ticks
weekFormatStringFormat used when timeline is in 'weekly' window
yearFormatStringFormat used when timeline is in 'yearly' window

GanttTimeline

Prop NameTypeBehavior
styleObjectCustomize the calculated appearance of the timeline. In pixels: tickWidth, paddingLeft, minWidth
rowsArrayThe parent's GanttRows (is this deprecated?)
scalingFactorNumberAllows customization of the calculated # of ticks

GanttRow

Prop NameTypeBehavior
barStyleObjectStyle object for gantt bar
popupStyleObjectStyle object for popup modal
markerStyleObjectStyle object for cursor
stepsArrayArray of steps that bar passes through (needs to exceed the templates steps by 1? Why?)
templateNameStringTemplate name to load style and step titles
titleStringTitle to be displayed alongside bar

GanttBar

Prop NameTypeBehavior
styleObjectCSS object for bar styles
stepsArrayArray of steps that bar passes through (needs to exceed the templates steps by 1? Why?)
templateNameStringTemplate name to load style and step titles

GanttPopup

Prop NameTypeBehavior
styleObjectCSS Object for popup style
markerTimeObjectTime object represnting cursor position on parent GanttBar
activeStepObjectObject representing current step cursor is hovering on parent GanttBar
titleStringTitle (same as parent Gantt bar)
titleStyleObjectStyle for title displayed on pop up

Support

Submit an issue

Screenshots

react-gantt

Contributing

Review the guidelines for contributing

License

MIT License

Jam Risser © 2018

Changelog

Review the changelog

Credits

Used By

  • ModernGreek - The next generation of fraternity and sorority apparel
  • yerbaBuena - a superpowered approach to electronic medical records
  • TaskCluster - task execution framework that supports Mozilla's continuous integration and release processes

Support on Liberapay

A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.

Add some fuel if you'd like to keep me going!

Liberapay receiving Liberapay patrons

2.3.0

11 months ago

2.2.3

11 months ago

2.2.2

11 months ago

2.2.1

11 months ago

2.2.0

11 months ago

2.1.9

11 months ago

2.1.8

11 months ago