@visactor/vtable-gantt 1.14.0 → 1.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.d.ts CHANGED
@@ -5,5 +5,5 @@ import { Gantt } from './Gantt';
5
5
  import * as tools from './tools';
6
6
  import * as VRender from './vrender';
7
7
  import * as VTable from './vtable';
8
- export declare const version = "1.14.0";
8
+ export declare const version = "1.14.2";
9
9
  export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable };
package/cjs/index.js CHANGED
@@ -52,5 +52,5 @@ exports.VRender = VRender;
52
52
 
53
53
  const VTable = __importStar(require("./vtable"));
54
54
 
55
- exports.VTable = VTable, exports.version = "1.14.0";
55
+ exports.VTable = VTable, exports.version = "1.14.2";
56
56
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAuBlC,sBAAK;AATP,mCAAgC;AAW9B,sFAXO,aAAK,OAWP;AAVP,+CAAiC;AAsB/B,sBAAK;AArBP,mDAAqC;AAsBnC,0BAAO;AArBT,iDAAmC;AAsBjC,wBAAM;AArBK,QAAA,OAAO,GAAG,QAAQ,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nexport const version = \"1.14.0\";\n/**\n * @namespace VTable\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable\n};\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAuBlC,sBAAK;AATP,mCAAgC;AAW9B,sFAXO,aAAK,OAWP;AAVP,+CAAiC;AAsB/B,sBAAK;AArBP,mDAAqC;AAsBnC,0BAAO;AArBT,iDAAmC;AAsBjC,wBAAM;AArBK,QAAA,OAAO,GAAG,QAAQ,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nexport const version = \"1.14.2\";\n/**\n * @namespace VTable\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable\n};\n"]}
@@ -2,8 +2,6 @@ import { Group } from '@visactor/vtable/es/vrender';
2
2
  import type { Scenegraph } from './scenegraph';
3
3
  import type { IGrid } from '../ts-types';
