iris-gantt 1.0.1 → 1.0.2

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.
Files changed (60) hide show
  1. package/README.md +183 -215
  2. package/USAGE.md +838 -0
  3. package/dist/Gantt/Chart.d.ts +22 -0
  4. package/dist/Gantt/Chart.d.ts.map +1 -0
  5. package/dist/Gantt/ContextMenu.d.ts +19 -0
  6. package/dist/Gantt/ContextMenu.d.ts.map +1 -0
  7. package/dist/Gantt/DependencyEditor.d.ts +13 -0
  8. package/dist/Gantt/DependencyEditor.d.ts.map +1 -0
  9. package/dist/Gantt/DependencyPopover.d.ts +12 -0
  10. package/dist/Gantt/DependencyPopover.d.ts.map +1 -0
  11. package/dist/Gantt/DragDrop.d.ts +18 -0
  12. package/dist/Gantt/DragDrop.d.ts.map +1 -0
  13. package/dist/Gantt/Gantt.d.ts +35 -0
  14. package/dist/Gantt/Gantt.d.ts.map +1 -0
  15. package/dist/Gantt/GanttPro.d.ts +16 -0
  16. package/dist/Gantt/GanttPro.d.ts.map +1 -0
  17. package/dist/Gantt/Grid.d.ts +29 -0
  18. package/dist/Gantt/Grid.d.ts.map +1 -0
  19. package/dist/Gantt/LinkRenderer.d.ts +15 -0
  20. package/dist/Gantt/LinkRenderer.d.ts.map +1 -0
  21. package/dist/Gantt/TaskBar.d.ts +19 -0
  22. package/dist/Gantt/TaskBar.d.ts.map +1 -0
  23. package/dist/Gantt/TaskCreator.d.ts +8 -0
  24. package/dist/Gantt/TaskCreator.d.ts.map +1 -0
  25. package/dist/Gantt/TaskEditor.d.ts +10 -0
  26. package/dist/Gantt/TaskEditor.d.ts.map +1 -0
  27. package/dist/Gantt/Timeline.d.ts +23 -0
  28. package/dist/Gantt/Timeline.d.ts.map +1 -0
  29. package/dist/Gantt/Toolbar.d.ts +15 -0
  30. package/dist/Gantt/Toolbar.d.ts.map +1 -0
  31. package/dist/Gantt/UndoRedo.d.ts +27 -0
  32. package/dist/Gantt/UndoRedo.d.ts.map +1 -0
  33. package/dist/Gantt/exports.d.ts +21 -0
  34. package/dist/Gantt/exports.d.ts.map +1 -0
  35. package/dist/Gantt/features/AutoScheduler.d.ts +10 -0
  36. package/dist/Gantt/features/AutoScheduler.d.ts.map +1 -0
  37. package/dist/Gantt/features/Baselines.d.ts +27 -0
  38. package/dist/Gantt/features/Baselines.d.ts.map +1 -0
  39. package/dist/Gantt/features/CriticalPath.d.ts +10 -0
  40. package/dist/Gantt/features/CriticalPath.d.ts.map +1 -0
  41. package/dist/Gantt/features/ExportUtils.d.ts +11 -0
  42. package/dist/Gantt/features/ExportUtils.d.ts.map +1 -0
  43. package/dist/Gantt/features/FilterSearch.d.ts +20 -0
  44. package/dist/Gantt/features/FilterSearch.d.ts.map +1 -0
  45. package/dist/Gantt/types.d.ts +80 -0
  46. package/dist/Gantt/types.d.ts.map +1 -0
  47. package/dist/Gantt/utils/dateUtils.d.ts +11 -0
  48. package/dist/Gantt/utils/dateUtils.d.ts.map +1 -0
  49. package/dist/Gantt/utils/dependencyParser.d.ts +26 -0
  50. package/dist/Gantt/utils/dependencyParser.d.ts.map +1 -0
  51. package/dist/gantt.css +1 -0
  52. package/dist/index.d.ts +3 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/iris-gantt.js +1232 -1500
  55. package/dist/iris-gantt.umd.cjs +8 -8
  56. package/dist/types.d.ts +2 -0
  57. package/dist/types.d.ts.map +1 -0
  58. package/package.json +42 -7
  59. package/dist/iris-gantt.css +0 -1
  60. package/src/components/Gantt/gantt.css +0 -2167
package/README.md CHANGED
@@ -1,278 +1,246 @@
1
- # Iris Gantt - Complete React Implementation
1
+ # iris-gantt
2
2
 
