You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

gantt-task-timeline-react

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gantt-task-timeline-react

A customized version of gantt-task-react with baseline support & Multiple Tasks in a Single Row

0.0.8
latest
Source
npmnpm
Version published
Weekly downloads
100
-54.55%
Maintainers
0
Weekly downloads
 
Created
Source

gantt-task-timeline-react

📌 This is a customized fork of gantt-task-react.

Customizations

  • Support for Multiple Tasks in a Single Row • Renders multiple bars in the same row using siblingTasks • If task dates do not overlap, they are placed on the same line; overlapping tasks are stacked vertically • Custom Y-position calculation implemented in bar-helper.ts

📌New Task properties

 siblingTasks?: Task[]; // Used to render multiple bars within the same row
  • Custom Dependency (Arrow) Rendering • Draws arrows between tasks based on dependencies • Supports arrow connections between siblingTasks within the same row

  • Automatic Line Wrapping Inside Bars • If a bar is too narrow, the task name is automatically wrapped using • If there are multiple lines, the bar height expands dynamically (up to rowHeight) • Text remains vertically centered within the bar

License

This project is licensed under the MIT License. Original copyright © 2020 MaTeMaTuK

gantt-task-react

Interactive Gantt Chart for React with TypeScript.

example

Live Demo

Install

npm install gantt-task-timeline-react

How to use it

import { Gantt, Task, EventOption, StylingOption, ViewMode, DisplayOption } from 'gantt-task-react';
import "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*TaskTasks array.
EventOptioninterfaceSpecifies gantt events.
DisplayOptioninterfaceSpecifies view type and display timeline language.
StylingOptioninterfaceSpecifies chart and global tasks styles

EventOption

Parameter NameTypeDescription
onSelect(task: Task, isSelected: boolean) => voidSpecifies the function to be executed on the taskbar select or unselect event.
onDoubleClick(task: Task) => voidSpecifies the function to be executed on the taskbar onDoubleClick event.
onClick(task: Task) => voidSpecifies the function to be executed on the taskbar onClick event.
onDelete*(task: Task) => void/boolean/Promise/PromiseSpecifies the function to be executed on the taskbar on Delete button press event.
onDateChange*(task: Task, children: Task[]) => void/boolean/Promise/PromiseSpecifies the function to be executed when drag taskbar event on timeline has finished.
onProgressChange*(task: Task, children: Task[]) => void/boolean/Promise/PromiseSpecifies the function to be executed when drag taskbar progress event has finished.
onExpanderClick*onExpanderClick: (task: Task) => void;Specifies the function to be executed on the table expander click
timeStepnumberA time step value for onDateChange. Specify in milliseconds.

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

DisplayOption

Parameter NameTypeDescription
viewModeenumSpecifies the time scale. 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 fist task
localestringSpecifies the month name language. Able formats: ISO 639-2, Java Locale.
rtlbooleanSets rtl mode.

StylingOption

Parameter NameTypeDescription
headerHeightnumberSpecifies the header height.
ganttHeightnumberSpecifies the gantt chart height without header. Default is 0. It`s mean no height limitation.
columnWidthnumberSpecifies the time period width.
listCellWidthstringSpecifies the task list cell width. Empty string is mean "no display".
rowHeightnumberSpecifies the task row height.
barCornerRadiusnumberSpecifies the taskbar corner rounding.
barFillnumberSpecifies the taskbar occupation. Sets in percent from 0 to 100.
handleWidthnumberSpecifies width the taskbar drag event control for start and end dates.
fontFamilystringSpecifies the application font.
fontSizestringSpecifies the application font size.
barProgressColorstringSpecifies the taskbar progress fill color globally.
barProgressSelectedColorstringSpecifies the taskbar progress fill color globally on select.
barBackgroundColorstringSpecifies the taskbar background fill color globally.
barBackgroundSelectedColorstringSpecifies the taskbar background fill color globally on select.
arrowColorstringSpecifies the relationship arrow fill color.
arrowIndentnumberSpecifies the relationship arrow right indent. Sets in px
todayColorstringSpecifies the current period column fill color.
TooltipContentSpecifies the Tooltip view for selected taskbar.
TaskListHeaderSpecifies the task list Header view
TaskListTableSpecifies the task list Table view
  • TooltipContent: React.FC<{ task: Task; fontSize: string; fontFamily: string; }>;
  • TaskListHeader: React.FC<{ headerHeight: number; rowWidth: string; fontFamily: string; fontSize: string;}>;
  • TaskListTable: React.FC<{ rowHeight: number; rowWidth: string; fontFamily: string; fontSize: string; locale: string; tasks: Task[]; selectedTaskId: string; setSelectedTask: (taskId: string) => void; }>;

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.
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

react

FAQs

Package last updated on 30 Jul 2025

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