javascriptgantt 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/readme.md CHANGED
@@ -1,158 +1,405 @@
1
- # javascriptgantt Chart Library Documentation
2
-
3
-
4
- ## Introduction
5
- Welcome to the documentation for [javascriptgantt](https://sunilsolankiji.github.io/javascriptgantt/) Chart Library. This library provides a powerful set of tools and functionalities to create interactive Gantt charts for project management. This documentation will guide you through the installation process, usage instructions, and available features of the library.
6
-
7
-
8
- ## Table of Contents
9
- - [Installation](#installation)
10
- - [Getting Started](#getting-started)
11
- - [Features](#features)
12
-
13
- ---
14
-
15
- <a name="installation"></a>
16
- ## Installation
17
-
18
- To integrate the Gantt Chart Library, adhere to the steps below:
19
-
20
- 1. Download the library files from our website or repository.
21
- 2. Integrate the library files (`gantt.js` and `gantt.css`) into your project.
22
- 3. Link the library files in your HTML file.
23
- 4. You're now ready to start using the javascriptgantt Chart Library!
24
-
25
- <a href="https://sunilsolankiji.github.io/javascriptgantt/">
26
- <img src="./src/assets/images/jsgantt-screenshot.png">
27
- </a>
28
-
29
- ---
30
-
31
- <a name="getting-started"></a>
32
- ## Getting Started ##
33
- To create a basic Gantt Chart, follow these steps:
34
-
35
- **Step 1:** Add the files:
36
- ~~~html
37
- <script src="gantt.js" ></script>
38
- <link rel="stylesheet" href="gantt.css" type="text/css">
39
- ~~~
40
-
41
- **Step 2:** Insert the markup:
42
- ~~~html
43
- <div id="gantt_here" style='width:100%; height:100vh;'></div>
44
- ~~~
45
-
46
- **Step 3:** Invoke the Gantt Chart Library using JavaScript, targeting the container element, and define your tasks, dependencies, and duration.
47
-
48
- ~~~js
49
- let element = document.getElementById("gantt_here");
50
- let gantt = new javascriptgantt(element);
51
- gantt.options.columns = [
52
- {
53
- name: "text",
54
- width: 245,
55
- min_width: 80,
56
- max_width: 300,
57
- tree: true,
58
- label: "Name",
59
- resize: true,
60
- template: (task) => {
61
- return `<span>${task.parent == 0 ? task.text : task.subject}</span>`;
62
- },
63
- },
64
- ...
65
- ];
66
-
67
- gantt.options.data = [
68
- { id: 1, text: "Project 1", parent: 0, progress: 50 },
69
- {
70
- id: 2,
71
- text: "Task #1",
72
- start_date: "05-05-2023",
73
- end_date: "05-05-2023",
74
- parent: 1,
75
- progress: 60,
76
- },
77
- ...
78
- ];
79
-
80
- gantt.options.scales = [
81
- {
82
- unit: "week",
83
- step: 1,
84
- format: (t) => {
85
- return "%d %F";
86
- },
87
- },
88
- {
89
- unit: "day",
90
- step: 1,
91
- format: "%d %D",
92
- },
93
- ];
94
-
95
- gantt.options.links = [
96
- { id: 1, source: 1, target: 2, type: 0 },
97
- { id: 2, source: 2, target: 3, type: 1 },
98
- { id: 3, source: 3, target: 4, type: 2 },
99
- { id: 4, source: 12, target: 15, type: 3 },
100
- ];
101
-
102
- gantt.render();
103
- ~~~
104
-
105
- **Note:** Remember to call `gantt.render();` whenever you wish to visualize the updated data.
106
-
107
- [Live demo](https://sunilsolankiji.github.io/javascriptgantt/)
108
-
109
- **Complete Documentation:** [javascriptgantt Documentation](./docs/Gantt-Chart-Documentation.pdf)
110
-
111
- ---
112
-
113
- <a name="features"></a>
114
- ## Features
115
-
116
- * **Task Linking:** Four types - finish-to-start, start-to-start, finish-to-finish, start-to-finish.
117
-
118
- <a href="https://sunilsolankiji.github.io/javascriptgantt/">
119
- <img src="./src/assets/images/links.gif">
120
- </a>
121
-
122
- * **Drag and Drop:** Shift multiple tasks horizontally and vertically.
123
- * **Filtering:** Conveniently filter out tasks.
124
- * **Tooltips:** Additional insights via tooltips.
125
- * **Grid:** Columns in the grid are fully customizable.
126
- * **Customization:** Modify the time scale, task edit form, and much more.
127
-
128
- <a href="https://sunilsolankiji.github.io/javascriptgantt/">
129
- <img src="./src/assets/images/popup.gif">
130
- </a>
131
-
132
- * **Task Progress:** Update task progress via dragging or manually set the percentage.
133
- * **Exports:** Get your charts in PDF, PNG, or Excel formats.
134
- * **Zoom Levels:** Multiple timeline views - hour, day, week, month, quarter, and year.
135
- * **Full Screen:** View your Gantt in full screen for an immersive experience.
136
- * **Task Management:** Expand, collapse, add markers, modify, or delete tasks.
137
- * **Auto Scheduling:** Tasks are automatically scheduled.
138
- * **Date Selection:** Easily select start and end dates through drag and drop.
139
- * **Mouse Scroll:** Scroll timeline using mouse click.
140
- * **Aesthetics:** Customize the task colors via a color picker.
141
-
142
- <a href="https://sunilsolankiji.github.io/javascriptgantt/">
143
- <img src="./src/assets/images/taskColor.gif">
144
- </a>
145
-
146
- * **Localization:** Multilingual support to cater to a global audience.
147
- * **Themes:** Dark mode for those late-night work sessions.
148
-
149
- <a href="https://sunilsolankiji.github.io/javascriptgantt/">
150
- <img src="./src/assets/images/theme.gif">
151
- </a>
152
-
153
- You can see the full list of features in the [documentation](./docs/Gantt-Chart-Documentation.pdf)
154
-
155
-
156
- [Try it Yourself:](https://stackblitz.com/edit/js-bdaa47?file=index.js): Dive into hands-on examples and truly understand the potential of the library.
157
-
158
- ---
1
+ # javascriptgantt
2
+
3
+ [![npm version](https://img.shields.io/npm/v/javascriptgantt?style=flat-square)](https://www.npmjs.com/package/javascriptgantt)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
5
+ [![GitHub issues](https://img.shields.io/github/issues/Sunilsolankiji/javascriptgantt?style=flat-square)](https://github.com/Sunilsolankiji/javascriptgantt/issues)
6
+ [![GitHub stars](https://img.shields.io/github/stars/Sunilsolankiji/javascriptgantt?style=flat-square)](https://github.com/Sunilsolankiji/javascriptgantt/stargazers)
7
+ [![npm downloads](https://img.shields.io/npm/dm/javascriptgantt?style=flat-square)](https://www.npmjs.com/package/javascriptgantt)
8
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md)
9
+
10
+ A modern, feature-rich JavaScript Gantt chart library for project management. Build interactive, responsive Gantt charts
11
+ with zero dependencies, featuring drag-and-drop functionality, task dependencies, auto-scheduling, and extensive
12
+ customization options.
13
+
14
+ ## ✨ Key Highlights
15
+
16
+ - 🚀 **Zero Dependencies** - Lightweight and fast
17
+ - 📱 **Responsive Design** - Works seamlessly on all devices
18
+ - 🎨 **Fully Customizable** - Themes, colors, and layouts
19
+ - 🔗 **Task Dependencies** - Four types of task linking
20
+ - 📊 **Multiple Views** - Hour, day, week, month, quarter, year
21
+ - 🌍 **i18n Support** - Multilingual ready
22
+ - 📤 **Export Options** - PDF, PNG, Excel
23
+ - 🎯 **Auto-Scheduling** - Intelligent task scheduling
24
+
25
+ ## 📚 Table of Contents
26
+
27
+ - [Installation](#installation)
28
+ - [Getting Started](#getting-started)
29
+ - [Features](#features)
30
+ - [Documentation](#documentation)
31
+ - [Development](#development)
32
+ - [Contributing](#contributing)
33
+ - [License](#license)
34
+ - [Support](#support)
35
+
36
+ ---
37
+
38
+ <a name="installation"></a>
39
+
40
+ ## 📦 Installation
41
+
42
+ ### Using npm (Recommended)
43
+
44
+ ```bash
45
+ npm install javascriptgantt
46
+ ```
47
+
48
+ Or using yarn:
49
+
50
+ ```bash
51
+ yarn add javascriptgantt
52
+ ```
53
+
54
+ ### Via CDN
55
+
56
+ Add these lines to your HTML file:
57
+
58
+ ```html
59
+ <link
60
+ rel="stylesheet"
61
+ href="https://unpkg.com/javascriptgantt@latest/src/gantt.css"
62
+ />
63
+ <script src="https://unpkg.com/javascriptgantt@latest/src/gantt.js"></script>
64
+ ```
65
+
66
+ ### Manual Download
67
+
68
+ 1. Download the latest release from our [GitHub repository](https://github.com/Sunilsolankiji/javascriptgantt/releases)
69
+ 2. Extract and copy `gantt.js` and `gantt.css` to your project
70
+ 3. Link the files in your HTML:
71
+ ```html
72
+ <link rel="stylesheet" href="path/to/gantt.css" />
73
+ <script src="path/to/gantt.js"></script>
74
+ ```
75
+
76
+ <a href="https://sunilsolankiji.github.io/javascriptgantt/">
77
+ <img src="./src/assets/images/jsgantt-screenshot.png" alt="javascriptgantt Screenshot">
78
+ </a>
79
+
80
+ ---
81
+
82
+ <a name="getting-started"></a>
83
+
84
+ ## 🚀 Getting Started
85
+
86
+ ### Quick Start Guide
87
+
88
+ **Step 1:** Include the library files in your HTML
89
+
90
+ ```html
91
+ <link rel="stylesheet" href="gantt.css" />
92
+ <script src="gantt.js"></script>
93
+ ```
94
+
95
+ **Step 2:** Create a container element
96
+
97
+ ```html
98
+ <div id="gantt_here" style="width: 100%; height: 100vh;"></div>
99
+ ```
100
+
101
+ **Step 3:** Initialize the Gantt chart with your data
102
+
103
+ ```js
104
+ const element = document.getElementById("gantt_here");
105
+ const gantt = new javascriptgantt(element);
106
+
107
+ // Configure columns
108
+ gantt.options.columns = [
109
+ {
110
+ name: "text",
111
+ width: 245,
112
+ min_width: 80,
113
+ max_width: 300,
114
+ tree: true,
115
+ label: "Name",
116
+ resize: true,
117
+ template: (task) => {
118
+ return `<span>${task.parent == 0 ? task.text : task.subject}</span>`;
119
+ },
120
+ },
121
+ // ...more columns
122
+ ];
123
+
124
+ // Add your tasks
125
+ gantt.options.data = [
126
+ { id: 1, text: "Project 1", parent: 0, progress: 50 },
127
+ {
128
+ id: 2,
129
+ text: "Task #1",
130
+ start_date: "05-05-2023",
131
+ end_date: "05-05-2023",
132
+ parent: 1,
133
+ progress: 60,
134
+ },
135
+ // ...more tasks
136
+ ];
137
+
138
+ // Configure time scales
139
+ gantt.options.scales = [
140
+ {
141
+ unit: "week",
142
+ step: 1,
143
+ format: (t) => {
144
+ return "%d %F";
145
+ },
146
+ },
147
+ {
148
+ unit: "day",
149
+ step: 1,
150
+ format: "%d %D",
151
+ },
152
+ ];
153
+
154
+ // Define task dependencies
155
+ gantt.options.links = [
156
+ { id: 1, source: 1, target: 2, type: 0 }, // Finish-to-Start
157
+ { id: 2, source: 2, target: 3, type: 1 }, // Start-to-Start
158
+ { id: 3, source: 3, target: 4, type: 2 }, // Finish-to-Finish
159
+ { id: 4, source: 12, target: 15, type: 3 }, // Start-to-Finish
160
+ ];
161
+
162
+ // Render the chart
163
+ gantt.render();
164
+ ```
165
+
166
+ > **💡 Tip:** Call `gantt.render()` whenever you need to update the chart with new data.
167
+
168
+ ### 📖 Resources
169
+
170
+ - [Live Demo](https://sunilsolankiji.github.io/javascriptgantt/)
171
+ - [Interactive Tutorial on StackBlitz](https://stackblitz.com/edit/js-bdaa47?file=index.js)
172
+ - [Complete Documentation](./docs/Gantt-Chart-Documentation.pdf)
173
+
174
+ ***
175
+
176
+ <a name="features"></a>
177
+
178
+ ## ✨ Features
179
+
180
+ ### Core Functionality
181
+
182
+ #### 🔗 Task Linking
183
+
184
+ Four types of task dependencies:
185
+
186
+ - **Finish-to-Start (FS)** - Task B starts when Task A finishes
187
+ - **Start-to-Start (SS)** - Task B starts when Task A starts
188
+ - **Finish-to-Finish (FF)** - Task B finishes when Task A finishes
189
+ - **Start-to-Finish (SF)** - Task B finishes when Task A starts
190
+
191
+ <a href="https://sunilsolankiji.github.io/javascriptgantt/">
192
+ <img src="./src/assets/images/links.gif" alt="Task Linking Demo">
193
+ </a>
194
+
195
+ #### 🎯 Interactive Controls
196
+
197
+ - **Drag and Drop:** Move tasks horizontally (reschedule) and vertically (reorder)
198
+ - **Task Progress:** Update progress by dragging or set percentage manually
199
+ - **Date Selection:** Select start and end dates via drag and drop
200
+ - **Mouse Scroll:** Navigate timeline with mouse click and drag
201
+
202
+ #### 🎨 Customization & Theming
203
+
204
+ - **Task Colors:** Customize task appearance with color picker
205
+ - **Themes:** Built-in dark mode support
206
+ - **Grid Columns:** Fully customizable column layout
207
+ - **Time Scale:** Configurable time scale and formats
208
+
209
+ <a href="https://sunilsolankiji.github.io/javascriptgantt/">
210
+ <img src="./src/assets/images/theme.gif" alt="Theme Demo">
211
+ </a>
212
+
213
+ <a href="https://sunilsolankiji.github.io/javascriptgantt/">
214
+ <img src="./src/assets/images/taskColor.gif" alt="Task Color Demo">
215
+ </a>
216
+
217
+ ### Advanced Features
218
+
219
+ #### 📊 Views & Display
220
+
221
+ - **Multiple Zoom Levels:** Hour, day, week, month, quarter, and year views
222
+ - **Full Screen Mode:** Immersive full-screen experience
223
+ - **Tooltips:** Detailed task information on hover
224
+ - **Filtering:** Advanced task filtering capabilities
225
+ - **Expand/Collapse:** Hierarchical task management
226
+
227
+ <a href="https://sunilsolankiji.github.io/javascriptgantt/">
228
+ <img src="./src/assets/images/popup.gif" alt="Popup Demo">
229
+ </a>
230
+
231
+ #### ⚡ Productivity
232
+
233
+ - **Auto-Scheduling:** Automatic task scheduling based on dependencies
234
+ - **Task Management:** Add, modify, or delete tasks easily
235
+ - **Markers:** Add visual markers to important dates
236
+ - **Progress Tracking:** Visual progress indicators
237
+
238
+ #### 📤 Export & Integration
239
+
240
+ - **PDF Export:** Generate professional PDF reports
241
+ - **PNG Export:** Export charts as images
242
+ - **Excel Export:** Export data to spreadsheet format
243
+ - **Localization:** Multi-language support (i18n ready)
244
+
245
+ ### 🔍 Learn More
246
+
247
+ For a complete list of features and detailed usage instructions, see
248
+ our [Full Documentation](./docs/Gantt-Chart-Documentation.pdf).
249
+
250
+ **Try it yourself:**
251
+
252
+ - [Live Demo](https://sunilsolankiji.github.io/javascriptgantt/)
253
+ - [Interactive Examples on StackBlitz](https://stackblitz.com/edit/js-bdaa47?file=index.js)
254
+ ***
255
+
256
+ <a name="documentation"></a>
257
+
258
+ ## 📖 Documentation
259
+
260
+ **Complete Documentation:** [javascriptgantt Documentation](./docs/Gantt-Chart-Documentation.pdf)
261
+
262
+ ### Quick Links
263
+
264
+ - 📘 [Full Documentation PDF](./docs/Gantt-Chart-Documentation.pdf) - Comprehensive guide with all features
265
+ - 🎮 [Live Demo](https://sunilsolankiji.github.io/javascriptgantt/) - See it in action
266
+ - 💻 [StackBlitz Tutorial](https://stackblitz.com/edit/js-bdaa47?file=index.js) - Interactive examples
267
+
268
+ ---
269
+
270
+ <a name="development"></a>
271
+
272
+ ## 🔧 Development
273
+
274
+ This project uses modern development tools to maintain code quality and consistency.
275
+
276
+ ### Development Tools
277
+
278
+ - **Prettier** - Automatic code formatting
279
+ - **ESLint** - Code linting and quality checks
280
+ - **Commitlint** - Conventional commit message validation
281
+ - **Husky** - Git hooks automation
282
+ - **Lint-Staged** - Run linters on staged files
283
+ - **Standard-Version** - Automated versioning and changelog generation
284
+
285
+ ### Quick Start for Contributors
286
+
287
+ ```bash
288
+ # Install dependencies
289
+ npm install
290
+
291
+ # Format code
292
+ npm run format
293
+
294
+ # Lint code
295
+ npm run lint
296
+
297
+ # Run tests (lint + format check)
298
+ npm run test
299
+
300
+ # Create a release with automatic changelog
301
+ npm run release
302
+ ```
303
+
304
+ ### Commit Message Convention
305
+
306
+ This project follows [Conventional Commits](https://www.conventionalcommits.org/):
307
+
308
+ ```bash
309
+ <type>(<scope>): <subject>
310
+ ```
311
+
312
+ **Types:**
313
+
314
+ - `feat`: New feature
315
+ - `fix`: Bug fix
316
+ - `docs`: Documentation changes
317
+ - `style`: Code style changes (formatting)
318
+ - `refactor`: Code refactoring
319
+ - `perf`: Performance improvements
320
+ - `test`: Adding or updating tests
321
+ - `build`: Build system changes
322
+ - `ci`: CI/CD changes
323
+ - `chore`: Maintenance tasks
324
+
325
+ **Example:**
326
+
327
+ ```bash
328
+ git commit -m "feat: add export to Excel functionality"
329
+ git commit -m "fix: resolve drag and drop issue on mobile"
330
+ ```
331
+
332
+ For detailed development guidelines, see [DEVELOPMENT.md](DEVELOPMENT.md).
333
+
334
+ ---
335
+
336
+ <a name="contributing"></a>
337
+
338
+ ## 🤝 Contributing
339
+
340
+ We welcome contributions from the community! Please read our [Contributing Guidelines](CONTRIBUTING.md) to get started.
341
+
342
+ ### How to Contribute
343
+
344
+ 1. **Fork** the repository
345
+ 2. **Create** your feature branch (`git checkout -b feature/AmazingFeature`)
346
+ 3. **Commit** your changes (`git commit -m 'Add some AmazingFeature'`)
347
+ 4. **Push** to the branch (`git push origin feature/AmazingFeature`)
348
+ 5. **Open** a Pull Request
349
+
350
+ Please ensure your code follows our coding standards and includes appropriate tests.
351
+
352
+ ### Code of Conduct
353
+
354
+ Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.
355
+
356
+ ---
357
+
358
+ <a name="license"></a>
359
+
360
+ ## 📄 License
361
+
362
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
363
+
364
+ ---
365
+
366
+ <a name="support"></a>
367
+
368
+ ## 💬 Support
369
+
370
+ ### Get Help
371
+
372
+ - 📖 **Documentation:** [Full Documentation](./docs/Gantt-Chart-Documentation.pdf)
373
+ - 🐛 **Bug Reports:** [GitHub Issues](https://github.com/Sunilsolankiji/javascriptgantt/issues)
374
+ - 💡 **Feature Requests:** [Feature Request Template](.github/ISSUE_TEMPLATE/feature_request.md)
375
+ - 💬 **Discussions:** [GitHub Discussions](https://github.com/Sunilsolankiji/javascriptgantt/discussions)
376
+
377
+ ### Reporting Issues
378
+
379
+ Found a bug? Please report it using our [Bug Report Template](.github/ISSUE_TEMPLATE/bug_report.md).
380
+
381
+ **Include:**
382
+
383
+ - Clear description of the issue
384
+ - Steps to reproduce
385
+ - Expected vs actual behavior
386
+ - Browser/environment information
387
+ - Code samples or screenshots
388
+
389
+ ---
390
+
391
+ ## 🌟 Show Your Support
392
+
393
+ If you find this project useful, please consider:
394
+
395
+ - ⭐ **Star this repository**
396
+ - 🐛 **Report bugs** to help improve it
397
+ - 💡 **Suggest features** you'd like to see
398
+ - 🤝 **Contribute** to the codebase
399
+ - 📢 **Share** with others who might find it useful
400
+
401
+ ---
402
+
403
+ Made with ❤️ by [Sunil Solanki](https://github.com/Sunilsolankiji)
404
+
405
+ **[⬆ Back to Top](#javascriptgantt)**