@wimi/vtable-gantt 1.0.1 → 1.0.3
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/event/scroll.js +1 -2
- package/cjs/event/touch.js +1 -0
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/grid.js +3 -3
- package/cjs/scenegraph/grid.js.map +1 -1
- package/cjs/scenegraph/timeline-header.js +2 -1
- package/cjs/state/state-manager.js +0 -1
- package/cjs/ts-types/gantt-engine.js +1 -2
- package/cjs/zoom-scale/ZoomScaleManager.js +2 -1
- package/dist/vtable-gantt.js +3 -2
- package/dist/vtable-gantt.min.js +2 -2
- package/es/event/scroll.js +1 -2
- package/es/event/touch.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/grid.js +3 -3
- package/es/scenegraph/grid.js.map +1 -1
- package/es/scenegraph/timeline-header.js +2 -1
- package/es/state/state-manager.js +1 -2
- package/es/ts-types/gantt-engine.js +1 -2
- package/es/zoom-scale/ZoomScaleManager.js +2 -1
- package/package.json +3 -3
package/cjs/event/scroll.js
CHANGED
|
@@ -108,5 +108,4 @@ function bindScrollBarListener(eventManager) {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
exports.handleWhell = handleWhell, exports.isVerticalScrollable = isVerticalScrollable,
|
|
111
|
-
exports.isHorizontalScrollable = isHorizontalScrollable, exports.bindScrollBarListener = bindScrollBarListener;
|
|
112
|
-
//# sourceMappingURL=scroll.js.map
|
|
111
|
+
exports.isHorizontalScrollable = isHorizontalScrollable, exports.bindScrollBarListener = bindScrollBarListener;
|
package/cjs/event/touch.js
CHANGED
package/cjs/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ import * as tools from './tools';
|
|
|
6
6
|
import * as VRender from './vrender';
|
|
7
7
|
import * as VTable from './vtable';
|
|
8
8
|
import * as plugins from './plugins';
|
|
9
|
-
export declare const version = "1.0.
|
|
9
|
+
export declare const version = "1.0.3";
|
|
10
10
|
export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable, plugins };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,OAAO,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';\nimport * as plugins from './plugins';\nexport const version = \"1.0.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,OAAO,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';\nimport * as plugins from './plugins';\nexport const version = \"1.0.3\";\n/**\n * @namespace VTableGantt\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 plugins\n};\n"]}
|
package/cjs/scenegraph/grid.js
CHANGED
|
@@ -21,8 +21,8 @@ class Grid {
|
|
|
21
21
|
clip: !0,
|
|
22
22
|
fill: null === (_a = scene._gantt.parsedOptions.grid) || void 0 === _a ? void 0 : _a.backgroundColor
|
|
23
23
|
}), this.group.name = "grid-container", scene.ganttGroup.addChild(this.group), this.createHorizontalBackgroundRects(),
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
24
|
+
this.createVerticalLines(), this.createHorizontalLines(), this.createTimeLineHeaderBottomLine(),
|
|
25
|
+
this.createCellBackgroundRects();
|
|
26
26
|
}
|
|
27
27
|
createTimeLineHeaderBottomLine() {
|
|
28
28
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -288,7 +288,7 @@ class Grid {
|
|
|
288
288
|
}), this.rowCount = this._scene._gantt.itemCount, this.allGridWidth = this._scene._gantt.getAllDateColsWidth(),
|
|
289
289
|
this.allGridHeight = this._scene._gantt.getAllTaskBarsHeight(), this.group.removeAllChild(),
|
|
290
290
|
this.createVerticalBackgroundRects(), this.createHorizontalBackgroundRects(), this.createVerticalLines(),
|
|
291
|
-
this.createHorizontalLines(), this.createTimeLineHeaderBottomLine();
|
|
291
|
+
this.createHorizontalLines(), this.createTimeLineHeaderBottomLine(), this.createCellBackgroundRects();
|
|
292
292
|
}
|
|
293
293
|
setX(x) {
|
|
294
294
|
var _a, _b, _c, _d, _e;
|
|
@@ -1 +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,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,CAAC,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;QACvD,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACzD,IAAI,CAAC,KAAK,GAAG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AAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC7C,MAAA,IAAI,CAAC,mBAAmB,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC/C,MAAA,IAAI,CAAC,4BAA4B,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACxD,MAAA,IAAI,CAAC,8BAA8B,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC1D,MAAA,IAAI,CAAC,wBAAwB,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACtD,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;AApdD,oBAodC","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';\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"]}
|
|
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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AS,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;AAhdD,oBAgdC","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';\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.createVerticalLines();\n this.createHorizontalLines();\n this.createTimeLineHeaderBottomLine();\n this.createCellBackgroundRects();\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 // 取第一层时间刻度(reverseSortedTimelineScales[0])\n const scale = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0];\n const timelineDates = scale?.timelineDates ?? [];\n const colCount = timelineDates.length;\n const timelineColWidth: number = this._scene._gantt.parsedOptions.timelineColWidth;\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 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 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 this.createCellBackgroundRects();\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"]}
|
|
@@ -14,5 +14,4 @@ function(DependencyType) {
|
|
|
14
14
|
TasksShowMode.Sub_Tasks_Compact = "sub_tasks_compact", TasksShowMode.Project_Sub_Tasks_Inline = "project_sub_tasks_inline";
|
|
15
15
|
}(TasksShowMode = exports.TasksShowMode || (exports.TasksShowMode = {})), function(TaskType) {
|
|
16
16
|
TaskType.TASK = "task", TaskType.PROJECT = "project", TaskType.MILESTONE = "milestone";
|
|
17
|
-
}(TaskType = exports.TaskType || (exports.TaskType = {}));
|
|
18
|
-
//# sourceMappingURL=gantt-engine.js.map
|
|
17
|
+
}(TaskType = exports.TaskType || (exports.TaskType = {}));
|
package/dist/vtable-gantt.js
CHANGED
|
@@ -35368,10 +35368,10 @@
|
|
|
35368
35368
|
this.group.name = 'grid-container';
|
|
35369
35369
|
scene.ganttGroup.addChild(this.group);
|
|
35370
35370
|
this.createHorizontalBackgroundRects();
|
|
35371
|
-
this.createCellBackgroundRects();
|
|
35372
35371
|
this.createVerticalLines();
|
|
35373
35372
|
this.createHorizontalLines();
|
|
35374
35373
|
this.createTimeLineHeaderBottomLine();
|
|
35374
|
+
this.createCellBackgroundRects();
|
|
35375
35375
|
}
|
|
35376
35376
|
createTimeLineHeaderBottomLine() {
|
|
35377
35377
|
const options = this._scene._gantt.parsedOptions;
|
|
@@ -35704,6 +35704,7 @@
|
|
|
35704
35704
|
this.createVerticalLines();
|
|
35705
35705
|
this.createHorizontalLines();
|
|
35706
35706
|
this.createTimeLineHeaderBottomLine();
|
|
35707
|
+
this.createCellBackgroundRects();
|
|
35707
35708
|
}
|
|
35708
35709
|
setX(x) {
|
|
35709
35710
|
this.verticalLineGroup?.setAttribute('x', x);
|
|
@@ -76315,7 +76316,7 @@
|
|
|
76315
76316
|
PluginManager: PluginManager
|
|
76316
76317
|
});
|
|
76317
76318
|
|
|
76318
|
-
const version = "1.0.
|
|
76319
|
+
const version = "1.0.3";
|
|
76319
76320
|
|
|
76320
76321
|
exports.Gantt = Gantt;
|
|
76321
76322
|
exports.TYPES = index$4;
|