forked from python3statement/python3statement.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.js
278 lines (251 loc) · 10.5 KB
/
site.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
$.extend($.easing,
{
def: 'easeOutQuad',
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
}
});
(function( $ ) {
var settings;
var disableScrollFn = false;
var navItems;
var navs = {}, sections = {};
$.fn.navScroller = function(options) {
settings = $.extend({
scrollToOffset: 170,
scrollSpeed: 800,
activateParentNode: true,
}, options );
navItems = this;
//attatch click listeners
navItems.on('click', function(event){
event.preventDefault();
var navID = $(this).attr("href").substring(1);
disableScrollFn = true;
activateNav(navID);
populateDestinations(); //recalculate these!
$('html,body').animate({scrollTop: sections[navID] - settings.scrollToOffset},
settings.scrollSpeed, "easeInOutExpo", function(){
disableScrollFn = false;
}
);
});
//populate lookup of clicable elements and destination sections
populateDestinations(); //should also be run on browser resize, btw
// setup scroll listener
$(document).scroll(function(){
if (disableScrollFn) { return; }
var page_height = $(window).height();
var pos = $(this).scrollTop();
for (i in sections) {
if ((pos + settings.scrollToOffset >= sections[i]) && sections[i] < pos + page_height){
activateNav(i);
}
}
});
};
function populateDestinations() {
navItems.each(function(){
var scrollID = $(this).attr('href').substring(1);
navs[scrollID] = (settings.activateParentNode)? this.parentNode : this;
sections[scrollID] = $(document.getElementById(scrollID)).offset().top;
});
}
function activateNav(navID) {
for (nav in navs) { $(navs[nav]).removeClass('active'); }
$(navs[navID]).addClass('active');
}
})( jQuery );
$(document).ready(function (){
$('nav li a').navScroller();
//section divider icon click gently scrolls to reveal the section
$(".sectiondivider").on('click', function(event) {
$('html,body').animate({scrollTop: $(event.target.parentNode).offset().top - 50}, 400, "linear");
});
//links going to other sections nicely scroll
$(".container a").each(function(){
if ($(this).attr("href").charAt(0) == '#'){
$(this).on('click', function(event) {
event.preventDefault();
var target = $(event.target).closest("a");
var targetHight = $(target.attr("href")).offset().top
$('html,body').animate({scrollTop: targetHight - 170}, 800, "easeInOutExpo");
});
}
});
// DOM element where the Timeline will be attached
var container = document.getElementById('visualization');
// add your project here with the following format
//
// '<groupname> : [
// { content:'<text>', start: <date>, end: <date>, py2:<true|false>},
// ...
// ]
var data = {
'CPython':[
{content:'Python 2.7', start: '2010-07-03', end: '2020-01-01', py2:true},
{content:'Python 3.3', start: '2012-09-29', end: '2017-09-29'},
// EOL for Python 3.4 - 3.7 not announced yet; project 5 years from initial release to follow CPython policy.
{content:'Python 3.4', start: '2014-03-16', end: '2019-03-16'},
{content:'Python 3.5', start: '2015-09-13', end: '2020-09-13'},
{content:'Python 3.6', start: '2016-12-23', end: '2021-12-23'},
{content:'Python 3.7', start: '2018-06-15', end: '2023-06-01'},
],
'IPython':[
{content: '1.x', start: '2013-08-08', end:'2014-03-31', py2:true},
{content: '2.x', start: '2014-04-01', end:'2015-02-26', py2:true},
{content: '3.x', start: '2015-02-27', end:'2015-08-10', py2:true},
{content: '4.x', start: '2015-08-11', end:'2016-07-07', py2:true},
{content: 'IPython 5.x LTS', start: '2016-07-08', end:'2019-06-01', py2:true},
{content: '6.x', start: '2017-04-19', end:'2018-12-01'},
{content: '7.x', start: '2018-12-01', end:'2019-12-12'},
{content: '8.x', start: '2019-12-12', end:'2020-12-01'},
],
'pandas':[
{content: 'Python 2 & 3', start: '2011-10-10', end:'2018-12-31', py2:true},
{content: 'Python 3 only', start: '2019-01-01', end:'2021-12-16'},
],
'Numpy':[
{content: 'Py 2 & 3 full', start: '2010-08-31', end:'2018-12-31', py2:true},
{content: 'Py 2 bug fix', start: '2019-01-01', end:'2019-12-31', py2:true},
{content: 'Py 3 full', start: '2019-01-01', end:'2021-12-16'},
],
'Matplotlib':[
{content: '2.2 LTS', start: '2018-03-05', end: '2020-01-10', py2:true},
{content: '3.0', start: '2018-07-01', end: '2019-01-01'},
{content: '3.1', start: '2019-01-01', end: '2019-07-01'},
{content: '3.2', start: '2019-07-01', end: '2020-01-01'}
],
'Xonsh':[
{content: '0.x series – Python 3.4+', start: '2015-03-09', end: '2021-12-16'},
],
'scikit-bio':[
{content: '0.1.1 - 0.4.2', start: '2014-05-16', end: '2016-05-30', py2:true},
{content: '0.5.0+', start: '2016-05-31', end: '2021-12-16'},
],
'QIIME':[
{content: '1.x', start: '2010-04-09', end: '2017-12-31', py2:true},
{content: '2.x+', start: '2016-07-11', end: '2021-12-16'},
],
'SunPy':[
{content: '0.7', start: '2016-05-24', end: '2017-08-07', py2:true},
{content: '0.8', start: '2017-08-07', end: '2018-04-23', py2:true},
{content: '0.9', start: '2018-04-23', end: '2020-01-01', py2:true},
{content: '1.0', start: '2019-01-01', end: '2020-01-01'},
{content: '1.1', start: '2020-01-01', end: '2020-06-01'},
],
'Astropy':[
{content: '1.0 LTS', start: '2015-02-19', end: '2017-06-01', py2:true},
{content: '1.1', start: '2015-12-11', end: '2016-06-23', py2:true},
{content: '1.2', start: '2016-06-23', end: '2016-12-16', py2:true},
{content: '1.3', start: '2016-12-16', end: '2017-06-01', py2:true},
{content: '2.0 LTS', start: '2017-06-01', end: '2019-12-31', py2:true},
{content: '3.0', start: '2018-02-19', end: '2018-11-30'},
{content: '3.1', start: '2018-11-30', end: '2019-05-01'},
{content: '3.2', start: '2019-05-01', end: '2019-11-30'},
{content: '4.0 LTS', start: '2019-11-30', end: '2021-12-01'},
],
'Tryton':[
{content: '4.0', start: '2016-05-02', end: '2018-10-01', py2:true},
{content: '4.2', start: '2016-11-28', end: '2019-05-01', py2:true},
{content: '4.4', start: '2017-05-01', end: '2019-10-01', py2:true},
{content: '4.6', start: '2017-10-30', end: '2020-05-01', py2:true},
{content: '4.8', start: '2018-04-23', end: '2020-10-01', py2:true},
{content: '5.0', start: '2018-10-01', end: '2023-10-01'},
{content: '5.2', start: '2019-05-01', end: '2020-05-01'},
],
'osBrain':[
{content: '0.x', start: '2016-07-01', end: '2021-12-16'},
],
'PyMeasure':[
{content: '0.2', start: '2015-12-16', end: '2016-04-08'},
{content: '0.3', start: '2016-04-08', end: '2016-07-29'},
{content: '0.4', start: '2016-07-29', end: '2017-07-29'},
],
'rpy2':[
{content: '2.8.x', start: '2016-12-21', end:'2018-12-21', py2:true},
{content: '2.9.x', start: '2017-07-14', end:'2018-07-14'},
],
'FEniCS':[
{content: '2017.1.0', start: '2017-05-12', end: '2017-12-31', py2:true},
{content: '2018.1.0', start: '2018-01-01', end: '2018-06-01'}
],
'RDKit':[
{content: '2014.9.1 - 2019.03.1', start: '2014-09-1', end: '2019-09-1', py2:true},
{content: '2019.9.1 -' , start: '2019-09-01', end: '2021-03-01'}
],
'music21':[
{content: 'v3', start: '2016-08-22', end: '2017-08-06', py2:true},
{content: 'v4', start: '2017-08-22', end: '2019-06-01', py2:true},
{content: 'v5', start: '2018-03-17', end: '2019-08-01'},
{content: 'v6', start: '2019-08-01', end: '2020-08-01'},
],
'mitmproxy':[
{content: '0.18.x', start: '2016-10-16', end: '2017-10-16', py2:true},
{content: '1.0.x -', start: '2016-12-26', end: '2021-12-23'}
],
'SPADE':[
{content: '2.0', start: '2010-08-01', end: '2012-11-09', py2:true},
{content: '2.1', start: '2012-11-09', end: '2013-05-27', py2:true},
{content: '2.2', start: '2013-05-27', end: '2017-06-09', py2:true},
{content: '2.3', start: '2017-06-09', end: '2018-12-31', py2:true},
{content: '3.x -', start: '2018-09-15', end: '2020-12-31', py2:false}
],
'dateutil': [
{content: '2.x', start: '2011-12-01', end: '2018-09-01', py2:true},
{content: '3.x', start: '2018-09-01', end: '2019-07-01', py2:true},
{content: '4.x', start: '2019-01-01', end: '2020-07-01', py2:false},
],
'stomp.py':[
{content: '3.x', start: '2010-04-01', end: '2013-09-30', py2:true},
{content: '4.x', start: '2013-10-01', end: '2020-01-09', py2:true},
{content: '5.x+', start: '2020-01-10', end: '2023-12-31', py2:false},
],
'cmd2':[
{content: '0.7.x', start: '2017-02-23', end: '2018-01-04', py2:true},
{content: '0.8.x', start: '2018-02-01', end: '2018-08-31', py2:true},
{content: '0.9.x', start: '2018-05-28', end: '2023-12-31', py2:false},
],
// for tests, rando example
//'matplotlib':[
// {content: 'matplotlib 2.x', start: '2015-06-01', end:'2018-06-01', py2:true},
// {content: 'matplotlib 3.x', start: '2018-6-12', end:'2019-12-01'},
//],
//'scikit-bio':[
// {content: '0.18', start: '2016-05-01', end:'2016-11-01', py2:true},
// {content: '0.19', start: '2016-11-02', end:'2017-12-01'},
//]
}
// Create a DataSet (allows two way data-binding)
var items = new vis.DataSet([
]);
var groups = new vis.DataSet();
var g=0;
var i=0;
for (var gname in data) {
g++;
groups.add({id: g, content: gname});
gr = data[gname];
for(var k in gr){
i++;
gr[k].id = i;
gr[k].group = g;
if(gr[k].py2) gr[k].className ='py2'
items.add(gr[k])
}
}
// Configuration for the Timeline
var options = {};
var options = {
clickToUse: true,
groupOrder: 'group'
};
// Create a Timeline
var timeline = new vis.Timeline(container, items, options);
timeline.setGroups(groups);
timeline.setItems(items);
timeline.addCustomTime(Date.parse('2020-01-01'))
});