Skip to content

Commit b8a98e7

Browse files
committed
Sort timeline in alphabetical order
Sort data in timeline in alphabetical order except place CPython at top
1 parent 263a1f7 commit b8a98e7

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

site.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,19 @@ $(document).ready(function (){
100100
// { content:'<text>', start: <date>, end: <date>, py2:<true|false>},
101101
// ...
102102
// ]
103+
//
104+
// The placement of projects in the data does not matter.
105+
// They will be sorted alphabetically
106+
//
103107
var data = {
104108
'CPython':[
105109
{content:'Python 2.7', start: '2010-07-03', end: '2020-01-01', py2:true},
106110
{content:'Python 3.3', start: '2012-09-29', end: '2017-09-29'},
107-
// EOL for Python 3.4 - 3.7 not announced yet; project 5 years from initial release to follow CPython policy.
108-
{content:'Python 3.4', start: '2014-03-16', end: '2019-03-16'},
111+
{content:'Python 3.4', start: '2014-03-16', end: '2019-03-19'},
112+
// EOL for Python 3.5 - 3.7 not announced yet; project 5 years from initial release to follow CPython policy.
109113
{content:'Python 3.5', start: '2015-09-13', end: '2020-09-13'},
110114
{content:'Python 3.6', start: '2016-12-23', end: '2021-12-23'},
111-
{content:'Python 3.7', start: '2018-06-15', end: '2023-06-01'},
115+
{content:'Python 3.7', start: '2018-06-27', end: '2023-06-27'},
112116
],
113117
'IPython':[
114118
{content: '1.x', start: '2013-08-08', end:'2014-03-31', py2:true},
@@ -236,7 +240,7 @@ $(document).ready(function (){
236240
{content: 'v3', start: '2016-08-22', end: '2017-08-06', py2:true},
237241
{content: 'v4', start: '2017-08-22', end: '2019-06-01', py2:true},
238242
{content: 'v5', start: '2018-03-17', end: '2019-08-01'},
239-
{content: 'v6', start: '2019-08-01', end: '2020-08-01'},
243+
{content: 'v6', start: '2019-06-01', end: '2020-08-01'},
240244
],
241245
'mitmproxy':[
242246
{content: '0.18.x', start: '2016-10-16', end: '2017-10-16', py2:true},
@@ -288,7 +292,7 @@ $(document).ready(function (){
288292
// for tests, rando example
289293
//'matplotlib':[
290294
// {content: 'matplotlib 2.x', start: '2015-06-01', end:'2018-06-01', py2:true},
291-
// {content: 'matplotlib 3.x', start: '2018-6-12', end:'2019-12-01'},
295+
// {content: 'matplotlib 3.x', start: '2018-06-12', end:'2019-12-01'},
292296
//],
293297
//'scikit-bio':[
294298
// {content: '0.18', start: '2016-05-01', end:'2016-11-01', py2:true},
@@ -299,10 +303,16 @@ $(document).ready(function (){
299303
}
300304

301305
// Create a DataSet (allows two way data-binding)
302-
var items = new vis.DataSet([
303-
]);
304-
306+
var items = new vis.DataSet([]);
305307

308+
// put the data in alphabetical order, except CPython at top.
309+
var ordered = {};
310+
Object.keys(data).sort(function (a, b) {
311+
if (a == 'CPython') return -1;
312+
if (b == 'CPython') return 1;
313+
return a.toLowerCase().localeCompare(b.toLowerCase());
314+
}).forEach(function(key) { ordered[key] = data[key] });
315+
data = ordered;
306316

307317
var groups = new vis.DataSet();
308318
var g=0;

0 commit comments

Comments
 (0)