{"id":13426594,"url":"https://github.com/frappe/gantt","last_synced_at":"2025-05-13T20:05:37.537Z","repository":{"id":37270747,"uuid":"66645293","full_name":"frappe/gantt","owner":"frappe","description":"Open Source Javascript Gantt","archived":false,"fork":false,"pushed_at":"2025-02-21T15:09:27.000Z","size":2407,"stargazers_count":5207,"open_issues_count":44,"forks_count":1127,"subscribers_count":103,"default_branch":"master","last_synced_at":"2025-05-06T19:52:12.903Z","etag":null,"topics":["frappe-gantt","gantt","gantt-chart","ganttjs","javascript-gantt"],"latest_commit_sha":null,"homepage":"https://frappe.io/gantt","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frappe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-08-26T12:17:58.000Z","updated_at":"2025-05-06T19:35:44.000Z","dependencies_parsed_at":"2023-02-10T03:45:38.264Z","dependency_job_id":"a71ff7ad-1e90-492d-a1f0-2847cec4a69c","html_url":"https://github.com/frappe/gantt","commit_stats":{"total_commits":100,"total_committers":25,"mean_commits":4.0,"dds":0.47,"last_synced_commit":"038150330160756f18726e68fd63a1cfc389848f"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frappe%2Fgantt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frappe%2Fgantt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frappe%2Fgantt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frappe%2Fgantt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frappe","download_url":"https://codeload.github.com/frappe/gantt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020478,"owners_count":22000750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["frappe-gantt","gantt","gantt-chart","ganttjs","javascript-gantt"],"created_at":"2024-07-31T00:01:38.653Z","updated_at":"2025-05-13T20:05:37.512Z","avatar_url":"https://github.com/frappe.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Libraries","Data Visualization","Data Visualization [🔝](#readme)","Repository","数据可视化","Web Frontend"],"sub_categories":["Gantt","Runner","Data Visualization","运行器","运行器e2e测试","JS Libraries \u0026 Utilities"],"readme":"\u003cdiv align=\"center\" markdown=\"1\"\u003e\n    \u003cimg src=\".github/gantt-logo.jpg\" width=\"80\"\u003e\n    \u003ch1\u003eFrappe Gantt\u003c/h1\u003e\n\n**A modern, configurable, Gantt library for the web.**\n\u003c/div\u003e\n\n![Hero Image](.github/hero-image.png)\n\n## Frappe Gantt\nGantt charts are bar charts that visually illustrate a project's tasks, schedule, and dependencies. With Frappe Gantt, you can build beautiful, customizable, Gantt charts with ease.\n\nYou can use it anywhere from hobby projects to tracking the goals of your team at the worksplace.\n\n[ERPNext](https://erpnext.com/) uses Frappe Gantt.\n\n\n### Motivation\nWe needed a Gantt View for ERPNext. Surprisingly, we couldn't find a visually appealing Gantt library that was open source - so we decided to build it. Initially, the design was heavily inspired by Google Gantt and DHTMLX.\n\n\n### Key Features\n- **Customizable Views**: customize the timeline based on various time periods - day, hour, or year, you have it. You can also create your own views.\n- **Ignore Periods**: exclude weekends and other holidays from your tasks' progress calculation.\n- **Configure Anything**: spacing, edit access, labels, you can control it all. Change both the style and functionality to meet your needs.\n- **Multi-lingual Support**: suitable for companies with an international base.\n\n## Usage\n\nInstall with:\n```bash\nnpm install frappe-gantt\n```\n\nInclude it in your HTML:\n\n```html\n\u003cscript src=\"frappe-gantt.umd.js\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" href=\"frappe-gantt.css\"\u003e\n```\n\nOr from the CDN:\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/frappe-gantt/dist/frappe-gantt.umd.js\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/frappe-gantt/dist/frappe-gantt.css\"\u003e\n```\n\nStart using Gantt:\n```js\nlet tasks = [\n  {\n    id: '1',\n    name: 'Redesign website',\n    start: '2016-12-28',\n    end: '2016-12-31',\n    progress: 20\n  },\n  ...\n]\nlet gantt = new Gantt(\"#gantt\", tasks);\n```\n\n### Configuration\nFrappe Gantt offers a wide range of options to customize your chart.\n\n\n| **Option**               | **Description**                                                                 | **Possible Values**                                 | **Default**                        |\n|---------------------------|---------------------------------------------------------------------------------|----------------------------------------------------|------------------------------------|\n| `arrow_curve`            | Curve radius of arrows connecting dependencies.                                        | Any positive integer.                              | `5`                                |\n| `auto_move_label`        | Move task labels when user scrolls horizontally.                                 | `true`, `false`                                    | `false`                            |\n| `bar_corner_radius`      | Radius of the task bar corners (in pixels).                                         | Any positive integer.                              | `3`                                |\n| `bar_height`             | Height of task bars (in pixels).                                                 | Any positive integer.                              | `30`                               |\n| `container_height`       | Height of the container.                                                       | `auto` - dynamic container height to fit all tasks - _or_ any positive integer (for pixels).            | `auto`                           |\n| `column_width`           | Width of each column in the timeline.                                          | Any positive integer.                  | 45                             |\n| `date_format`            | Format for displaying dates.                                                   | Any valid JS date format string.                     | `YYYY-MM-DD`                     |\n| `upper_header_height`    | Height of the upper header in the timeline (in pixels).                                     | Any positive integer.                              | `45`                               |\n| `lower_header_height`    | Height of the lower header in the timeline (in pixels).                                     | Any positive integer.                              | `30`                               |\n| `snap_at`                | Snap tasks at particular intervel while resizing or dragging.                                              | Any _interval_ (see below)                  | `1d`                             |\n| `infinite_padding`       | Whether to extend timeline infinitely when user scrolls.                                   | `true`, `false`                                    | `true`                             |\n| `holidays`               | Highlighted holidays on the timeline.                                           | Object mapping CSS colors to holiday types. Types can either be a) 'weekend', or b) array of _strings_ or _date objects_ or _objects_ in the format `{date: ..., label: ...}`          | `{ 'var(--g-weekend-highlight-color)': 'weekend' }` |\n| `ignore`                 | Ignored areas in the rendering                  | `weekend` _or_ Array of strings or date objects (`weekend` can be present to the array also).                      | `[]`                               |\n| `language`               | Language for localization.                                                     | ISO 639-1 codes like `en`, `fr`, `es`.            | `en`                             |\n| `lines`                  | Determines which grid lines to display.                                   | `none` for no lines, `vertical` for only vertical lines, `horizontal` for only horizontal lines, `both` for complete grid.      | `both`                           |\n| `move_dependencies`      | Whether moving a task automatically moves its dependencies.                                   | `true`, `false`                                    | `true`                             |\n| `padding`                | Padding around task bars (in pixels).                                                | Any positive integer.                              | `18`                               |\n| `popup_on`               | Event to trigger the popup display.                                             | `click` _or_ `hover`     | `click`                          |\n| `readonly_progress`      | Disables editing task progress.                                                 | `true`, `false`                                    | `false`                            |\n| `readonly_dates`         | Disables editing task dates.                                                    | `true`, `false`                                    | `false`                            |\n| `readonly`               | Disables all editing features.                                                  | `true`, `false`                                    | `false`                            |\n| `scroll_to`              | Determines the starting point when chart is rendered.                                           | `today`, `start`, `end`, or a date string.  | `today`                          |\n| `show_expected_progress` | Shows expected progress for tasks.                                              | `true`, `false`                                    | `false`                            |\n| `today_button`           | Adds a button to navigate to today’s date.                                      | `true`, `false`                                    | `true`                             |\n| `view_mode`              | The initial view mode of the Gantt chart.                                          | `Day`, `Week`, `Month`, `Year`.           | `Day`                            |\n| `view_mode_select`       | Allows selecting the view mode from a dropdown.                                 | `true`, `false`                                    | `false`                            |\n\nApart from these ones, two options - `popup` and `view_modes` (plural, not singular) - are available. They have \"sub\"-APIs, and thus are listed separately.\n\n#### View Mode Configuration\nThe `view_modes` option determines all the available view modes for the chart. It should be an array of objects.\n\nEach object can have the following properties:\n- `name` (string) - the name of view mode.\n- `padding` (interval) - the time above.\n- `step` - the interval of each column\n- `lower_text` (date format string _or_ function) - the format for text in lower header. Blank string for none. The function takes in `currentDate`, `previousDate`, and `lang`, and should return a string.\n- `upper_text` (date format string _or_ function) - the format for text in upper header. Blank string for none. The function takes in `currentDate`, `previousDate`, and `lang`, and should return a string.\n- `upper_text_frequency` (number) - how often the upper text has a value. Utilized in internal calculation to improve performance.\n- `thick_line` (function) - takes in `currentDate`, returns Boolean determining whether the line for that date should be thicker than the others.\n\nThree other options allow you to override general configuration for this view mode alone:\n- `date_format`\n- `column_width`\n- `snap_at`\nFor details, see the above table.\n\n#### Popup Configuration\n`popup` is a function. If it returns\n- `false`, there will be no popup.\n- `undefined`, the popup will be rendered based on manipulation within the function\n- a HTML string, the popup will be that string.\n\nThe function receives one object as an argument, containing:\n- `task` - the task as an object\n- `chart` - the entire Gantt chart\n- `get_title`, `get_subtitle`, `get_details` (functions) - get the relevant section as a HTML node.\n- `set_title`, `set_subtitle`, `set_details` (functions) - take in the HTML of the relevant section\n- `add_action` (function) - accepts two parameters, `html` and `func` - respectively determining the HTML of the action and the callback when the action is pressed.\n\n### API\nFrappe Gantt exposes a few helpful methods for you to interact with the chart:\n\n| **Name**               | **Description**                                                                 | **Parameters**                            |\n|---------------------------|---------------------------------------------------------------------------------|------------------------------------------|\n| `.update_options` | Re-renders the chart after updating specific options. | `new_options` - object containing new options. |\n| `.change_view_mode` | Updates the view mode. | `view_mode` - Name of view mode _or_ view mode object (see above) and `maintain_pos` - whether to go back to current scroll position after rerendering, defaults to `false`. |\n| `.scroll_current` | Scrolls to the current date | No parameters. |\n| `.update_task` | Re-renders a specific task bar alone | `task_id` - id of task and `new_details` - object containing the task properties to be updated. |\n\n## Development Setup\nIf you want to contribute enhancements or fixes:\n\n1. Clone this repo.\n2. `cd` into project directory.\n3. Run `pnpm i` to install dependencies.\n4. `pnpm run build` to build files - or `pnpm run build-dev` to build and watch for changes.\n5. Open `index.html` in your browser.\n6. Make your code changes and test them.\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\" style=\"padding-top: 0.75rem;\"\u003e\n\t\u003ca href=\"https://frappe.io\" target=\"_blank\"\u003e\n\t\t\u003cpicture\u003e\n\t\t\t\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://frappe.io/files/Frappe-white.png\"\u003e\n\t\t\t\u003cimg src=\"https://frappe.io/files/Frappe-black.png\" alt=\"Frappe Technologies\" height=\"28\"/\u003e\n\t\t\u003c/picture\u003e\n\t\u003c/a\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrappe%2Fgantt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrappe%2Fgantt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrappe%2Fgantt/lists"}