3
- A comprehensive, production-ready Gantt chart component built with React and TypeScript, featuring all FREE and PRO capabilities from Iris Gantt in a single, unified component.
3
+ A comprehensive, production-ready Gantt chart component for React with TypeScript support.
4
4
 
5
- ![Gantt Chart Demo](https://img.shields.io/badge/React-19.2.0-blue)
6
- ![TypeScript](https://img.shields.io/badge/TypeScript-5.9.3-blue)
7
- ![Storybook](https://img.shields.io/badge/Storybook-10.1.11-ff69b4)
8
- ![License](https://img.shields.io/badge/License-MIT-green)
9
-
10
- ## ✨ Features
11
-
12
- ### 🎯 Core Features
13
- - ✅ **Multi-column Task Grid** - Name, dates, duration, progress
14
- - ✅ **Hierarchical Structure** - Parent/child tasks with expand/collapse
15
- - ✅ **Configurable Timeline** - Hour/day/week/month/quarter/year scales
16
- - ✅ **Zoom Controls** - In, out, reset with smooth transitions
17
- - ✅ **Synchronized Scrolling** - Grid and timeline stay in sync
18
- - ✅ **Weekend & Holiday Highlighting** - Visual differentiation
19
- - ✅ **Light & Dark Themes** - Professional styling
20
-
21
- ### 🎨 Interactive Features
22
- - ✅ **Drag & Drop** - Move tasks by dragging bars
23
- - ✅ **Task Resize** - Adjust start/end dates from edges
24
- - ✅ **Dependencies** - 4 types with curved arrows (e2s, s2s, e2e, s2e)
25
- - ✅ **Progress Tracking** - Visual indicators on bars
26
- - ✅ **Task Types** - Regular tasks, milestones, projects
27
- - ✅ **Color Coding** - Custom colors per task
28
-
29
- ### 💎 PRO Features
30
- - ✅ **Undo/Redo System** - 50-action history with Ctrl+Z/Y
31
- - ✅ **Critical Path Analysis** - Automatic calculation and highlighting
32
- - ✅ **Auto-Scheduling** - Forward/backward scheduling modes
33
- - ✅ **Baselines** - Visual variance tracking with purple bars
34
- - ✅ **Resource Leveling** - Prevent overallocation
35
- - ✅ **Task Creation UI** - Beautiful modal form
36
- - ✅ **Task Editing UI** - Double-click to edit
37
- - ✅ **Advanced Filtering** - By status, priority, owner
38
- - ✅ **Search** - Real-time across all fields
39
- - ✅ **Export** - CSV, Excel, JSON, PDF
5
+ [![npm version](https://img.shields.io/npm/v/iris-gantt)](https://www.npmjs.com/package/iris-gantt)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
40
7
 
41
8
  ## 🚀 Quick Start
42
9
 
43
- ### Installation
10
+ ### 1. Install
44
11
 
45
12
  ```bash
46
- npm install
13
+ npm install iris-gantt
47
14
  ```
48
15
 
49
- ### Run Storybook
16
+ ### 2. Install Peer Dependencies
50
17
 
51
18
  ```bash
52
- npm run storybook
19
+ npm install react react-dom antd dayjs @fortawesome/react-fontawesome @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons
20
+ ```
21
+
22
+ ### 3. Use in Your Component
23
+
24
+ **Important:** Don't forget to import the CSS!
25
+
26
+ ```tsx
27
+ // Option 1: Named import (recommended)
28
+ import { Gantt } from 'iris-gantt'
29
+ import 'iris-gantt/gantt.css'
30
+
31
+ // Option 2: Default import (also supported)
32
+ import Gantt from 'iris-gantt'
33
+ import 'iris-gantt/gantt.css'
34
+
35
+ function App() {
36
+ const tasks = [
37
+ {
38
+ id: '1',
39
+ text: 'My First Task',
40
+ start: new Date(2024, 0, 1),
41
+ end: new Date(2024, 0, 10),
42
+ duration: 9,
43
+ progress: 50,
44
+ },
45
+ ]
46
+
47
+ return <Gantt tasks={tasks} />
48
+ }
53
49
  ```
54
50
 
55
- Or use the helper script:
51
+ **That's it!** Your Gantt chart is ready. 🎉
52
+
53
+ ## 📦 Installation
54
+
55
+ ### Option 1: Install Everything at Once
56
56
 
57
57
  ```bash
58
- ./run-storybook.sh
58
+ npm install iris-gantt react react-dom antd dayjs @fortawesome/react-fontawesome @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons
59
59
  ```
60
60
 
61
- Visit http://localhost:6006 to see all demos!
61
+ ### Option 2: Install Separately
62
62
 
63
- ## 📖 Usage
63
+ ```bash
64
+ # Install the package
65
+ npm install iris-gantt
66
+
67
+ # Install peer dependencies
68
+ npm install react react-dom antd dayjs @fortawesome/react-fontawesome @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons
69
+ ```
70
+
71
+ ## 💻 Basic Usage
64
72
 
65
73
  ```tsx
66
- import { Gantt } from './components/Gantt';
67
- import type { Task, Link } from './components/types';
68
-
69
- const tasks: Task[] = [
70
- {
71
- id: '1',
72
- text: 'Project Planning',
73
- start: new Date(2024, 0, 1),
74
- end: new Date(2024, 0, 15),
75
- duration: 14,
76
- progress: 100,
77
- type: 'project',
78
- owner: 'John Smith',
79
- priority: 'high',
80
- },
81
- {
82
- id: '2',
83
- text: 'Development',
84
- start: new Date(2024, 0, 15),
85
- end: new Date(2024, 1, 15),
86
- duration: 31,
87
- progress: 60,
88
- owner: 'Jane Doe',
89
- priority: 'high',
90
- },
91
- ];
92
-
93
- const links: Link[] = [
94
- { id: 'l1', source: '1', target: '2', type: 'e2s' },
95
- ];
74
+ import React from 'react'
75
+ import { Gantt } from 'iris-gantt'
76
+ import 'iris-gantt/gantt.css'
77
+ import type { Task, Link } from 'iris-gantt'
78
+
79
+ function MyGantt() {
80
+ const tasks: Task[] = [
81
+ {
82
+ id: '1',
83
+ text: 'Project Planning',
84
+ start: new Date(2024, 0, 1),
85
+ end: new Date(2024, 0, 15),
86
+ duration: 14,
87
+ progress: 100,
88
+ type: 'project',
89
+ },
90
+ {
91
+ id: '2',
92
+ text: 'Development',
93
+ start: new Date(2024, 0, 15),
94
+ end: new Date(2024, 1, 15),
95
+ duration: 31,
96
+ progress: 60,
97
+ },
98
+ ]
99
+
100
+ const links: Link[] = [
101
+ { id: 'l1', source: '1', target: '2', type: 'e2s' },
102
+ ]
96
103
 
97
- function App() {
98
104
  return (
99
105
  <Gantt
100
106
  tasks={tasks}
101
107
  links={links}
102
- config={{
103
- weekends: true,
104
- theme: 'light',
105
- }}
106
108
  onTaskUpdate={(task) => console.log('Updated:', task)}
107
- onTaskCreate={(task) => console.log('Created:', task)}
108
- onTaskDelete={(id) => console.log('Deleted:', id)}
109
109
  />
110
- );
110
+ )
111
111
  }
112
112
  ```
113
113
 
114
- ## 🎨 Storybook Demos
115
-
116
- The project includes comprehensive Storybook demos:
117
-
118
- - **Gantt Chart/Basic Examples** - Simple projects and use cases
119
- - **Gantt Chart/Advanced Features** - All PRO features in action
120
- - **Gantt Chart/Baselines** - Baseline tracking demonstrations
114
+ ## Features
121
115
 
122
- ## 🛠️ Configuration
116
+ ### Core Features
117
+ - ✅ Interactive task management
118
+ - ✅ Drag & drop task bars
119
+ - ✅ Task dependencies with 4 link types
120
+ - ✅ Hierarchical tasks (parent/child)
121
+ - ✅ Progress tracking
122
+ - ✅ Multiple task types (task, milestone, project)
123
+ - ✅ Customizable timeline scales
124
+ - ✅ Light & dark themes
125
+
126
+ ### Advanced Features
127
+ - ✅ Auto-scheduling
128
+ - ✅ Critical path analysis
129
+ - ✅ Baselines
130
+ - ✅ Undo/Redo (Ctrl+Z/Y)
131
+ - ✅ Export (CSV, Excel, JSON, PDF)
132
+ - ✅ Filtering & search
133
+ - ✅ Resource leveling
134
+
135
+ ## 📚 Documentation
136
+
137
+ - **[Complete Usage Guide](./USAGE.md)** - Comprehensive documentation with examples
138
+ - **[API Reference](./USAGE.md#api-reference)** - Full TypeScript API
139
+ - **[Examples](./USAGE.md#examples)** - Real-world usage examples
140
+
141
+ ## 🎯 Common Imports
123
142
 
124
143
  ```tsx
125
- interface GanttConfig {
126
- columns?: Column[]; // Custom columns
127
- scales?: Scale[]; // Timeline scales
128
- readonly?: boolean; // Disable editing
129
- editable?: boolean; // Enable inline editing
130
- taskHeight?: number; // Task bar height
131
- rowHeight?: number; // Row height
132
- columnWidth?: number; // Timeline column width
133
- weekends?: boolean; // Highlight weekends
134
- holidays?: Date[]; // Holiday dates
135
- theme?: 'light' | 'dark'; // Theme
136
- }
137
- ```
138
-
139
- ## 🎯 Interactive Controls
144
+ // Main component (named import - recommended)
145
+ import { Gantt } from 'iris-gantt'
140
146
 
141
- ### Toolbar Buttons
142
- - **+ Add Task** - Create new tasks
143
- - **↶ Undo / ↷ Redo** - Undo/redo with Ctrl+Z/Y
144
- - **⚡ Auto-Schedule** - Auto-schedule based on dependencies
145
- - **📊 Level Resources** - Balance workload
146
- - **🎯 Critical Path** - Highlight critical tasks
147
- - **📍 Baselines** - Create and toggle baselines
148
- - **🔍 Zoom** - Zoom in/out/reset
149
- - **💾 Export** - CSV, Excel, JSON, PDF
147
+ // Main component (default import - also works)
148
+ import Gantt from 'iris-gantt'
150
149
 
151
- ### Keyboard Shortcuts
152
- - **Ctrl+Z** - Undo
153
- - **Ctrl+Y** or **Ctrl+Shift+Z** - Redo
154
- - **Double-click task** - Edit task
150
+ // Types
151
+ import type { Task, Link, GanttConfig } from 'iris-gantt'
155
152
 
156
- ### Mouse Actions
157
- - **Drag task bar** - Move task
158
- - **Drag task edges** - Resize (adjust dates)
159
- - **Click task** - Select
160
- - **Hover dependencies** - Highlight relationships
153
+ // CSS (required!)
154
+ import 'iris-gantt/gantt.css'
155
+ ```
161
156
 
162
- ## 📁 Project Structure
157
+ ## 🔧 Configuration Example
163
158
 
159
+ ```tsx
160
+ <Gantt
161
+ tasks={tasks}
162
+ links={links}
163
+ config={{
164
+ theme: 'light', // 'light' | 'dark'
165
+ weekends: true, // Highlight weekends
166
+ criticalPath: true, // Show critical path
167
+ autoSchedule: true, // Enable auto-scheduling
168
+ }}
169
+ onTaskUpdate={(task) => {
170
+ // Handle task updates
171
+ console.log('Task updated:', task)
172
+ }}
173
+ onTaskCreate={(task) => {
174
+ // Handle new tasks
175
+ console.log('Task created:', task)
176
+ }}
177
+ onTaskDelete={(id) => {
178
+ // Handle task deletion
179
+ console.log('Task deleted:', id)
180
+ }}
181
+ />
164
182
  ```
165
- src/
166
- ├── components/
167
- │ ├── Gantt/
168
- │ │ ├── Gantt.tsx # Main unified component
169
- │ │ ├── Grid.tsx # Task list grid
170
- │ │ ├── Timeline.tsx # Timeline rendering
171
- │ │ ├── TaskBar.tsx # Task visualization
172
- │ │ ├── TaskCreator.tsx # Task creation modal
173
- │ │ ├── TaskEditor.tsx # Task editing modal
174
- │ │ ├── LinkRenderer.tsx # Dependency arrows
175
- │ │ ├── DragDrop.tsx # Drag & drop logic
176
- │ │ ├── FilterSearch.tsx # Filtering system
177
- │ │ ├── UndoRedo.tsx # Undo/redo system
178
- │ │ ├── CriticalPath.tsx # Critical path algorithm
179
- │ │ ├── AutoScheduler.tsx # Auto-scheduling
180
- │ │ ├── Baselines.tsx # Baseline tracking
181
- │ │ ├── ExportUtils.tsx # Export functionality
182
- │ │ └── gantt.css # All styles
183
- │ ├── types.ts # TypeScript interfaces
184
- │ └── utils/
185
- │ └── dateUtils.ts # Date calculations
186
- └── stories/
187
- ├── AdvancedGantt.stories.tsx # Basic examples
188
- ├── GanttProFeatures.stories.tsx # Advanced features
189
- └── BaselinesDemo.stories.tsx # Baseline demos
190
- ```
191
183
 
192
- ## 🎭 Task Types
184
+ ## 📖 More Examples
185
+
186
+ ### With State Management
193
187
 
194
188
  ```tsx
195
- interface Task {
196
- id: string;
197
- text: string;
198
- start: Date;
199
- end: Date;
200
- duration: number;
201
- progress: number;
202
- type?: 'task' | 'milestone' | 'project';
203
- parent?: string;
204
- color?: string;
205
- owner?: string;
206
- priority?: 'low' | 'medium' | 'high';
207
- details?: string;
208
- }
209
- ```
189
+ import { useState } from 'react'
190
+ import { Gantt } from 'iris-gantt'
191
+ import 'iris-gantt/gantt.css'
210
192
 
211
- ## 🔗 Dependency Types
193
+ function App() {
194
+ const [tasks, setTasks] = useState([
195
+ {
196
+ id: '1',
197
+ text: 'Task 1',
198
+ start: new Date(2024, 0, 1),
199
+ end: new Date(2024, 0, 10),
200
+ duration: 9,
201
+ progress: 50,
202
+ },
203
+ ])
212
204
 
213
- - **e2s** (End-to-Start) - Task B starts when Task A ends
214
- - **s2s** (Start-to-Start) - Tasks start together
215
- - **e2e** (End-to-End) - Tasks end together
216
- - **s2e** (Start-to-End) - Task B ends when Task A starts
205
+ return (
206
+ <Gantt
207
+ tasks={tasks}
208
+ onTaskUpdate={(task) => {
209
+ setTasks(prev => prev.map(t => t.id === task.id ? task : t))
210
+ }}
211
+ />
212
+ )
213
+ }
214
+ ```
217
215
 
218
- ## 🎨 Theming
216
+ ### Read-Only Mode
219
217
 
220
218
  ```tsx
221
219
  <Gantt
222
220
  tasks={tasks}
223
- config={{ theme: 'dark' }} // or 'light'
221
+ config={{ readonly: true }}
224
222
  />
225
223
  ```
226
224
 
227
- Custom colors can be applied per task:
228
- ```tsx
229
- {
230
- id: '1',
231
- text: 'High Priority',
232
- color: '#E74C3C', // Red
233
- // ...
234
- }
235
- ```
236
-
237
- ## 📊 Export Formats
238
-
239
- - **CSV** - Simple comma-separated values
240
- - **Excel** - .xls format with UTF-8 BOM
241
- - **JSON** - Complete project data (can be imported)
242
- - **PDF** - Text report (can be enhanced with jsPDF)
225
+ ## 🛠️ Requirements
243
226
 
244
- ## 🤝 Comparison with Iris Gantt
245
-
246
- This implementation provides **ALL** features from both Iris Free and PRO editions in a single component:
247
-
248
- | Feature | Iris Free | Iris PRO | This Implementation |
249
- |---------|-----------|----------|---------------------|
250
- | Task Management | ✅ | ✅ | ✅ |
251
- | Dependencies | ✅ | ✅ | ✅ |
252
- | Drag & Drop | ✅ | ✅ | ✅ |
253
- | Progress Tracking | ✅ | ✅ | ✅ |
254
- | Undo/Redo | ❌ | ✅ | ✅ |
255
- | Auto-Scheduling | ❌ | ✅ | ✅ |
256
- | Critical Path | ❌ | ✅ | ✅ |
257
- | Baselines | ❌ | ✅ | ✅ |
258
- | Resource Leveling | ❌ | ✅ | ✅ |
259
- | Export | ❌ | ✅ | ✅ |
260
- | Filtering | ❌ | ✅ | ✅ |
227
+ - React 18+ or 19+
228
+ - TypeScript (recommended)
229
+ - Peer dependencies (see installation above)
261
230
 
262
231
  ## 📝 License
263
232
 
264
- MIT - Free for commercial and personal use
265
-
266
- ## 🙏 Acknowledgments
267
-
268
- - Inspired by [Iris Gantt](https://svar.dev/demos/react/gantt/)
269
- - Built with React 19, TypeScript 5.9, and Storybook 10
233
+ MIT License - see [LICENSE](./LICENSE) file for details
270
234
 
271
235
  ## 🔗 Links
272
236
 
273
237
  - [GitHub Repository](https://github.com/TimJerry725/ganttchart)
274
- - [Documentation](./GANTT_FEATURES.md)
275
- - [Storybook Demos](http://localhost:6006)
238
+ - [Full Documentation](./USAGE.md)
239
+ - [npm Package](https://www.npmjs.com/package/iris-gantt)
240
+
241
+ ## 🤝 Contributing
242
+
243
+ Contributions are welcome! Please open an issue or submit a pull request.
276
244
 
277
245
  ---
278
246