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

@lowerton/gantt-task-react

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lowerton/gantt-task-react

Interactive Gantt Chart for React with TypeScript

  • 0.7.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

gantt-task-react

Interactive Gantt Chart for React with TypeScript.

A highly customizable and interactive Gantt chart component for React with TypeScript support. This repository integrates features and enhancements from the original MaTeMaTuK/gantt-task-react , the ObeoNetwork/gantt-task-react fork, and our current development, creating a comprehensive solution for managing Gantt charts.

multi-hierarchy.png

Key Features

  • Performance Improvements: Optimized rendering to handle large datasets efficiently, ensuring smooth user interactions.
  • Enhanced Customization: Allows for more extensive task styling options to match brand-specific requirements.
  • TypeScript Integration: Improved type definitions for safer and more efficient development workflows.
  • Responsive Design: Improved mobile and tablet support for better usability across different devices.
  • Dependency Management: Enhanced task dependency features, allowing for more complex project planning scenarios.
  • Advanced Timeline Navigation: Features smooth navigation across different timeframes like months and weeks.
  • Localization Support: Offers localization for various languages and date formats.
  • Event Handling: Supports comprehensive event handling for interactive features.
  • QuarterYear View Mode: Supports viewing tasks in quarterly segments, providing a flexible timeline view.

Enhancement Summary

This repository combines the foundational work of MaTeMaTuK/gantt-task-react with enhancements from ObeoNetwork, including better integration with TypeScript, improved rendering performance for large datasets, and new customization options for task styling. The project is further developed in this fork, focusing on additional usability improvements and feature expansions.

Installation

Install the package using npm:

npm install @wamra/gantt-task-react

How to use it

import { Gantt, Task, EventOption, StylingOption, ViewMode, DisplayOption } from '@wamra/gantt-task-react';
import "@wamra/gantt-task-react/dist/index.css";

let tasks: Task[] = [
  {
    start: new Date(2020, 1, 1),
    end: new Date(2020, 1, 2),
    name: 'Idea',
    id: 'Task 0',
    type: 'task',
    progress: 45,
    isDisabled: true,
    styles: { progressColor: '#ffbb54', progressSelectedColor: '#ff9e0d' },
  },
  ...
];
<Gantt tasks={tasks}/>

You may handle actions

<Gantt
  tasks={tasks}
  viewMode={view}
  onDateChange={onTaskChange}
  onTaskDelete={onTaskDelete}
  onProgressChange={onProgressChange}
  onDoubleClick={onDblClick}
  onClick={onClick}
/>

How to run example

cd ./example
npm install
npm start

Gantt Configuration

GanttProps

Parameter NameTypeDescription
tasks*TaskAn array of tasks to display in the Gantt chart.
viewModeViewModeSpecifies the time scale for the chart.
onDateChangefunctionCallback when a task's start or end date changes.
onProgressChangefunctionCallback when a task's progress changes.
onDoubleClickfunctionCallback when a task is double-clicked.
onClickfunctionCallback when a task is clicked.
rtlbooleanRight-to-left display mode.
localeLocaleLocalization for date and time formatting.
barBackgroundColorstringBackground color of task bars.
barProgressColorstringColor of the task bar's progress indicator.
projectBackgroundColorstringBackground color for project tasks.
milestoneBackgroundColorstringBackground color for milestone tasks.
todayColorstringColor of the "today" indicator line.
arrowColorstringColor of dependency arrows.
fontFamilystringFont family for the chart.
fontSizestringFont size for text within the chart.
rowHeightnumberHeight of each row.
columnWidthnumberWidth of each time unit column.
ganttHeightnumberTotal height of the Gantt chart.
ganttWidthnumberTotal width of the Gantt chart.
taskHeightnumberHeight of task bars within each row.
dependenciesbooleanDisplay task dependencies as arrows.
taskListCellWidthstringWidth of the task list cell. Empty to hide.
dragStepnumberTime step for dragging actions, in milliseconds.

EventOption

