-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvis.helper.js
45 lines (40 loc) · 1.03 KB
/
vis.helper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var view =
{
'start':0,
'end':0,
'zoomout':function ()
{
var time_window = this.end - this.start;
var middle = this.start + time_window / 2;
time_window = time_window * 2;
this.start = middle - (time_window/2);
this.end = middle + (time_window/2);
},
'zoomin':function ()
{
var time_window = this.end - this.start;
var middle = this.start + time_window / 2;
time_window = time_window * 0.5;
this.start = middle - (time_window/2);
this.end = middle + (time_window/2);
},
'panright':function ()
{
var time_window = this.end - this.start;
var shiftsize = time_window * 0.2;
this.start += shiftsize;
this.end += shiftsize;
},
'panleft':function ()
{
var time_window = this.end - this.start;
var shiftsize = time_window * 0.2;
this.start -= shiftsize;
this.end -= shiftsize;
},
'timewindow':function(time)
{
this.start = ((new Date()).getTime())-(3600000*24*time); //Get start time
this.end = (new Date()).getTime(); //Get end time
}
}