@visactor/vtable-gantt 1.23.1 → 1.23.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.
@@ -83,4 +83,5 @@ function isTouchEvent(e) {
83
83
  return !!e.changedTouches;
84
84
  }
85
85
 
86
+ //# sourceMappingURL=touch.js.map
86
87
  exports.bindTouchListener = bindTouchListener;
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.23.1";
9
+ export declare const version = "1.23.2";
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
@@ -56,5 +56,5 @@ exports.VTable = VTable;
56
56
 
57
57
  const plugins = __importStar(require("./plugins"));
58
58
 
59
- exports.plugins = plugins, exports.version = "1.23.1";
59
+ exports.plugins = plugins, exports.version = "1.23.2";
60
60
  //# sourceMappingURL=index.js.map
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,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';\nimport * as plugins from './plugins';\nexport const version = \"1.23.1\";\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"]}
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,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';\nimport * as plugins from './plugins';\nexport const version = \"1.23.2\";\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"]}
@@ -11,5 +11,4 @@ Object.defineProperty(exports, "PluginManager", {
11
11
  get: function() {
12
12
  return plugin_manager_1.PluginManager;
13
13
  }
14
- });
15
- //# sourceMappingURL=index.js.map
14
+ });
@@ -89,6 +89,7 @@ function _syncTableSize(gantt) {
89
89
  gantt._updateSize(), (0, gantt_helper_1.updateSplitLineAndResizeLine)(gantt), gantt.zoomScaleManager && gantt.zoomScaleManager.handleTableWidthChange());
90
90
  }
91
91
 
92
+ //# sourceMappingURL=gantt-table-sync.js.map
92
93
  exports.syncScrollStateToTable = syncScrollStateToTable, exports.syncScrollStateFromTable = syncScrollStateFromTable,
93
94
  exports.syncEditCellFromTable = syncEditCellFromTable, exports.syncTreeChangeFromTable = syncTreeChangeFromTable,
94
95
  exports.syncSortFromTable = syncSortFromTable, exports.syncDragOrderFromTable = syncDragOrderFromTable,
@@ -630,5 +630,4 @@ function resizeTaskBar(target, dx, newWidth, state) {
630
630
  state._gantt.scenegraph.refreshRecordLinkNodes(taskIndex, sub_task_index, target, 0);
631
631
  }
632
632
 
633
- //# sourceMappingURL=state-manager.js.map
634
633
  exports.StateManager = StateManager;
@@ -23,10 +23,12 @@ export declare class DataZoomIntegration {
23
23
  private isUpdatingFromDataZoom;
24
24
  private isUpdatingFromGantt;
25
25
  private lastDataZoomState;
26
+ private lastSpanLimits;
26
27
  private cleanupCallbacks;
27
28
  private resizeTimeout;
28
29
  private isInitializing;
29
30
  constructor(gantt: Gantt, config: DataZoomConfig);
31
+ private syncDataZoomToGanttView;
30
32
  private getContainerId;
31
33
  private initializeDataZoom;
32
34
  private setupEventListeners;
@@ -11,9 +11,21 @@ class DataZoomIntegration {
11
11
  this.isUpdatingFromDataZoom = !1, this.isUpdatingFromGantt = !1, this.lastDataZoomState = {
12
12
  start: .2,
13
13
  end: .5
14
- }, this.cleanupCallbacks = [], this.resizeTimeout = null, this.isInitializing = !0,
15
- this.gantt = gantt, this.initializeDataZoom(config), this.setupEventListeners(),
16
- this.updateDataZoomLimits();
14
+ }, this.lastSpanLimits = null, this.cleanupCallbacks = [], this.resizeTimeout = null,
15
+ this.isInitializing = !0, this.gantt = gantt, this.initializeDataZoom(config), this.setupEventListeners(),
16
+ setTimeout((() => {
17
+ this.updateDataZoomLimits(), this.syncDataZoomToGanttView();
18
+ }), 0);
19
+ }
20
+ syncDataZoomToGanttView() {
21
+ var _a, _b, _c;
22
+ try {
23
+ const scrollLeft = (null === (_a = this.gantt.stateManager) || void 0 === _a ? void 0 : _a.scrollLeft) || 0, totalWidth = (null === (_c = (_b = this.gantt).getAllDateColsWidth) || void 0 === _c ? void 0 : _c.call(_b)) || 0, viewportWidth = this.gantt.tableNoFrameWidth || 0;
24
+ if (totalWidth > 0 && viewportWidth > 0) {
25
+ const start = Math.max(0, Math.min(1, scrollLeft / totalWidth)), end = Math.max(0, Math.min(1, (scrollLeft + viewportWidth) / totalWidth));
26
+ this.dataZoomAxis.setStartAndEnd(start, end);
27
+ }
28
+ } catch (error) {}
17
29
  }
