Convert Figma logo to code with AI

frappe logogantt

Open Source Javascript Gantt

4,602
1,021
4,602
81

Top Related Projects

1,440

GPL version of Javascript Gantt Chart

🍞📅A JavaScript calendar that has everything you need.

jQuery Gantt editor

Gantt Gantt Gantt Timeline Schedule Calendar [ javascript gantt, js gantt, projects gantt, timeline, scheduler, gantt timeline, reservation timeline, react gantt, angular gantt, vue gantt, svelte gantt, booking manager ]

Quick Overview

Frappe Gantt is a simple, interactive, modern Gantt chart library for the web. It allows developers to create and manage project timelines and tasks visually, with features like drag-and-drop task management and dynamic updates.

Pros

  • Easy to integrate and customize
  • Responsive design, works well on various screen sizes
  • Supports task dependencies and progress tracking
  • Lightweight and performant

Cons

  • Limited advanced features compared to some commercial alternatives
  • Documentation could be more comprehensive
  • May require additional styling for complex UI requirements
  • Limited built-in export options

Code Examples

Creating a basic Gantt chart:

const tasks = [
  {
    id: 'Task 1',
    name: 'Redesign website',
    start: '2023-01-01',
    end: '2023-01-10',
    progress: 20
  },
  // Add more tasks here
];

const gantt = new Gantt("#gantt", tasks);

Adding task click event:

gantt.on('task_click', (task) => {
  console.log(`Clicked task: ${task.name}`);
});

Updating task progress:

gantt.change_progress('Task 1', 50);

Getting Started

  1. Include the Frappe Gantt CSS and JS files in your HTML:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/frappe-gantt/dist/frappe-gantt.css">
<script src="https://cdn.jsdelivr.net/npm/frappe-gantt/dist/frappe-gantt.min.js"></script>
  1. Create a container element in your HTML:
<div id="gantt"></div>
  1. Initialize the Gantt chart in your JavaScript:
const tasks = [
  {
    id: 'Task 1',
    name: 'Project Kickoff',
    start: '2023-05-01',
    end: '2023-05-05',
    progress: 0
  },
  {
    id: 'Task 2',
    name: 'Design Phase',
    start: '2023-05-06',
    end: '2023-05-15',
    progress: 0,
    dependencies: 'Task 1'
  }
];

const gantt = new Gantt("#gantt", tasks, {
  view_modes: ['Quarter Day', 'Half Day', 'Day', 'Week', 'Month'],
  bar_height: 40,
  bar_corner_radius: 3,
  arrow_curve: 5,
  padding: 18
});

This will create a basic Gantt chart with two tasks, including a dependency between them. You can customize the appearance and behavior further using the available options and methods provided by the library.

Competitor Comparisons

1,440

GPL version of Javascript Gantt Chart

Pros of DHTMLX Gantt

  • More feature-rich with advanced functionality like resource management and critical path calculation
  • Extensive documentation and examples for easier implementation
  • Regular updates and active community support

Cons of DHTMLX Gantt

  • Commercial license required for most use cases
  • Steeper learning curve due to more complex API
  • Larger file size and potential performance impact for simpler projects

Code Comparison

DHTMLX Gantt:

gantt.init("gantt_here");
gantt.parse({
  data: [
    {id: 1, text: "Task 1", start_date: "2023-05-01", duration: 5},
    {id: 2, text: "Task 2", start_date: "2023-05-06", duration: 3}
  ]
});

Frappe Gantt:

var tasks = [
  {id: 'Task 1', name: 'Task 1', start: '2023-05-01', end: '2023-05-05'},
  {id: 'Task 2', name: 'Task 2', start: '2023-05-06', end: '2023-05-08'}
];
var gantt = new Gantt("#gantt", tasks);

Both libraries offer similar basic functionality for creating Gantt charts, but DHTMLX Gantt provides more built-in features and customization options. Frappe Gantt has a simpler API and is more lightweight, making it suitable for smaller projects or those requiring minimal Gantt chart functionality.

🍞📅A JavaScript calendar that has everything you need.

Pros of tui.calendar

  • More comprehensive calendar features, including day, week, month views
  • Supports various calendar types (e.g., Google Calendar, iCal)
  • Extensive customization options and theming capabilities

Cons of tui.calendar

  • Steeper learning curve due to more complex API
  • Larger file size and potentially heavier performance impact
  • May be overkill for simple timeline or Gantt chart needs

Code Comparison

tui.calendar:

const calendar = new Calendar('#calendar', {
  defaultView: 'week',
  taskView: true,
  scheduleView: ['time'],
  template: {
    milestone: function(schedule) {
      return '<span style="color:red;">' + schedule.title + '</span>';
    }
  }
});

gantt:

const tasks = [
  {
    id: 'Task 1',
    name: 'Redesign website',
    start: '2019-01-01',
    end: '2019-01-05',
    progress: 20
  }
];
const gantt = new Gantt("#gantt", tasks);