4
4
  export declare class Grid {
5
- vertical: boolean;
6
- horizontal: boolean;
7
5
  gridStyle: IGrid;
8
6
  scrollLeft: number;
9
7
  scrollTop: number;
@@ -16,6 +14,8 @@ export declare class Grid {
16
14
  group: Group;
17
15
  verticalLineGroup: Group;
18
16
  horizontalLineGroup: Group;
17
+ verticalBackgroundRectsGroup: Group;
18
+ horizontalBackgroundRectsGroup: Group;
19
19
  allGridHeight: number;
20
20
  allGridWidth: number;
21
21
  _scene: Scenegraph;
@@ -23,6 +23,8 @@ export declare class Grid {
23
23
  createTimeLineHeaderBottomLine(): void;
24
24
  createVerticalLines(): void;
25
25
  createHorizontalLines(): void;
26
+ createVerticalBackgroundRects(): void;
27
+ createHorizontalBackgroundRects(): void;
26
28
  refresh(): void;
27
29
  setX(x: number): void;
28
30
  setY(y: number): void;
@@ -9,9 +9,7 @@ const vrender_1 = require("@visactor/vtable/es/vrender");
9
9
  class Grid {
10
10
  constructor(scene) {
11
11
  var _a;
12
- this._scene = scene, this.vertical = !!scene._gantt.parsedOptions.grid.verticalLine,
13
- this.horizontal = !!scene._gantt.parsedOptions.grid.horizontalLine, this.scrollLeft = 0,
14
- this.scrollTop = 0, this.x = 0, this.y = scene._gantt.getAllHeaderRowsHeight(),
12
+ this._scene = scene, this.scrollLeft = 0, this.scrollTop = 0, this.x = 0, this.y = scene._gantt.getAllHeaderRowsHeight(),
15
13
  this.width = scene.tableGroup.attribute.width, this.height = scene.tableGroup.attribute.height - scene.timelineHeader.group.attribute.height,
16
14
  this.rowHeight = scene._gantt.parsedOptions.rowHeight, this.rowCount = scene._gantt.itemCount,
17
15
  this.allGridWidth = scene._gantt.getAllDateColsWidth(), this.allGridHeight = scene._gantt.getAllTaskBarsHeight(),
@@ -22,8 +20,9 @@ class Grid {
22
20
  height: this.height,
23
21
  clip: !0,
24
22
  fill: null === (_a = scene._gantt.parsedOptions.grid) || void 0 === _a ? void 0 : _a.backgroundColor
25
- }), this.group.name = "grid-container", scene.tableGroup.addChild(this.group), this.createVerticalLines(),
26
- this.createHorizontalLines(), this.createTimeLineHeaderBottomLine();
23
+ }), this.group.name = "grid-container", scene.tableGroup.addChild(this.group), this.createVerticalBackgroundRects(),
24
+ this.createHorizontalBackgroundRects(), this.createVerticalLines(), this.createHorizontalLines(),
25
+ this.createTimeLineHeaderBottomLine();
27
26
  }
28
27
  createTimeLineHeaderBottomLine() {
29
28
  var _a, _b, _c, _d, _e, _f;
@@ -44,7 +43,7 @@ class Grid {
44
43
  }
45
44
  createVerticalLines() {
46
45
  const gridStyle = this._scene._gantt.parsedOptions.grid;
47
- if (this.vertical) {
46
+ if (gridStyle.verticalLine) {
48
47
  this.verticalLineGroup = new vrender_1.Group({
49
48
  x: 0,
50
49
  y: 0,
@@ -95,7 +94,7 @@ class Grid {
95
94
  }
96
95
  createHorizontalLines() {
97
96
  const gridStyle = this._scene._gantt.parsedOptions.grid;
98
- if (this.horizontal) if (this.horizontalLineGroup = new vrender_1.Group({
97
+ if (gridStyle.horizontalLine) if (this.horizontalLineGroup = new vrender_1.Group({
99
98
  x: 0,
100
99
  y: 0,
101
100
  width: this.allGridWidth,
@@ -145,27 +144,90 @@ class Grid {
145
144
  }
146
145
  }
147
146
  }
147
+ createVerticalBackgroundRects() {
148
+ const verticalBackgroundColor = this._scene._gantt.parsedOptions.grid.verticalBackgroundColor, weekendBackgroundColor = this._scene._gantt.parsedOptions.grid.weekendBackgroundColor;
149
+ if (verticalBackgroundColor || weekendBackgroundColor) {
150
+ this.verticalBackgroundRectsGroup = new vrender_1.Group({
151
+ x: 0,
152
+ y: 0,
153
+ width: this.allGridWidth,
154
+ height: this.allGridHeight
155
+ }), this.verticalBackgroundRectsGroup.name = "grid-vertical-background", this.group.appendChild(this.verticalBackgroundRectsGroup);
156
+ const {timelineDates: timelineDates, unit: unit, step: step} = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0], timelineColWidth = this._scene._gantt.parsedOptions.timelineColWidth;
157
+ if (verticalBackgroundColor || weekendBackgroundColor) for (let i = 0; i <= (null == timelineDates ? void 0 : timelineDates.length) - 1; i++) {
158
+ let backgroundColor;
159
+ if (!weekendBackgroundColor || "day" !== unit || 1 !== step || 0 !== timelineDates[i].startDate.getDay() && 6 !== timelineDates[i].startDate.getDay() ? "function" == typeof verticalBackgroundColor ? backgroundColor = verticalBackgroundColor({
160
+ index: i,
161
+ dateIndex: timelineDates[i].dateIndex,
162
+ date: timelineDates[i].endDate,
163
+ ganttInstance: this._scene._gantt
164
+ }) : verticalBackgroundColor && (backgroundColor = verticalBackgroundColor[i % verticalBackgroundColor.length]) : backgroundColor = weekendBackgroundColor,
165
+ backgroundColor) {
166
+ const x = Math.ceil(timelineColWidth * i), rect = (0, vrender_1.createRect)({
167
+ pickable: !1,
168
+ fill: backgroundColor,
169
+ x: x,
170
+ y: 0,
171
+ width: timelineColWidth,
172
+ height: this.allGridHeight
173
+ });
174
+ this.verticalBackgroundRectsGroup.appendChild(rect);
175
+ }
176
+ }
177
+ }
178
+ }
179
+ createHorizontalBackgroundRects() {
180
+ const horizontalBackgroundColor = this._scene._gantt.parsedOptions.grid.horizontalBackgroundColor;
181
+ if (horizontalBackgroundColor) {
182
+ this.horizontalBackgroundRectsGroup = new vrender_1.Group({
183
+ x: 0,
184
+ y: 0,
185
+ width: this.allGridWidth,
186
+ height: this.allGridHeight
187
+ }), this.horizontalBackgroundRectsGroup.name = "grid-horizontal-background", this.group.appendChild(this.horizontalBackgroundRectsGroup);
188
+ let y = 0;
189
+ for (let i = 0; i <= this.rowCount - 1; i++) {
190
+ let backgroundColor;
191
+ backgroundColor = "function" == typeof horizontalBackgroundColor ? horizontalBackgroundColor({
192
+ index: i,
193
+ ganttInstance: this._scene._gantt
194
+ }) : horizontalBackgroundColor[i % horizontalBackgroundColor.length];
195
+ const rect = (0, vrender_1.createRect)({
196
+ pickable: !1,
197
+ fill: backgroundColor,
198
+ x: 0,
199
+ y: y,
200
+ width: this.allGridWidth,
201
+ height: this._scene._gantt.getRowHeightByIndex(i)
202
+ });
203
+ this.horizontalBackgroundRectsGroup.appendChild(rect), y += this._scene._gantt.getRowHeightByIndex(i);
204
+ }
205
+ }
206
+ }
148
207
  refresh() {
149
- var _a, _b;
150
208
  this.width = this._scene.tableGroup.attribute.width, this.height = this._scene.tableGroup.attribute.height - this._scene.timelineHeader.group.attribute.height,
151
209
  this.group.setAttributes({
152
210
  width: this.width,
153
211
  height: this.height,
154
212
  y: this._scene._gantt.getAllHeaderRowsHeight()
155
213
  }), this.rowCount = this._scene._gantt.itemCount, this.allGridWidth = this._scene._gantt.getAllDateColsWidth(),
156
- this.allGridHeight = this._scene._gantt.getAllTaskBarsHeight(), null === (_a = this.verticalLineGroup) || void 0 === _a || _a.parent.removeChild(this.verticalLineGroup),
157
- null === (_b = this.horizontalLineGroup) || void 0 === _b || _b.parent.removeChild(this.horizontalLineGroup),
158
- this.createVerticalLines(), this.createHorizontalLines(), this.createTimeLineHeaderBottomLine();
214
+ this.allGridHeight = this._scene._gantt.getAllTaskBarsHeight(), this.group.removeAllChild(),
215
+ this.createVerticalBackgroundRects(), this.createHorizontalBackgroundRects(), this.createVerticalLines(),
216
+ this.createHorizontalLines(), this.createTimeLineHeaderBottomLine();
159
217
  }
160
218
  setX(x) {
161
- var _a, _b;
219
+ var _a, _b, _c, _d;
162
220
  null === (_a = this.verticalLineGroup) || void 0 === _a || _a.setAttribute("x", x),
163
- null === (_b = this.horizontalLineGroup) || void 0 === _b || _b.setAttribute("x", x);
221
+ null === (_b = this.horizontalLineGroup) || void 0 === _b || _b.setAttribute("x", x),
222
+ null === (_c = this.verticalBackgroundRectsGroup) || void 0 === _c || _c.setAttribute("x", x),
223
+ null === (_d = this.horizontalBackgroundRectsGroup) || void 0 === _d || _d.setAttribute("x", x);
164
224
  }
165
225
  setY(y) {
166
- var _a, _b;
226
+ var _a, _b, _c, _d;
167
227
  null === (_a = this.verticalLineGroup) || void 0 === _a || _a.setAttribute("y", y),
168
- null === (_b = this.horizontalLineGroup) || void 0 === _b || _b.setAttribute("y", y);
228
+ null === (_b = this.horizontalLineGroup) || void 0 === _b || _b.setAttribute("y", y),
229
+ null === (_c = this.verticalBackgroundRectsGroup) || void 0 === _c || _c.setAttribute("y", y),
230
+ null === (_d = this.horizontalBackgroundRectsGroup) || void 0 === _d || _d.setAttribute("y", y);
169
231
  }
170
232
  resize() {
171
233
  this.width = this._scene.tableGroup.attribute.width, this.height = this._scene.tableGroup.attribute.height - this._scene.timelineHeader.group.attribute.height,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/grid.ts"],"names":[],"mappings":";;;AAAA,yDAAgE;AAIhE,MAAa,IAAI;IAoBf,YAAY,KAAiB;;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC;QAC/D,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC;QACnE,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,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;QAC9F,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC;QACtD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;QACvC,IAAI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AAE,CAAC,CAAC,CAAC;QAC7C,MAAA,IAAI,CAAC,mBAAmB,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,CAAC,CAAS;;QACZ,MAAA,IAAI,CAAC,iBAAiB,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC7C,MAAA,IAAI,CAAC,mBAAmB,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,MAAM;QACJ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;QAC1G,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;CACF;AAjND,oBAiNC","file":"grid.js","sourcesContent":["import { Group, createLine } from '@visactor/vtable/es/vrender';\n\nimport type { Scenegraph } from './scenegraph';\nimport type { IGrid } from '../ts-types';\nexport class Grid {\n vertical: boolean;\n horizontal: boolean;\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 allGridHeight: number;\n allGridWidth: number;\n _scene: Scenegraph;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n this.vertical = !!scene._gantt.parsedOptions.grid.verticalLine;\n this.horizontal = !!scene._gantt.parsedOptions.grid.horizontalLine;\n this.scrollLeft = 0;\n this.scrollTop = 0;\n this.x = 0;\n this.y = scene._gantt.getAllHeaderRowsHeight();\n this.width = scene.tableGroup.attribute.width;\n this.height = scene.tableGroup.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.tableGroup.addChild(this.group);\n\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 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 if (this.vertical) {\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 timelineDates = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates;\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 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 = 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 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 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 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 (this.horizontal) {\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 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 points: [\n { x: 0, y },\n { x: this.allGridWidth, y }\n ]\n });\n this.horizontalLineGroup.appendChild(line);\n }\n }\n }\n }\n /** 重新创建网格线场景树结点 */\n refresh() {\n this.width = this._scene.tableGroup.attribute.width;\n this.height = this._scene.tableGroup.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.verticalLineGroup?.parent.removeChild(this.verticalLineGroup);\n this.horizontalLineGroup?.parent.removeChild(this.horizontalLineGroup);\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 }\n setY(y: number) {\n this.verticalLineGroup?.setAttribute('y', y);\n this.horizontalLineGroup?.setAttribute('y', y);\n }\n resize() {\n this.width = this._scene.tableGroup.attribute.width;\n this.height = this._scene.tableGroup.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"]}
1
+ {"version":3,"sources":["../src/scenegraph/grid.ts"],"names":[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AAC;QACpD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;QAC1G,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;CACF;AApTD,oBAoTC","file":"grid.js","sourcesContent":["import { Group, createLine, createRect } from '@visactor/vtable/es/vrender';\n\nimport type { Scenegraph } from './scenegraph';\nimport type { IGrid } from '../ts-types';\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 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.tableGroup.attribute.width;\n this.height = scene.tableGroup.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.tableGroup.addChild(this.group);\n this.createVerticalBackgroundRects();\n this.createHorizontalBackgroundRects();\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 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 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 timelineDates = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates;\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 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 = 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 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 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 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 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 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 refresh() {\n this.width = this._scene.tableGroup.attribute.width;\n this.height = this._scene.tableGroup.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 }\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 }\n resize() {\n this.width = this._scene.tableGroup.attribute.width;\n this.height = this._scene.tableGroup.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"]}
@@ -174,6 +174,7 @@ class Scenegraph {
174
174
  ({startDate: linkedToTaskStartDate, endDate: linkedToTaskEndDate, taskDays: linkedToTaskTaskDays} = gantt.getTaskInfoByTaskListIndex(linkedToTaskShowIndex)),
175
175
  ({startDate: linkedFromTaskStartDate, endDate: linkedFromTaskEndDate, taskDays: linkedFromTaskTaskDays} = gantt.getTaskInfoByTaskListIndex(linkedFromTaskShowIndex));
176
176
  }
177
+ if (!(linkedFromTaskStartDate && linkedFromTaskEndDate && linkedToTaskStartDate && linkedToTaskEndDate && linkLineNode && lineArrowNode)) return;
177
178
  const {linePoints: linePoints, arrowPoints: arrowPoints} = (0, dependency_link_1.updateLinkLinePoints)(type, linkedFromTaskStartDate, linkedFromTaskEndDate, linkedFromTaskShowIndex, linkedFromTaskTaskDays, "milestone" === linkedFromTaskRecord.record.type, null, 0, linkedToTaskStartDate, linkedToTaskEndDate, linkedToTaskShowIndex, linkedToTaskTaskDays, "milestone" === linkedToTaskRecord.record.type, target, null != diffY ? diffY : 0, this._gantt);
178
179
  linkLineNode.setAttribute("points", linePoints), lineArrowNode.setAttribute("points", arrowPoints);
179
180
  }
@@ -205,6 +206,7 @@ class Scenegraph {
205
206
  ({startDate: linkedFromTaskStartDate, endDate: linkedFromTaskEndDate, taskDays: linkedFromTaskTaskDays} = gantt.getTaskInfoByTaskListIndex(linkedFromTaskShowIndex));
206
207
  }
207
208
  const {linePoints: linePoints, arrowPoints: arrowPoints} = (0, dependency_link_1.updateLinkLinePoints)(type, linkedFromTaskStartDate, linkedFromTaskEndDate, linkedFromTaskShowIndex, linkedFromTaskTaskDays, "milestone" === linkedFromTaskRecord.record.type, target, null != diffY ? diffY : 0, linkedToTaskStartDate, linkedToTaskEndDate, linkedToTaskShowIndex, linkedToTaskTaskDays, "milestone" === linkedToTaskRecord.record.type, null, 0, this._gantt);
209
+ if (!(linkedFromTaskStartDate && linkedFromTaskEndDate && linkedToTaskStartDate && linkedToTaskEndDate && linkLineNode && lineArrowNode)) return;
208
210
  linkLineNode.setAttribute("points", linePoints), lineArrowNode.setAttribute("points", arrowPoints);
209
211
  }
210
212
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/scenegraph.ts"],"names":[],"mappings":";;;;;;AACA,yDAAqF;AACrF,iCAA8B;AAE9B,gCAA6B;AAC7B,6CAAkD;AAClD,4CAAwD;AACxD,uDAAmD;AACnD,yCAAqC;AACrC,2CAAuC;AACvC,iDAA6C;AAC7C,kDAA6F;AAC7F,wDAA4C;AAC5C,iEAA4D;AAC5D,uDAAyE;AACzE,uDAAkD;AAElD,0CAA4C;AAC5C,mBAAS,CAAC,IAAI,CAAC,iBAAmB,CAAC,CAAC;AACpC,MAAa,UAAU;IAkBrB,YAAY,KAAY;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,iBAAiB,CAAC;QAC/C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,KAAK,CAAC;QACV,IAAI,MAAM,CAAC;QACX,IAAI,SAAG,CAAC,IAAI,KAAK,MAAM,EAAE;SAIxB;aAAM;YACL,iBAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC1B,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;YAC3B,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;SAC9B;QACD,IAAI,CAAC,KAAK,GAAG,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ChC,OAAO,EAAE,mBAAmB;oBAC5B,QAAQ,EAAE,oBAAoB;iBAC/B,GAAG,KAAK,CAAC,0BAA0B,CAAC,qBAAqB,CAAC,CAAC,CAAC;gBAC7D,CAAC;oBACC,SAAS,EAAE,uBAAuB;oBAClC,OAAO,EAAE,qBAAqB;oBAC9B,QAAQ,EAAE,sBAAsB;iBACjC,GAAG,KAAK,CAAC,0BAA0B,CAAC,uBAAuB,CAAC,CAAC,CAAC;aAChE;YACD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,IAAA,sCAAoB,EACtD,IAAI,EACJ,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,CAAC,MAAM,CAAC,IAAI,KAAK,WAAW,EAChD,MAAM,EACN,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,CAAC,EACV,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,CAAC,MAAM,CAAC,IAAI,KAAK,WAAW,EAC9C,IAAI,EACJ,CAAC,EACD,IAAI,CAAC,MAAM,CACZ,CAAC;YAEF,YAAY,CAAC,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;YAChD,aAAa,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;SACnD;IACH,CAAC;CACF;AArhBD,gCAqhBC","file":"scenegraph.js","sourcesContent":["import type { Stage } from '@visactor/vtable/es/vrender';\nimport { container, Group, vglobal, createStage } from '@visactor/vtable/es/vrender';\nimport { Grid } from './grid';\nimport type { Gantt } from '../Gantt';\nimport { Env } from '../env';\nimport { ScrollBarComponent } from './scroll-bar';\nimport { bindScrollBarListener } from '../event/scroll';\nimport { TimelineHeader } from './timeline-header';\nimport { TaskBar } from './task-bar';\nimport { MarkLine } from './mark-line';\nimport { FrameBorder } from './frame-border';\nimport { findRecordByTaskKey, getTaskIndexByY, getTaskIndexsByTaskY } from '../gantt-helper';\nimport graphicContribution from './graphic';\nimport { TaskCreationButton } from './task-creation-button';\nimport { DependencyLink, updateLinkLinePoints } from './dependency-link';\nimport { DragOrderLine } from './drag-order-line';\nimport type { GanttTaskBarNode } from './gantt-node';\nimport { TasksShowMode } from '../ts-types';\ncontainer.load(graphicContribution);\nexport class Scenegraph {\n dateStepWidth: number;\n rowHeight: number;\n _scales: {}[];\n timelineHeader: TimelineHeader;\n grid: Grid;\n dependencyLink: DependencyLink;\n taskBar: TaskBar;\n _gantt: Gantt;\n tableGroup: Group;\n scrollbarComponent: ScrollBarComponent;\n markLine: MarkLine;\n dragOrderLine: DragOrderLine;\n frameBorder: FrameBorder;\n taskCreationButton: TaskCreationButton;\n stage: Stage;\n tableGroupWidth: number;\n tableGroupHeight: number;\n constructor(gantt: Gantt) {\n this._gantt = gantt;\n this.tableGroupWidth = gantt.tableNoFrameWidth;\n this.tableGroupHeight = Math.min(gantt.tableNoFrameHeight, gantt.drawHeight);\n let width;\n let height;\n if (Env.mode === 'node') {\n // vglobal.setEnv('node', gantt.options.modeParams);\n // width = table.canvasWidth;\n // height = table.canvasHeight;\n } else {\n vglobal.setEnv('browser');\n width = gantt.canvas.width;\n height = gantt.canvas.height;\n }\n this.stage = createStage({\n canvas: gantt.canvas,\n width,\n height,\n disableDirtyBounds: false,\n background: gantt.parsedOptions.underlayBackgroundColor,\n // dpr: gantt.internalProps.pixelRatio,\n enableLayout: true,\n autoRender: false,\n context: {\n appName: 'vtable'\n },\n pluginList: ['poptipForText']\n // afterRender: () => {\n // this._gantt.fireListeners('after_render', null);\n // }\n });\n (this.stage as any).gantt = this._gantt;\n (this.stage as any).table = this._gantt; // 为了使用bindDebugTool\n this.stage.defaultLayer.setTheme({\n group: {\n boundsPadding: 0,\n strokeBoundsBuffer: 0,\n lineJoin: 'round'\n },\n text: {\n ignoreBuf: true\n }\n });\n this.initSceneGraph();\n }\n\n initSceneGraph() {\n const scene = this;\n\n scene.tableGroup = new Group({\n x: scene._gantt.tableX,\n y: scene._gantt.tableY,\n width: this.tableGroupWidth,\n height: this.tableGroupHeight,\n clip: true,\n pickable: false\n });\n scene.stage.defaultLayer.add(scene.tableGroup);\n scene.tableGroup.name = 'table';\n // 初始化顶部时间线表头部分\n scene.timelineHeader = new TimelineHeader(scene);\n\n // 初始化网格线组件\n scene.grid = new Grid(scene);\n // 初始化任务条线组件\n scene.dependencyLink = new DependencyLink(scene);\n // 初始化任务条线组件\n scene.taskBar = new TaskBar(scene);\n\n // 初始化标记线组件\n scene.markLine = new MarkLine(scene);\n\n // 初始化边框\n scene.frameBorder = new FrameBorder(scene);\n\n // 初始化滚动条组件\n scene.scrollbarComponent = new ScrollBarComponent(scene._gantt);\n scene.stage.defaultLayer.addChild(scene.scrollbarComponent.hScrollBar);\n scene.stage.defaultLayer.addChild(scene.scrollbarComponent.vScrollBar);\n\n //初始化换位交互标记线\n scene.dragOrderLine = new DragOrderLine(scene);\n }\n updateSceneGraph() {\n const gantt = this._gantt;\n this.tableGroupWidth = gantt.tableNoFrameWidth;\n this.tableGroupHeight = Math.min(gantt.tableNoFrameHeight, gantt.drawHeight);\n let width;\n let height;\n if (Env.mode === 'node') {\n } else {\n vglobal.setEnv('browser');\n width = gantt.canvas.width;\n height = gantt.canvas.height;\n }\n this.stage.resize(width, height);\n this.refreshAll();\n }\n\n afterCreateSceneGraph() {\n this.scrollbarComponent.updateScrollBar();\n bindScrollBarListener(this._gantt.eventManager);\n }\n\n refreshAll() {\n this.tableGroupHeight = Math.min(this._gantt.tableNoFrameHeight, this._gantt.drawHeight);\n this.tableGroupWidth = this._gantt.tableNoFrameWidth;\n this.tableGroup.setAttribute('height', this.tableGroupHeight);\n this.tableGroup.setAttribute('width', this.tableGroupWidth);\n this.timelineHeader.refresh();\n this.grid.refresh();\n this.taskBar.refresh();\n this.dependencyLink.refresh();\n this.markLine.refresh();\n this.dependencyLink.refresh();\n this.frameBorder.refresh();\n this.scrollbarComponent.updateScrollBar();\n this.updateNextFrame();\n }\n\n refreshTaskBars() {\n // this.timelineHeader.refresh();\n // this.grid.refresh();\n this.dependencyLink.refresh();\n this.taskBar.refresh();\n // this.markLine.refresh();\n // this.frameBorder.refresh();\n // this.scrollbarComponent.refresh();\n this.updateNextFrame();\n }\n refreshTaskBarsAndGrid() {\n this._gantt.verticalSplitResizeLine.style.height = this._gantt.drawHeight + 'px'; //'100%';\n this.tableGroupHeight = Math.min(this._gantt.tableNoFrameHeight, this._gantt.drawHeight);\n this.tableGroup.setAttribute('height', this.tableGroupHeight);\n // this.timelineHeader.refresh();\n this.grid.refresh();\n this.taskBar.refresh();\n this.dependencyLink.refresh();\n this.markLine.refresh();\n this.frameBorder.resize();\n this.scrollbarComponent.updateScrollBar();\n this.updateNextFrame();\n }\n\n updateTableSize() {\n this.tableGroupHeight = Math.min(this._gantt.tableNoFrameHeight, this._gantt.drawHeight);\n this.tableGroupWidth = this._gantt.tableNoFrameWidth;\n this.tableGroup.setAttributes({\n x: this._gantt.tableX,\n y: this._gantt.tableY,\n width: this._gantt.tableNoFrameWidth,\n height: this.tableGroupHeight\n } as any);\n this.grid.resize();\n this.taskBar.resize();\n this.markLine.refresh();\n this.frameBorder.resize();\n }\n\n updateStageBackground() {\n this.stage.background = this._gantt.parsedOptions.underlayBackgroundColor;\n this.updateNextFrame();\n }\n\n /**\n * @description: 绘制场景树\n * @param {any} element\n * @param {CellRange} visibleCoord\n * @return {*}\n */\n renderSceneGraph() {\n this.stage.render();\n }\n\n /**\n * @description: 触发下一帧渲染\n * @return {*}\n */\n updateNextFrame() {\n this.stage.renderNextFrame();\n }\n get width(): number {\n return this.tableGroup.attribute?.width ?? 0;\n }\n\n get height(): number {\n return this.tableGroup.attribute?.height ?? 0;\n }\n\n get x(): number {\n return this.tableGroup.attribute?.x ?? 0;\n }\n\n get y(): number {\n return this.tableGroup.attribute?.y ?? 0;\n }\n\n /**\n * @description: 设置表格的x位置,滚动中使用\n * @param {number} x\n * @return {*}\n */\n setX(x: number, isEnd = false) {\n this.timelineHeader.setX(x);\n this.grid.setX(x);\n this.taskBar.setX(x);\n this.dependencyLink.setX(x);\n this.markLine.setX(x);\n this.updateNextFrame();\n // this._gantt.scenegraph.proxy.setX(-x, isEnd);\n }\n\n /**\n * @description: 更新表格的y位置,滚动中使用\n * @param {number} y\n * @return {*}\n */\n setY(y: number, isEnd = false) {\n // this._gantt.scenegraph.proxy.setY(-y, isEnd);\n this.grid.setY(y);\n this.taskBar.setY(y);\n this.dependencyLink.setY(y);\n this.updateNextFrame();\n }\n\n setPixelRatio(pixelRatio: number) {\n // this.stage.setDpr(pixelRatio);\n // 这里因为本时刻部分节点有更新bounds标记,直接render回导致开启DirtyBounds,无法完整重绘画布;\n // 所以这里先关闭DirtyBounds,等待下一帧再开启\n this.stage.disableDirtyBounds();\n this.stage.window.setDpr(pixelRatio);\n this.stage.render();\n this.stage.enableDirtyBounds();\n }\n\n resize() {\n this.updateTableSize();\n // this.updateBorderSizeAndPosition();\n this.scrollbarComponent.updateScrollBar();\n this.updateNextFrame();\n }\n release() {\n this.stage.release();\n }\n\n showTaskCreationButton(x: number, y: number, dateIndex: number) {\n if (!this.taskCreationButton) {\n this.taskCreationButton = new TaskCreationButton(this._gantt.scenegraph);\n }\n this.taskCreationButton.show(x, y, this._gantt.getDateColWidth(dateIndex), this._gantt.parsedOptions.rowHeight);\n this.updateNextFrame();\n }\n\n hideTaskCreationButton() {\n if (this.taskCreationButton) {\n this.taskCreationButton.hide();\n this.updateNextFrame();\n }\n }\n refreshRecordLinkNodes(taskIndex: number, sub_task_index: number, target: GanttTaskBarNode, dy: number = 0) {\n const gantt: Gantt = this._gantt;\n const record = gantt.getRecordByIndex(taskIndex, sub_task_index);\n const vtable_gantt_linkedTo = record.vtable_gantt_linkedTo;\n const vtable_gantt_linkedFrom = record.vtable_gantt_linkedFrom;\n for (let i = 0; i < vtable_gantt_linkedTo?.length; i++) {\n const link = vtable_gantt_linkedTo[i];\n const linkLineNode = link.vtable_gantt_linkLineNode;\n const lineArrowNode = link.vtable_gantt_linkArrowNode;\n\n const { linkedToTaskKey, linkedFromTaskKey, type } = link;\n const { taskKeyField, minDate } = gantt.parsedOptions;\n const linkedFromTaskRecord = findRecordByTaskKey(gantt.records, taskKeyField, linkedFromTaskKey);\n const linkedToTaskRecord = findRecordByTaskKey(gantt.records, taskKeyField, linkedToTaskKey);\n // const { startDate: linkedToTaskStartDate, endDate: linkedToTaskEndDate } =\n // gantt.getTaskInfoByTaskListIndex(taskIndex);\n // const taskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index);\n // const { startDate: linkedFromTaskStartDate, endDate: linkedFromTaskEndDate } =\n // gantt.getTaskInfoByTaskListIndex(taskShowIndex);\n\n let linkedToTaskStartDate;\n let linkedToTaskEndDate;\n let linkedToTaskTaskDays;\n // let linkedToTaskTaskRecord;\n let linkedFromTaskStartDate;\n let linkedFromTaskEndDate;\n let linkedFromTaskTaskDays;\n // let linkedFromTaskTaskRecord;\n\n let linkedToTaskShowIndex;\n let linkedFromTaskShowIndex;\n let diffY: number;\n if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline) {\n const new_indexs = getTaskIndexsByTaskY(target.attribute.y + dy, gantt);\n linkedFromTaskShowIndex = linkedFromTaskRecord.index[0];\n // linkedToTaskShowIndex = linkedToTaskRecord.index[0];\n const beforeRowCountLinkedTo =\n gantt.getRowsHeightByIndex(0, new_indexs.task_index - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedToTaskShowIndex = beforeRowCountLinkedTo;\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskRecord.index[0], linkedToTaskRecord.index[1]));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));\n\n const taskbarHeight = gantt.parsedOptions.taskBarStyle.width;\n diffY = target.attribute.y + taskbarHeight / 2 - (linkedToTaskShowIndex + 0.5) * gantt.parsedOptions.rowHeight;\n } else if (\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ) {\n const new_indexs = getTaskIndexsByTaskY(target.attribute.y + dy, gantt);\n const beforeRowCountLinkedFrom =\n gantt.getRowsHeightByIndex(0, linkedFromTaskRecord.index[0] - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedFromTaskShowIndex =\n beforeRowCountLinkedFrom +\n (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ? linkedFromTaskRecord.record.vtable_gantt_showIndex\n : linkedFromTaskRecord.index[1]);\n // const beforeRowCountLinkedTo =\n // gantt.getRowsHeightByIndex(0, linkedToTaskRecord.index[0] - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n // linkedToTaskShowIndex = beforeRowCountLinkedTo + linkedToTaskRecord.index[1];\n const beforeRowCountLinkedTo =\n gantt.getRowsHeightByIndex(0, new_indexs.task_index - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedToTaskShowIndex =\n beforeRowCountLinkedTo +\n (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ? linkedToTaskRecord.record.vtable_gantt_showIndex\n : new_indexs.sub_task_index);\n\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskRecord.index[0], linkedToTaskRecord.index[1]));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));\n\n const taskbarHeight = gantt.parsedOptions.taskBarStyle.width;\n diffY = target.attribute.y + taskbarHeight / 2 - (linkedToTaskShowIndex + 0.5) * gantt.parsedOptions.rowHeight;\n } else {\n linkedFromTaskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index);\n linkedToTaskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index);\n if (linkedFromTaskShowIndex === -1 || linkedToTaskShowIndex === -1) {\n continue;\n }\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskShowIndex));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskShowIndex));\n }\n const { linePoints, arrowPoints } = updateLinkLinePoints(\n type,\n linkedFromTaskStartDate,\n linkedFromTaskEndDate,\n linkedFromTaskShowIndex,\n linkedFromTaskTaskDays,\n linkedFromTaskRecord.record.type === 'milestone',\n null,\n 0,\n linkedToTaskStartDate,\n linkedToTaskEndDate,\n linkedToTaskShowIndex,\n linkedToTaskTaskDays,\n linkedToTaskRecord.record.type === 'milestone',\n target,\n diffY ?? 0,\n this._gantt\n );\n linkLineNode.setAttribute('points', linePoints);\n lineArrowNode.setAttribute('points', arrowPoints);\n }\n\n for (let i = 0; i < vtable_gantt_linkedFrom?.length; i++) {\n const link = vtable_gantt_linkedFrom[i];\n const linkLineNode = link.vtable_gantt_linkLineNode;\n const lineArrowNode = link.vtable_gantt_linkArrowNode;\n\n const { linkedToTaskKey, linkedFromTaskKey, type } = link;\n const { taskKeyField, minDate } = gantt.parsedOptions;\n const linkedToTaskRecord = findRecordByTaskKey(gantt.records, taskKeyField, linkedToTaskKey);\n const linkedFromTaskRecord = findRecordByTaskKey(gantt.records, taskKeyField, linkedFromTaskKey);\n // const { startDate: linkedFromTaskStartDate, endDate: linkedFromTaskEndDate } =\n // gantt.getTaskInfoByTaskListIndex(taskIndex);\n // const taskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index);\n // const { startDate: linkedToTaskStartDate, endDate: linkedToTaskEndDate } =\n // gantt.getTaskInfoByTaskListIndex(taskShowIndex);\n\n let linkedToTaskStartDate;\n let linkedToTaskEndDate;\n let linkedToTaskTaskDays;\n let linkedFromTaskStartDate;\n let linkedFromTaskEndDate;\n let linkedFromTaskTaskDays;\n\n let linkedToTaskShowIndex;\n let linkedFromTaskShowIndex;\n let diffY: number;\n if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline) {\n const new_indexs = getTaskIndexsByTaskY(target.attribute.y + dy, gantt);\n const beforeRowCountLinkedFrom =\n gantt.getRowsHeightByIndex(0, new_indexs.task_index - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedFromTaskShowIndex = beforeRowCountLinkedFrom;\n\n // linkedFromTaskShowIndex = linkedFromTaskRecord.index[0];\n linkedToTaskShowIndex = linkedToTaskRecord.index[0];\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskRecord.index[0], linkedToTaskRecord.index[1]));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));\n const taskbarHeight = gantt.parsedOptions.taskBarStyle.width;\n diffY =\n target.attribute.y + taskbarHeight / 2 - (linkedFromTaskShowIndex + 0.5) * gantt.parsedOptions.rowHeight;\n } else if (\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ) {\n const new_indexs = getTaskIndexsByTaskY(target.attribute.y + dy, gantt);\n // const beforeRowCountLinkedFrom =\n // gantt.getRowsHeightByIndex(0, linkedFromTaskRecord.index[0] - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n // linkedFromTaskShowIndex = beforeRowCountLinkedFrom + linkedFromTaskRecord.index[1];\n const beforeRowCountLinkedFrom =\n gantt.getRowsHeightByIndex(0, new_indexs.task_index - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedFromTaskShowIndex =\n beforeRowCountLinkedFrom +\n (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ? linkedFromTaskRecord.record.vtable_gantt_showIndex\n : new_indexs.sub_task_index);\n\n const beforeRowCountLinkedTo =\n gantt.getRowsHeightByIndex(0, linkedToTaskRecord.index[0] - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedToTaskShowIndex =\n beforeRowCountLinkedTo +\n (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ? linkedToTaskRecord.record.vtable_gantt_showIndex\n : linkedToTaskRecord.index[1]);\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskRecord.index[0], linkedToTaskRecord.index[1]));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));\n const taskbarHeight = gantt.parsedOptions.taskBarStyle.width;\n diffY =\n target.attribute.y + taskbarHeight / 2 - (linkedFromTaskShowIndex + 0.5) * gantt.parsedOptions.rowHeight;\n } else {\n linkedFromTaskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index);\n linkedToTaskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index);\n if (linkedFromTaskShowIndex === -1 || linkedToTaskShowIndex === -1) {\n continue;\n }\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskShowIndex));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskShowIndex));\n }\n const { linePoints, arrowPoints } = updateLinkLinePoints(\n type,\n linkedFromTaskStartDate,\n linkedFromTaskEndDate,\n linkedFromTaskShowIndex,\n linkedFromTaskTaskDays,\n linkedFromTaskRecord.record.type === 'milestone',\n target,\n diffY ?? 0,\n linkedToTaskStartDate,\n linkedToTaskEndDate,\n linkedToTaskShowIndex,\n linkedToTaskTaskDays,\n linkedToTaskRecord.record.type === 'milestone',\n null,\n 0,\n this._gantt\n );\n\n linkLineNode.setAttribute('points', linePoints);\n lineArrowNode.setAttribute('points', arrowPoints);\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/scenegraph.ts"],"names":[],"mappings":";;;;;;AACA,yDAAqF;AACrF,iCAA8B;AAE9B,gCAA6B;AAC7B,6CAAkD;AAClD,4CAAwD;AACxD,uDAAmD;AACnD,yCAAqC;AACrC,2CAAuC;AACvC,iDAA6C;AAC7C,kDAA6F;AAC7F,wDAA4C;AAC5C,iEAA4D;AAC5D,uDAA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MAAM,CAAC,IAAI,KAAK,WAAW,EAChD,MAAM,EACN,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,CAAC,EACV,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,CAAC,MAAM,CAAC,IAAI,KAAK,WAAW,EAC9C,IAAI,EACJ,CAAC,EACD,IAAI,CAAC,MAAM,CACZ,CAAC;YACF,IACE,CAAC,uBAAuB;gBACxB,CAAC,qBAAqB;gBACtB,CAAC,qBAAqB;gBACtB,CAAC,mBAAmB;gBACpB,CAAC,YAAY;gBACb,CAAC,aAAa,EACd;gBACA,OAAO;aACR;YACD,YAAY,CAAC,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;YAChD,aAAa,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;SACnD;IACH,CAAC;CACF;AAxiBD,gCAwiBC","file":"scenegraph.js","sourcesContent":["import type { Stage } from '@visactor/vtable/es/vrender';\nimport { container, Group, vglobal, createStage } from '@visactor/vtable/es/vrender';\nimport { Grid } from './grid';\nimport type { Gantt } from '../Gantt';\nimport { Env } from '../env';\nimport { ScrollBarComponent } from './scroll-bar';\nimport { bindScrollBarListener } from '../event/scroll';\nimport { TimelineHeader } from './timeline-header';\nimport { TaskBar } from './task-bar';\nimport { MarkLine } from './mark-line';\nimport { FrameBorder } from './frame-border';\nimport { findRecordByTaskKey, getTaskIndexByY, getTaskIndexsByTaskY } from '../gantt-helper';\nimport graphicContribution from './graphic';\nimport { TaskCreationButton } from './task-creation-button';\nimport { DependencyLink, updateLinkLinePoints } from './dependency-link';\nimport { DragOrderLine } from './drag-order-line';\nimport type { GanttTaskBarNode } from './gantt-node';\nimport { TasksShowMode } from '../ts-types';\ncontainer.load(graphicContribution);\nexport class Scenegraph {\n dateStepWidth: number;\n rowHeight: number;\n _scales: {}[];\n timelineHeader: TimelineHeader;\n grid: Grid;\n dependencyLink: DependencyLink;\n taskBar: TaskBar;\n _gantt: Gantt;\n tableGroup: Group;\n scrollbarComponent: ScrollBarComponent;\n markLine: MarkLine;\n dragOrderLine: DragOrderLine;\n frameBorder: FrameBorder;\n taskCreationButton: TaskCreationButton;\n stage: Stage;\n tableGroupWidth: number;\n tableGroupHeight: number;\n constructor(gantt: Gantt) {\n this._gantt = gantt;\n this.tableGroupWidth = gantt.tableNoFrameWidth;\n this.tableGroupHeight = Math.min(gantt.tableNoFrameHeight, gantt.drawHeight);\n let width;\n let height;\n if (Env.mode === 'node') {\n // vglobal.setEnv('node', gantt.options.modeParams);\n // width = table.canvasWidth;\n // height = table.canvasHeight;\n } else {\n vglobal.setEnv('browser');\n width = gantt.canvas.width;\n height = gantt.canvas.height;\n }\n this.stage = createStage({\n canvas: gantt.canvas,\n width,\n height,\n disableDirtyBounds: false,\n background: gantt.parsedOptions.underlayBackgroundColor,\n // dpr: gantt.internalProps.pixelRatio,\n enableLayout: true,\n autoRender: false,\n context: {\n appName: 'vtable'\n },\n pluginList: ['poptipForText']\n // afterRender: () => {\n // this._gantt.fireListeners('after_render', null);\n // }\n });\n (this.stage as any).gantt = this._gantt;\n (this.stage as any).table = this._gantt; // 为了使用bindDebugTool\n this.stage.defaultLayer.setTheme({\n group: {\n boundsPadding: 0,\n strokeBoundsBuffer: 0,\n lineJoin: 'round'\n },\n text: {\n ignoreBuf: true\n }\n });\n this.initSceneGraph();\n }\n\n initSceneGraph() {\n const scene = this;\n\n scene.tableGroup = new Group({\n x: scene._gantt.tableX,\n y: scene._gantt.tableY,\n width: this.tableGroupWidth,\n height: this.tableGroupHeight,\n clip: true,\n pickable: false\n });\n scene.stage.defaultLayer.add(scene.tableGroup);\n scene.tableGroup.name = 'table';\n // 初始化顶部时间线表头部分\n scene.timelineHeader = new TimelineHeader(scene);\n\n // 初始化网格线组件\n scene.grid = new Grid(scene);\n // 初始化任务条线组件\n scene.dependencyLink = new DependencyLink(scene);\n // 初始化任务条线组件\n scene.taskBar = new TaskBar(scene);\n\n // 初始化标记线组件\n scene.markLine = new MarkLine(scene);\n\n // 初始化边框\n scene.frameBorder = new FrameBorder(scene);\n\n // 初始化滚动条组件\n scene.scrollbarComponent = new ScrollBarComponent(scene._gantt);\n scene.stage.defaultLayer.addChild(scene.scrollbarComponent.hScrollBar);\n scene.stage.defaultLayer.addChild(scene.scrollbarComponent.vScrollBar);\n\n //初始化换位交互标记线\n scene.dragOrderLine = new DragOrderLine(scene);\n }\n updateSceneGraph() {\n const gantt = this._gantt;\n this.tableGroupWidth = gantt.tableNoFrameWidth;\n this.tableGroupHeight = Math.min(gantt.tableNoFrameHeight, gantt.drawHeight);\n let width;\n let height;\n if (Env.mode === 'node') {\n } else {\n vglobal.setEnv('browser');\n width = gantt.canvas.width;\n height = gantt.canvas.height;\n }\n this.stage.resize(width, height);\n this.refreshAll();\n }\n\n afterCreateSceneGraph() {\n this.scrollbarComponent.updateScrollBar();\n bindScrollBarListener(this._gantt.eventManager);\n }\n\n refreshAll() {\n this.tableGroupHeight = Math.min(this._gantt.tableNoFrameHeight, this._gantt.drawHeight);\n this.tableGroupWidth = this._gantt.tableNoFrameWidth;\n this.tableGroup.setAttribute('height', this.tableGroupHeight);\n this.tableGroup.setAttribute('width', this.tableGroupWidth);\n this.timelineHeader.refresh();\n this.grid.refresh();\n this.taskBar.refresh();\n this.dependencyLink.refresh();\n this.markLine.refresh();\n this.dependencyLink.refresh();\n this.frameBorder.refresh();\n this.scrollbarComponent.updateScrollBar();\n this.updateNextFrame();\n }\n\n refreshTaskBars() {\n // this.timelineHeader.refresh();\n // this.grid.refresh();\n this.dependencyLink.refresh();\n this.taskBar.refresh();\n // this.markLine.refresh();\n // this.frameBorder.refresh();\n // this.scrollbarComponent.refresh();\n this.updateNextFrame();\n }\n refreshTaskBarsAndGrid() {\n this._gantt.verticalSplitResizeLine.style.height = this._gantt.drawHeight + 'px'; //'100%';\n this.tableGroupHeight = Math.min(this._gantt.tableNoFrameHeight, this._gantt.drawHeight);\n this.tableGroup.setAttribute('height', this.tableGroupHeight);\n // this.timelineHeader.refresh();\n this.grid.refresh();\n this.taskBar.refresh();\n this.dependencyLink.refresh();\n this.markLine.refresh();\n this.frameBorder.resize();\n this.scrollbarComponent.updateScrollBar();\n this.updateNextFrame();\n }\n\n updateTableSize() {\n this.tableGroupHeight = Math.min(this._gantt.tableNoFrameHeight, this._gantt.drawHeight);\n this.tableGroupWidth = this._gantt.tableNoFrameWidth;\n this.tableGroup.setAttributes({\n x: this._gantt.tableX,\n y: this._gantt.tableY,\n width: this._gantt.tableNoFrameWidth,\n height: this.tableGroupHeight\n } as any);\n this.grid.resize();\n this.taskBar.resize();\n this.markLine.refresh();\n this.frameBorder.resize();\n }\n\n updateStageBackground() {\n this.stage.background = this._gantt.parsedOptions.underlayBackgroundColor;\n this.updateNextFrame();\n }\n\n /**\n * @description: 绘制场景树\n * @param {any} element\n * @param {CellRange} visibleCoord\n * @return {*}\n */\n renderSceneGraph() {\n this.stage.render();\n }\n\n /**\n * @description: 触发下一帧渲染\n * @return {*}\n */\n updateNextFrame() {\n this.stage.renderNextFrame();\n }\n get width(): number {\n return this.tableGroup.attribute?.width ?? 0;\n }\n\n get height(): number {\n return this.tableGroup.attribute?.height ?? 0;\n }\n\n get x(): number {\n return this.tableGroup.attribute?.x ?? 0;\n }\n\n get y(): number {\n return this.tableGroup.attribute?.y ?? 0;\n }\n\n /**\n * @description: 设置表格的x位置,滚动中使用\n * @param {number} x\n * @return {*}\n */\n setX(x: number, isEnd = false) {\n this.timelineHeader.setX(x);\n this.grid.setX(x);\n this.taskBar.setX(x);\n this.dependencyLink.setX(x);\n this.markLine.setX(x);\n this.updateNextFrame();\n // this._gantt.scenegraph.proxy.setX(-x, isEnd);\n }\n\n /**\n * @description: 更新表格的y位置,滚动中使用\n * @param {number} y\n * @return {*}\n */\n setY(y: number, isEnd = false) {\n // this._gantt.scenegraph.proxy.setY(-y, isEnd);\n this.grid.setY(y);\n this.taskBar.setY(y);\n this.dependencyLink.setY(y);\n this.updateNextFrame();\n }\n\n setPixelRatio(pixelRatio: number) {\n // this.stage.setDpr(pixelRatio);\n // 这里因为本时刻部分节点有更新bounds标记,直接render回导致开启DirtyBounds,无法完整重绘画布;\n // 所以这里先关闭DirtyBounds,等待下一帧再开启\n this.stage.disableDirtyBounds();\n this.stage.window.setDpr(pixelRatio);\n this.stage.render();\n this.stage.enableDirtyBounds();\n }\n\n resize() {\n this.updateTableSize();\n // this.updateBorderSizeAndPosition();\n this.scrollbarComponent.updateScrollBar();\n this.updateNextFrame();\n }\n release() {\n this.stage.release();\n }\n\n showTaskCreationButton(x: number, y: number, dateIndex: number) {\n if (!this.taskCreationButton) {\n this.taskCreationButton = new TaskCreationButton(this._gantt.scenegraph);\n }\n this.taskCreationButton.show(x, y, this._gantt.getDateColWidth(dateIndex), this._gantt.parsedOptions.rowHeight);\n this.updateNextFrame();\n }\n\n hideTaskCreationButton() {\n if (this.taskCreationButton) {\n this.taskCreationButton.hide();\n this.updateNextFrame();\n }\n }\n refreshRecordLinkNodes(taskIndex: number, sub_task_index: number, target: GanttTaskBarNode, dy: number = 0) {\n const gantt: Gantt = this._gantt;\n const record = gantt.getRecordByIndex(taskIndex, sub_task_index);\n const vtable_gantt_linkedTo = record.vtable_gantt_linkedTo;\n const vtable_gantt_linkedFrom = record.vtable_gantt_linkedFrom;\n for (let i = 0; i < vtable_gantt_linkedTo?.length; i++) {\n const link = vtable_gantt_linkedTo[i];\n const linkLineNode = link.vtable_gantt_linkLineNode;\n const lineArrowNode = link.vtable_gantt_linkArrowNode;\n\n const { linkedToTaskKey, linkedFromTaskKey, type } = link;\n const { taskKeyField, minDate } = gantt.parsedOptions;\n const linkedFromTaskRecord = findRecordByTaskKey(gantt.records, taskKeyField, linkedFromTaskKey);\n const linkedToTaskRecord = findRecordByTaskKey(gantt.records, taskKeyField, linkedToTaskKey);\n // const { startDate: linkedToTaskStartDate, endDate: linkedToTaskEndDate } =\n // gantt.getTaskInfoByTaskListIndex(taskIndex);\n // const taskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index);\n // const { startDate: linkedFromTaskStartDate, endDate: linkedFromTaskEndDate } =\n // gantt.getTaskInfoByTaskListIndex(taskShowIndex);\n\n let linkedToTaskStartDate;\n let linkedToTaskEndDate;\n let linkedToTaskTaskDays;\n // let linkedToTaskTaskRecord;\n let linkedFromTaskStartDate;\n let linkedFromTaskEndDate;\n let linkedFromTaskTaskDays;\n // let linkedFromTaskTaskRecord;\n\n let linkedToTaskShowIndex;\n let linkedFromTaskShowIndex;\n let diffY: number;\n if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline) {\n const new_indexs = getTaskIndexsByTaskY(target.attribute.y + dy, gantt);\n linkedFromTaskShowIndex = linkedFromTaskRecord.index[0];\n // linkedToTaskShowIndex = linkedToTaskRecord.index[0];\n const beforeRowCountLinkedTo =\n gantt.getRowsHeightByIndex(0, new_indexs.task_index - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedToTaskShowIndex = beforeRowCountLinkedTo;\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskRecord.index[0], linkedToTaskRecord.index[1]));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));\n\n const taskbarHeight = gantt.parsedOptions.taskBarStyle.width;\n diffY = target.attribute.y + taskbarHeight / 2 - (linkedToTaskShowIndex + 0.5) * gantt.parsedOptions.rowHeight;\n } else if (\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ) {\n const new_indexs = getTaskIndexsByTaskY(target.attribute.y + dy, gantt);\n const beforeRowCountLinkedFrom =\n gantt.getRowsHeightByIndex(0, linkedFromTaskRecord.index[0] - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedFromTaskShowIndex =\n beforeRowCountLinkedFrom +\n (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ? linkedFromTaskRecord.record.vtable_gantt_showIndex\n : linkedFromTaskRecord.index[1]);\n // const beforeRowCountLinkedTo =\n // gantt.getRowsHeightByIndex(0, linkedToTaskRecord.index[0] - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n // linkedToTaskShowIndex = beforeRowCountLinkedTo + linkedToTaskRecord.index[1];\n const beforeRowCountLinkedTo =\n gantt.getRowsHeightByIndex(0, new_indexs.task_index - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedToTaskShowIndex =\n beforeRowCountLinkedTo +\n (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ? linkedToTaskRecord.record.vtable_gantt_showIndex\n : new_indexs.sub_task_index);\n\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskRecord.index[0], linkedToTaskRecord.index[1]));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));\n\n const taskbarHeight = gantt.parsedOptions.taskBarStyle.width;\n diffY = target.attribute.y + taskbarHeight / 2 - (linkedToTaskShowIndex + 0.5) * gantt.parsedOptions.rowHeight;\n } else {\n linkedFromTaskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index);\n linkedToTaskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index);\n if (linkedFromTaskShowIndex === -1 || linkedToTaskShowIndex === -1) {\n continue;\n }\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskShowIndex));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskShowIndex));\n }\n if (\n !linkedFromTaskStartDate ||\n !linkedFromTaskEndDate ||\n !linkedToTaskStartDate ||\n !linkedToTaskEndDate ||\n !linkLineNode ||\n !lineArrowNode\n ) {\n return;\n }\n const { linePoints, arrowPoints } = updateLinkLinePoints(\n type,\n linkedFromTaskStartDate,\n linkedFromTaskEndDate,\n linkedFromTaskShowIndex,\n linkedFromTaskTaskDays,\n linkedFromTaskRecord.record.type === 'milestone',\n null,\n 0,\n linkedToTaskStartDate,\n linkedToTaskEndDate,\n linkedToTaskShowIndex,\n linkedToTaskTaskDays,\n linkedToTaskRecord.record.type === 'milestone',\n target,\n diffY ?? 0,\n this._gantt\n );\n linkLineNode.setAttribute('points', linePoints);\n lineArrowNode.setAttribute('points', arrowPoints);\n }\n\n for (let i = 0; i < vtable_gantt_linkedFrom?.length; i++) {\n const link = vtable_gantt_linkedFrom[i];\n const linkLineNode = link.vtable_gantt_linkLineNode;\n const lineArrowNode = link.vtable_gantt_linkArrowNode;\n\n const { linkedToTaskKey, linkedFromTaskKey, type } = link;\n const { taskKeyField, minDate } = gantt.parsedOptions;\n const linkedToTaskRecord = findRecordByTaskKey(gantt.records, taskKeyField, linkedToTaskKey);\n const linkedFromTaskRecord = findRecordByTaskKey(gantt.records, taskKeyField, linkedFromTaskKey);\n // const { startDate: linkedFromTaskStartDate, endDate: linkedFromTaskEndDate } =\n // gantt.getTaskInfoByTaskListIndex(taskIndex);\n // const taskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index);\n // const { startDate: linkedToTaskStartDate, endDate: linkedToTaskEndDate } =\n // gantt.getTaskInfoByTaskListIndex(taskShowIndex);\n\n let linkedToTaskStartDate;\n let linkedToTaskEndDate;\n let linkedToTaskTaskDays;\n let linkedFromTaskStartDate;\n let linkedFromTaskEndDate;\n let linkedFromTaskTaskDays;\n\n let linkedToTaskShowIndex;\n let linkedFromTaskShowIndex;\n let diffY: number;\n if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline) {\n const new_indexs = getTaskIndexsByTaskY(target.attribute.y + dy, gantt);\n const beforeRowCountLinkedFrom =\n gantt.getRowsHeightByIndex(0, new_indexs.task_index - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedFromTaskShowIndex = beforeRowCountLinkedFrom;\n\n // linkedFromTaskShowIndex = linkedFromTaskRecord.index[0];\n linkedToTaskShowIndex = linkedToTaskRecord.index[0];\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskRecord.index[0], linkedToTaskRecord.index[1]));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));\n const taskbarHeight = gantt.parsedOptions.taskBarStyle.width;\n diffY =\n target.attribute.y + taskbarHeight / 2 - (linkedFromTaskShowIndex + 0.5) * gantt.parsedOptions.rowHeight;\n } else if (\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ) {\n const new_indexs = getTaskIndexsByTaskY(target.attribute.y + dy, gantt);\n // const beforeRowCountLinkedFrom =\n // gantt.getRowsHeightByIndex(0, linkedFromTaskRecord.index[0] - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n // linkedFromTaskShowIndex = beforeRowCountLinkedFrom + linkedFromTaskRecord.index[1];\n const beforeRowCountLinkedFrom =\n gantt.getRowsHeightByIndex(0, new_indexs.task_index - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedFromTaskShowIndex =\n beforeRowCountLinkedFrom +\n (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ? linkedFromTaskRecord.record.vtable_gantt_showIndex\n : new_indexs.sub_task_index);\n\n const beforeRowCountLinkedTo =\n gantt.getRowsHeightByIndex(0, linkedToTaskRecord.index[0] - 1) / gantt.parsedOptions.rowHeight; // 耦合了listTableOption的customComputeRowHeight\n linkedToTaskShowIndex =\n beforeRowCountLinkedTo +\n (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ? linkedToTaskRecord.record.vtable_gantt_showIndex\n : linkedToTaskRecord.index[1]);\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskRecord.index[0], linkedToTaskRecord.index[1]));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));\n const taskbarHeight = gantt.parsedOptions.taskBarStyle.width;\n diffY =\n target.attribute.y + taskbarHeight / 2 - (linkedFromTaskShowIndex + 0.5) * gantt.parsedOptions.rowHeight;\n } else {\n linkedFromTaskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index);\n linkedToTaskShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index);\n if (linkedFromTaskShowIndex === -1 || linkedToTaskShowIndex === -1) {\n continue;\n }\n ({\n startDate: linkedToTaskStartDate,\n endDate: linkedToTaskEndDate,\n taskDays: linkedToTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedToTaskShowIndex));\n ({\n startDate: linkedFromTaskStartDate,\n endDate: linkedFromTaskEndDate,\n taskDays: linkedFromTaskTaskDays\n } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskShowIndex));\n }\n const { linePoints, arrowPoints } = updateLinkLinePoints(\n type,\n linkedFromTaskStartDate,\n linkedFromTaskEndDate,\n linkedFromTaskShowIndex,\n linkedFromTaskTaskDays,\n linkedFromTaskRecord.record.type === 'milestone',\n target,\n diffY ?? 0,\n linkedToTaskStartDate,\n linkedToTaskEndDate,\n linkedToTaskShowIndex,\n linkedToTaskTaskDays,\n linkedToTaskRecord.record.type === 'milestone',\n null,\n 0,\n this._gantt\n );\n if (\n !linkedFromTaskStartDate ||\n !linkedFromTaskEndDate ||\n !linkedToTaskStartDate ||\n !linkedToTaskEndDate ||\n !linkLineNode ||\n !lineArrowNode\n ) {\n return;\n }\n linkLineNode.setAttribute('points', linePoints);\n lineArrowNode.setAttribute('points', arrowPoints);\n }\n }\n}\n"]}
@@ -258,9 +258,9 @@ class StateManager {
258
258
  const x1 = this._gantt.eventManager.lastDragPointerXYOnWindow.x, dx = e.x - x1, taskBarGroup = this._gantt.stateManager.resizeTaskBar.target;
259
259
  taskBarGroup.setAttribute("zIndex", 1e4);
260
260
  const clipGroupBox = taskBarGroup.clipGroupBox, rect = taskBarGroup.barRect, progressRect = taskBarGroup.progressRect, textLabel = taskBarGroup.textLabel, progressField = this._gantt.parsedOptions.progressField, taskIndex = taskBarGroup.task_index, sub_task_index = taskBarGroup.sub_task_index, progress = this._gantt.getRecordByIndex(taskIndex, sub_task_index)[progressField];
261
- let diffWidth = "left" === this._gantt.stateManager.resizeTaskBar.onIconName ? -dx : dx, taskBarSize = taskBarGroup.attribute.width + diffWidth;
262
- diffWidth < 0 && taskBarSize <= this._gantt.parsedOptions.timelineColWidth && (diffWidth = this._gantt.parsedOptions.timelineColWidth - taskBarGroup.attribute.width,
263
- taskBarSize += diffWidth), resizeOrMoveTaskBar(taskBarGroup, "left" === this._gantt.stateManager.resizeTaskBar.onIconName ? -diffWidth : 0, 0, taskBarSize, this),
261
+ let diffWidth = "left" === this._gantt.stateManager.resizeTaskBar.onIconName ? -dx : dx;
262
+ const taskBarSize = Math.max(1, taskBarGroup.attribute.width + diffWidth);
263
+ diffWidth = taskBarSize - taskBarGroup.attribute.width, resizeOrMoveTaskBar(taskBarGroup, "left" === this._gantt.stateManager.resizeTaskBar.onIconName ? -diffWidth : 0, 0, taskBarSize, this),
264
264
  clipGroupBox.setAttribute("width", taskBarGroup.attribute.width), null == rect || rect.setAttribute("width", taskBarGroup.attribute.width),
265
265
  null == progressRect || progressRect.setAttribute("width", progress / 100 * taskBarGroup.attribute.width),
266
266
  null == textLabel || textLabel.setAttribute("maxLineWidth", taskBarSize - 2 * task_bar_1.TASKBAR_HOVER_ICON_WIDTH),