@wimi/vtable-gantt 1.0.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.
Files changed (317) hide show
  1. package/README.md +213 -0
  2. package/README.zh-CN.md +215 -0
  3. package/cjs/Gantt.d.ts +200 -0
  4. package/cjs/Gantt.js +582 -0
  5. package/cjs/Gantt.js.map +1 -0
  6. package/cjs/components/Menu.d.ts +1 -0
  7. package/cjs/components/Menu.js +1 -0
  8. package/cjs/components/Menu.js.map +1 -0
  9. package/cjs/components/MenuElementStyle.d.ts +1 -0
  10. package/cjs/components/MenuElementStyle.js +12 -0
  11. package/cjs/components/MenuElementStyle.js.map +1 -0
  12. package/cjs/data/DataSource.d.ts +9 -0
  13. package/cjs/data/DataSource.js +76 -0
  14. package/cjs/data/DataSource.js.map +1 -0
  15. package/cjs/env.d.ts +19 -0
  16. package/cjs/env.js +48 -0
  17. package/cjs/env.js.map +1 -0
  18. package/cjs/event/EventHandler.d.ts +47 -0
  19. package/cjs/event/EventHandler.js +128 -0
  20. package/cjs/event/EventHandler.js.map +1 -0
  21. package/cjs/event/EventTarget.d.ts +12 -0
  22. package/cjs/event/EventTarget.js +67 -0
  23. package/cjs/event/EventTarget.js.map +1 -0
  24. package/cjs/event/event-manager.d.ts +34 -0
  25. package/cjs/event/event-manager.js +369 -0
  26. package/cjs/event/event-manager.js.map +1 -0
  27. package/cjs/event/scroll.d.ts +8 -0
  28. package/cjs/event/scroll.js +112 -0
  29. package/cjs/event/scroll.js.map +1 -0
  30. package/cjs/event/touch.d.ts +2 -0
  31. package/cjs/event/touch.js +86 -0
  32. package/cjs/event/touch.js.map +1 -0
  33. package/cjs/gantt-helper.d.ts +63 -0
  34. package/cjs/gantt-helper.js +712 -0
  35. package/cjs/gantt-helper.js.map +1 -0
  36. package/cjs/index.d.ts +10 -0
  37. package/cjs/index.js +60 -0
  38. package/cjs/index.js.map +1 -0
  39. package/cjs/plugins/index.d.ts +2 -0
  40. package/cjs/plugins/index.js +15 -0
  41. package/cjs/plugins/index.js.map +1 -0
  42. package/cjs/plugins/interface.d.ts +10 -0
  43. package/cjs/plugins/interface.js +6 -0
  44. package/cjs/plugins/interface.js.map +1 -0
  45. package/cjs/plugins/plugin-manager.d.ts +16 -0
  46. package/cjs/plugins/plugin-manager.js +63 -0
  47. package/cjs/plugins/plugin-manager.js.map +1 -0
  48. package/cjs/register.d.ts +1 -0
  49. package/cjs/register.js +1 -0
  50. package/cjs/register.js.map +1 -0
  51. package/cjs/scenegraph/dependency-link.d.ts +48 -0
  52. package/cjs/scenegraph/dependency-link.js +480 -0
  53. package/cjs/scenegraph/dependency-link.js.map +1 -0
  54. package/cjs/scenegraph/drag-order-line.d.ts +12 -0
  55. package/cjs/scenegraph/drag-order-line.js +49 -0
  56. package/cjs/scenegraph/drag-order-line.js.map +1 -0
  57. package/cjs/scenegraph/frame-border.d.ts +10 -0
  58. package/cjs/scenegraph/frame-border.js +58 -0
  59. package/cjs/scenegraph/frame-border.js.map +1 -0
  60. package/cjs/scenegraph/gantt-node.d.ts +22 -0
  61. package/cjs/scenegraph/gantt-node.js +66 -0
  62. package/cjs/scenegraph/gantt-node.js.map +1 -0
  63. package/cjs/scenegraph/graphic/group-contribution-render.d.ts +12 -0
  64. package/cjs/scenegraph/graphic/group-contribution-render.js +37 -0
  65. package/cjs/scenegraph/graphic/group-contribution-render.js.map +1 -0
  66. package/cjs/scenegraph/graphic/index.d.ts +3 -0
  67. package/cjs/scenegraph/graphic/index.js +13 -0
  68. package/cjs/scenegraph/graphic/index.js.map +1 -0
  69. package/cjs/scenegraph/grid.d.ts +34 -0
  70. package/cjs/scenegraph/grid.js +316 -0
  71. package/cjs/scenegraph/grid.js.map +1 -0
  72. package/cjs/scenegraph/mark-line.d.ts +13 -0
  73. package/cjs/scenegraph/mark-line.js +109 -0
  74. package/cjs/scenegraph/mark-line.js.map +1 -0
  75. package/cjs/scenegraph/scenegraph.d.ts +59 -0
  76. package/cjs/scenegraph/scenegraph.js +240 -0
  77. package/cjs/scenegraph/scenegraph.js.map +1 -0
  78. package/cjs/scenegraph/scroll-bar.d.ts +19 -0
  79. package/cjs/scenegraph/scroll-bar.js +150 -0
  80. package/cjs/scenegraph/scroll-bar.js.map +1 -0
  81. package/cjs/scenegraph/task-bar.d.ts +40 -0
  82. package/cjs/scenegraph/task-bar.js +476 -0
  83. package/cjs/scenegraph/task-bar.js.map +1 -0
  84. package/cjs/scenegraph/task-creation-button.d.ts +13 -0
  85. package/cjs/scenegraph/task-creation-button.js +86 -0
  86. package/cjs/scenegraph/task-creation-button.js.map +1 -0
  87. package/cjs/scenegraph/timeline-header.d.ts +14 -0
  88. package/cjs/scenegraph/timeline-header.js +190 -0
  89. package/cjs/scenegraph/timeline-header.js.map +1 -0
  90. package/cjs/scenegraph/tooltip.d.ts +9 -0
  91. package/cjs/scenegraph/tooltip.js +59 -0
  92. package/cjs/scenegraph/tooltip.js.map +1 -0
  93. package/cjs/state/gantt-table-sync.d.ts +8 -0
  94. package/cjs/state/gantt-table-sync.js +96 -0
  95. package/cjs/state/gantt-table-sync.js.map +1 -0
  96. package/cjs/state/state-manager.d.ts +127 -0
  97. package/cjs/state/state-manager.js +634 -0
  98. package/cjs/state/state-manager.js.map +1 -0
  99. package/cjs/sub-tasks-inline-helper.d.ts +1 -0
  100. package/cjs/sub-tasks-inline-helper.js +1 -0
  101. package/cjs/sub-tasks-inline-helper.js.map +1 -0
  102. package/cjs/themes.d.ts +1 -0
  103. package/cjs/themes.js +1 -0
  104. package/cjs/themes.js.map +1 -0
  105. package/cjs/tools/debounce.d.ts +1 -0
  106. package/cjs/tools/debounce.js +51 -0
  107. package/cjs/tools/debounce.js.map +1 -0
  108. package/cjs/tools/dom.d.ts +1 -0
  109. package/cjs/tools/dom.js +11 -0
  110. package/cjs/tools/dom.js.map +1 -0
  111. package/cjs/tools/index.d.ts +2 -0
  112. package/cjs/tools/index.js +30 -0
  113. package/cjs/tools/index.js.map +1 -0
  114. package/cjs/tools/inertia.d.ts +15 -0
  115. package/cjs/tools/inertia.js +40 -0
  116. package/cjs/tools/inertia.js.map +1 -0
  117. package/cjs/tools/isx.d.ts +16 -0
  118. package/cjs/tools/isx.js +117 -0
  119. package/cjs/tools/isx.js.map +1 -0
  120. package/cjs/tools/pixel-ratio.d.ts +2 -0
  121. package/cjs/tools/pixel-ratio.js +16 -0
  122. package/cjs/tools/pixel-ratio.js.map +1 -0
  123. package/cjs/tools/util.d.ts +19 -0
  124. package/cjs/tools/util.js +404 -0
  125. package/cjs/tools/util.js.map +1 -0
  126. package/cjs/ts-types/EVENT_TYPE.d.ts +19 -0
  127. package/cjs/ts-types/EVENT_TYPE.js +22 -0
  128. package/cjs/ts-types/EVENT_TYPE.js.map +1 -0
  129. package/cjs/ts-types/common.d.ts +11 -0
  130. package/cjs/ts-types/common.js +10 -0
  131. package/cjs/ts-types/common.js.map +1 -0
  132. package/cjs/ts-types/events.d.ts +132 -0
  133. package/cjs/ts-types/events.js +6 -0
  134. package/cjs/ts-types/events.js.map +1 -0
  135. package/cjs/ts-types/gantt-engine.d.ts +344 -0
  136. package/cjs/ts-types/gantt-engine.js +18 -0
  137. package/cjs/ts-types/gantt-engine.js.map +1 -0
  138. package/cjs/ts-types/index.d.ts +5 -0
  139. package/cjs/ts-types/index.js +23 -0
  140. package/cjs/ts-types/index.js.map +1 -0
  141. package/cjs/ts-types/zoom-scale.d.ts +32 -0
  142. package/cjs/ts-types/zoom-scale.js +6 -0
  143. package/cjs/ts-types/zoom-scale.js.map +1 -0
  144. package/cjs/vrender.d.ts +1 -0
  145. package/cjs/vrender.js +60 -0
  146. package/cjs/vrender.js.map +1 -0
  147. package/cjs/vtable.d.ts +1 -0
  148. package/cjs/vtable.js +35 -0
  149. package/cjs/vtable.js.map +1 -0
  150. package/cjs/zoom-scale/DataZoomIntegration.d.ts +50 -0
  151. package/cjs/zoom-scale/DataZoomIntegration.js +261 -0
  152. package/cjs/zoom-scale/DataZoomIntegration.js.map +1 -0
  153. package/cjs/zoom-scale/ZoomScaleManager.d.ts +55 -0
  154. package/cjs/zoom-scale/ZoomScaleManager.js +328 -0
  155. package/cjs/zoom-scale/ZoomScaleManager.js.map +1 -0
  156. package/cjs/zoom-scale/index.d.ts +4 -0
  157. package/cjs/zoom-scale/index.js +24 -0
  158. package/cjs/zoom-scale/index.js.map +1 -0
  159. package/dist/vtable-gantt.js +76328 -0
  160. package/dist/vtable-gantt.min.js +15 -0
  161. package/es/Gantt.d.ts +200 -0
  162. package/es/Gantt.js +584 -0
  163. package/es/Gantt.js.map +1 -0
  164. package/es/components/Menu.d.ts +1 -0
  165. package/es/components/Menu.js +1 -0
  166. package/es/components/Menu.js.map +1 -0
  167. package/es/components/MenuElementStyle.d.ts +1 -0
  168. package/es/components/MenuElementStyle.js +6 -0
  169. package/es/components/MenuElementStyle.js.map +1 -0
  170. package/es/data/DataSource.d.ts +9 -0
  171. package/es/data/DataSource.js +63 -0
  172. package/es/data/DataSource.js.map +1 -0
  173. package/es/env.d.ts +19 -0
  174. package/es/env.js +42 -0
  175. package/es/env.js.map +1 -0
  176. package/es/event/EventHandler.d.ts +47 -0
  177. package/es/event/EventHandler.js +119 -0
  178. package/es/event/EventHandler.js.map +1 -0
  179. package/es/event/EventTarget.d.ts +12 -0
  180. package/es/event/EventTarget.js +58 -0
  181. package/es/event/EventTarget.js.map +1 -0
  182. package/es/event/event-manager.d.ts +34 -0
  183. package/es/event/event-manager.js +376 -0
  184. package/es/event/event-manager.js.map +1 -0
  185. package/es/event/scroll.d.ts +8 -0
  186. package/es/event/scroll.js +104 -0
  187. package/es/event/scroll.js.map +1 -0
  188. package/es/event/touch.d.ts +2 -0
  189. package/es/event/touch.js +78 -0
  190. package/es/event/touch.js.map +1 -0
  191. package/es/gantt-helper.d.ts +63 -0
  192. package/es/gantt-helper.js +683 -0
  193. package/es/gantt-helper.js.map +1 -0
  194. package/es/index.d.ts +10 -0
  195. package/es/index.js +16 -0
  196. package/es/index.js.map +1 -0
  197. package/es/plugins/index.d.ts +2 -0
  198. package/es/plugins/index.js +2 -0
  199. package/es/plugins/index.js.map +1 -0
  200. package/es/plugins/interface.d.ts +10 -0
  201. package/es/plugins/interface.js +2 -0
  202. package/es/plugins/interface.js.map +1 -0
  203. package/es/plugins/plugin-manager.d.ts +16 -0
  204. package/es/plugins/plugin-manager.js +55 -0
  205. package/es/plugins/plugin-manager.js.map +1 -0
  206. package/es/register.d.ts +1 -0
  207. package/es/register.js +1 -0
  208. package/es/register.js.map +1 -0
  209. package/es/scenegraph/dependency-link.d.ts +48 -0
  210. package/es/scenegraph/dependency-link.js +462 -0
  211. package/es/scenegraph/dependency-link.js.map +1 -0
  212. package/es/scenegraph/drag-order-line.d.ts +12 -0
  213. package/es/scenegraph/drag-order-line.js +40 -0
  214. package/es/scenegraph/drag-order-line.js.map +1 -0
  215. package/es/scenegraph/frame-border.d.ts +10 -0
  216. package/es/scenegraph/frame-border.js +51 -0
  217. package/es/scenegraph/frame-border.js.map +1 -0
  218. package/es/scenegraph/gantt-node.d.ts +22 -0
  219. package/es/scenegraph/gantt-node.js +64 -0
  220. package/es/scenegraph/gantt-node.js.map +1 -0
  221. package/es/scenegraph/graphic/group-contribution-render.d.ts +12 -0
  222. package/es/scenegraph/graphic/group-contribution-render.js +32 -0
  223. package/es/scenegraph/graphic/group-contribution-render.js.map +1 -0
  224. package/es/scenegraph/graphic/index.d.ts +3 -0
  225. package/es/scenegraph/graphic/index.js +8 -0
  226. package/es/scenegraph/graphic/index.js.map +1 -0
  227. package/es/scenegraph/grid.d.ts +34 -0
  228. package/es/scenegraph/grid.js +306 -0
  229. package/es/scenegraph/grid.js.map +1 -0
  230. package/es/scenegraph/mark-line.d.ts +13 -0
  231. package/es/scenegraph/mark-line.js +101 -0
  232. package/es/scenegraph/mark-line.js.map +1 -0
  233. package/es/scenegraph/scenegraph.d.ts +59 -0
  234. package/es/scenegraph/scenegraph.js +250 -0
  235. package/es/scenegraph/scenegraph.js.map +1 -0
  236. package/es/scenegraph/scroll-bar.d.ts +19 -0
  237. package/es/scenegraph/scroll-bar.js +144 -0
  238. package/es/scenegraph/scroll-bar.js.map +1 -0
  239. package/es/scenegraph/task-bar.d.ts +40 -0
  240. package/es/scenegraph/task-bar.js +475 -0
  241. package/es/scenegraph/task-bar.js.map +1 -0
  242. package/es/scenegraph/task-creation-button.d.ts +13 -0
  243. package/es/scenegraph/task-creation-button.js +78 -0
  244. package/es/scenegraph/task-creation-button.js.map +1 -0
  245. package/es/scenegraph/timeline-header.d.ts +14 -0
  246. package/es/scenegraph/timeline-header.js +186 -0
  247. package/es/scenegraph/timeline-header.js.map +1 -0
  248. package/es/scenegraph/tooltip.d.ts +9 -0
  249. package/es/scenegraph/tooltip.js +51 -0
  250. package/es/scenegraph/tooltip.js.map +1 -0
  251. package/es/state/gantt-table-sync.d.ts +8 -0
  252. package/es/state/gantt-table-sync.js +87 -0
  253. package/es/state/gantt-table-sync.js.map +1 -0
  254. package/es/state/state-manager.d.ts +127 -0
  255. package/es/state/state-manager.js +631 -0
  256. package/es/state/state-manager.js.map +1 -0
  257. package/es/sub-tasks-inline-helper.d.ts +1 -0
  258. package/es/sub-tasks-inline-helper.js +1 -0
  259. package/es/sub-tasks-inline-helper.js.map +1 -0
  260. package/es/themes.d.ts +1 -0
  261. package/es/themes.js +1 -0
  262. package/es/themes.js.map +1 -0
  263. package/es/tools/debounce.d.ts +1 -0
  264. package/es/tools/debounce.js +45 -0
  265. package/es/tools/debounce.js.map +1 -0
  266. package/es/tools/dom.d.ts +1 -0
  267. package/es/tools/dom.js +5 -0
  268. package/es/tools/dom.js.map +1 -0
  269. package/es/tools/index.d.ts +2 -0
  270. package/es/tools/index.js +4 -0
  271. package/es/tools/index.js.map +1 -0
  272. package/es/tools/inertia.d.ts +15 -0
  273. package/es/tools/inertia.js +31 -0
  274. package/es/tools/inertia.js.map +1 -0
  275. package/es/tools/isx.d.ts +16 -0
  276. package/es/tools/isx.js +80 -0
  277. package/es/tools/isx.js.map +1 -0
  278. package/es/tools/pixel-ratio.d.ts +2 -0
  279. package/es/tools/pixel-ratio.js +12 -0
  280. package/es/tools/pixel-ratio.js.map +1 -0
  281. package/es/tools/util.d.ts +19 -0
  282. package/es/tools/util.js +390 -0
  283. package/es/tools/util.js.map +1 -0
  284. package/es/ts-types/EVENT_TYPE.d.ts +19 -0
  285. package/es/ts-types/EVENT_TYPE.js +18 -0
  286. package/es/ts-types/EVENT_TYPE.js.map +1 -0
  287. package/es/ts-types/common.d.ts +11 -0
  288. package/es/ts-types/common.js +6 -0
  289. package/es/ts-types/common.js.map +1 -0
  290. package/es/ts-types/events.d.ts +132 -0
  291. package/es/ts-types/events.js +2 -0
  292. package/es/ts-types/events.js.map +1 -0
  293. package/es/ts-types/gantt-engine.d.ts +344 -0
  294. package/es/ts-types/gantt-engine.js +21 -0
  295. package/es/ts-types/gantt-engine.js.map +1 -0
  296. package/es/ts-types/index.d.ts +5 -0
  297. package/es/ts-types/index.js +10 -0
  298. package/es/ts-types/index.js.map +1 -0
  299. package/es/ts-types/zoom-scale.d.ts +32 -0
  300. package/es/ts-types/zoom-scale.js +2 -0
  301. package/es/ts-types/zoom-scale.js.map +1 -0
  302. package/es/vrender.d.ts +1 -0
  303. package/es/vrender.js +2 -0
  304. package/es/vrender.js.map +1 -0
  305. package/es/vtable.d.ts +1 -0
  306. package/es/vtable.js +2 -0
  307. package/es/vtable.js.map +1 -0
  308. package/es/zoom-scale/DataZoomIntegration.d.ts +50 -0
  309. package/es/zoom-scale/DataZoomIntegration.js +253 -0
  310. package/es/zoom-scale/DataZoomIntegration.js.map +1 -0
  311. package/es/zoom-scale/ZoomScaleManager.d.ts +55 -0
  312. package/es/zoom-scale/ZoomScaleManager.js +322 -0
  313. package/es/zoom-scale/ZoomScaleManager.js.map +1 -0
  314. package/es/zoom-scale/index.d.ts +4 -0
  315. package/es/zoom-scale/index.js +4 -0
  316. package/es/zoom-scale/index.js.map +1 -0
  317. package/package.json +124 -0
