apexgantt 0.0.1

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 ADDED
@@ -0,0 +1,134 @@
1
+ # ApexGantt
2
+
3
+ A JavaScript library to create Gantt diagrams built on SVG
4
+
5
+ ## Installation
6
+
7
+ To add the ApexGantt to your project and its dependencies, install the package from npm.
8
+
9
+ ```bash
10
+ npm install apexgantt
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```js
16
+ import ApexGantt from "apexgantt";
17
+ ```
18
+
19
+ To create a basic gantt with minimal configuration, write as follows:
20
+
21
+ ```html
22
+ <div id="gantt-container"></div>
23
+ ```
24
+
25
+ ```js
26
+
27
+ const tasks = [
28
+ ...(tasks with format provided below)
29
+ ];
30
+ const gantt = new ApexGantt(document.getElementById('gantt-container'), tasks);
31
+ gantt.render(data);
32
+ ```
33
+
34
+
35
+ ## ApexGantt Options
36
+
37
+ The layout can be configured by either setting the properties in the table below by passing a second arg to ApexGantt with these properties set. The latter takes precedence.
38
+
39
+ | Options | Default | Description |
40
+ | ------------------ | ------------------------------| ---------------------------------------- |
41
+ | width | `800` | The width of graph container |
42
+ | height | `800` | The height of graph container |
43
+ | canvasStyle | `None` | The css styles for canvas root container |
44
+ | rowHeight | `28` | Height for timeline row |
45
+ | enableToolbar | `false` | Enable/disable graph toolbar |
46
+ | barBackgroundColor | `#537CFA` | Background color for timeline bar |
47
+ | barBorderRadius | `5px` | Border radius for timeline bar |
48
+ | barMargin | `4` | Top and bottom margin for timeline bar |
49
+ | barTextColor | `#FFFFFF` | Text color for timeline bar |
50
+ | enableResize | `true` | Enable/disable gantt sidebar resize |
51
+ | headerBackground | `#f3f3f3` | Background color for header |
52
+ | inputDateFormat | `MM-DD-YYYY` | Input date format |
53
+ | tasksContainerWidth | `440` | Task sidebar container width |
54
+ | viewMode | `ViewMode.Month` | View mode |
55
+ | tooltipId | `apexgantt-tooltip-container` | The tooltip HTML element id |
56
+ | tooltipTemplate | `tooltipTemplate` | The HTML template for tooltip |
57
+ | tooltipBorderColor | `#BCBCBC` | The border color of tooltip |
58
+ | tooltipBGColor | `#FFFFFF` | The background color of tooltip |
59
+ | fontSize | `14px` | The size of font of nodes |
60
+ | fontFamily | `None` | The font family of nodes |
61
+ | fontWeight | `400` | The font weight of nodes |
62
+ | fontColor | `#000000` | The font color of nodes |
63
+
64
+ Default tooltip template
65
+
66
+ ```js
67
+ tooltipTemplate(task, dateFormat) {
68
+ const items = [
69
+ `<div>
70
+ <strong>Name:</strong>
71
+ <span>${task.name}</span>
72
+ </div>
73
+ `,
74
+ ];
75
+
76
+ if (task.type === TaskType.Task) {
77
+ items.push(`
78
+ <div>
79
+ <strong>Start:</strong>
80
+ <span>${getTaskTextByColumn(task, ColumnKey.StartTime, '')}</span>
81
+ </div>
82
+ <div>
83
+ <strong>End:</strong>
84
+ <span>${getTaskTextByColumn(task, ColumnKey.EndTime, dateFormat)}</span>
85
+ </div>
86
+ <div>
87
+ <strong>Duration:</strong>
88
+ <span>${getTaskTextByColumn(task, ColumnKey.Duration, dateFormat)}</span>
89
+ </div>
90
+ <div>
91
+ <strong>Progress:</strong>
92
+ <span>${task.progress}%</span>
93
+ </div>
94
+ `);
95
+ } else if (task.type === TaskType.Milestone) {
96
+ items.push(`
97
+ <div>
98
+ <strong>Date:</strong>
99
+ <span>${getTaskTextByColumn(task, ColumnKey.StartTime, '')}</span>
100
+ </div>
101
+ `);
102
+ }
103
+
104
+ if (task.dependency) {
105
+ items.push(`
106
+ <div>
107
+ <strong>Dependency:</strong>
108
+ <span>${task.dependency}</span>
109
+ </div>
110
+ `);
111
+ }
112
+
113
+ return `
114
+ <div style='display:flex;flex-direction:column;align-items:left;gap:5px;padding:5px 10px;'>
115
+ ${items.join('')}
116
+ </div>
117
+ `;
118
+ },
119
+ ```
120
+
121
+ ### Expected data format
122
+
123
+ Each tasks should be in below format
124
+ ```
125
+ {
126
+ id: 'a', // unique id of the task
127
+ startTime: '10-11-2024', // start time of the task
128
+ endTime: '11-01-2024', // end time of the task
129
+ name: 'task 1', // task name
130
+ parentId: 'a', // parent task id
131
+ progress: 65, // progress in percentage
132
+ },
133
+
134
+ ```
@@ -0,0 +1,4 @@
1
+ import { A as f } from "./index-rCBgY2lh.js";
2
+ export {
3
+ f as default
4
+ };