Skip to content

Commit 60bfd3d

Browse files
authored
Merge pull request #4575 from VisActor/docs/gantt-zoom
Docs/gantt zoom
2 parents 2b3e2e3 + cbb1d63 commit 60bfd3d

6 files changed

Lines changed: 35 additions & 48 deletions

File tree

common/changes/@visactor/vtable/4551-bug-pasteHtmlToTable_2025-10-10-07-21.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: zoom axis component should release\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vtable"
7+
}
8+
],
9+
"packageName": "@visactor/vtable",
10+
"email": "892739385@qq.com"
11+
}

docs/assets/demo/en/gantt/gantt-datazoom.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
category: examples
33
group: gantt
44
title: Gantt DataZoomAxis Scrollbar
5-
cover:
5+
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/gantt-zoom-axis.gif
66
link: gantt/datazoom
77
option: Gantt#zoomScale.dataZoomAxis
88
---
@@ -31,8 +31,8 @@ let ganttInstance;
3131

3232
// Force cleanup of all possible existing zoom control panels
3333
// First try to call any previously existing global cleanup function
34-
if (typeof window.cleanupZoomControls === 'function') {
35-
window.cleanupZoomControls();
34+
if (typeof window.cleanupControls === 'function') {
35+
window.cleanupControls();
3636
}
3737

3838
const existingControls = document.getElementById('zoom-controls');
@@ -717,9 +717,6 @@ const option = {
717717
ganttInstance = new VTableGantt.Gantt(document.getElementById(CONTAINER_ID), option);
718718
window['ganttInstance'] = ganttInstance;
719719

720-
// Ensure ganttInstance can be properly cleaned by document system
721-
window[CONTAINER_ID] = ganttInstance;
722-
723720
/**
724721
* Create zoom control buttons
725722
*/
@@ -729,8 +726,8 @@ function createZoomControls(ganttInstance) {
729726
controlsContainer.id = 'zoom-controls';
730727
controlsContainer.style.cssText = `
731728
position: fixed;
732-
top: 180px;
733-
right: 20px;
729+
bottom: 0px;
730+
left: 130px;
734731
display: flex;
735732
gap: 8px;
736733
flex-direction: column;
@@ -1033,5 +1030,5 @@ ganttInstance.release = function () {
10331030
};
10341031
10351032
// Store cleanup function globally for other places to call
1036-
window.cleanupZoomControls = cleanup;
1033+
window.cleanupControls = cleanup;
10371034
```

docs/assets/demo/en/gantt/gantt-zoom.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
category: examples
33
group: gantt
44
title: Gantt Chart Smart Zoom Feature
5-
cover:
5+
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/gantt-zoom.gif
66
link: gantt/zoom-scale
77
option: Gantt#zoomScale
88
---
@@ -28,8 +28,8 @@ let ganttInstance;
2828

2929
// Force cleanup of all possible existing zoom control panels
3030
// First try to call any previously existing global cleanup function
31-
if (typeof window.cleanupZoomControls === 'function') {
32-
window.cleanupZoomControls();
31+
if (typeof window.cleanupControls === 'function') {
32+
window.cleanupControls();
3333
}
3434

3535
const existingControls = document.getElementById('zoom-controls');
@@ -737,9 +737,6 @@ const option = {
737737
ganttInstance = new VTableGantt.Gantt(document.getElementById(CONTAINER_ID), option);
738738
window['ganttInstance'] = ganttInstance;
739739

740-
// Ensure ganttInstance can be properly cleaned up by the documentation system
741-
window[CONTAINER_ID] = ganttInstance;
742-
743740
/**
744741
* Create zoom control buttons
745742
*/
@@ -749,8 +746,8 @@ function createZoomControls(ganttInstance) {
749746
controlsContainer.id = 'zoom-controls';
750747
controlsContainer.style.cssText = `
751748
position: fixed;
752-
bottom: 20px;
753-
right: 20px;
749+
bottom: 0px;
750+
left: 130px;
754751
display: flex;
755752
gap: 8px;
756753
flex-direction: column;
@@ -1054,5 +1051,5 @@ ganttInstance.release = function () {
10541051
};
10551052
10561053
// Store cleanup function globally for other calls
1057-
window.cleanupZoomControls = cleanup;
1054+
window.cleanupControls = cleanup;
10581055
```

docs/assets/demo/zh/gantt/gantt-datazoom.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
category: examples
33
group: gantt
44
title: 甘特图 DataZoomAxis 滚动条
5-
cover:
5+
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/gantt-zoom-axis.gif
66
link: gantt/datazoom
77
option: Gantt#zoomScale.dataZoomAxis
88
---
@@ -31,8 +31,8 @@ let ganttInstance;
3131

3232
// 强制清理所有可能存在的缩放控制面板
3333
// 首先尝试调用之前可能存在的全局清理函数
34-
if (typeof window.cleanupZoomControls === 'function') {
35-
window.cleanupZoomControls();
34+
if (typeof window.cleanupControls === 'function') {
35+
window.cleanupControls();
3636
}
3737

3838
const existingControls = document.getElementById('zoom-controls');
@@ -718,10 +718,6 @@ const option = {
718718

719719
ganttInstance = new VTableGantt.Gantt(document.getElementById(CONTAINER_ID), option);
720720
window['ganttInstance'] = ganttInstance;
721-
722-
// 确保ganttInstance能被文档系统正确清理
723-
window[CONTAINER_ID] = ganttInstance;
724-
725721
/**
726722
* 创建缩放控制按钮
727723
*/
@@ -731,8 +727,8 @@ function createZoomControls(ganttInstance) {
731727
controlsContainer.id = 'zoom-controls';
732728
controlsContainer.style.cssText = `
733729
position: fixed;
734-
top: 180px;
735-
right: 20px;
730+
bottom: 0px;
731+
left: 130px;
736732
display: flex;
737733
gap: 8px;
738734
flex-direction: column;
@@ -1035,5 +1031,5 @@ ganttInstance.release = function () {
10351031
};
10361032
10371033
// 在全局存储清理函数,以便其他地方也能调用
1038-
window.cleanupZoomControls = cleanup;
1034+
window.cleanupControls = cleanup;
10391035
```

docs/assets/demo/zh/gantt/gantt-zoom.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
category: examples
33
group: gantt
44
title: 甘特图智能缩放功能
5-
cover:
5+
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/gantt-zoom.gif
66
link: gantt/zoom-scale
77
option: Gantt#zoomScale
88
---
@@ -28,8 +28,8 @@ let ganttInstance;
2828

2929
// 强制清理所有可能存在的缩放控制面板
3030
// 首先尝试调用之前可能存在的全局清理函数
31-
if (typeof window.cleanupZoomControls === 'function') {
32-
window.cleanupZoomControls();
31+
if (typeof window.cleanupControls === 'function') {
32+
window.cleanupControls();
3333
}
3434

3535
const existingControls = document.getElementById('zoom-controls');
@@ -708,9 +708,6 @@ const option = {
708708
ganttInstance = new VTableGantt.Gantt(document.getElementById(CONTAINER_ID), option);
709709
window['ganttInstance'] = ganttInstance;
710710

711-
// 确保ganttInstance能被文档系统正确清理
712-
window[CONTAINER_ID] = ganttInstance;
713-
714711
/**
715712
* 创建缩放控制按钮
716713
*/
@@ -720,8 +717,8 @@ function createZoomControls(ganttInstance) {
720717
controlsContainer.id = 'zoom-controls';
721718
controlsContainer.style.cssText = `
722719
position: fixed;
723-
bottom: 20px;
724-
right: 20px;
720+
bottom: 0px;
721+
left: 130px;
725722
display: flex;
726723
gap: 8px;
727724
flex-direction: column;
@@ -1024,5 +1021,5 @@ ganttInstance.release = function () {
10241021
};
10251022
10261023
// 在全局存储清理函数,以便其他地方也能调用
1027-
window.cleanupZoomControls = cleanup;
1024+
window.cleanupControls = cleanup;
10281025
```

0 commit comments

Comments
 (0)