Skip to content

Commit 3d3ce8c

Browse files
committed
Merge branch 'release/3.4.0'
2 parents b677a62 + 4ec1576 commit 3d3ce8c

File tree

20 files changed

+813
-24
lines changed

20 files changed

+813
-24
lines changed

CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ All notable changes to this project will be documented in this file.
44

55
---
66

7-
## [v3.2.0](https://github.com/Xeyos88/HyVueGantt/tree/v3.2.0) (2025-02-26)
8-
9-
[Full Changelog](https://github.com/Xeyos88/HyVueGantt/compare/v3.1.2...v3.2.0)
10-
7+
## [v3.3.0](https://github.com/Xeyos88/HyVueGantt/tree/v3.3.0) (2025-02-26)
118

9+
[Full Changelog](https://github.com/Xeyos88/HyVueGantt/compare/v3.1.2...v3.3.0)
1210

1311
**✨ New Features:**
1412

docs/.vitepress/theme/components/AdvancedGanttDemo.vue

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const dateFormat = ref('YYYY-MM-DD HH:mm')
2626
const enableMinutes = ref(false)
2727
const currentTime = ref(true)
2828
const currentTimeLabel = ref('Now')
29+
const pointerMarker = ref(true)
2930
const locale = ref('en')
3031
const utc = ref(false)
3132
@@ -43,6 +44,8 @@ const width = ref('100%')
4344
const showLabel = ref(true)
4445
const barLabelEditable = ref(true)
4546
const showProgress = ref(true)
47+
const showEventsAxis = ref(true)
48+
const eventsAxisHeight = ref(30)
4649
4750
4851
// Time Highlight Configuration
@@ -100,6 +103,7 @@ const customSlots = ref({
100103
barLabel: false,
101104
barTooltip: false,
102105
currentTimeLabel: false,
106+
pointerMarkerTooltips: false,
103107
upperTimeunit: false
104108
})
105109
@@ -343,6 +347,23 @@ const sampleData = ref<ChartRowWithOptionalBars[]>([
343347
}
344348
])
345349
350+
const events = ref([
351+
{
352+
id: 'visibility-1',
353+
label: 'First develop period',
354+
startDate: `${year}-${month}-02 15:00`,
355+
endDate: `${year}-${month}-03 17:00`,
356+
description: 'First custom event period'
357+
},
358+
{
359+
id: 'visibility-2',
360+
label: 'Second develop period',
361+
startDate: `${year}-${month}-05 05:00`,
362+
endDate: `${year}-${month}-08 12:00`,
363+
description: 'Second custom event period'
364+
}
365+
]);
366+
346367
const milestones = ref([
347368
{
348369
id: 'milestone1',
@@ -543,6 +564,12 @@ const formattedEventLog = computed(() => {
543564
<input type="checkbox" v-model="customSlots.currentTimeLabel">
544565
</label>
545566
</div>
567+
<div class="setting-item">
568+
<label>
569+
Custom Pointer Marker Tooltips:
570+
<input type="checkbox" v-model="customSlots.pointerMarkerTooltips">
571+
</label>
572+
</div>
546573
<div class="setting-item">
547574
<label>
548575
Custom Time Unit:
@@ -597,6 +624,12 @@ const formattedEventLog = computed(() => {
597624
<input type="checkbox" v-model="showProgress">
598625
</label>
599626
</div>
627+
<div class="setting-item">
628+
<label>
629+
Show Event Axis:
630+
<input type="checkbox" v-model="showEventsAxis">
631+
</label>
632+
</div>
600633
<div class="setting-item">
601634
<label>
602635
Hide Timeline:
@@ -615,6 +648,12 @@ const formattedEventLog = computed(() => {
615648
<input type="number" v-model="rowHeight">
616649
</label>
617650
</div>
651+
<div class="setting-item">
652+
<label>
653+
Event Axis Height:
654+
<input type="number" v-model="eventsAxisHeight">
655+
</label>
656+
</div>
618657
<div class="setting-item">
619658
<label>
620659
Max Rows:
@@ -647,6 +686,12 @@ const formattedEventLog = computed(() => {
647686
<input type="checkbox" v-model="currentTime">
648687
</label>
649688
</div>
689+
<div class="setting-item">
690+
<label>
691+
Show Pointer Marker:
692+
<input type="checkbox" v-model="pointerMarker">
693+
</label>
694+
</div>
650695
<div class="setting-item">
651696
<label>
652697
Push on Overlap:
@@ -739,6 +784,7 @@ const formattedEventLog = computed(() => {
739784
:max-rows="maxRows"
740785
:current-time="currentTime"
741786
:current-time-label="currentTimeLabel"
787+
:pointer-marker="pointerMarker"
742788
:date-format="dateFormat"
743789
:highlighted-hours="highlightedHours"
744790
:highlighted-days-in-week="highlightedDaysInWeek"
@@ -761,6 +807,9 @@ const formattedEventLog = computed(() => {
761807
:enableConnectionCreation="enableConnectionCreation"
762808
:enableConnectionDeletion="enableConnectionDeletion"
763809
:utc="utc"
810+
:timeaxis-events="events"
811+
:showEventsAxis="showEventsAxis"
812+
:eventsAxisHeight="eventsAxisHeight"
764813
@click-bar="handleEvent($event, 'Bar Click')"
765814
@drag-bar="handleEvent($event, 'Bar Drag')"
766815
@sort="handleEvent($event, 'Sort Change')"
@@ -866,6 +915,20 @@ const formattedEventLog = computed(() => {
866915
</div>
867916
</template>
868917

918+
<!-- Custom Pointer Marker Tooltips Slot -->
919+
<template v-if="customSlots.pointerMarkerTooltips" #pointer-marker-tooltips="{ hitBars, datetime }">
920+
<div style="background: crimson;">
921+
<div>{{ datetime }}</div>
922+
<div>
923+
<ul>
924+
<li v-for="bar in hitBars" :key="bar.ganttBarConfig.id">
925+
{{ bar.ganttBarConfig.label ?? bar.ganttBarConfig.id }}
926+
</li>
927+
</ul>
928+
</div>
929+
</div>
930+
</template>
931+
869932
<!-- Custom Upper Time Unit Slot -->
870933
<template v-if="customSlots.upperTimeunit" #upper-timeunit="{ label, value, date }">
871934
<div class="custom-timeunit">

docs/api/types.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ interface GanttMilestone {
7171
description?: string
7272
color?: string
7373
}
74+
75+
interface TimeaxisEvent {
76+
id: string;
77+
label: string;
78+
startDate: string | Date;
79+
endDate: string | Date;
80+
color?: string;
81+
backgroundColor?: string;
82+
description?: string;
83+
}
7484
```
7585

7686
## Label Data Types

docs/components/g-gantt-chart.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ Here's a minimal example of using the GGanttChart component:
106106
| connection-cancel | `{ sourceBar: GanttBarObject, connectionPoint: ConnectionPoint, e: MouseEvent }` | Cancels the creation of a connection |
107107
| connection-delete | `{ sourceBar: GanttBarObject, targetBar: GanttBarObject, e: MouseEvent }` | Delete a connection |
108108
| label-edit | `{ sourceBar: GanttBarObject, e: MouseEvent, oldValue: string, newValue: string }` | Edit bar label |
109-
109+
| timeaxisEvents | `TimeaxisEvent[]` | `[]` | Array of events to display on the time axis |
110+
| showEventsAxis | `boolean` | `true` | Controls the visibility of the events axis |
111+
| eventsAxisHeight | `number` | `25` | Sets the height of the events axis in pixels |
110112

111113
### Slots
112114

@@ -120,6 +122,7 @@ Here's a minimal example of using the GGanttChart component:
120122
| milestone | `{ bar: GanttBarObject }` | Custom milestones content |
121123
| milestone-`{milestoneId}` | `{ bar: GanttBarObject }` | Custom specific milestone content |
122124
| commands | `CommandSlotProps` | Customization of the command section |
125+
| timeaxis-event | `{ event: TimeaxisEvent }` | Custom template for timeline events displayed on the events axis |
123126

124127
## Command Slot Usage
125128

docs/guide/time-axis.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,33 @@ You can customize the time scale appearance:
4343
:holiday-highlight="'US'"
4444
:locale="'en'"
4545
/>
46-
```
46+
```
47+
48+
## Events Axis
49+
50+
The Gantt chart supports a third axis specifically for displaying timeline events such as releases, milestones, or any time-bound occurrences. This events axis appears below the regular time units and provides visual cues for important dates or periods.
51+
52+
### Configuring Events
53+
54+
Events are defined using the `timeaxisEvents` property, which accepts an array of `TimeaxisEvent` objects:
55+
56+
```typescript
57+
const events = [
58+
{
59+
id: '1',
60+
label: 'Release v1.0',
61+
startDate: '2024-01-15',
62+
endDate: '2024-01-15',
63+
backgroundColor: '#42b883',
64+
color: '#ffffff',
65+
description: 'Product release v1.0'
66+
},
67+
{
68+
id: '2',
69+
label: 'Maintenance',
70+
startDate: '2024-02-10',
71+
endDate: '2024-02-12',
72+
backgroundColor: '#e67e22',
73+
description: 'Scheduled maintenance'
74+
}
75+
]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hy-vue-gantt",
3-
"version": "3.3.0",
3+
"version": "3.4.0",
44
"description": "Evolution of vue-ganttastic package",
55
"author": "Eugenio Topa (@Xeyos88)",
66
"scripts": {

src/color-schemes.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
88
quartenary: "#ededed",
99
hoverHighlight: "rgba(204, 216, 219, 0.5)",
1010
markerCurrentTime: "#000",
11+
markerPointer: '#000',
1112
text: "#404040",
1213
background: "white",
1314
commands: "#eeeeee",
@@ -25,6 +26,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
2526
quartenary: "#f7ece6",
2627
hoverHighlight: "rgba(230, 221, 202, 0.5)",
2728
markerCurrentTime: "#000",
29+
markerPointer: '#000',
2830
text: "#542d05",
2931
background: "white",
3032
commands: "white",
@@ -42,6 +44,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
4244
quartenary: "#ce5f64",
4345
hoverHighlight: "rgba(196, 141, 141, 0.5)",
4446
markerCurrentTime: "#000",
47+
markerPointer: '#000',
4548
text: "black",
4649
background: "white",
4750
commands: "white",
@@ -59,6 +62,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
5962
quartenary: "#383838",
6063
hoverHighlight: "rgba(159, 160, 161, 0.5)",
6164
markerCurrentTime: "#fff",
65+
markerPointer: '#fff',
6266
text: "white",
6367
background: "#525252",
6468
toast: "#1f1f1f",
@@ -77,6 +81,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
7781
quartenary: "#665648",
7882
hoverHighlight: "rgba(196, 141, 141, 0.5)",
7983
markerCurrentTime: "#000",
84+
markerPointer: '#000',
8085
text: "white",
8186
background: "white",
8287
rangeHighlight: "#000",
@@ -93,6 +98,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
9398
quartenary: "#f2799f",
9499
hoverHighlight: "rgba(196, 141, 141, 0.5)",
95100
markerCurrentTime: "#000",
101+
markerPointer: '#000',
96102
text: "white",
97103
background: "white",
98104
commands: "white",
@@ -110,6 +116,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
110116
quartenary: "#65a577",
111117
hoverHighlight: "rgba(160, 219, 171, 0.5)",
112118
markerCurrentTime: "#000",
119+
markerPointer: '#000',
113120
text: "white",
114121
background: "white",
115122
commands: "white",
@@ -127,6 +134,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
127134
quartenary: "#409fed",
128135
hoverHighlight: "rgba(110, 165, 196, 0.5)",
129136
markerCurrentTime: "#000",
137+
markerPointer: '#000',
130138
text: "white",
131139
background: "white",
132140
commands: "white",
@@ -144,6 +152,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
144152
quartenary: "#d0edf4",
145153
hoverHighlight: "rgba(193, 202, 214, 0.5)",
146154
markerCurrentTime: "#000",
155+
markerPointer: '#000',
147156
text: "#022c47",
148157
background: "white",
149158
commands: "white",
@@ -161,6 +170,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
161170
quartenary: "#2c3044",
162171
hoverHighlight: "rgba(179, 162, 127, 0.5)",
163172
markerCurrentTime: "#fff",
173+
markerPointer: '#fff',
164174
text: "#ffe0b3",
165175
background: "#38383b",
166176
toast: "#1f1f1f",
@@ -179,6 +189,7 @@ export const colorSchemes: Record<string, ColorScheme> = {
179189
quartenary: "#2a3d51",
180190
hoverHighlight: "rgba(160, 219, 171, 0.5)",
181191
markerCurrentTime: "#000",
192+
markerPointer: '#000',
182193
text: "white",
183194
background: "white",
184195
commands: "white",

src/components/GGanttChart.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import GGanttCurrentTime from "./GGanttCurrentTime.vue"
4747
import GGanttConnector from "./GGanttConnector.vue"
4848
import GGanttMilestone from "./GGanttMilestone.vue"
4949
import GGanttRow from "./GGanttRow.vue"
50+
import GGanttPointerMarker from './GGanttPointerMarker.vue'
5051
5152
// Composables
5253
import { useConnections } from "../composables/useConnections"
@@ -63,7 +64,7 @@ import useBarSelector from "../composables/useBarSelector"
6364
// Types and Constants
6465
import { colorSchemes, type ColorSchemeKey } from "../color-schemes"
6566
import { DEFAULT_DATE_FORMAT } from "../composables/useDayjsHelper"
66-
import { BOOLEAN_KEY, CONFIG_KEY, EMIT_BAR_EVENT_KEY, GANTT_ID_KEY } from "../provider/symbols"
67+
import { BOOLEAN_KEY, CONFIG_KEY, EMIT_BAR_EVENT_KEY, GANTT_ID_KEY, CHART_AREA_KEY, CHART_WRAPPER_KEY } from "../provider/symbols"
6768
import type {
6869
GanttBarObject,
6970
GGanttChartProps,
@@ -77,6 +78,7 @@ import type {
7778
// Props
7879
const props = withDefaults(defineProps<GGanttChartProps>(), {
7980
currentTimeLabel: "",
81+
pointerMarkerLabel: "",
8082
dateFormat: DEFAULT_DATE_FORMAT,
8183
precision: "day",
8284
width: "100%",
@@ -108,6 +110,9 @@ const props = withDefaults(defineProps<GGanttChartProps>(), {
108110
sortable: true,
109111
labelResizable: true,
110112
milestones: () => [],
113+
timeaxisEvents: () => [],
114+
showEventsAxis: true,
115+
eventsAxisHeight: 25,
111116
holidayHighlight: "",
112117
rowClass: () => "",
113118
rowLabelClass: () => "",
@@ -764,6 +769,8 @@ provide(CONFIG_KEY, {
764769
provide(EMIT_BAR_EVENT_KEY, emitBarEvent)
765770
provide(BOOLEAN_KEY, { ...props })
766771
provide(GANTT_ID_KEY, id.value)
772+
provide(CHART_AREA_KEY, ganttChart)
773+
provide(CHART_WRAPPER_KEY, ganttWrapper)
767774
</script>
768775

769776
<template>
@@ -855,6 +862,12 @@ provide(GANTT_ID_KEY, id.value)
855862
</template>
856863
</g-gantt-current-time>
857864

865+
<g-gantt-pointer-marker v-if="pointerMarker">
866+
<template #pointer-marker-tooltips="{ hitBars, datetime }">
867+
<slot name="pointer-marker-tooltips" v-bind="{ hitBars, datetime }" />
868+
</template>
869+
</g-gantt-pointer-marker>
870+
858871
<g-gantt-milestone
859872
v-for="milestone in milestones"
860873
:key="milestone.date.toString()"

0 commit comments

Comments
 (0)