Skip to content

Commit 7228fe6

Browse files
committed
Merge branch 'release/4.1.0'
2 parents 1d9aa60 + 7abb19d commit 7228fe6

28 files changed

+7729
-417
lines changed

docs/api/props.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ interface BehaviorProps {
7676
barLabelEditable?: boolean; // Allow editing bar labels
7777
enableConnectionCreation?: boolean; // Enable creating connections
7878
enableConnectionDeletion?: boolean; // Enable deleting connections
79+
autoScrollToToday?: boolean; // Auto-scroll to center today's date on chart load
7980
}
8081
```
8182

docs/components/g-gantt-chart.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Here's a minimal example of using the GGanttChart component:
9595
| baseUnitWidth | `number` | `24` | Default width in px for one lower unit in timeaxis (min: 20, max: 50) |
9696
| defaultZoom | `number` | `3` | Default initial zoom value (min: 1, max: 10) |
9797
| tick | `number` | `0` | Range selection snap interval. When > 0, enables snapped selection based on current precision |
98+
| autoScrollToToday | `boolean` | `false` | Automatically scroll to center today's date on chart initialization. Only works if today falls within the chart range |
9899

99100
### Events
100101

docs/guide/chart-configuration.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The GGanttChart component accepts several key configuration properties that defi
1919
:push-on-overlap="true"
2020
:no-overlap="false"
2121
:commands="true"
22+
:auto-scroll-to-today="true"
2223
/>
2324
```
2425

@@ -59,6 +60,33 @@ The chart emits various events that you can listen to:
5960
/>
6061
```
6162

63+
## Auto-Scroll to Current Date
64+
65+
The chart can automatically center on today's date when it loads using the `autoScrollToToday` property:
66+
67+
```vue
68+
<template>
69+
<g-gantt-chart
70+
:chart-start="'2024-01-01'"
71+
:chart-end="'2024-12-31'"
72+
:auto-scroll-to-today="true"
73+
>
74+
<!-- Your gantt rows here -->
75+
</g-gantt-chart>
76+
</template>
77+
```
78+
79+
**Key Features:**
80+
- Only activates when today's date falls within the chart's visible range (`chartStart` to `chartEnd`)
81+
- Centers the current date in the viewport on chart initialization
82+
- No action taken if today is outside the date range
83+
- Executes after the chart is fully loaded and positioned
84+
85+
**Use Cases:**
86+
- Project timelines where you want immediate visibility of current status
87+
- Long-term planning charts that span multiple months or years
88+
- Real-time dashboards showing current progress
89+
6290
## Performance Optimization
6391

6492
For optimal performance:

package-lock.json

Lines changed: 111 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hy-vue-gantt",
3-
"version": "4.0.0",
3+
"version": "4.1.0",
44
"description": "Evolution of vue-ganttastic package",
55
"author": "Eugenio Topa (@Xeyos88)",
66
"scripts": {
@@ -79,7 +79,7 @@
7979
"date-holidays": "^3.23.14",
8080
"dayjs": "^1.11.13",
8181
"html2canvas": "^1.4.1",
82-
"jspdf": "^3.0.1",
82+
"jspdf": "^3.0.2",
8383
"lodash-es": "^4.17.21",
8484
"papaparse": "^5.5.2",
8585
"uuid": "^11.0.5",

0 commit comments

Comments
 (0)