tui.calendar offers more advanced calendar functionality and customization, while gantt focuses specifically on Gantt charts with a simpler API. tui.calendar is better suited for complex scheduling needs, whereas gantt is ideal for straightforward project timeline visualization.

jQuery Gantt editor

Pros of jQueryGantt

  • More feature-rich with advanced functionalities like resource management and critical path calculation
  • Offers a wider range of customization options and styling capabilities
  • Includes built-in export features for various formats (PDF, PNG, XML)

Cons of jQueryGantt

  • Larger file size and potentially heavier performance impact due to more complex codebase
  • Steeper learning curve for implementation and customization
  • Dependency on jQuery library, which may not be ideal for all projects

Code Comparison

jQueryGantt:

var g = new JSGantt.GanttChart(document.getElementById('GanttChartDIV'), 'week');
g.setShowRes(1);
g.setShowDur(1);
g.setShowComp(1);
g.Draw();

Gantt:

var tasks = [
  {id: "Task 1", start: '2018-10-01', end: '2018-10-08'},
  {id: "Task 2", start: '2018-10-03', end: '2018-10-06'}
];
var gantt = new Gantt("#gantt", tasks);

The code comparison shows that jQueryGantt requires more setup and configuration, while Gantt offers a simpler initialization process. jQueryGantt provides more granular control over chart features, whereas Gantt focuses on a streamlined approach for basic Gantt chart functionality.

Gantt Gantt Gantt Timeline Schedule Calendar [ javascript gantt, js gantt, projects gantt, timeline, scheduler, gantt timeline, reservation timeline, react gantt, angular gantt, vue gantt, svelte gantt, booking manager ]

Pros of gantt-schedule-timeline-calendar

  • More feature-rich with advanced scheduling capabilities
  • Supports multiple views (timeline, calendar, etc.)
  • Highly customizable with extensive API and event handling

Cons of gantt-schedule-timeline-calendar

  • Steeper learning curve due to increased complexity
  • Larger file size and potentially higher performance overhead
  • Less straightforward implementation for simple Gantt charts

Code Comparison

gantt-schedule-timeline-calendar:

import { GSTCResult } from 'gantt-schedule-timeline-calendar';
const gstc = GSTCResult({
  element: document.getElementById('gstc'),
  config: {
    // Complex configuration options
  }
});

gantt:

import { Gantt } from 'frappe-gantt';
const gantt = new Gantt("#gantt", tasks, {
  // Simple configuration options
});

The code comparison shows that gantt-schedule-timeline-calendar requires more complex configuration, while gantt offers a simpler setup for basic Gantt charts. gantt-schedule-timeline-calendar provides more flexibility and features at the cost of increased complexity, whereas gantt focuses on simplicity and ease of use for straightforward Gantt chart implementations.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Frappe Gantt

A simple, interactive, modern gantt chart library for the web

View the demo »

Install

npm install frappe-gantt

Usage

Include it in your HTML:

<script src="frappe-gantt.min.js"></script>
<link rel="stylesheet" href="frappe-gantt.css">

And start hacking:

var tasks = [
  {
    id: 'Task 1',
    name: 'Redesign website',
    start: '2016-12-28',
    end: '2016-12-31',
    progress: 20,
    dependencies: 'Task 2, Task 3',
    custom_class: 'bar-milestone' // optional
  },
  ...
]
var gantt = new Gantt("#gantt", tasks);

You can also pass various options to the Gantt constructor:

var gantt = new Gantt("#gantt", tasks, {
  header_height: 50,
  column_width: 30,
  step: 24,
  view_modes: ["Quarter Day", "Half Day", "Day", "Week", "Month"],
  bar_height: 20,
  bar_corner_radius: 3,
  arrow_curve: 5,
  padding: 18,
  view_mode: "Day",
  date_format: "YYYY-MM-DD",
  language: "en", // or 'es', 'it', 'ru', 'ptBr', 'fr', 'tr', 'zh', 'de', 'hu'
  custom_popup_html: null,
});

You can add dark class to the container element to apply dark theme.

<div class="gantt-target dark"></div>

Contributing

If you want to contribute enhancements or fixes:

  1. Clone this repo.
  2. cd into project directory
  3. yarn
  4. yarn run dev
  5. Open index.html in your browser, make your code changes and test them.

Publishing

If you have publishing rights (Frappe Team), follow these steps to publish a new version.

Assuming the last commit (or a couple of commits) were enhancements or fixes,

  1. Run yarn build

    This will generate files in the dist/ folder. These files need to be committed.

  2. Run yarn publish

  3. Type the new version at the prompt

    Depending on the type of change, you can either bump the patch version or the minor version. For e.g.,

    0.5.0 -> 0.6.0 (minor version bump)
    0.5.0 -> 0.5.1 (patch version bump)
    
  4. Now, there will be a commit named after the version you just entered. Include the generated files in dist/ folder as part of this commit by running the command:

    git add dist
    git commit --amend
    git push origin master
    

License: MIT


Project maintained by frappe

NPM DownloadsLast 30 Days