package/README.md ADDED
@@ -0,0 +1,213 @@
1
+ <div align="center">
2
+ <a href="" target="_blank">
3
+ <img alt="VisActor Logo" width="200" src="https://github.com/VisActor/.github/blob/main/profile/500_200.svg"/>
4
+ </a>
5
+ </div>
6
+
7
+ <div align="center">
8
+ <h1>VTable-Gantt</h1>
9
+ </div>
10
+
11
+ <div align="center">
12
+
13
+ VTable-Gantt create an efficient and flexible Gantt chart solution to make project management easier. Through simple configuration and custom layout, you can quickly get started and meet various complex needs. Improve team collaboration efficiency and achieve transparency of project progress.
14
+
15
+ <p align="center">
16
+ <a href="https://visactor.io/vtable/guide/gantt/introduction">Introduction</a> •
17
+ <a href="https://visactor.io/vtable/demo/gantt/gantt-basic">Demo</a> •
18
+ <a href="https://visactor.io/vtable/guide/gantt/Getting_Started">Tutorial</a> •
19
+ <a href="https://visactor.io/vtable/option/Gantt">API</a>•
20
+ </p>
21
+
22
+ [![npm Version](https://img.shields.io/npm/v/@visactor/vtable-gantt.svg)](https://www.npmjs.com/package/@visactor/vtable-gantt)
23
+ [![npm Download](https://img.shields.io/npm/dm/@visactor/vtable-gantt.svg)](https://www.npmjs.com/package/@visactor/vtable-gantt)
24
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/visactor/vtable/blob/main/LICENSE)
25
+
26
+ </div>
27
+
28
+ <div align="center">
29
+
30
+ English| [简体中文](./README.zh-CN.md)
31
+
32
+ </div>
33
+
34
+ <div align="center">
35
+
36
+ (video)
37
+
38
+ </div>
39
+
40
+ # Introduction
41
+
42
+ VTable-Gantt is a Gantt chart component library in the VisActor visualization system, based on the table component VTable and the visualization rendering engine VRender. It is designed specifically for project management and task tracking, providing powerful visualization and interaction features. The core capabilities are as follows:
43
+
44
+ 1. High performance: Supports fast computation and rendering of large-scale project data, ensuring a smooth user experience.
45
+ 2. Flexible layout: Supports custom timeline, task bar styles, and layouts to meet different project management needs.
46
+ 3. Powerful interaction: Provides drag-and-drop, zoom, and edit functions for tasks, simplifying project management operations.
47
+ 4. Rich visualization capabilities: supports custom rendering of information cells and task bars, provides tree structure display, and improves the diversity and intuitiveness of data display.
48
+
49
+ # Repo Intro
50
+
51
+ This repository includes the following packages:
52
+
53
+ 1. packages/vtable: The core code repository of VTable
54
+ 2. packages/vtable-gantt: Gantt chart component code
55
+ 3. packages/vtable-editors: Table editor component code
56
+ 4. packages/vtable-plugins: Table plugin code
57
+ 5. packages/vtable-export: Table export tool code
58
+ 6. packages/vtable-search: Table search tool code
59
+ 7. packages/react-vtable: React version of the table component
60
+ 8. packages/vue-vtable: Vue version of the table component
61
+ 9. docs: Include VTable site tutorials, demos,apis and options, and also contains all Chinese and English documents.
62
+
63
+ # Usage
64
+
65
+ ## Installation
66
+
67
+ [npm package](https://www.npmjs.com/package/@visactor/vtable)
68
+
69
+ ```bash
70
+ // npm
71
+ npm install @visactor/vtable-gantt
72
+
73
+ // yarn
74
+ yarn add @visactor/vtable-gantt
75
+ ```
76
+
77
+ ## Quick Start
78
+
79
+ ```javascript
80
+ import {Gantt} from '@visactor/vtable-gantt';
81
+ const records = [
82
+ {
83
+ id: 1,
84
+ title: 'Task 1',
85
+ developer: 'liufangfang.jane@bytedance.com',
86
+ start: '2024-07-24',
87
+ end: '2024-07-26',
88
+ progress: 31,
89
+ priority: 'P0',
90
+ },
91
+ {
92
+ id: 2,
93
+ title: 'Task 2',
94
+ developer: 'liufangfang.jane@bytedance.com',
95
+ start: '07/24/2024',
96
+ end: '08/04/2024',
97
+ progress: 60,
98
+ priority: 'P0'
99
+ },
100
+ {
101
+ id: 3,
102
+ title: 'Task 3',
103
+ developer: 'liufangfang.jane@bytedance.com',
104
+ start: '2024-08-04',
105
+ end: '2024-08-04',
106
+ progress: 100,
107
+ priority: 'P1'
108
+ },
109
+ {
110
+ id: 4,
111
+ title: 'Task 4',
112
+ developer: 'liufangfang.jane@bytedance.com',
113
+ start: '2024-07-26',
114
+ end: '2024-07-28',
115
+ progress: 31,
116
+ priority: 'P0'
117
+ }
118
+ ];
119
+
120
+ const columns = [
121
+ {
122
+ field: 'title',
123
+ title: 'title',
124
+ width: 'auto',
125
+ sort: true,
126
+ tree: true,
127
+ editor: 'input'
128
+ },
129
+ {
130
+ field: 'start',
131
+ title: 'start',
132
+ width: 'auto',
133
+ sort: true,
134
+ editor: 'date-input'
135
+ },
136
+ {
137
+ field: 'end',
138
+ title: 'end',
139
+ width: 'auto',
140
+ sort: true,
141
+ editor: 'date-input'
142
+ }
143
+ ];
144
+ const option = {
145
+ overscrollBehavior: 'none',
146
+ records,
147
+ taskListTable: {
148
+ columns,
149
+ },
150
+ taskBar: {
151
+ startDateField: 'start',
152
+ endDateField: 'end',
153
+ progressField: 'progress'
154
+ },
155
+ timelineHeader: {
156
+ colWidth: 100,
157
+ backgroundColor: '#EEF1F5',
158
+ horizontalLine: {
159
+ lineWidth: 1,
160
+ lineColor: '#e1e4e8'
161
+ },
162
+ verticalLine: {
163
+ lineWidth: 1,
164
+ lineColor: '#e1e4e8'
165
+ },
166
+ scales: [
167
+ {
168
+ unit: 'day',
169
+ step: 1,
170
+ format(date) {
171
+ return date.dateIndex.toString();
172
+ },
173
+ style: {
174
+ fontSize: 20,
175
+ fontWeight: 'bold',
176
+ color: 'white',
177
+ strokeColor: 'black',
178
+ textAlign: 'right',
179
+ textBaseline: 'bottom',
180
+ backgroundColor: '#EEF1F5'
181
+ }
182
+ }
183
+ ]
184
+ },
185
+ };
186
+ const ganttInstance = new Gantt(document.getElementById(CONTAINER_ID), option);
187
+ ```
188
+
189
+ ##
190
+
191
+ [More demos and detailed tutorials](https://visactor.io/vtable)
192
+
193
+ # Related Links
194
+
195
+ - [Official website](https://visactor.io/vtable)
196
+
197
+ # Ecosystem
198
+
199
+ | Project | Description |
200
+ | ----------------------------------------------------------- | -------------------------------------------------------------------------------------- |
201
+ | [AI-generated Components](https://visactor.io/ai-vtable) | AI-generated table component. |
202
+
203
+ # Contribution
204
+
205
+ If you would like to contribute, please read the [Code of Conduct ](./CODE_OF_CONDUCT.md) 和 [ Guide](./CONTRIBUTING.zh-CN.md) first。
206
+
207
+ Small streams converge to make great rivers and seas!
208
+
209
+ <a href="https://github.com/visactor/vtable/graphs/contributors"><img src="https://contrib.rocks/image?repo=visactor/vtable" /></a>
210
+
211
+ # License
212
+
213
+ [MIT License](./LICENSE)
@@ -0,0 +1,215 @@
1
+ <div align="center">
2
+ <a href="" target="_blank">
3
+ <img alt="VisActor Logo" width="200" src="https://github.com/VisActor/.github/blob/main/profile/500_200.svg"/>
4
+ </a>
5
+ </div>
6
+
7
+ <div align="center">
8
+ <h1>VTable-Gantt</h1>
9
+ </div>
10
+
11
+ <div align="center">
12
+
13
+ VTable-Gantt 打造高效、灵活的甘特图解决方案,让项目管理更轻松。通过简单的配置和自定义布局,快速上手并满足各种复杂需求。提升团队协作效率,实现项目进度透明化。.
14
+
15
+ <p align="center">
16
+ <a href="https://visactor.io/vtable/guide/gantt/introduction">Introduction</a> •
17
+ <a href="https://visactor.io/vtable/demo/gantt/gantt-basic">Demo</a> •
18
+ <a href="https://visactor.io/vtable/guide/gantt/Getting_Started">Tutorial</a> •
19
+ <a href="https://visactor.io/vtable/option/Gantt">API</a>•
20
+ </p>
21
+
22
+ [![npm Version](https://img.shields.io/npm/v/@visactor/vtable-gantt.svg)](https://www.npmjs.com/package/@visactor/vtable-gantt)
23
+ [![npm Download](https://img.shields.io/npm/dm/@visactor/vtable-gantt.svg)](https://www.npmjs.com/package/@visactor/vtable-gantt)
24
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/visactor/vtable/blob/main/LICENSE)
25
+
26
+ </div>
27
+
28
+ <div align="center">
29
+
30
+ 简体中文| [English](./README.md)
31
+
32
+ </div>
33
+
34
+ <div align="center">
35
+
36
+ (video)
37
+
38
+ </div>
39
+
40
+ # 介绍
41
+
42
+ VTable-Gantt 是 VisActor 可视化体系中的甘特图组件库,基于表格组件VTabe和可视化渲染引擎 VRender 进行封装。它专为项目管理和任务跟踪设计,提供了强大的可视化和交互功能。核心能力如下:
43
+
44
+ 1. 高效性能:支持大规模项目数据的快速运算与渲染,确保流畅的用户体验。
45
+ 2. 灵活布局:支持自定义时间轴、任务条样式和布局,满足不同项目管理需求。
46
+ 3. 强大交互:提供任务的拖拽、缩放和编辑功能,简化项目管理操作。
47
+ 4. 丰富的可视化能力:支持信息单元格及任务条的自定义渲染,提供树形结构展示,提升数据展示的多样性和直观性。
48
+
49
+ # 代码仓库介绍
50
+
51
+ 主要包含以下几个子项目:
52
+
53
+ 1. packages/vtable:表格组件代码
54
+ 2. packages/vtable-gantt: 甘特图组件代码
55
+ 3. packages/vtable-editors: 表格编辑器组件代码
56
+ 4. packages/vtable-plugins: 表格插件代码
57
+ 5. packages/vtable-export: 表格导出工具代码
58
+ 6. packages/vtable-search: 表格搜索工具代码
59
+ 7. packages/react-vtable: React 版本的表格组件
60
+ 8. packages/vue-vtable: Vue 版本的表格组件
61
+ 9. docs: 教程文档
62
+
63
+ # 用法
64
+
65
+ ## 安装
66
+
67
+ [npm package](https://www.npmjs.com/package/@visactor/vtable)
68
+
69
+ ```bash
70
+ // npm
71
+ npm install @visactor/vtable-gantt
72
+
73
+ // yarn
74
+ yarn add @visactor/vtable-gantt
75
+ ```
76
+
77
+ ## 快速上手
78
+
79
+ ```javascript
80
+ import {Gantt} from '@visactor/vtable-gantt';
81
+
82
+ const records = [
83
+ {
84
+ id: 1,
85
+ title: 'Task 1',
86
+ developer: 'liufangfang.jane@bytedance.com',
87
+ start: '2024-07-24',
88
+ end: '2024-07-26',
89
+ progress: 31,
90
+ priority: 'P0',
91
+ },
92
+ {
93
+ id: 2,
94
+ title: 'Task 2',
95
+ developer: 'liufangfang.jane@bytedance.com',
96
+ start: '07/24/2024',
97
+ end: '08/04/2024',
98
+ progress: 60,
99
+ priority: 'P0'
100
+ },
101
+ {
102
+ id: 3,
103
+ title: 'Task 3',
104
+ developer: 'liufangfang.jane@bytedance.com',
105
+ start: '2024-08-04',
106
+ end: '2024-08-04',
107
+ progress: 100,
108
+ priority: 'P1'
109
+ },
110
+ {
111
+ id: 4,
112
+ title: 'Task 4',
113
+ developer: 'liufangfang.jane@bytedance.com',
114
+ start: '2024-07-26',
115
+ end: '2024-07-28',
116
+ progress: 31,
117
+ priority: 'P0'
118
+ }
119
+ ];
120
+
121
+ const columns = [
122
+ {
123
+ field: 'title',
124
+ title: 'title',
125
+ width: 'auto',
126
+ sort: true,
127
+ tree: true,
128
+ editor: 'input'
129
+ },
130
+ {
131
+ field: 'start',
132
+ title: 'start',
133
+ width: 'auto',
134
+ sort: true,
135
+ editor: 'date-input'
136
+ },
137
+ {
138
+ field: 'end',
139
+ title: 'end',
140
+ width: 'auto',
141
+ sort: true,
142
+ editor: 'date-input'
143
+ }
144
+ ];
145
+ const option = {
146
+ overscrollBehavior: 'none',
147
+ records,
148
+ taskListTable: {
149
+ columns,
150
+ },
151
+ taskBar: {
152
+ startDateField: 'start',
153
+ endDateField: 'end',
154
+ progressField: 'progress'
155
+ },
156
+ timelineHeader: {
157
+ colWidth: 100,
158
+ backgroundColor: '#EEF1F5',
159
+ horizontalLine: {
160
+ lineWidth: 1,
161
+ lineColor: '#e1e4e8'
162
+ },
163
+ verticalLine: {
164
+ lineWidth: 1,
165
+ lineColor: '#e1e4e8'
166
+ },
167
+ scales: [
168
+ {
169
+ unit: 'day',
170
+ step: 1,
171
+ format(date) {
172
+ return date.dateIndex.toString();
173
+ },
174
+ style: {
175
+ fontSize: 20,
176
+ fontWeight: 'bold',
177
+ color: 'white',
178
+ strokeColor: 'black',
179
+ textAlign: 'right',
180
+ textBaseline: 'bottom',
181
+ backgroundColor: '#EEF1F5'
182
+ }
183
+ }
184
+ ]
185
+ },
186
+ };
187
+ const ganttInstance = new Gantt(document.getElementById(CONTAINER_ID), option);
188
+
189
+ ```
190
+
191
+ ##
192
+
193
+ [更多 demo 和详细教程](https://visactor.io/vtable)
194
+
195
+ # 相关链接
196
+
197
+ - [官网](https://visactor.io/vtable)
198
+
199
+ # 生态系统
200
+
201
+ | Project | Description |
202
+ | ----------------------------------------------------------- | -------------------------------------------------------------------------------------- |
203
+ | [AI-generated Components](https://visactor.io/ai-vtable) | AI-generated table component. |
204
+
205
+ # 参与贡献
206
+
207
+ 如想参与贡献,请先阅读 [行为准则](./CODE_OF_CONDUCT.md) 和 [贡献指南](./CONTRIBUTING.zh-CN.md)。
208
+
209
+ 细流成河,终成大海!
210
+
211
+ <a href="https://github.com/visactor/vtable/graphs/contributors"><img src="https://contrib.rocks/image?repo=visactor/vtable" /></a>
212
+
213
+ # 许可证
214
+
215
+ [MIT 协议](./LICENSE)
package/cjs/Gantt.d.ts ADDED
@@ -0,0 +1,200 @@
1
+ import { Scenegraph } from './scenegraph/scenegraph';
2
+ import type { ITaskBarStyle, GanttConstructorOptions, IGrid, ITimelineHeaderStyle, IMarkLine, ITaskBarLabelText, ITaskBarLabelTextStyle, IScrollStyle, IFrameStyle, ITableColumnsDefine, ITaskBarCustomLayout, ITimelineDateInfo, ITimelineScale, ILineStyle, ITaskCreationCustomLayout, ITaskLink, ITaskBarSelectedStyle, ITaskBarHoverStyle, ITaskLinkSelectedStyle, IPointStyle, TaskBarInteractionArgumentType, IEventOptions, IMilestoneStyle, IKeyboardOptions, IMarkLineCreateOptions } from './ts-types';
3
+ import { TasksShowMode } from './ts-types';
4
+ import type { ListTableConstructorOptions } from '@visactor/vtable';
5
+ import { ListTable } from '@visactor/vtable';
6
+ import { EventManager } from './event/event-manager';
7
+ import { StateManager } from './state/state-manager';
8
+ import { EventTarget } from './event/EventTarget';
9
+ import { DataSource } from './data/DataSource';
10
+ import { PluginManager } from './plugins/plugin-manager';
11
+ import { ZoomScaleManager } from './zoom-scale';
12
+ export declare function createRootElement(padding: any, className?: string): HTMLElement;
13
+ export declare class Gantt extends EventTarget {
14
+ options: GanttConstructorOptions;
15
+ container: HTMLElement;
16
+ tableNoFrameWidth: number;
17
+ tableNoFrameHeight: number;
18
+ tableX: number;
19
+ tableY: number;
20
+ scenegraph: Scenegraph;
21
+ stateManager: StateManager;
22
+ eventManager: EventManager;
23
+ taskListTableInstance?: ListTable;
24
+ canvas: HTMLCanvasElement;
25
+ element: HTMLElement;
26
+ verticalSplitResizeLine: HTMLDivElement;
27
+ horizontalSplitLine: HTMLDivElement;
28
+ context: CanvasRenderingContext2D;
29
+ timeLineHeaderLevel: number;
30
+ itemCount: number;
31
+ drawHeight: number;
32
+ headerHeight: number;
33
+ gridHeight: number;
34
+ pluginManager: PluginManager;
35
+ parsedOptions: {
36
+ timeLineHeaderRowHeights: number[];
37
+ rowHeight: number;
38
+ timelineColWidth: number;
39
+ scrollStyle: IScrollStyle;
40
+ timelineHeaderVerticalLineStyle: ILineStyle;
41
+ timelineHeaderHorizontalLineStyle: ILineStyle;
42
+ timelineHeaderBackgroundColor: string;
43
+ timelineHeaderStyles: ITimelineHeaderStyle[];
44
+ sortedTimelineScales: (ITimelineScale & {
45
+ timelineDates?: ITimelineDateInfo[];
46
+ })[];
47
+ reverseSortedTimelineScales: (ITimelineScale & {
48
+ timelineDates?: ITimelineDateInfo[];
49
+ })[];
50
+ timeScaleIncludeHour: boolean;
51
+ grid: IGrid;
52
+ taskBarStyle: ITaskBarStyle | ((interactionArgs: TaskBarInteractionArgumentType) => ITaskBarStyle);
53
+ taskBarMilestoneStyle: IMilestoneStyle;
54
+ projectBarStyle: ITaskBarStyle | ((interactionArgs: TaskBarInteractionArgumentType) => ITaskBarStyle);
55
+ taskBarMilestoneHypotenuse: number;
56
+ taskBarHoverStyle: ITaskBarHoverStyle;
57
+ taskBarSelectedStyle: ITaskBarSelectedStyle;
58
+ taskBarSelectable: boolean;
59
+ taskBarLabelText: ITaskBarLabelText;
60
+ taskBarMoveable: boolean | ((interactionArgs: TaskBarInteractionArgumentType) => boolean);
61
+ moveTaskBarToExtendDateRange: boolean;
62
+ taskBarResizable: boolean | [boolean, boolean] | ((interactionArgs: TaskBarInteractionArgumentType) => boolean | [boolean, boolean]);
63
+ taskBarProgressAdjustable: boolean | ((interactionArgs: TaskBarInteractionArgumentType) => boolean);
64
+ taskBarDragOrder: boolean;
65
+ taskBarLabelStyle: ITaskBarLabelTextStyle;
66
+ taskBarCustomLayout: ITaskBarCustomLayout;
67
+ taskBarCreatable: boolean | ((interactionArgs: TaskBarInteractionArgumentType) => boolean);
68
+ taskBarCreationButtonStyle: ILineStyle & {
69
+ cornerRadius?: number;
70
+ backgroundColor?: string;
71
+ };
72
+ taskBarCreationCustomLayout: ITaskCreationCustomLayout;
73
+ taskBarCreationMaxWidth: number;
74
+ taskBarCreationMinWidth: number;
75
+ outerFrameStyle: IFrameStyle;
76
+ pixelRatio: number;
77
+ tasksShowMode: TasksShowMode;
78
+ projectSubTasksExpandable: boolean;
79
+ taskBarClip: boolean;
80
+ startDateField: string;
81
+ endDateField: string;
82
+ progressField: string;
83
+ minDate: Date;
84
+ maxDate: Date;
85
+ _minDateTime: number;
86
+ _maxDateTime: number;
87
+ markLine: IMarkLine[];
88
+ scrollToMarkLineDate: Date;
89
+ horizontalSplitLine: ILineStyle;
90
+ verticalSplitLine: ILineStyle;
91
+ verticalSplitLineHighlight: ILineStyle;
92
+ verticalSplitLineMoveable?: boolean;
93
+ overscrollBehavior: 'auto' | 'none';
94
+ dateFormat?: 'yyyy-mm-dd' | 'dd-mm-yyyy' | 'mm/dd/yyyy' | 'yyyy/mm/dd' | 'dd/mm/yyyy' | 'yyyy.mm.dd' | 'dd.mm.yyyy' | 'mm.dd.yyyy';
95
+ taskKeyField: string;
96
+ dependencyLinks?: ITaskLink[];
97
+ dependencyLinkCreatable: boolean;
98
+ dependencyLinkSelectable: boolean;
99
+ dependencyLinkDeletable: boolean;
100
+ dependencyLinkLineStyle: ILineStyle;
101
+ dependencyLinkSelectedLineStyle: ITaskLinkSelectedStyle;
102
+ dependencyLinkLineCreatePointStyle: IPointStyle;
103
+ dependencyLinkLineCreatingPointStyle: IPointStyle;
104
+ dependencyLinkLineCreatingStyle?: ILineStyle;
105
+ dependencyLinkDistanceToTaskBar?: number;
106
+ underlayBackgroundColor: string;
107
+ eventOptions: IEventOptions;
108
+ keyboardOptions: IKeyboardOptions;
109
+ markLineCreateOptions: IMarkLineCreateOptions;
110
+ zoom?: {
111
+ minMillisecondsPerPixel?: number;
112
+ maxMillisecondsPerPixel?: number;
113
+ step?: number;
114
+ };
115
+ };
116
+ private millisecondsPerPixel;
117
+ zoomScaleManager?: ZoomScaleManager;
118
+ recalculateTimeScale(): void;
119
+ zoomByFactor(factor: number, keepCenter?: boolean, centerX?: number): void;
120
+ taskTableWidth: number;
121
+ taskTableColumns: ITableColumnsDefine;
122
+ records: any[];
123
+ data: DataSource;
124
+ constructor(container: HTMLElement, options: GanttConstructorOptions);
125
+ renderTaskBarsTable(): void;
126
+ _updateSize(): void;
127
+ _updateListTableSize(taskListTableInstance: ListTable): void;
128
+ _generateListTable(): void;
129
+ _generateListTableOptions(): ListTableConstructorOptions;
130
+ getElement(): HTMLElement;
131
+ getContainer(): HTMLElement;
132
+ _sortScales(): void;
133
+ _generateTimeLineDateMap(): void;
134
+ getRowHeightByIndex(index: number): number;
135
+ getRowsHeightByIndex(startIndex: number, endIndex: number): number;
136
+ getAllRowsHeight(): number;
137
+ getAllHeaderRowsHeight(): number;
138
+ getAllDateColsWidth(): number;
139
+ getAllTaskBarsHeight(): number;
140
+ getRecordIndexByTaskShowIndex(showIndex: number): number | number[];
141
+ getTaskShowIndexByRecordIndex(index: number | number[]): number;
142
+ getRecordByIndex(taskShowIndex: number, sub_task_index?: number | number[]): any;
143
+ _refreshTaskBar(taskShowIndex: number, sub_task_index?: number): void;
144
+ _updateRecordToListTable(record: any, index: number | number[]): void;
145
+ getTaskInfoByTaskListIndex(taskShowIndex: number, sub_task_index?: number | number[]): {
146
+ taskRecord: any;
147
+ taskDays: number;
148
+ startDate: Date;
149
+ endDate: Date;
150
+ progress: number;
151
+ };
152
+ _updateStartDateToTaskRecord(startDate: Date, index: number, sub_task_index?: number | number[]): void;
153
+ _updateEndDateToTaskRecord(endDate: Date, index: number, sub_task_index?: number): void;
154
+ _updateStartEndDateToTaskRecord(startDate: Date, endDate: Date, index: number, sub_task_index?: number): void;
155
+ _updateProgressToTaskRecord(progress: number, index: number, sub_task_index?: number): void;
156
+ _dragOrderTaskRecord(source_index: number, source_sub_task_index: number, target_index: number, target_sub_task_index: number): void;
157
+ updateTaskRecord(record: any, task_index: number | number[]): void;
158
+ updateTaskRecord(record: any, task_index: number, sub_task_index: number): void;
159
+ setPixelRatio(pixelRatio: number): void;
160
+ updateTasksShowMode(tasksShowMode: TasksShowMode): void;
161
+ _resize(): void;
162
+ _syncPropsFromTable(): void;
163
+ private hasDataZoom;
164
+ private getDataZoomHeight;
165
+ getContext(): CanvasRenderingContext2D;
166
+ release(): void;
167
+ updateOption(options: GanttConstructorOptions): void;
168
+ setRecords(records: any[]): void;
169
+ updateScales(scales: ITimelineScale[]): void;
170
+ updateDateRange(minDate: string, maxDate: string): void;
171
+ updateMarkLine(markLine: IMarkLine[]): void;
172
+ addMarkLine(markLine: IMarkLine): void;
173
+ updateCurrentMarkLine(markLine: IMarkLine): void;
174
+ _scrollToMarkLine(): void;
175
+ scrollToMarkLine(date: Date): void;
176
+ addLink(link: ITaskLink): void;
177
+ deleteLink(link: ITaskLink): void;
178
+ get scrollTop(): number;
179
+ set scrollTop(value: number);
180
+ get scrollLeft(): number;
181
+ set scrollLeft(value: number);
182
+ getTaskBarRelativeRect(index: number): {
183
+ left: number;
184
+ top: number;
185
+ width: number;
186
+ height: number;
187
+ };
188
+ getDateColWidth(dateIndex: number): number;
189
+ getDateColsWidth(startDateIndex: number, endDateIndex: number): number;
190
+ getDateRangeByIndex(index: number): {
191
+ startDate: Date;
192
+ endDate: Date;
193
+ };
194
+ parseTimeFormat(date: string): string;
195
+ getTaskBarStyle(task_index: number, sub_task_index?: number | number[]): ITaskBarStyle;
196
+ formatDate(date: Date | string, format: string): string;
197
+ getCurrentMillisecondsPerPixel(): number;
198
+ setMillisecondsPerPixel(millisecondsPerPixel: number): void;
199
+ getCurrentZoomScaleLevel(): number;
200
+ }