Parameter NameTypeDescription
onSelect(task: Task, isSelected: boolean) => voidFunction to execute on taskbar select/unselect event.
onDoubleClick(task: Task) => voidFunction to execute on taskbar double-click event.
onClick(task: Task) => voidFunction to execute on taskbar click event.
onDelete*(task: Task) => void/boolean/Promise/PromiseFunction to execute on taskbar delete button press event.
onDateChange*(task: Task, children: Task[]) => void/boolean/Promise/PromiseFunction to execute when dragging taskbar event on timeline finishes.
onProgressChange*(task: Task, children: Task[]) => void/boolean/Promise/PromiseFunction to execute when dragging taskbar progress event finishes.
onExpanderClick*onExpanderClick: (task: Task) => void;Function to execute on the table expander click.
onWheel*onWheel: (wheelEvent: WheelEvent) => void;Function to execute when the mouse wheel is used.
timeStepnumberTime step value for onDateChange. Specify in milliseconds.

Chart undoes operation if method returns false or error. Parameter children returns one-level deep records.

DisplayOption

Parameter NameTypeDescription
viewModeenumSpecifies the time scale. Options: Hour, Quarter Day, Half Day, Day, Week(ISO-8601, 1st day is Monday), Month, QuarterYear, Year.
viewDatedateSpecifies display date and time for display.
preStepsCountnumberSpecifies empty space before the first task.
localestringSpecifies the month name language. Able formats: ISO 639-2, Java Locale.
monthCalendarFormatstringSpecifies the month display on the calendar.
monthTaskListFormatstringSpecifies the month display on the list.
rtlbooleanSets rtl mode.
roundDateAllows customizing the way the date start/end are rounded.
checkIsHolidayTells if a date is a holiday. Impacts the style of the day and the way the date is adjusted to working days.
dateMoveStepAn object corresponding to a duration. Gives the step to adjust to the working day when moving the date allowing smooth feedback.

StylingOption

Parameter NameTypeDescription
headerHeightnumberSpecifies the header height.
columnWidthnumberSpecifies the time period width.
listCellWidthstringSpecifies the task list cell width. Empty string means "no display".
rowHeightnumberSpecifies the task row height.
barCornerRadiusnumberSpecifies the taskbar corner rounding.
barFillnumberSpecifies the taskbar occupation, in percent from 0 to 100.
handleWidthnumberSpecifies the width of the taskbar drag control for start and end dates.
fontFamilystringSpecifies the font family for the application.
fontSizestringSpecifies the font size for the application.
barProgressColorstringSpecifies the taskbar progress fill color globally.
barProgressSelectedColorstringSpecifies the taskbar progress fill color globally when selected.
barBackgroundColorstringSpecifies the taskbar background fill color globally.
barBackgroundSelectedColorstringSpecifies the taskbar background fill color globally when selected.
arrowColorstringSpecifies the relationship arrow fill color.
arrowIndentnumberSpecifies the relationship arrow right indent, in px.
todayColorstringSpecifies the current period column fill color.
TooltipContentReact.FC<{ task: Task; fontSize: string; fontFamily: string; }>;Specifies the Tooltip view for selected taskbar.
TaskListHeaderReact.FC<{ headerHeight: number; rowWidth: string; fontFamily: string; fontSize: string;}>;Specifies the task list Header view
TaskListTableReact.FC<{ rowHeight: number; rowWidth: string; fontFamily: string; fontSize: string; locale: string; tasks: Task[]; selectedTaskId: string; setSelectedTask: (taskId: string) => void; }>;Specifies the task list Table view

Task

Parameter NameTypeDescription
id*stringTask id.
name*stringTask display name.
type*stringTask display type: task, milestone, project
start*DateTask start date.
end*DateTask end date.
progress*numberTask progress. Sets in percent from 0 to 100.
assignees*string[]List of people assigned to the task
dependenciesstring[]Specifies the parent dependencies ids.
stylesobjectSpecifies the taskbar styling settings locally. Object is passed with the following attributes:
- backgroundColor: String. Specifies the taskbar background fill color locally.
- backgroundSelectedColor: String. Specifies the taskbar background fill color locally on select.
- progressColor: String. Specifies the taskbar progress fill color locally.
- progressSelectedColor: String. Specifies the taskbar progress fill color globally on select.
isDisabledboolDisables all action for current task.
fontSizestringSpecifies the taskbar font size locally.
projectstringTask project name
hideChildrenboolHide children items. Parameter works with project type only

*Required

License

MIT

Keywords

FAQs

Package last updated on 16 Oct 2024

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