18
30
  getContainerId(providedId) {
19
31
  if (providedId) return providedId;
@@ -104,12 +116,10 @@ class DataZoomIntegration {
104
116
  let start = null !== (_c = null !== (_a = event.start) && void 0 !== _a ? _a : null === (_b = event.detail) || void 0 === _b ? void 0 : _b.start) && void 0 !== _c ? _c : null === (_e = null === (_d = event.currentTarget) || void 0 === _d ? void 0 : _d.attribute) || void 0 === _e ? void 0 : _e.start, end = null !== (_h = null !== (_f = event.end) && void 0 !== _f ? _f : null === (_g = event.detail) || void 0 === _g ? void 0 : _g.end) && void 0 !== _h ? _h : null === (_k = null === (_j = event.currentTarget) || void 0 === _j ? void 0 : _j.attribute) || void 0 === _k ? void 0 : _k.end;
105
117
  void 0 !== start && void 0 !== end || (start = this.dataZoomAxis.attribute.start,
106
118
  end = this.dataZoomAxis.attribute.end), void 0 === start || void 0 === end || isNaN(start) || isNaN(end) || this.applyDataZoomRangeToGantt(start, end),
107
- setTimeout((() => {
108
- this.isUpdatingFromDataZoom = !1;
109
- }), 50);
119
+ this.updateDataZoomLimits(), this.isUpdatingFromDataZoom = !1;
110
120
  };
111
- this.dataZoomAxis.addEventListener("change", dataZoomChangeHandler), this.cleanupCallbacks.push((() => {
112
- this.dataZoomAxis.removeEventListener("change", dataZoomChangeHandler);
121
+ this.dataZoomAxis.addEventListener("dataZoomChange", dataZoomChangeHandler), this.cleanupCallbacks.push((() => {
122
+ this.dataZoomAxis.removeEventListener("dataZoomChange", dataZoomChangeHandler);
113
123
  }));
114
124
  const ganttScrollHandler = event => {
115
125
  if (this.isUpdatingFromDataZoom) return;
@@ -117,25 +127,22 @@ class DataZoomIntegration {
117
127
  this.isUpdatingFromGantt = !0;
118
128
  const boundaries = this.getGanttViewBoundaries();
119
129
  this.dataZoomAxis.setStartAndEnd(boundaries.startRatio, boundaries.endRatio), this.stage.render(),
120
- setTimeout((() => {
121
- this.dataZoomAxis.setAttribute("disableTriggerEvent", !1), this.isUpdatingFromGantt = !1;
122
- }), 10);
130
+ this.dataZoomAxis.setAttribute("disableTriggerEvent", !1), this.isUpdatingFromGantt = !1;
123
131
  };
124
132
  this.gantt.addEventListener("scroll", ganttScrollHandler), this.cleanupCallbacks.push((() => {
125
133
  this.gantt.removeEventListener("scroll", ganttScrollHandler);
126
134
  }));
127
135
  const windowResizeHandler = () => {
128
136
  clearTimeout(this.resizeTimeout), this.resizeTimeout = setTimeout((() => {
129
- this.updateResponsive(), this.updateDataZoomLimits();
130
- }), 50);
137
+ this.updateDataZoomLimits(), this.updateResponsive();
138
+ }), 70);
131
139
  };
132
140
  window.addEventListener("resize", windowResizeHandler), this.cleanupCallbacks.push((() => {
133
141
  window.removeEventListener("resize", windowResizeHandler), this.resizeTimeout && clearTimeout(this.resizeTimeout);
134
142
  }));
135
143
  const ganttZoomHandler = () => {
136
- setTimeout((() => {
137
- this.updateDataZoomLimits(), this.isUpdatingFromDataZoom || this.syncToDataZoom();
138
- }), 50);
144
+ this.isUpdatingFromDataZoom || (this.isUpdatingFromGantt = !0, this.updateDataZoomLimits(),
145
+ this.isUpdatingFromDataZoom || this.syncToDataZoom(), this.isUpdatingFromGantt = !1);
139
146
  };
140
147
  this.gantt.addEventListener("zoom", ganttZoomHandler), this.cleanupCallbacks.push((() => {
141
148
  this.gantt.removeEventListener("zoom", ganttZoomHandler);
@@ -157,10 +164,17 @@ class DataZoomIntegration {
157
164
  }
158
165
  updateDataZoomLimits() {
159
166
  const limits = this.calculateDataZoomLimits();
167
+ if (!(!this.lastSpanLimits || limits.minRangeRatio !== this.lastSpanLimits.minSpan || limits.maxRangeRatio !== this.lastSpanLimits.maxSpan)) return;
168
+ const start = this.lastDataZoomState.start, end = this.lastDataZoomState.end;
160
169
  this.dataZoomAxis.setAttributes({
170
+ minSpan: limits.minRangeRatio,
171
+ maxSpan: limits.maxRangeRatio,
172
+ start: start,
173
+ end: end
174
+ }), this.lastSpanLimits = {
161
175
  minSpan: limits.minRangeRatio,
162
176
  maxSpan: limits.maxRangeRatio
163
- }), this.stage.render();
177
+ }, this.stage.render();
164
178
  }
165
179
  getGanttViewBoundaries() {
166
180
  const scrollLeft = this.gantt.stateManager.scrollLeft, totalWidth = this.gantt.getAllDateColsWidth(), viewportWidth = this.gantt.tableNoFrameWidth;
@@ -238,9 +252,7 @@ class DataZoomIntegration {
238
252
  const taskTableWidth = this.gantt.taskTableWidth || 0, newWidth = ganttContainer.offsetWidth - taskTableWidth;
239
253
  this.resize(newWidth);
240
254
  const defaultX = this.gantt.taskTableWidth || 0;
241
- this.updatePosition(defaultX, 0), setTimeout((() => {
242
- this.syncToDataZoom();
243
- }), 10);
255
+ this.updatePosition(defaultX, 0), this.syncToDataZoom();
244
256
  }
245
257
  updatePosition(x, y) {
246
258
  var _a;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/zoom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AI,OAAO,CAAC,EAAE,KAAK,iBAAiB,IAAI,OAAO,CAAC,UAAU,EAAE;gBAErE,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;aACzC;iBAAM;gBAEL,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAClC;SACF;QAED,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;SACtB;IACH,CAAC;CACF;AA9hBD,kDA8hBC","file":"DataZoomIntegration.js","sourcesContent":["import type { Gantt } from '../Gantt';\nimport { DataZoom, createStage, vglobal } from '@visactor/vtable/es/vrender';\n\nexport interface DataZoomConfig {\n /** DataZoom 容器 ID(可选,如果不提供会自动从 Gantt 实例获取) */\n containerId?: string;\n /** DataZoom 初始开始位置 (0-1) */\n start?: number;\n /** DataZoom 初始结束位置 (0-1) */\n end?: number;\n /** DataZoom 宽度 */\n width?: number;\n /** DataZoom 高度 */\n height?: number;\n /** X 坐标 */\n x?: number;\n /** Y 坐标 */\n y?: number;\n /** 事件触发延迟时间 */\n delayTime?: number;\n}\n\nexport interface DataZoomLimits {\n minRangeRatio: number;\n maxRangeRatio: number;\n minMillisecondsPerPixel: number;\n maxMillisecondsPerPixel: number;\n}\n\n/**\n * DataZoom 与 Gantt 集成管理器\n * 负责 DataZoom 组件与 Gantt 图表的双向同步\n */\nexport class DataZoomIntegration {\n private gantt: Gantt;\n private dataZoomAxis: DataZoom;\n private stage: any;\n private canvas: HTMLCanvasElement;\n private isUpdatingFromDataZoom = false;\n private isUpdatingFromGantt = false;\n private lastDataZoomState = { start: 0.2, end: 0.5 };\n private cleanupCallbacks: (() => void)[] = [];\n private resizeTimeout: NodeJS.Timeout | null = null;\n private isInitializing = true;\n\n constructor(gantt: Gantt, config: DataZoomConfig) {\n this.gantt = gantt;\n this.initializeDataZoom(config);\n this.setupEventListeners();\n this.updateDataZoomLimits();\n }\n\n /**\n * 获取容器 ID\n */\n private getContainerId(providedId?: string): string {\n if (providedId) {\n return providedId;\n }\n\n // 尝试从 Gantt 实例获取容器 ID\n const ganttContainer = (this.gantt as any).container;\n if (ganttContainer?.id) {\n return ganttContainer.id;\n }\n\n const ganttElements = document.querySelectorAll(\n '[id*=\"gantt\"], [id*=\"table\"], [class*=\"gantt\"], [class*=\"vtable\"]'\n );\n if (ganttElements.length > 0) {\n const element = ganttElements[0] as HTMLElement;\n if (element.id) {\n return element.id;\n }\n }\n\n // 生成默认 ID\n return 'vTable';\n }\n\n /**\n * 初始化 DataZoom 组件\n */\n private initializeDataZoom(config: DataZoomConfig): void {\n // 自动获取容器 ID\n const containerId = this.getContainerId(config.containerId);\n const container = document.getElementById(containerId);\n if (!container) {\n throw new Error(`DataZoom container with ID \"${containerId}\" not found`);\n }\n\n // 获取甘特图容器(VTable 容器)\n const ganttContainer = this.gantt.container as HTMLElement;\n if (!ganttContainer) {\n throw new Error('Gantt container not found');\n }\n\n // 计算 DataZoom 的默认宽度:甘特图容器宽度减去左侧表头宽度\n const taskTableWidth = this.gantt.taskTableWidth || 0;\n const ganttContainerWidth = ganttContainer.offsetWidth || 1000;\n const defaultWidth = ganttContainerWidth - taskTableWidth;\n\n // 计算默认 x 坐标,排除左侧表头宽度\n const defaultX = this.gantt.taskTableWidth || 0;\n\n const {\n start = 0.2,\n end = 0.5,\n width = defaultWidth, // 默认使用容器宽度\n height = 30,\n x = defaultX, // 默认排除左侧表头宽度,与时间轴内容区域对齐\n y = 0, // 默认贴着容器底部\n delayTime = 10\n } = config;\n\n // 确保 VTable 容器有相对定位\n const containerStyle = window.getComputedStyle(ganttContainer);\n if (containerStyle.position === 'static') {\n ganttContainer.style.position = 'relative';\n }\n\n const dataZoomWrapper = document.createElement('div');\n dataZoomWrapper.id = 'dataZoomWrapper';\n dataZoomWrapper.style.cssText = `\n width: 100%;\n height: ${height}px;\n position: absolute;\n bottom: ${y}px;\n left: 0px;\n background: transparent;\n overflow: visible;\n pointer-events: none;\n z-index: 1000;\n `;\n\n // 创建独立的 Canvas 和 Stage\n this.canvas = document.createElement('canvas');\n this.canvas.id = 'dataZoomCanvas';\n this.canvas.width = width;\n this.canvas.height = height;\n\n this.canvas.style.cssText = `\n width: ${width}px;\n height: ${height}px;\n position: absolute;\n top: 0px;\n left: ${x}px;\n pointer-events: auto;\n `;\n\n // 将 Canvas 添加到包装器,再将包装器添加到 VTable 容器\n dataZoomWrapper.appendChild(this.canvas);\n ganttContainer.appendChild(dataZoomWrapper);\n\n this.stage = createStage({\n canvas: this.canvas,\n width,\n height,\n autoRender: true\n });\n\n // 创建 DataZoom 实例\n this.dataZoomAxis = new DataZoom({\n start,\n end,\n position: { x: 0, y: 0 },\n size: { width, height: height - 1 },\n showDetail: false,\n delayTime,\n brushSelect: false,\n backgroundChartStyle: {\n line: { visible: true, stroke: '#ddd' },\n area: { visible: true, fill: '#f5f5f5' }\n },\n startHandlerStyle: {\n symbolType:\n 'M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\\n' +\n 'C-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1' +\n 'v-2.6\\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,' +\n '0-0.1,0-0.1v-2.6\\nC0.3-1.4,0.3-1.4,0.3-1.4z;',\n fill: '#fff',\n size: config.width ?? 30,\n stroke: '#c2c8cf',\n lineWidth: 1\n },\n endHandlerStyle: {\n symbolType:\n 'M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\\n' +\n 'C-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1' +\n 'v-2.6\\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,' +\n '0-0.1,0-0.1v-2.6\\nC0.3-1.4,0.3-1.4,0.3-1.4z;',\n fill: '#fff',\n size: config.width ?? 30,\n stroke: '#c2c8cf',\n lineWidth: 1\n },\n middleHandlerStyle: {\n visible: false\n }\n });\n\n this.stage.defaultLayer.add(this.dataZoomAxis as any);\n\n vglobal.getRequestAnimationFrame()(() => {\n if (this.isInitializing) {\n const boundaries = this.getGanttViewBoundaries();\n this.dataZoomAxis.setStartAndEnd(boundaries.startRatio, boundaries.endRatio);\n this.isInitializing = false;\n }\n this.stage.render();\n });\n\n this.lastDataZoomState = { start, end };\n }\n\n /**\n * 设置事件监听器\n */\n private setupEventListeners(): void {\n // DataZoom 变化时同步到 Gantt\n const dataZoomChangeHandler = (event: any) => {\n if (this.isUpdatingFromGantt) {\n return;\n }\n\n this.isUpdatingFromDataZoom = true;\n\n let start = event.start ?? event.detail?.start ?? event.currentTarget?.attribute?.start;\n let end = event.end ?? event.detail?.end ?? event.currentTarget?.attribute?.end;\n\n if (start === undefined || end === undefined) {\n start = this.dataZoomAxis.attribute.start;\n end = this.dataZoomAxis.attribute.end;\n }\n\n if (start !== undefined && end !== undefined && !isNaN(start) && !isNaN(end)) {\n this.applyDataZoomRangeToGantt(start, end);\n }\n\n setTimeout(() => {\n this.isUpdatingFromDataZoom = false;\n }, 50);\n };\n\n this.dataZoomAxis.addEventListener('change', dataZoomChangeHandler);\n this.cleanupCallbacks.push(() => {\n this.dataZoomAxis.removeEventListener('change', dataZoomChangeHandler);\n });\n\n // Gantt 滚动时同步到 DataZoom\n const ganttScrollHandler = (event: any) => {\n if (this.isUpdatingFromDataZoom) {\n return;\n }\n if (event.scrollDirection !== 'horizontal') {\n return;\n }\n\n this.isUpdatingFromGantt = true;\n const boundaries = this.getGanttViewBoundaries();\n this.dataZoomAxis.setStartAndEnd(boundaries.startRatio, boundaries.endRatio);\n\n this.stage.render();\n\n setTimeout(() => {\n this.dataZoomAxis.setAttribute('disableTriggerEvent', false);\n this.isUpdatingFromGantt = false;\n }, 10);\n };\n\n this.gantt.addEventListener('scroll', ganttScrollHandler);\n this.cleanupCallbacks.push(() => {\n this.gantt.removeEventListener('scroll', ganttScrollHandler);\n });\n\n // 窗口大小变化时的响应式更新\n const windowResizeHandler = () => {\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = setTimeout(() => {\n this.updateResponsive();\n this.updateDataZoomLimits();\n }, 50);\n };\n\n window.addEventListener('resize', windowResizeHandler);\n this.cleanupCallbacks.push(() => {\n window.removeEventListener('resize', windowResizeHandler);\n if (this.resizeTimeout) {\n clearTimeout(this.resizeTimeout);\n }\n });\n\n // 监听 Gantt 的缩放事件,重新计算限制并同步 DataZoom 位置\n const ganttZoomHandler = () => {\n setTimeout(() => {\n this.updateDataZoomLimits();\n // 同步 DataZoom 位置到当前 Gantt 视图\n if (!this.isUpdatingFromDataZoom) {\n this.syncToDataZoom();\n }\n }, 50);\n };\n\n this.gantt.addEventListener('zoom', ganttZoomHandler);\n this.cleanupCallbacks.push(() => {\n this.gantt.removeEventListener('zoom', ganttZoomHandler);\n });\n }\n\n /**\n * 计算 DataZoom 的合理范围限制\n */\n private calculateDataZoomLimits(): DataZoomLimits {\n // 获取 Gantt 的缩放限制\n let minMillisecondsPerPixel: number;\n let maxMillisecondsPerPixel: number;\n\n if (this.gantt.zoomScaleManager) {\n minMillisecondsPerPixel = this.gantt.zoomScaleManager.getGlobalMinMillisecondsPerPixel?.() || 1000;\n maxMillisecondsPerPixel = this.gantt.zoomScaleManager.getGlobalMaxMillisecondsPerPixel?.() || 6000000;\n } else {\n minMillisecondsPerPixel = this.gantt.parsedOptions.zoom?.minMillisecondsPerPixel ?? 1000;\n maxMillisecondsPerPixel = this.gantt.parsedOptions.zoom?.maxMillisecondsPerPixel ?? 6000000;\n }\n\n // 获取关键参数\n const viewportWidth = this.gantt.tableNoFrameWidth; // 视口宽度(像素)\n const totalTimeRange = this.gantt.parsedOptions._maxDateTime - this.gantt.parsedOptions._minDateTime; // 总时间范围\n\n // 计算 minSpan:当使用 minMillisecondsPerPixel 时,视口能显示的时间范围占总时间的比例\n const minViewTimeRange = minMillisecondsPerPixel * viewportWidth; // 最小缩放时视口显示的时间范围\n const minRangeRatio = Math.min(1.0, minViewTimeRange / totalTimeRange);\n\n // 计算 maxSpan:当使用 maxMillisecondsPerPixel 时,视口能显示的时间范围占总时间的比例\n const maxViewTimeRange = maxMillisecondsPerPixel * viewportWidth; // 最大缩放时视口显示的时间范围\n const maxRangeRatio = Math.min(1.0, maxViewTimeRange / totalTimeRange);\n\n // 确保逻辑正确:minSpan < maxSpan\n const finalMinRangeRatio = Math.min(minRangeRatio, maxRangeRatio);\n const finalMaxRangeRatio = Math.max(minRangeRatio, maxRangeRatio);\n\n return {\n minRangeRatio: finalMinRangeRatio,\n maxRangeRatio: finalMaxRangeRatio,\n minMillisecondsPerPixel,\n maxMillisecondsPerPixel\n };\n }\n\n /**\n * 更新 DataZoom 的范围限制\n */\n private updateDataZoomLimits(): void {\n const limits = this.calculateDataZoomLimits();\n\n this.dataZoomAxis.setAttributes({\n minSpan: limits.minRangeRatio,\n maxSpan: limits.maxRangeRatio\n });\n\n this.stage.render();\n }\n\n /**\n * 获取 Gantt 视图边界信息\n */\n private getGanttViewBoundaries() {\n const scrollLeft = this.gantt.stateManager.scrollLeft;\n const totalWidth = this.gantt.getAllDateColsWidth();\n const viewportWidth = this.gantt.tableNoFrameWidth;\n\n const startRatio = Math.max(0, Math.min(1, scrollLeft / totalWidth));\n const endRatio = Math.max(0, Math.min(1, (scrollLeft + viewportWidth) / totalWidth));\n\n return {\n scrollLeft,\n totalWidth,\n viewportWidth,\n startRatio,\n endRatio\n };\n }\n\n /**\n * 将 DataZoom 范围应用到 Gantt 视图\n */\n private applyDataZoomRangeToGantt(start: number, end: number): void {\n if (start === undefined || end === undefined || isNaN(start) || isNaN(end)) {\n return;\n }\n\n // 更新状态记录\n this.lastDataZoomState = { start, end };\n\n // 获取当前 Gantt 的基础信息\n const currentViewportWidth = this.gantt.tableNoFrameWidth;\n const currentMillisecondsPerPixel = this.gantt.getCurrentMillisecondsPerPixel();\n const rangeRatio = end - start;\n\n // 根据 DataZoom 范围计算目标 millisecondsPerPixel\n const totalTimeRange = this.gantt.parsedOptions._maxDateTime - this.gantt.parsedOptions._minDateTime;\n const selectedTimeRange = totalTimeRange * rangeRatio;\n const targetMillisecondsPerPixel = selectedTimeRange / currentViewportWidth;\n\n // 应用新的 millisecondsPerPixel\n if (Math.abs(targetMillisecondsPerPixel - currentMillisecondsPerPixel) > currentMillisecondsPerPixel * 0.01) {\n if (this.gantt.zoomScaleManager) {\n const targetLevel = this.gantt.zoomScaleManager.findOptimalLevel(targetMillisecondsPerPixel);\n const currentLevel = this.gantt.zoomScaleManager.getCurrentLevel();\n\n if (targetLevel !== currentLevel) {\n this.gantt.zoomScaleManager.switchToLevel(targetLevel);\n }\n\n this.gantt.setMillisecondsPerPixel(targetMillisecondsPerPixel);\n } else {\n this.gantt.setMillisecondsPerPixel(targetMillisecondsPerPixel);\n }\n }\n\n // 重新计算滚动位置\n const newTotalWidth = this.gantt.getAllDateColsWidth();\n const targetScrollLeft = start * newTotalWidth;\n this.gantt.stateManager.setScrollLeft(targetScrollLeft);\n }\n\n /**\n * 同步初始位置\n */\n private syncInitialPosition(): void {\n setTimeout(() => {\n const boundaries = this.getGanttViewBoundaries();\n if (boundaries.startRatio > 0 || boundaries.endRatio < 1) {\n this.dataZoomAxis.setStartAndEnd(boundaries.startRatio, boundaries.endRatio);\n }\n }, 100);\n }\n\n /**\n * 手动同步 DataZoom 到 Gantt 当前视图\n */\n syncToGantt(): void {\n const start = this.dataZoomAxis.attribute.start || 0;\n const end = this.dataZoomAxis.attribute.end || 1;\n this.applyDataZoomRangeToGantt(start, end);\n }\n\n /**\n * 手动同步 Gantt 当前视图到 DataZoom\n */\n syncToDataZoom(): void {\n const boundaries = this.getGanttViewBoundaries();\n\n this.dataZoomAxis.setStartAndEnd(boundaries.startRatio, boundaries.endRatio);\n }\n\n /**\n * 私有方法:同步 DataZoom 范围到 Gantt\n */\n private syncToGanttWithState(start: number, end: number): void {\n this.isUpdatingFromDataZoom = true;\n this.applyDataZoomRangeToGantt(start, end);\n setTimeout(() => {\n this.isUpdatingFromDataZoom = false;\n }, 50);\n }\n\n /**\n * 设置 DataZoom 的范围\n */\n setRange(start: number, end: number): void {\n this.dataZoomAxis.setStartAndEnd(start, end);\n }\n\n /**\n * 获取 DataZoom 当前范围\n */\n getRange(): { start: number; end: number } {\n return {\n start: this.dataZoomAxis.attribute.start || 0,\n end: this.dataZoomAxis.attribute.end || 1\n };\n }\n\n /**\n * 更新 DataZoom 尺寸\n */\n resize(width?: number, height?: number): void {\n if (width === undefined) {\n // 使用甘特图容器而不是外部容器来计算宽度\n const ganttContainer = this.gantt.container as HTMLElement;\n if (ganttContainer) {\n const taskTableWidth = this.gantt.taskTableWidth || 0;\n width = ganttContainer.offsetWidth - taskTableWidth;\n } else {\n width = 1000;\n }\n }\n\n if (height === undefined) {\n height = 30;\n }\n\n this.canvas.width = width;\n this.canvas.height = height;\n this.canvas.style.width = `${width}px`;\n this.canvas.style.height = `${height}px`;\n\n this.stage.resize(width, height);\n this.dataZoomAxis.setAttributes({\n size: { width, height: height - 1 }\n });\n\n // 强制重新渲染\n this.stage.render();\n }\n\n /**\n * 响应式更新 DataZoom 大小和位置\n * 当容器大小或位置发生变化时调用\n */\n updateResponsive(): void {\n const ganttContainer = this.gantt.container as HTMLElement;\n if (!ganttContainer) {\n return;\n }\n\n // 计算新宽度:甘特图容器宽度减去左侧表头宽度\n const taskTableWidth = this.gantt.taskTableWidth || 0;\n const newWidth = ganttContainer.offsetWidth - taskTableWidth;\n\n this.resize(newWidth);\n\n // 更新位置(保持与时间轴内容区域对齐,排除左侧表头)\n const defaultX = this.gantt.taskTableWidth || 0;\n this.updatePosition(defaultX, 0);\n\n // 重新同步 DataZoom 状态,因为视图宽度变化会影响时间范围的显示比例\n setTimeout(() => {\n this.syncToDataZoom();\n }, 10);\n }\n\n /**\n * 更新 DataZoom 位置\n * 当容器位置发生变化时调用\n */\n updatePosition(x?: number, y?: number): void {\n const xPos = x ?? this.gantt.taskTableWidth ?? 0;\n this.canvas.style.left = `${xPos}px`;\n }\n\n /**\n * 销毁 DataZoom 集成\n */\n destroy(): void {\n this.cleanupCallbacks.forEach(cleanup => cleanup());\n this.cleanupCallbacks = [];\n\n // 清理包装器和 Canvas\n if (this.canvas && this.canvas.parentNode) {\n const wrapper = this.canvas.parentNode as HTMLElement;\n if (wrapper && wrapper.id === 'dataZoomWrapper' && wrapper.parentNode) {\n // 移除整个包装器\n wrapper.parentNode.removeChild(wrapper);\n } else {\n // 如果没有包装器,直接移除 Canvas\n wrapper.removeChild(this.canvas);\n }\n }\n\n if (this.stage) {\n this.stage.release();\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/zoom-scale/DataZoomIntegration.ts"],"names":[],"mappings":";;;AACA,yDAA6E;AAgC7E,MAAa,mBAAmB;IAa9B,YAAY,KAAY,EAAE,MAAsB;QARxC,2BAAsB,GAAG,KAAK,CAAC;QAC/B,wBAAmB,GAAG,KAAK,CAAC;QAC5B,sBAAiB,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;QAC7C,mBAAc,GAAgD,IAAI,CAAC;QACnE,qBAAgB,GAAmB,EAAE,CAAC;QACtC,kBAAa,GAA0B,IAAI,CAAC;QAC5C,mBAAc,GAAG,IAAI,CAAC;QAG5B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,kBAAkB,CAAC,MAA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CAAC;CACF;AAhlBD,kDAglBC","file":"DataZoomIntegration.js","sourcesContent":["import type { Gantt } from '../Gantt';\nimport { DataZoom, createStage, vglobal } from '@visactor/vtable/es/vrender';\n\nexport interface DataZoomConfig {\n /** DataZoom 容器 ID(可选,如果不提供会自动从 Gantt 实例获取) */\n containerId?: string;\n /** DataZoom 初始开始位置 (0-1) */\n start?: number;\n /** DataZoom 初始结束位置 (0-1) */\n end?: number;\n /** DataZoom 宽度 */\n width?: number;\n /** DataZoom 高度 */\n height?: number;\n /** X 坐标 */\n x?: number;\n /** Y 坐标 */\n y?: number;\n /** 事件触发延迟时间 */\n delayTime?: number;\n}\n\nexport interface DataZoomLimits {\n minRangeRatio: number;\n maxRangeRatio: number;\n minMillisecondsPerPixel: number;\n maxMillisecondsPerPixel: number;\n}\n\n/**\n * DataZoom 与 Gantt 集成管理器\n * 负责 DataZoom 组件与 Gantt 图表的双向同步\n */\nexport class DataZoomIntegration {\n private gantt: Gantt;\n private dataZoomAxis: DataZoom;\n private stage: any;\n private canvas: HTMLCanvasElement;\n private isUpdatingFromDataZoom = false;\n private isUpdatingFromGantt = false;\n private lastDataZoomState = { start: 0.2, end: 0.5 };\n private lastSpanLimits: { minSpan: number; maxSpan: number } | null = null;\n private cleanupCallbacks: (() => void)[] = [];\n private resizeTimeout: NodeJS.Timeout | null = null;\n private isInitializing = true;\n\n constructor(gantt: Gantt, config: DataZoomConfig) {\n this.gantt = gantt;\n this.initializeDataZoom(config);\n this.setupEventListeners();\n\n // 延迟初始化 limits 和同步位置,等待 Gantt 完全就绪\n setTimeout(() => {\n this.updateDataZoomLimits();\n this.syncDataZoomToGanttView();\n }, 0);\n }\n\n /**\n * 同步 DataZoom 位置到 Gantt 当前视图\n * 根据 Gantt 的实际滚动位置和视口大小,计算并设置 DataZoom 的 start/end\n */\n private syncDataZoomToGanttView(): void {\n try {\n const scrollLeft = this.gantt.stateManager?.scrollLeft || 0;\n const totalWidth = this.gantt.getAllDateColsWidth?.() || 0;\n const viewportWidth = this.gantt.tableNoFrameWidth || 0;\n\n if (totalWidth > 0 && viewportWidth > 0) {\n const start = Math.max(0, Math.min(1, scrollLeft / totalWidth));\n const end = Math.max(0, Math.min(1, (scrollLeft + viewportWidth) / totalWidth));\n\n this.dataZoomAxis.setStartAndEnd(start, end);\n }\n } catch (error) {\n console.warn('⚠️ 无法同步 DataZoom 位置:', error);\n }\n }\n\n /**\n * 获取容器 ID\n */\n private getContainerId(providedId?: string): string {\n if (providedId) {\n return providedId;\n }\n\n // 尝试从 Gantt 实例获取容器 ID\n const ganttContainer = (this.gantt as any).container;\n if (ganttContainer?.id) {\n return ganttContainer.id;\n }\n\n const ganttElements = document.querySelectorAll(\n '[id*=\"gantt\"], [id*=\"table\"], [class*=\"gantt\"], [class*=\"vtable\"]'\n );\n if (ganttElements.length > 0) {\n const element = ganttElements[0] as HTMLElement;\n if (element.id) {\n return element.id;\n }\n }\n\n // 生成默认 ID\n return 'vTable';\n }\n\n /**\n * 初始化 DataZoom 组件\n */\n private initializeDataZoom(config: DataZoomConfig): void {\n // 自动获取容器 ID\n const containerId = this.getContainerId(config.containerId);\n const container = document.getElementById(containerId);\n if (!container) {\n throw new Error(`DataZoom container with ID \"${containerId}\" not found`);\n }\n\n // 获取甘特图容器(VTable 容器)\n const ganttContainer = this.gantt.container as HTMLElement;\n if (!ganttContainer) {\n throw new Error('Gantt container not found');\n }\n\n // 计算 DataZoom 的默认宽度:甘特图容器宽度减去左侧表头宽度\n const taskTableWidth = this.gantt.taskTableWidth || 0;\n const ganttContainerWidth = ganttContainer.offsetWidth || 1000;\n const defaultWidth = ganttContainerWidth - taskTableWidth;\n\n // 计算默认 x 坐标,排除左侧表头宽度\n const defaultX = this.gantt.taskTableWidth || 0;\n\n const {\n start = 0.2,\n end = 0.5,\n width = defaultWidth, // 默认使用容器宽度\n height = 30,\n x = defaultX, // 默认排除左侧表头宽度,与时间轴内容区域对齐\n y = 0, // 默认贴着容器底部\n delayTime = 10\n } = config;\n\n // 确保 VTable 容器有相对定位\n const containerStyle = window.getComputedStyle(ganttContainer);\n if (containerStyle.position === 'static') {\n ganttContainer.style.position = 'relative';\n }\n\n const dataZoomWrapper = document.createElement('div');\n dataZoomWrapper.id = 'dataZoomWrapper';\n dataZoomWrapper.style.cssText = `\n width: 100%;\n height: ${height}px;\n position: absolute;\n bottom: ${y}px;\n left: 0px;\n background: transparent;\n overflow: visible;\n pointer-events: none;\n z-index: 1000;\n `;\n\n // 创建独立的 Canvas 和 Stage\n this.canvas = document.createElement('canvas');\n this.canvas.id = 'dataZoomCanvas';\n this.canvas.width = width;\n this.canvas.height = height;\n\n this.canvas.style.cssText = `\n width: ${width}px;\n height: ${height}px;\n position: absolute;\n top: 0px;\n left: ${x}px;\n pointer-events: auto;\n `;\n\n // 将 Canvas 添加到包装器,再将包装器添加到 VTable 容器\n dataZoomWrapper.appendChild(this.canvas);\n ganttContainer.appendChild(dataZoomWrapper);\n\n this.stage = createStage({\n canvas: this.canvas,\n width,\n height,\n autoRender: true\n });\n\n // 创建 DataZoom 实例\n this.dataZoomAxis = new DataZoom({\n start,\n end,\n position: { x: 0, y: 0 },\n size: { width, height: height - 1 },\n showDetail: false,\n delayTime,\n brushSelect: false,\n backgroundChartStyle: {\n line: { visible: true, stroke: '#ddd' },\n area: { visible: true, fill: '#f5f5f5' }\n },\n startHandlerStyle: {\n symbolType:\n 'M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\\n' +\n 'C-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1' +\n 'v-2.6\\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,' +\n '0-0.1,0-0.1v-2.6\\nC0.3-1.4,0.3-1.4,0.3-1.4z;',\n fill: '#fff',\n size: config.width ?? 30,\n stroke: '#c2c8cf',\n lineWidth: 1\n },\n endHandlerStyle: {\n symbolType:\n 'M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\\n' +\n 'C-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1' +\n 'v-2.6\\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,' +\n '0-0.1,0-0.1v-2.6\\nC0.3-1.4,0.3-1.4,0.3-1.4z;',\n fill: '#fff',\n size: config.width ?? 30,\n stroke: '#c2c8cf',\n lineWidth: 1\n },\n middleHandlerStyle: {\n visible: false\n }\n });\n\n this.stage.defaultLayer.add(this.dataZoomAxis as any);\n\n vglobal.getRequestAnimationFrame()(() => {\n if (this.isInitializing) {\n const boundaries = this.getGanttViewBoundaries();\n this.dataZoomAxis.setStartAndEnd(boundaries.startRatio, boundaries.endRatio);\n this.isInitializing = false;\n }\n this.stage.render();\n });\n\n this.lastDataZoomState = { start, end };\n }\n\n /**\n * 设置事件监听器\n */\n private setupEventListeners(): void {\n // DataZoom 变化时同步到 Gantt\n const dataZoomChangeHandler = (event: any) => {\n if (this.isUpdatingFromGantt) {\n return;\n }\n\n this.isUpdatingFromDataZoom = true;\n\n let start = event.start ?? event.detail?.start ?? event.currentTarget?.attribute?.start;\n let end = event.end ?? event.detail?.end ?? event.currentTarget?.attribute?.end;\n\n if (start === undefined || end === undefined) {\n start = this.dataZoomAxis.attribute.start;\n end = this.dataZoomAxis.attribute.end;\n }\n\n if (start !== undefined && end !== undefined && !isNaN(start) && !isNaN(end)) {\n this.applyDataZoomRangeToGantt(start, end);\n }\n this.updateDataZoomLimits();\n this.isUpdatingFromDataZoom = false;\n };\n\n this.dataZoomAxis.addEventListener('dataZoomChange', dataZoomChangeHandler);\n\n this.cleanupCallbacks.push(() => {\n this.dataZoomAxis.removeEventListener('dataZoomChange', dataZoomChangeHandler);\n });\n\n // Gantt 滚动时同步到 DataZoom\n const ganttScrollHandler = (event: any) => {\n if (this.isUpdatingFromDataZoom) {\n return;\n }\n if (event.scrollDirection !== 'horizontal') {\n return;\n }\n\n this.isUpdatingFromGantt = true;\n const boundaries = this.getGanttViewBoundaries();\n this.dataZoomAxis.setStartAndEnd(boundaries.startRatio, boundaries.endRatio);\n\n this.stage.render();\n\n this.dataZoomAxis.setAttribute('disableTriggerEvent', false);\n this.isUpdatingFromGantt = false;\n };\n\n this.gantt.addEventListener('scroll', ganttScrollHandler);\n this.cleanupCallbacks.push(() => {\n this.gantt.removeEventListener('scroll', ganttScrollHandler);\n });\n\n // 窗口大小变化时的响应式更新\n const windowResizeHandler = () => {\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = setTimeout(() => {\n this.updateDataZoomLimits();\n this.updateResponsive();\n }, 70);\n };\n\n window.addEventListener('resize', windowResizeHandler);\n this.cleanupCallbacks.push(() => {\n window.removeEventListener('resize', windowResizeHandler);\n if (this.resizeTimeout) {\n clearTimeout(this.resizeTimeout);\n }\n });\n\n // 监听 Gantt 的缩放事件,重新计算限制并同步 DataZoom 位置\n const ganttZoomHandler = () => {\n if (this.isUpdatingFromDataZoom) {\n return;\n }\n\n this.isUpdatingFromGantt = true;\n\n this.updateDataZoomLimits();\n\n // 同步 DataZoom 位置到当前 Gantt 视图\n if (!this.isUpdatingFromDataZoom) {\n this.syncToDataZoom();\n }\n\n this.isUpdatingFromGantt = false;\n };\n\n this.gantt.addEventListener('zoom', ganttZoomHandler);\n this.cleanupCallbacks.push(() => {\n this.gantt.removeEventListener('zoom', ganttZoomHandler);\n });\n }\n\n /**\n * 计算 DataZoom 的合理范围限制\n */\n private calculateDataZoomLimits(): DataZoomLimits {\n // 获取 Gantt 的缩放限制\n let minMillisecondsPerPixel: number;\n let maxMillisecondsPerPixel: number;\n\n if (this.gantt.zoomScaleManager) {\n minMillisecondsPerPixel = this.gantt.zoomScaleManager.getGlobalMinMillisecondsPerPixel?.() || 1000;\n maxMillisecondsPerPixel = this.gantt.zoomScaleManager.getGlobalMaxMillisecondsPerPixel?.() || 6000000;\n } else {\n minMillisecondsPerPixel = this.gantt.parsedOptions.zoom?.minMillisecondsPerPixel ?? 1000;\n maxMillisecondsPerPixel = this.gantt.parsedOptions.zoom?.maxMillisecondsPerPixel ?? 6000000;\n }\n\n // 获取关键参数\n const viewportWidth = this.gantt.tableNoFrameWidth; // 视口宽度(像素)\n const totalTimeRange = this.gantt.parsedOptions._maxDateTime - this.gantt.parsedOptions._minDateTime; // 总时间范围\n\n // 计算 minSpan:当使用 minMillisecondsPerPixel 时,视口能显示的时间范围占总时间的比例\n const minViewTimeRange = minMillisecondsPerPixel * viewportWidth; // 最小缩放时视口显示的时间范围\n const minRangeRatio = Math.min(1.0, minViewTimeRange / totalTimeRange);\n\n // 计算 maxSpan:当使用 maxMillisecondsPerPixel 时,视口能显示的时间范围占总时间的比例\n const maxViewTimeRange = maxMillisecondsPerPixel * viewportWidth; // 最大缩放时视口显示的时间范围\n const maxRangeRatio = Math.min(1.0, maxViewTimeRange / totalTimeRange);\n\n // 确保逻辑正确:minSpan < maxSpan\n const finalMinRangeRatio = Math.min(minRangeRatio, maxRangeRatio);\n const finalMaxRangeRatio = Math.max(minRangeRatio, maxRangeRatio);\n\n return {\n minRangeRatio: finalMinRangeRatio,\n maxRangeRatio: finalMaxRangeRatio,\n minMillisecondsPerPixel,\n maxMillisecondsPerPixel\n };\n }\n\n /**\n * 更新 DataZoom 的范围限制\n */\n private updateDataZoomLimits(): void {\n const limits = this.calculateDataZoomLimits();\n\n // 只在值改变时才更新,避免无效的 setAttributes 调用\n const hasChanged =\n !this.lastSpanLimits ||\n limits.minRangeRatio !== this.lastSpanLimits.minSpan ||\n limits.maxRangeRatio !== this.lastSpanLimits.maxSpan;\n\n if (!hasChanged) {\n return;\n }\n // 使用 lastDataZoomState 记录的当前位置\n const start = this.lastDataZoomState.start;\n const end = this.lastDataZoomState.end;\n\n this.dataZoomAxis.setAttributes({\n minSpan: limits.minRangeRatio,\n maxSpan: limits.maxRangeRatio,\n start,\n end\n });\n\n // 更新缓存\n this.lastSpanLimits = {\n minSpan: limits.minRangeRatio,\n maxSpan: limits.maxRangeRatio\n };\n\n this.stage.render();\n }\n\n /**\n * 获取 Gantt 视图边界信息\n */\n private getGanttViewBoundaries() {\n const scrollLeft = this.gantt.stateManager.scrollLeft;\n const totalWidth = this.gantt.getAllDateColsWidth();\n const viewportWidth = this.gantt.tableNoFrameWidth;\n\n const startRatio = Math.max(0, Math.min(1, scrollLeft / totalWidth));\n const endRatio = Math.max(0, Math.min(1, (scrollLeft + viewportWidth) / totalWidth));\n\n return {\n scrollLeft,\n totalWidth,\n viewportWidth,\n startRatio,\n endRatio\n };\n }\n\n /**\n * 将 DataZoom 范围应用到 Gantt 视图\n */\n private applyDataZoomRangeToGantt(start: number, end: number): void {\n if (start === undefined || end === undefined || isNaN(start) || isNaN(end)) {\n return;\n }\n\n // 更新状态记录\n this.lastDataZoomState = { start, end };\n\n // 获取当前 Gantt 的基础信息\n const currentViewportWidth = this.gantt.tableNoFrameWidth;\n const currentMillisecondsPerPixel = this.gantt.getCurrentMillisecondsPerPixel();\n const rangeRatio = end - start;\n\n // 根据 DataZoom 范围计算目标 millisecondsPerPixel\n const totalTimeRange = this.gantt.parsedOptions._maxDateTime - this.gantt.parsedOptions._minDateTime;\n const selectedTimeRange = totalTimeRange * rangeRatio;\n const targetMillisecondsPerPixel = selectedTimeRange / currentViewportWidth;\n\n // 应用新的 millisecondsPerPixel\n if (Math.abs(targetMillisecondsPerPixel - currentMillisecondsPerPixel) > currentMillisecondsPerPixel * 0.01) {\n if (this.gantt.zoomScaleManager) {\n const targetLevel = this.gantt.zoomScaleManager.findOptimalLevel(targetMillisecondsPerPixel);\n const currentLevel = this.gantt.zoomScaleManager.getCurrentLevel();\n\n if (targetLevel !== currentLevel) {\n this.gantt.zoomScaleManager.switchToLevel(targetLevel);\n }\n\n this.gantt.setMillisecondsPerPixel(targetMillisecondsPerPixel);\n } else {\n this.gantt.setMillisecondsPerPixel(targetMillisecondsPerPixel);\n }\n }\n\n // 重新计算滚动位置\n const newTotalWidth = this.gantt.getAllDateColsWidth();\n const targetScrollLeft = start * newTotalWidth;\n this.gantt.stateManager.setScrollLeft(targetScrollLeft);\n }\n\n /**\n * 同步初始位置\n */\n private syncInitialPosition(): void {\n setTimeout(() => {\n const boundaries = this.getGanttViewBoundaries();\n if (boundaries.startRatio > 0 || boundaries.endRatio < 1) {\n this.dataZoomAxis.setStartAndEnd(boundaries.startRatio, boundaries.endRatio);\n }\n }, 100);\n }\n\n /**\n * 手动同步 DataZoom 到 Gantt 当前视图\n */\n syncToGantt(): void {\n const start = this.dataZoomAxis.attribute.start || 0;\n const end = this.dataZoomAxis.attribute.end || 1;\n this.applyDataZoomRangeToGantt(start, end);\n }\n\n /**\n * 手动同步 Gantt 当前视图到 DataZoom\n */\n syncToDataZoom(): void {\n const boundaries = this.getGanttViewBoundaries();\n\n this.dataZoomAxis.setStartAndEnd(boundaries.startRatio, boundaries.endRatio);\n }\n\n /**\n * 私有方法:同步 DataZoom 范围到 Gantt\n */\n private syncToGanttWithState(start: number, end: number): void {\n this.isUpdatingFromDataZoom = true;\n this.applyDataZoomRangeToGantt(start, end);\n setTimeout(() => {\n this.isUpdatingFromDataZoom = false;\n }, 50);\n }\n\n /**\n * 设置 DataZoom 的范围\n */\n setRange(start: number, end: number): void {\n this.dataZoomAxis.setStartAndEnd(start, end);\n }\n\n /**\n * 获取 DataZoom 当前范围\n */\n getRange(): { start: number; end: number } {\n return {\n start: this.dataZoomAxis.attribute.start || 0,\n end: this.dataZoomAxis.attribute.end || 1\n };\n }\n\n /**\n * 更新 DataZoom 尺寸\n */\n resize(width?: number, height?: number): void {\n if (width === undefined) {\n // 使用甘特图容器而不是外部容器来计算宽度\n const ganttContainer = this.gantt.container as HTMLElement;\n if (ganttContainer) {\n const taskTableWidth = this.gantt.taskTableWidth || 0;\n width = ganttContainer.offsetWidth - taskTableWidth;\n } else {\n width = 1000;\n }\n }\n\n if (height === undefined) {\n height = 30;\n }\n\n this.canvas.width = width;\n this.canvas.height = height;\n this.canvas.style.width = `${width}px`;\n this.canvas.style.height = `${height}px`;\n\n this.stage.resize(width, height);\n this.dataZoomAxis.setAttributes({\n size: { width, height: height - 1 }\n });\n\n // 强制重新渲染\n this.stage.render();\n }\n\n /**\n * 响应式更新 DataZoom 大小和位置\n * 当容器大小或位置发生变化时调用\n */\n updateResponsive(): void {\n const ganttContainer = this.gantt.container as HTMLElement;\n if (!ganttContainer) {\n return;\n }\n\n // 计算新宽度:甘特图容器宽度减去左侧表头宽度\n const taskTableWidth = this.gantt.taskTableWidth || 0;\n const newWidth = ganttContainer.offsetWidth - taskTableWidth;\n\n this.resize(newWidth);\n\n // 更新位置(保持与时间轴内容区域对齐,排除左侧表头)\n const defaultX = this.gantt.taskTableWidth || 0;\n this.updatePosition(defaultX, 0);\n\n // 重新同步 DataZoom 状态,因为视图宽度变化会影响时间范围的显示比例\n this.syncToDataZoom();\n }\n\n /**\n * 更新 DataZoom 位置\n * 当容器位置发生变化时调用\n */\n updatePosition(x?: number, y?: number): void {\n const xPos = x ?? this.gantt.taskTableWidth ?? 0;\n this.canvas.style.left = `${xPos}px`;\n }\n\n /**\n * 销毁 DataZoom 集成\n */\n destroy(): void {\n this.cleanupCallbacks.forEach(cleanup => cleanup());\n this.cleanupCallbacks = [];\n\n // 清理包装器和 Canvas\n if (this.canvas && this.canvas.parentNode) {\n const wrapper = this.canvas.parentNode as HTMLElement;\n if (wrapper && wrapper.id === 'dataZoomWrapper' && wrapper.parentNode) {\n // 移除整个包装器\n wrapper.parentNode.removeChild(wrapper);\n } else {\n // 如果没有包装器,直接移除 Canvas\n wrapper.removeChild(this.canvas);\n }\n }\n\n if (this.stage) {\n this.stage.release();\n }\n }\n}\n"]}
@@ -324,4 +324,5 @@ class ZoomScaleManager {
324
324
  }
325
325
  }
326
326
 
327
- exports.ZoomScaleManager = ZoomScaleManager;
327
+ exports.ZoomScaleManager = ZoomScaleManager;
328
+ //# sourceMappingURL=ZoomScaleManager.js.map
@@ -20,5 +20,4 @@ Object.defineProperty(exports, "DataZoomIntegration", {
20
20
  get: function() {
21
21
  return DataZoomIntegration_1.DataZoomIntegration;
22
22
  }
23
- });
24
- //# sourceMappingURL=index.js.map
23
+ });