@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
@@ -0,0 +1,316 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.Grid = void 0;
6
+
7
+ const vrender_1 = require("@visactor/vtable/es/vrender"), util_1 = require("../tools/util");
8
+
9
+ class Grid {
10
+ constructor(scene) {
11
+ var _a;
12
+ this._scene = scene, this.scrollLeft = 0, this.scrollTop = 0, this.x = 0, this.y = scene._gantt.getAllHeaderRowsHeight(),
13
+ this.width = scene.ganttGroup.attribute.width, this.height = scene.ganttGroup.attribute.height - scene.timelineHeader.group.attribute.height,
14
+ this.rowHeight = scene._gantt.parsedOptions.rowHeight, this.rowCount = scene._gantt.itemCount,
15
+ this.allGridWidth = scene._gantt.getAllDateColsWidth(), this.allGridHeight = scene._gantt.getAllTaskBarsHeight(),
16
+ this.group = new vrender_1.Group({
17
+ x: this.x,
18
+ y: this.y,
19
+ width: this.width,
20
+ height: this.height,
21
+ clip: !0,
22
+ fill: null === (_a = scene._gantt.parsedOptions.grid) || void 0 === _a ? void 0 : _a.backgroundColor
23
+ }), this.group.name = "grid-container", scene.ganttGroup.addChild(this.group), this.createHorizontalBackgroundRects(),
24
+ this.createCellBackgroundRects(), this.createVerticalLines(), this.createHorizontalLines(),
25
+ this.createTimeLineHeaderBottomLine();
26
+ }
27
+ createTimeLineHeaderBottomLine() {
28
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
29
+ const options = this._scene._gantt.parsedOptions, horizontalSplitLineWidth = null !== (_b = null === (_a = options.horizontalSplitLine) || void 0 === _a ? void 0 : _a.lineWidth) && void 0 !== _b ? _b : null === (_c = options.timelineHeaderHorizontalLineStyle) || void 0 === _c ? void 0 : _c.lineWidth, bottomLineY = (1 & horizontalSplitLineWidth ? -.5 : 0) + horizontalSplitLineWidth / 2, line = (0,
30
+ vrender_1.createLine)({
31
+ pickable: !1,
32
+ stroke: null !== (_e = null === (_d = options.horizontalSplitLine) || void 0 === _d ? void 0 : _d.lineColor) && void 0 !== _e ? _e : null === (_f = options.timelineHeaderHorizontalLineStyle) || void 0 === _f ? void 0 : _f.lineColor,
33
+ lineWidth: horizontalSplitLineWidth + (1 & horizontalSplitLineWidth ? 1 : 0),
34
+ lineDash: null !== (_h = null === (_g = options.horizontalSplitLine) || void 0 === _g ? void 0 : _g.lineDash) && void 0 !== _h ? _h : null === (_j = options.timelineHeaderHorizontalLineStyle) || void 0 === _j ? void 0 : _j.lineDash,
35
+ points: [ {
36
+ x: 0,
37
+ y: bottomLineY
38
+ }, {
39
+ x: this._scene._gantt.getAllDateColsWidth(),
40
+ y: bottomLineY
41
+ } ]
42
+ });
43
+ line.name = "timeLine-header-bottom-line", this.group.addChild(line);
44
+ }
45
+ createVerticalLines() {
46
+ var _a, _b;
47
+ const gridStyle = this._scene._gantt.parsedOptions.grid, verticalLineDependenceOnTimeScale = null !== (_a = gridStyle.verticalLineDependenceOnTimeScale) && void 0 !== _a ? _a : this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0].unit;
48
+ if (gridStyle.verticalLine) {
49
+ this.verticalLineGroup = new vrender_1.Group({
50
+ x: 0,
51
+ y: 0,
52
+ width: this.allGridWidth,
53
+ height: this.allGridHeight
54
+ }), this.verticalLineGroup.name = "grid-vertical", this.group.appendChild(this.verticalLineGroup);
55
+ const dependenceOnTimeScale = null !== (_b = this._scene._gantt.parsedOptions.reverseSortedTimelineScales.find((scale => scale.unit === verticalLineDependenceOnTimeScale))) && void 0 !== _b ? _b : this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0], {unit: minUnit, step: step} = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0], {timelineDates: timelineDates} = dependenceOnTimeScale, timelineColWidth = this._scene._gantt.parsedOptions.timelineColWidth;
56
+ if ("function" == typeof gridStyle.verticalLine) for (let i = 0; i < (null == timelineDates ? void 0 : timelineDates.length) - 1; i++) {
57
+ const {endDate: endDate} = timelineDates[i], verticalLine_style = gridStyle.verticalLine({
58
+ index: i,
59
+ dateIndex: timelineDates[i].dateIndex,
60
+ date: timelineDates[i].endDate,
61
+ ganttInstance: this._scene._gantt
62
+ }), x = Math.ceil((0, util_1.computeCountToTimeScale)(endDate, this._scene._gantt.parsedOptions.minDate, minUnit, step, 1) * timelineColWidth) + (1 & verticalLine_style.lineWidth ? .5 : 0), line = (0,
63
+ vrender_1.createLine)({
64
+ pickable: !1,
65
+ stroke: verticalLine_style.lineColor,
66
+ lineWidth: verticalLine_style.lineWidth,
67
+ lineDash: verticalLine_style.lineDash,
68
+ points: [ {
69
+ x: x,
70
+ y: 0
71
+ }, {
72
+ x: x,
73
+ y: this.allGridHeight
74
+ } ]
75
+ });
76
+ this.verticalLineGroup.appendChild(line);
77
+ } else {
78
+ const verticalLine_style = gridStyle.verticalLine;
79
+ for (let i = 0; i < (null == timelineDates ? void 0 : timelineDates.length) - 1; i++) {
80
+ const {endDate: endDate} = timelineDates[i], x = Math.ceil((0, util_1.computeCountToTimeScale)(endDate, this._scene._gantt.parsedOptions.minDate, minUnit, step, 1) * timelineColWidth) + (1 & verticalLine_style.lineWidth ? .5 : 0), line = (0,
81
+ vrender_1.createLine)({
82
+ pickable: !1,
83
+ stroke: verticalLine_style.lineColor,
84
+ lineWidth: verticalLine_style.lineWidth,
85
+ lineDash: verticalLine_style.lineDash,
86
+ points: [ {
87
+ x: x,
88
+ y: 0
89
+ }, {
90
+ x: x,
91
+ y: this.allGridHeight
92
+ } ]
93
+ });
94
+ this.verticalLineGroup.appendChild(line);
95
+ }
96
+ }
97
+ }
98
+ }
99
+ createHorizontalLines() {
100
+ const gridStyle = this._scene._gantt.parsedOptions.grid;
101
+ if (gridStyle.horizontalLine) if (this.horizontalLineGroup = new vrender_1.Group({
102
+ x: 0,
103
+ y: 0,
104
+ width: this.allGridWidth,
105
+ height: this.allGridHeight
106
+ }), this.horizontalLineGroup.name = "grid-horizontal", this.group.appendChild(this.horizontalLineGroup),
107
+ "function" == typeof gridStyle.horizontalLine) {
108
+ let y = .5;
109
+ for (let i = 0; i < this.rowCount - 1; i++) {
110
+ const horizontalLine_style = gridStyle.horizontalLine({
111
+ index: i,
112
+ ganttInstance: this._scene._gantt
113
+ });
114
+ y += this._scene._gantt.getRowHeightByIndex(i);
115
+ const line = (0, vrender_1.createLine)({
116
+ pickable: !1,
117
+ stroke: horizontalLine_style.lineColor,
118
+ lineWidth: horizontalLine_style.lineWidth,
119
+ lineDash: horizontalLine_style.lineDash,
120
+ points: [ {
121
+ x: 0,
122
+ y: y
123
+ }, {
124
+ x: this.allGridWidth,
125
+ y: y
126
+ } ]
127
+ });
128
+ this.horizontalLineGroup.appendChild(line);
129
+ }
130
+ } else {
131
+ const horizontalLine_style = gridStyle.horizontalLine;
132
+ let y = 0;
133
+ 1 & horizontalLine_style.lineWidth && (y += .5);
134
+ for (let i = 0; i < this.rowCount - 1; i++) {
135
+ y += this._scene._gantt.getRowHeightByIndex(i);
136
+ const line = (0, vrender_1.createLine)({
137
+ pickable: !1,
138
+ stroke: horizontalLine_style.lineColor,
139
+ lineWidth: horizontalLine_style.lineWidth,
140
+ lineDash: horizontalLine_style.lineDash,
141
+ points: [ {
142
+ x: 0,
143
+ y: y
144
+ }, {
145
+ x: this.allGridWidth,
146
+ y: y
147
+ } ]
148
+ });
149
+ this.horizontalLineGroup.appendChild(line);
150
+ }
151
+ }
152
+ }
153
+ createVerticalBackgroundRects() {
154
+ const verticalBackgroundColor = this._scene._gantt.parsedOptions.grid.verticalBackgroundColor, weekendBackgroundColor = this._scene._gantt.parsedOptions.grid.weekendBackgroundColor;
155
+ if (verticalBackgroundColor || weekendBackgroundColor) {
156
+ this.verticalBackgroundRectsGroup = new vrender_1.Group({
157
+ x: 0,
158
+ y: 0,
159
+ width: this.allGridWidth,
160
+ height: this.allGridHeight
161
+ }), this.verticalBackgroundRectsGroup.name = "grid-vertical-background", this.group.appendChild(this.verticalBackgroundRectsGroup);
162
+ const {timelineDates: timelineDates, unit: unit, step: step} = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0], timelineColWidth = this._scene._gantt.parsedOptions.timelineColWidth;
163
+ if (verticalBackgroundColor || weekendBackgroundColor) for (let i = 0; i <= (null == timelineDates ? void 0 : timelineDates.length) - 1; i++) {
164
+ let backgroundColor;
165
+ if (!weekendBackgroundColor || "day" !== unit || 1 !== step || 0 !== timelineDates[i].startDate.getDay() && 6 !== timelineDates[i].startDate.getDay() ? "function" == typeof verticalBackgroundColor ? backgroundColor = verticalBackgroundColor({
166
+ index: i,
167
+ dateIndex: timelineDates[i].dateIndex,
168
+ date: timelineDates[i].endDate,
169
+ ganttInstance: this._scene._gantt
170
+ }) : verticalBackgroundColor && (backgroundColor = verticalBackgroundColor[i % verticalBackgroundColor.length]) : backgroundColor = weekendBackgroundColor,
171
+ backgroundColor) {
172
+ const x = Math.ceil(timelineColWidth * i), rect = (0, vrender_1.createRect)({
173
+ pickable: !1,
174
+ fill: backgroundColor,
175
+ x: x,
176
+ y: 0,
177
+ width: timelineColWidth,
178
+ height: this.allGridHeight
179
+ });
180
+ this.verticalBackgroundRectsGroup.appendChild(rect);
181
+ }
182
+ }
183
+ }
184
+ }
185
+ createHorizontalBackgroundRects() {
186
+ const horizontalBackgroundColor = this._scene._gantt.parsedOptions.grid.horizontalBackgroundColor;
187
+ if (horizontalBackgroundColor) {
188
+ this.horizontalBackgroundRectsGroup = new vrender_1.Group({
189
+ x: 0,
190
+ y: 0,
191
+ width: this.allGridWidth,
192
+ height: this.allGridHeight
193
+ }), this.horizontalBackgroundRectsGroup.name = "grid-horizontal-background", this.group.appendChild(this.horizontalBackgroundRectsGroup);
194
+ let y = 0;
195
+ for (let i = 0; i <= this.rowCount - 1; i++) {
196
+ let backgroundColor;
197
+ backgroundColor = "function" == typeof horizontalBackgroundColor ? horizontalBackgroundColor({
198
+ index: i,
199
+ ganttInstance: this._scene._gantt
200
+ }) : horizontalBackgroundColor[i % horizontalBackgroundColor.length];
201
+ const rect = (0, vrender_1.createRect)({
202
+ pickable: !1,
203
+ fill: backgroundColor,
204
+ x: 0,
205
+ y: y,
206
+ width: this.allGridWidth,
207
+ height: this._scene._gantt.getRowHeightByIndex(i)
208
+ });
209
+ this.horizontalBackgroundRectsGroup.appendChild(rect), y += this._scene._gantt.getRowHeightByIndex(i);
210
+ }
211
+ }
212
+ }
213
+ createCellBackgroundRects() {
214
+ var _a, _b, _c;
215
+ const cellBackgroundColor = this._scene._gantt.parsedOptions.grid.cellBackgroundColor;
216
+ if (!cellBackgroundColor) return;
217
+ const bgGroup = new vrender_1.Group({
218
+ x: 0,
219
+ y: 0,
220
+ width: this.allGridWidth,
221
+ height: this.allGridHeight
222
+ });
223
+ bgGroup.name = "grid-cell-background", this.cellBackgroundRectsGroup = bgGroup,
224
+ this.group.appendChild(bgGroup);
225
+ const rowCount = this.rowCount, scale = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0], timelineDates = null !== (_a = null == scale ? void 0 : scale.timelineDates) && void 0 !== _a ? _a : [], colCount = timelineDates.length, timelineColWidth = this._scene._gantt.parsedOptions.timelineColWidth;
226
+ let y = 0;
227
+ for (let r = 0; r < rowCount; r++) {
228
+ const rowHeight = this._scene._gantt.getRowHeightByIndex(r);
229
+ let x = 0;
230
+ for (let c = 0; c < colCount; c++) {
231
+ const cellStart = null === (_b = timelineDates[c]) || void 0 === _b ? void 0 : _b.startDate, cellEnd = null === (_c = timelineDates[c]) || void 0 === _c ? void 0 : _c.endDate;
232
+ if (!cellStart || !cellEnd) {
233
+ x += timelineColWidth;
234
+ continue;
235
+ }
236
+ const result = "function" == typeof cellBackgroundColor ? cellBackgroundColor({
237
+ rowIndex: r,
238
+ colIndex: c,
239
+ date: cellStart,
240
+ ganttInstance: this._scene._gantt
241
+ }) : cellBackgroundColor[(r + c) % cellBackgroundColor.length];
242
+ if (!result) {
243
+ x += timelineColWidth;
244
+ continue;
245
+ }
246
+ const resultArray = Array.isArray(result) ? result : [ result ];
247
+ if (1 === resultArray.length && "string" == typeof resultArray[0]) {
248
+ const rect = (0, vrender_1.createRect)({
249
+ pickable: !1,
250
+ fill: resultArray[0],
251
+ x: x,
252
+ y: y,
253
+ width: timelineColWidth,
254
+ height: rowHeight
255
+ });
256
+ bgGroup.appendChild(rect), x += timelineColWidth;
257
+ continue;
258
+ }
259
+ const cs = cellStart.getTime(), ce = cellEnd.getTime(), total = ce - cs;
260
+ for (const seg of resultArray) {
261
+ if (!seg) continue;
262
+ const {startTime: startTime, endTime: endTime, color: color} = seg;
263
+ if (!startTime || !endTime || !color) continue;
264
+ const ss = startTime.getTime(), se = endTime.getTime();
265
+ if (se <= cs || ss >= ce) continue;
266
+ const startOffset = (Math.max(ss, cs) - cs) / total, pixelStartX = x + startOffset * timelineColWidth, pixelWidth = ((Math.min(se, ce) - cs) / total - startOffset) * timelineColWidth, rect = (0,
267
+ vrender_1.createRect)({
268
+ pickable: !1,
269
+ fill: color,
270
+ x: pixelStartX,
271
+ y: y,
272
+ width: pixelWidth,
273
+ height: rowHeight
274
+ });
275
+ bgGroup.appendChild(rect);
276
+ }
277
+ x += timelineColWidth;
278
+ }
279
+ y += rowHeight;
280
+ }
281
+ }
282
+ refresh() {
283
+ this.width = this._scene.ganttGroup.attribute.width, this.height = this._scene.ganttGroup.attribute.height - this._scene.timelineHeader.group.attribute.height,
284
+ this.group.setAttributes({
285
+ width: this.width,
286
+ height: this.height,
287
+ y: this._scene._gantt.getAllHeaderRowsHeight()
288
+ }), this.rowCount = this._scene._gantt.itemCount, this.allGridWidth = this._scene._gantt.getAllDateColsWidth(),
289
+ this.allGridHeight = this._scene._gantt.getAllTaskBarsHeight(), this.group.removeAllChild(),
290
+ this.createVerticalBackgroundRects(), this.createHorizontalBackgroundRects(), this.createVerticalLines(),
291
+ this.createHorizontalLines(), this.createTimeLineHeaderBottomLine();
292
+ }
293
+ setX(x) {
294
+ var _a, _b, _c, _d, _e;
295
+ null === (_a = this.verticalLineGroup) || void 0 === _a || _a.setAttribute("x", x),
296
+ null === (_b = this.horizontalLineGroup) || void 0 === _b || _b.setAttribute("x", x),
297
+ null === (_c = this.verticalBackgroundRectsGroup) || void 0 === _c || _c.setAttribute("x", x),
298
+ null === (_d = this.horizontalBackgroundRectsGroup) || void 0 === _d || _d.setAttribute("x", x),
299
+ null === (_e = this.cellBackgroundRectsGroup) || void 0 === _e || _e.setAttribute("x", x);
300
+ }
301
+ setY(y) {
302
+ var _a, _b, _c, _d, _e;
303
+ null === (_a = this.verticalLineGroup) || void 0 === _a || _a.setAttribute("y", y),
304
+ null === (_b = this.horizontalLineGroup) || void 0 === _b || _b.setAttribute("y", y),
305
+ null === (_c = this.verticalBackgroundRectsGroup) || void 0 === _c || _c.setAttribute("y", y),
306
+ null === (_d = this.horizontalBackgroundRectsGroup) || void 0 === _d || _d.setAttribute("y", y),
307
+ null === (_e = this.cellBackgroundRectsGroup) || void 0 === _e || _e.setAttribute("y", y);
308
+ }
309
+ resize() {
310
+ this.width = this._scene.ganttGroup.attribute.width, this.height = this._scene.ganttGroup.attribute.height - this._scene.timelineHeader.group.attribute.height,
311
+ this.group.setAttribute("width", this.width), this.group.setAttribute("height", this.height);
312
+ }
313
+ }
314
+
315
+ exports.Grid = Grid;
316
+ //# sourceMappingURL=grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scenegraph/grid.ts"],"names":[],"mappings":";;;AAAA,yDAA4E;AAI5E,wCAAwD;AACxD,MAAa,IAAI;IAqBf,YAAY,KAAiB;;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC,c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":["import { Group, createLine, createRect } from '@visactor/vtable/es/vrender';\n\nimport type { Scenegraph } from './scenegraph';\nimport type { IGrid } from '../ts-types';\nimport { computeCountToTimeScale } from '../tools/util';\nexport class Grid {\n // verticalLineSpace: number;\n // horizontalLineSpace: number;\n gridStyle: IGrid;\n scrollLeft: number;\n scrollTop: number;\n x: number;\n y: number;\n width: number;\n height: number;\n rowHeight: number;\n rowCount: number;\n group: Group;\n verticalLineGroup: Group;\n horizontalLineGroup: Group;\n verticalBackgroundRectsGroup: Group;\n horizontalBackgroundRectsGroup: Group;\n cellBackgroundRectsGroup: Group;\n allGridHeight: number;\n allGridWidth: number;\n _scene: Scenegraph;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n\n this.scrollLeft = 0;\n this.scrollTop = 0;\n this.x = 0;\n this.y = scene._gantt.getAllHeaderRowsHeight();\n this.width = scene.ganttGroup.attribute.width;\n this.height = scene.ganttGroup.attribute.height - scene.timelineHeader.group.attribute.height;\n this.rowHeight = scene._gantt.parsedOptions.rowHeight;\n this.rowCount = scene._gantt.itemCount;\n this.allGridWidth = scene._gantt.getAllDateColsWidth();\n this.allGridHeight = scene._gantt.getAllTaskBarsHeight();\n this.group = new Group({\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height,\n clip: true,\n fill: scene._gantt.parsedOptions.grid?.backgroundColor\n });\n this.group.name = 'grid-container';\n scene.ganttGroup.addChild(this.group);\n this.createHorizontalBackgroundRects();\n this.createCellBackgroundRects();\n this.createVerticalLines();\n this.createHorizontalLines();\n this.createTimeLineHeaderBottomLine();\n }\n\n createTimeLineHeaderBottomLine() {\n const options = this._scene._gantt.parsedOptions;\n //补充timelineHeader中不好绘制的底部的边线\n const horizontalSplitLineWidth =\n options.horizontalSplitLine?.lineWidth ?? options.timelineHeaderHorizontalLineStyle?.lineWidth;\n const bottomLineY = (horizontalSplitLineWidth & 1 ? -0.5 : 0) + horizontalSplitLineWidth / 2; // 原来是(horizontalSplitLineWidth & 1 ? 0.5 : 0) 这里改成-0.5为了和左侧表格的水平分割线对齐\n const line = createLine({\n pickable: false,\n stroke: options.horizontalSplitLine?.lineColor ?? options.timelineHeaderHorizontalLineStyle?.lineColor,\n lineWidth: horizontalSplitLineWidth + (horizontalSplitLineWidth & 1 ? 1 : 0), // 加上后面这个1是为了和左侧表格的水平分割线对齐\n lineDash: options.horizontalSplitLine?.lineDash ?? options.timelineHeaderHorizontalLineStyle?.lineDash,\n points: [\n { x: 0, y: bottomLineY },\n {\n x: this._scene._gantt.getAllDateColsWidth(),\n y: bottomLineY\n }\n ]\n });\n line.name = 'timeLine-header-bottom-line';\n this.group.addChild(line);\n }\n\n createVerticalLines() {\n const gridStyle = this._scene._gantt.parsedOptions.grid;\n const verticalLineDependenceOnTimeScale =\n gridStyle.verticalLineDependenceOnTimeScale ??\n this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0].unit;\n\n if (gridStyle.verticalLine) {\n this.verticalLineGroup = new Group({\n x: 0,\n y: 0,\n width: this.allGridWidth,\n height: this.allGridHeight\n });\n this.verticalLineGroup.name = 'grid-vertical';\n this.group.appendChild(this.verticalLineGroup);\n\n const dependenceOnTimeScale =\n this._scene._gantt.parsedOptions.reverseSortedTimelineScales.find(\n scale => scale.unit === verticalLineDependenceOnTimeScale\n ) ?? this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0];\n const { unit: minUnit, step } = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0];\n const { timelineDates } = dependenceOnTimeScale;\n const timelineColWidth = this._scene._gantt.parsedOptions.timelineColWidth;\n\n if (typeof gridStyle.verticalLine === 'function') {\n for (let i = 0; i < timelineDates?.length - 1; i++) {\n const { endDate } = timelineDates[i];\n const verticalLine_style = gridStyle.verticalLine({\n index: i,\n dateIndex: timelineDates[i].dateIndex,\n date: timelineDates[i].endDate,\n ganttInstance: this._scene._gantt\n });\n const x =\n Math.ceil(\n computeCountToTimeScale(endDate, this._scene._gantt.parsedOptions.minDate, minUnit, step, 1) *\n timelineColWidth\n ) + (verticalLine_style.lineWidth & 1 ? 0.5 : 0);\n // const x = Math.ceil(timelineColWidth * (i + 1)) + (verticalLine_style.lineWidth & 1 ? 0.5 : 0);\n const line = createLine({\n pickable: false,\n stroke: verticalLine_style.lineColor,\n lineWidth: verticalLine_style.lineWidth,\n lineDash: verticalLine_style.lineDash,\n points: [\n { x, y: 0 },\n { x, y: this.allGridHeight }\n ]\n });\n this.verticalLineGroup.appendChild(line);\n }\n } else {\n const verticalLine_style = gridStyle.verticalLine;\n for (let i = 0; i < timelineDates?.length - 1; i++) {\n const { endDate } = timelineDates[i];\n const x =\n Math.ceil(\n computeCountToTimeScale(endDate, this._scene._gantt.parsedOptions.minDate, minUnit, step, 1) *\n timelineColWidth\n ) + (verticalLine_style.lineWidth & 1 ? 0.5 : 0);\n // const x = Math.ceil(timelineColWidth * (i + 1)) + (verticalLine_style.lineWidth & 1 ? 0.5 : 0);\n const line = createLine({\n pickable: false,\n stroke: verticalLine_style.lineColor,\n lineWidth: verticalLine_style.lineWidth,\n lineDash: verticalLine_style.lineDash,\n points: [\n { x, y: 0 },\n { x, y: this.allGridHeight }\n ]\n });\n this.verticalLineGroup.appendChild(line);\n }\n }\n }\n }\n createHorizontalLines() {\n const gridStyle = this._scene._gantt.parsedOptions.grid;\n if (gridStyle.horizontalLine) {\n this.horizontalLineGroup = new Group({\n x: 0,\n y: 0,\n width: this.allGridWidth,\n height: this.allGridHeight\n });\n this.horizontalLineGroup.name = 'grid-horizontal';\n this.group.appendChild(this.horizontalLineGroup);\n if (typeof gridStyle.horizontalLine === 'function') {\n let y = 0.5; //确保大多数情况 LineWidth为1时是准确的\n for (let i = 0; i < this.rowCount - 1; i++) {\n const horizontalLine_style = gridStyle.horizontalLine({\n index: i,\n ganttInstance: this._scene._gantt\n });\n y = y + this._scene._gantt.getRowHeightByIndex(i); // Math.floor(this.rowHeight);\n const line = createLine({\n pickable: false,\n stroke: horizontalLine_style.lineColor,\n lineWidth: horizontalLine_style.lineWidth,\n lineDash: horizontalLine_style.lineDash,\n points: [\n { x: 0, y },\n { x: this.allGridWidth, y }\n ]\n });\n this.horizontalLineGroup.appendChild(line);\n }\n } else {\n const horizontalLine_style = gridStyle.horizontalLine;\n let y = 0;\n if (horizontalLine_style.lineWidth & 1) {\n y += 0.5;\n }\n for (let i = 0; i < this.rowCount - 1; i++) {\n y = y + this._scene._gantt.getRowHeightByIndex(i); // Math.floor(this.rowHeight);\n const line = createLine({\n pickable: false,\n stroke: horizontalLine_style.lineColor,\n lineWidth: horizontalLine_style.lineWidth,\n lineDash: horizontalLine_style.lineDash,\n points: [\n { x: 0, y },\n { x: this.allGridWidth, y }\n ]\n });\n this.horizontalLineGroup.appendChild(line);\n }\n }\n }\n }\n\n createVerticalBackgroundRects() {\n const verticalBackgroundColor = this._scene._gantt.parsedOptions.grid.verticalBackgroundColor;\n const weekendBackgroundColor = this._scene._gantt.parsedOptions.grid.weekendBackgroundColor;\n if (verticalBackgroundColor || weekendBackgroundColor) {\n this.verticalBackgroundRectsGroup = new Group({\n x: 0,\n y: 0,\n width: this.allGridWidth,\n height: this.allGridHeight\n });\n this.verticalBackgroundRectsGroup.name = 'grid-vertical-background';\n this.group.appendChild(this.verticalBackgroundRectsGroup);\n\n const { timelineDates, unit, step } = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0];\n const timelineColWidth = this._scene._gantt.parsedOptions.timelineColWidth;\n\n if (verticalBackgroundColor || weekendBackgroundColor) {\n for (let i = 0; i <= timelineDates?.length - 1; i++) {\n let backgroundColor;\n if (\n weekendBackgroundColor &&\n unit === 'day' &&\n step === 1 &&\n (timelineDates[i].startDate.getDay() === 0 || timelineDates[i].startDate.getDay() === 6)\n ) {\n backgroundColor = weekendBackgroundColor;\n } else if (typeof verticalBackgroundColor === 'function') {\n backgroundColor = verticalBackgroundColor({\n index: i,\n dateIndex: timelineDates[i].dateIndex,\n date: timelineDates[i].endDate,\n ganttInstance: this._scene._gantt\n });\n } else if (verticalBackgroundColor) {\n backgroundColor = verticalBackgroundColor[i % verticalBackgroundColor.length];\n }\n if (backgroundColor) {\n const x = Math.ceil(timelineColWidth * i);\n const rect = createRect({\n pickable: false,\n fill: backgroundColor,\n x,\n y: 0,\n width: timelineColWidth,\n height: this.allGridHeight\n });\n this.verticalBackgroundRectsGroup.appendChild(rect);\n }\n }\n }\n }\n }\n createHorizontalBackgroundRects() {\n const horizontalBackgroundColor = this._scene._gantt.parsedOptions.grid.horizontalBackgroundColor;\n if (horizontalBackgroundColor) {\n this.horizontalBackgroundRectsGroup = new Group({\n x: 0,\n y: 0,\n width: this.allGridWidth,\n height: this.allGridHeight\n });\n this.horizontalBackgroundRectsGroup.name = 'grid-horizontal-background';\n this.group.appendChild(this.horizontalBackgroundRectsGroup);\n\n let y = 0;\n for (let i = 0; i <= this.rowCount - 1; i++) {\n let backgroundColor;\n if (typeof horizontalBackgroundColor === 'function') {\n backgroundColor = horizontalBackgroundColor({\n index: i,\n ganttInstance: this._scene._gantt\n });\n } else {\n backgroundColor = horizontalBackgroundColor[i % horizontalBackgroundColor.length];\n }\n\n const rect = createRect({\n pickable: false,\n fill: backgroundColor,\n x: 0,\n y,\n width: this.allGridWidth,\n height: this._scene._gantt.getRowHeightByIndex(i)\n });\n this.horizontalBackgroundRectsGroup.appendChild(rect);\n y += this._scene._gantt.getRowHeightByIndex(i);\n }\n }\n }\n\n createCellBackgroundRects() {\n const cellBackgroundColor = this._scene._gantt.parsedOptions.grid.cellBackgroundColor;\n\n // 没配置就不画\n if (!cellBackgroundColor) {\n return;\n }\n\n // 建一个 group 专门放背景 rect\n const bgGroup = new Group({\n x: 0,\n y: 0,\n width: this.allGridWidth,\n height: this.allGridHeight\n });\n bgGroup.name = 'grid-cell-background';\n\n this.cellBackgroundRectsGroup = bgGroup;\n this.group.appendChild(bgGroup);\n\n const rowCount = this.rowCount;\n\n // 取第一层时间刻度(reverseSortedTimelineScales[0])\n const scale = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0];\n const timelineDates = scale?.timelineDates ?? [];\n const colCount = timelineDates.length;\n\n const timelineColWidth: number = this._scene._gantt.parsedOptions.timelineColWidth;\n\n let y = 0;\n\n for (let r = 0; r < rowCount; r++) {\n const rowHeight: number = this._scene._gantt.getRowHeightByIndex(r);\n\n let x = 0;\n\n for (let c = 0; c < colCount; c++) {\n const cellStart: Date | undefined = timelineDates[c]?.startDate;\n const cellEnd: Date | undefined = timelineDates[c]?.endDate;\n\n // 没有时间范围就跳过\n if (!cellStart || !cellEnd) {\n x += timelineColWidth;\n continue;\n }\n\n // 计算当前单元格的背景配置结果\n const result =\n typeof cellBackgroundColor === 'function'\n ? cellBackgroundColor({\n rowIndex: r,\n colIndex: c,\n date: cellStart,\n ganttInstance: this._scene._gantt\n })\n : cellBackgroundColor[(r + c) % cellBackgroundColor.length];\n\n // 没结果就跳过\n if (!result) {\n x += timelineColWidth;\n continue;\n }\n\n // 统一转成数组处理:要么 [string],要么 segments[]\n const resultArray = Array.isArray(result) ? result : [result];\n\n // 情况1:只有一个 string,整格纯色\n if (resultArray.length === 1 && typeof resultArray[0] === 'string') {\n const rect = createRect({\n pickable: false,\n fill: resultArray[0],\n x,\n y,\n width: timelineColWidth,\n height: rowHeight\n });\n\n bgGroup.appendChild(rect);\n x += timelineColWidth;\n continue;\n }\n\n // 情况2:分段着色(按时间切片映射到像素宽度)\n const cs = cellStart.getTime();\n const ce = cellEnd.getTime();\n const total = ce - cs;\n\n for (const seg of resultArray) {\n if (!seg) {\n continue;\n }\n\n const { startTime, endTime, color } = seg;\n if (!startTime || !endTime || !color) {\n continue;\n }\n\n const ss = startTime.getTime();\n const se = endTime.getTime();\n\n // 完全不相交就跳过\n if (se <= cs || ss >= ce) {\n continue;\n }\n\n // 将时间段裁剪到 [cs, ce],映射到 [x, x+timelineColWidth]\n const startOffset = (Math.max(ss, cs) - cs) / total;\n const pixelStartX = x + startOffset * timelineColWidth;\n\n const endOffset = (Math.min(se, ce) - cs) / total;\n const pixelWidth = (endOffset - startOffset) * timelineColWidth;\n\n const rect = createRect({\n pickable: false,\n fill: color,\n x: pixelStartX,\n y,\n width: pixelWidth,\n height: rowHeight\n });\n\n bgGroup.appendChild(rect);\n }\n\n x += timelineColWidth;\n }\n\n y += rowHeight;\n }\n }\n /** 重新创建网格线场景树结点 */\n refresh() {\n this.width = this._scene.ganttGroup.attribute.width;\n this.height = this._scene.ganttGroup.attribute.height - this._scene.timelineHeader.group.attribute.height;\n this.group.setAttributes({\n width: this.width,\n height: this.height,\n y: this._scene._gantt.getAllHeaderRowsHeight()\n });\n this.rowCount = this._scene._gantt.itemCount;\n this.allGridWidth = this._scene._gantt.getAllDateColsWidth();\n this.allGridHeight = this._scene._gantt.getAllTaskBarsHeight();\n this.group.removeAllChild();\n // this.verticalLineGroup?.parent.removeChild(this.verticalLineGroup);\n // this.horizontalLineGroup?.parent.removeChild(this.horizontalLineGroup);\n // this.verticalBackgroundRectsGroup?.parent.removeChild(this.verticalBackgroundRectsGroup);\n // this.horizontalBackgroundRectsGroup?.parent.removeChild(this.horizontalBackgroundRectsGroup);\n this.createVerticalBackgroundRects();\n this.createHorizontalBackgroundRects();\n this.createVerticalLines();\n this.createHorizontalLines();\n this.createTimeLineHeaderBottomLine();\n }\n setX(x: number) {\n this.verticalLineGroup?.setAttribute('x', x);\n this.horizontalLineGroup?.setAttribute('x', x);\n this.verticalBackgroundRectsGroup?.setAttribute('x', x);\n this.horizontalBackgroundRectsGroup?.setAttribute('x', x);\n this.cellBackgroundRectsGroup?.setAttribute('x', x);\n }\n setY(y: number) {\n this.verticalLineGroup?.setAttribute('y', y);\n this.horizontalLineGroup?.setAttribute('y', y);\n this.verticalBackgroundRectsGroup?.setAttribute('y', y);\n this.horizontalBackgroundRectsGroup?.setAttribute('y', y);\n this.cellBackgroundRectsGroup?.setAttribute('y', y);\n }\n resize() {\n this.width = this._scene.ganttGroup.attribute.width;\n this.height = this._scene.ganttGroup.attribute.height - this._scene.timelineHeader.group.attribute.height;\n this.group.setAttribute('width', this.width);\n this.group.setAttribute('height', this.height);\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { Scenegraph } from './scenegraph';
2
+ import { Group } from '@visactor/vtable/es/vrender';
3
+ export declare class MarkLine {
4
+ _scene: Scenegraph;
5
+ group: Group;
6
+ markLIneContainer: Group;
7
+ markLineContainerWidth: number;
8
+ height: number;
9
+ constructor(scene: Scenegraph);
10
+ initMarkLines(): void;
11
+ refresh(): void;
12
+ setX(x: number): void;
13
+ }
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.MarkLine = void 0;
6
+
7
+ const util_1 = require("../tools/util"), vrender_1 = require("@visactor/vtable/es/vrender");
8
+
9
+ class MarkLine {
10
+ constructor(scene) {
11
+ this.markLineContainerWidth = 20, this._scene = scene, this.height = Math.min(scene._gantt.tableNoFrameHeight, scene._gantt.drawHeight) - scene._gantt.getAllHeaderRowsHeight(),
12
+ this.group = new vrender_1.Group({
13
+ x: 0,
14
+ y: scene._gantt.getAllHeaderRowsHeight(),
15
+ width: scene._gantt.tableNoFrameWidth,
16
+ height: this.height,
17
+ pickable: !1,
18
+ clip: !0
19
+ }), this.group.name = "mark-line-container", scene.ganttGroup.addChild(this.group),
20
+ this.markLIneContainer = new vrender_1.Group({
21
+ x: 0,
22
+ y: 0,
23
+ width: this._scene._gantt.getAllDateColsWidth(),
24
+ height: this.height,
25
+ pickable: !1,
26
+ clip: !0
27
+ }), this.group.appendChild(this.markLIneContainer), this.initMarkLines();
28
+ }
29
+ initMarkLines() {
30
+ const height = Math.min(this._scene._gantt.tableNoFrameHeight, this._scene._gantt.drawHeight) - this._scene._gantt.getAllHeaderRowsHeight();
31
+ this.group.setAttributes({
32
+ y: this._scene._gantt.getAllHeaderRowsHeight(),
33
+ width: this._scene._gantt.tableNoFrameWidth,
34
+ height: height
35
+ }), this.markLIneContainer.setAttribute("width", this._scene._gantt.getAllDateColsWidth()),
36
+ this.markLIneContainer.setAttribute("height", height);
37
+ const markLine = this._scene._gantt.parsedOptions.markLine, minDate = this._scene._gantt.parsedOptions.minDate;
38
+ minDate && markLine.forEach((line => {
39
+ const style = line.style, contentStyle = line.contentStyle || {}, date = this._scene._gantt.parsedOptions.timeScaleIncludeHour ? (0,
40
+ util_1.createDateAtMidnight)(line.date) : (0, util_1.createDateAtMidnight)(line.date, !0), {unit: unit, step: step} = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0], unitCount = (0,
41
+ util_1.computeCountToTimeScale)(date, minDate, unit, step);
42
+ let positionOffset = 0;
43
+ if ("right" === line.position) positionOffset = 1; else if ("middle" === line.position) positionOffset = .5; else if ("date" === line.position) {
44
+ const date = (0, util_1.createDateAtMidnight)(line.date), unitCount = (0, util_1.computeCountToTimeScale)(date, minDate, unit, step);
45
+ positionOffset = unitCount - Math.floor(unitCount);
46
+ }
47
+ const dateX = this._scene._gantt.parsedOptions.timelineColWidth * (Math.floor(unitCount) + positionOffset), markLineGroup = new vrender_1.Group({
48
+ pickable: !1,
49
+ x: dateX - this.markLineContainerWidth / 2,
50
+ y: 0,
51
+ width: this.markLineContainerWidth,
52
+ height: this.height
53
+ });
54
+ markLineGroup.name = "mark-line", this.markLIneContainer.appendChild(markLineGroup);
55
+ const lineObj = (0, vrender_1.createLine)({
56
+ pickable: !1,
57
+ stroke: style.lineColor,
58
+ lineWidth: style.lineWidth,
59
+ lineDash: style.lineDash,
60
+ points: [ {
61
+ x: this.markLineContainerWidth / 2,
62
+ y: 0
63
+ }, {
64
+ x: this.markLineContainerWidth / 2,
65
+ y: this.height
66
+ } ]
67
+ });
68
+ if (markLineGroup.appendChild(lineObj), line.content) {
69
+ const textMaxLineWidth = this._scene._gantt.parsedOptions.timelineColWidth, textContainerHeight = contentStyle.lineHeight || 18, textGroup = new vrender_1.Group({
70
+ x: this.markLineContainerWidth / 2,
71
+ y: 0,
72
+ cursor: "pointer",
73
+ height: textContainerHeight,
74
+ clip: !1,
75
+ fill: contentStyle.backgroundColor || style.lineColor,
76
+ display: "flex",
77
+ cornerRadius: contentStyle.cornerRadius || [ 0, 2, 2, 0 ]
78
+ });
79
+ textGroup.name = "mark-line-content", textGroup.data = line, markLineGroup.appendChild(textGroup);
80
+ const text = new vrender_1.Text({
81
+ maxLineWidth: textMaxLineWidth,
82
+ text: line.content,
83
+ cursor: "pointer",
84
+ lineHeight: textContainerHeight,
85
+ fontWeight: contentStyle.fontWeight || "normal",
86
+ fill: contentStyle.color || style.lineColor,
87
+ fontSize: contentStyle.fontSize || 12,
88
+ poptip: {
89
+ position: "top",
90
+ dx: textMaxLineWidth / 4,
91
+ dy: -textContainerHeight / 4
92
+ }
93
+ });
94
+ textGroup.appendChild(text);
95
+ }
96
+ }));
97
+ }
98
+ refresh() {
99
+ this.height = Math.min(this._scene._gantt.tableNoFrameHeight, this._scene._gantt.drawHeight) - this._scene._gantt.getAllHeaderRowsHeight(),
100
+ this.markLIneContainer.removeAllChild(), this.group.setAttribute("height", this.height),
101
+ this.markLIneContainer.setAttribute("height", this.height), this.initMarkLines();
102
+ }
103
+ setX(x) {
104
+ this.markLIneContainer.setAttribute("x", x);
105
+ }
106
+ }
107
+
108
+ exports.MarkLine = MarkLine;
109
+ //# sourceMappingURL=mark-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scenegraph/mark-line.ts"],"names":[],"mappings":";;;AAAA,wCAA8E;AAI9E,yDAAsE;AAEtE,MAAa,QAAQ;IAMnB,YAAY,KAAiB;QAF7B,2BAAsB,GAAW,EAAE,CAAC;QAGlC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAC7G,IAAI,CAAC,KAAK,GAAG,IAAI,eAAK,CAAC;YACrB,CAAC,E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,CAAC,CAAC;oBACV,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;iBAC7B;YACH,CAAC,CAAC,CAAC;IACP,CAAC;IAGD,OAAO;QACL,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;gBAC9E,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAC9C,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QACxC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3D,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IACD,IAAI,CAAC,CAAS;QACZ,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AA3ID,4BA2IC","file":"mark-line.js","sourcesContent":["import { computeCountToTimeScale, createDateAtMidnight } from '../tools/util';\nimport { DayTimes } from '../gantt-helper';\n//import type { IMarkLine } from '../ts-types';\nimport type { Scenegraph } from './scenegraph';\nimport { Group, createLine, Text } from '@visactor/vtable/es/vrender';\n\nexport class MarkLine {\n _scene: Scenegraph;\n group: Group;\n markLIneContainer: Group;\n markLineContainerWidth: number = 20;\n height: number;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n this.height =\n Math.min(scene._gantt.tableNoFrameHeight, scene._gantt.drawHeight) - scene._gantt.getAllHeaderRowsHeight();\n this.group = new Group({\n x: 0,\n y: scene._gantt.getAllHeaderRowsHeight(),\n width: scene._gantt.tableNoFrameWidth,\n height: this.height,\n pickable: false,\n clip: true\n });\n this.group.name = 'mark-line-container';\n scene.ganttGroup.addChild(this.group);\n\n this.markLIneContainer = new Group({\n x: 0,\n y: 0,\n width: this._scene._gantt.getAllDateColsWidth(),\n height: this.height,\n pickable: false,\n clip: true\n });\n this.group.appendChild(this.markLIneContainer);\n this.initMarkLines();\n }\n initMarkLines() {\n //#region 重置markLine容器大小\n const height =\n Math.min(this._scene._gantt.tableNoFrameHeight, this._scene._gantt.drawHeight) -\n this._scene._gantt.getAllHeaderRowsHeight();\n this.group.setAttributes({\n y: this._scene._gantt.getAllHeaderRowsHeight(),\n width: this._scene._gantt.tableNoFrameWidth,\n height: height\n });\n this.markLIneContainer.setAttribute('width', this._scene._gantt.getAllDateColsWidth());\n this.markLIneContainer.setAttribute('height', height);\n //#endregion\n const markLine = this._scene._gantt.parsedOptions.markLine;\n const minDate = this._scene._gantt.parsedOptions.minDate;\n minDate &&\n markLine.forEach(line => {\n const style = line.style;\n const contentStyle = line.contentStyle || {};\n const date = this._scene._gantt.parsedOptions.timeScaleIncludeHour\n ? createDateAtMidnight(line.date)\n : createDateAtMidnight(line.date, true);\n const { unit, step } = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0];\n const unitCount = computeCountToTimeScale(date, minDate, unit, step);\n let positionOffset = 0;\n if (line.position === 'right') {\n positionOffset = 1;\n } else if (line.position === 'middle') {\n positionOffset = 0.5;\n } else if (line.position === 'date') {\n const date = createDateAtMidnight(line.date);\n const unitCount = computeCountToTimeScale(date, minDate, unit, step);\n const cellIndex = Math.floor(unitCount);\n positionOffset = unitCount - cellIndex;\n }\n const dateX = this._scene._gantt.parsedOptions.timelineColWidth * (Math.floor(unitCount) + positionOffset);\n const markLineGroup = new Group({\n pickable: false,\n x: dateX - this.markLineContainerWidth / 2,\n y: 0,\n width: this.markLineContainerWidth,\n height: this.height\n });\n markLineGroup.name = 'mark-line';\n this.markLIneContainer.appendChild(markLineGroup);\n // 创建整个任务条rect\n const lineObj = createLine({\n pickable: false,\n stroke: style.lineColor,\n lineWidth: style.lineWidth,\n lineDash: style.lineDash,\n points: [\n { x: this.markLineContainerWidth / 2, y: 0 },\n { x: this.markLineContainerWidth / 2, y: this.height }\n ]\n });\n markLineGroup.appendChild(lineObj);\n if (line.content) {\n const textMaxLineWidth = this._scene._gantt.parsedOptions.timelineColWidth;\n const textContainerHeight = contentStyle.lineHeight || 18;\n // 创建内容区\n const textGroup = new Group({\n x: this.markLineContainerWidth / 2,\n y: 0,\n cursor: 'pointer',\n height: textContainerHeight,\n clip: false,\n fill: contentStyle.backgroundColor || style.lineColor,\n display: 'flex',\n cornerRadius: contentStyle.cornerRadius || [0, 2, 2, 0]\n });\n textGroup.name = 'mark-line-content';\n (textGroup as any).data = line;\n markLineGroup.appendChild(textGroup);\n // 创建内容\n const text = new Text({\n maxLineWidth: textMaxLineWidth,\n text: line.content,\n cursor: 'pointer',\n lineHeight: textContainerHeight,\n fontWeight: contentStyle.fontWeight || 'normal',\n fill: contentStyle.color || style.lineColor,\n fontSize: contentStyle.fontSize || 12,\n poptip: {\n position: 'top',\n dx: textMaxLineWidth / 4,\n dy: -textContainerHeight / 4\n }\n } as any);\n textGroup.appendChild(text);\n }\n });\n }\n\n /** 重新场景场景树节点 */\n refresh() {\n this.height =\n Math.min(this._scene._gantt.tableNoFrameHeight, this._scene._gantt.drawHeight) -\n this._scene._gantt.getAllHeaderRowsHeight();\n this.markLIneContainer.removeAllChild();\n this.group.setAttribute('height', this.height);\n this.markLIneContainer.setAttribute('height', this.height);\n this.initMarkLines();\n }\n setX(x: number) {\n this.markLIneContainer.setAttribute('x', x);\n }\n}\n"]}
@@ -0,0 +1,59 @@
1
+ import type { Stage } from '@visactor/vtable/es/vrender';
2
+ import { Group } from '@visactor/vtable/es/vrender';
3
+ import { Grid } from './grid';
4
+ import type { Gantt } from '../Gantt';
5
+ import { ScrollBarComponent } from './scroll-bar';
6
+ import { TimelineHeader } from './timeline-header';
7
+ import { TaskBar } from './task-bar';
8
+ import { MarkLine } from './mark-line';
9
+ import { FrameBorder } from './frame-border';
10
+ import { TaskCreationButton } from './task-creation-button';
11
+ import { ToolTip } from './tooltip';
12
+ import { DependencyLink } from './dependency-link';
13
+ import { DragOrderLine } from './drag-order-line';
14
+ import type { GanttTaskBarNode } from './gantt-node';
15
+ export declare class Scenegraph {
16
+ dateStepWidth: number;
17
+ rowHeight: number;
18
+ _scales: {}[];
19
+ timelineHeader: TimelineHeader;
20
+ grid: Grid;
21
+ dependencyLink: DependencyLink;
22
+ taskBar: TaskBar;
23
+ _gantt: Gantt;
24
+ ganttGroup: Group;
25
+ scrollbarComponent: ScrollBarComponent;
26
+ markLine: MarkLine;
27
+ dragOrderLine: DragOrderLine;
28
+ frameBorder: FrameBorder;
29
+ taskCreationButton: TaskCreationButton;
30
+ toolTip: ToolTip;
31
+ stage: Stage;
32
+ tableGroupWidth: number;
33
+ tableGroupHeight: number;
34
+ constructor(gantt: Gantt);
35
+ initSceneGraph(): void;
36
+ updateSceneGraph(): void;
37
+ afterCreateSceneGraph(): void;
38
+ refreshAll(): void;
39
+ refreshTaskBars(): void;
40
+ refreshTaskBarsAndGrid(): void;
41
+ updateTableSize(): void;
42
+ updateStageBackground(): void;
43
+ renderSceneGraph(): void;
44
+ updateNextFrame(): void;
45
+ get width(): number;
46
+ get height(): number;
47
+ get x(): number;
48
+ get y(): number;
49
+ setX(x: number, isEnd?: boolean): void;
50
+ setY(y: number, isEnd?: boolean): void;
51
+ setPixelRatio(pixelRatio: number): void;
52
+ resize(): void;
53
+ release(): void;
54
+ showTaskCreationButton(x: number, y: number, dateIndex: number): void;
55
+ hideTaskCreationButton(): void;
56
+ showToolTip(target: any): void;
57
+ hideToolTip(): void;
58
+ refreshRecordLinkNodes(taskIndex: number, sub_task_index: number, target: GanttTaskBarNode, dy?: number): void;
59
+ }