Skip to content

Commit 3164ae0

Browse files
feat(timeline): add keyboard and scroll panning support
Enable horizontal scroll/swipe panning and keyboard navigation (arrow keys to pan, +/- to zoom) using vis-timeline's built-in options. Vertical scroll still zooms as before. Supersedes ActivityWatch#535. Closes ActivityWatch#629
1 parent 1db85aa commit 3164ae0

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/views/Timeline.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ div
5555
option(:value='1 * 60 * 60') 1+ hrs
5656
option(:value='2 * 60 * 60') 2+ hrs
5757
div(style="float: right; color: #999").d-inline-block.pt-3
58-
| Drag to pan and scroll to zoom
58+
| Scroll to zoom, swipe/horizontal-scroll to pan, arrow keys to navigate
5959

6060
div(v-if="buckets !== null")
6161
div(style="clear: both")

src/visualizations/VisTimeline.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ export default {
102102
overflowMethod: 'flip',
103103
delay: 0,
104104
},
105+
// Keyboard & scroll navigation (see #629)
106+
horizontalScroll: true, // horizontal scroll/swipe pans the timeline
107+
keyboard: {
108+
enabled: true,
109+
speed: { x: 10, y: 0, zoom: 0.02 },
110+
},
105111
},
106112
editingEvent: null,
107113
editingEventBucket: null,

0 commit comments

Comments
 (0)