From e4ce9ed9e24924901affe8c8411d946421994880 Mon Sep 17 00:00:00 2001 From: jrtechs Date: Sat, 16 Feb 2019 19:43:52 -0500 Subject: [PATCH] Created initial skeleton code for creating a timeline view of a user's repository. --- public/TimeLineGraph.html | 144 +++++++++++++++++++++++++++++++++++ public/js/profileTimeLine.js | 57 ++++++++++++++ 2 files changed, 201 insertions(+) create mode 100644 public/TimeLineGraph.html create mode 100644 public/js/profileTimeLine.js diff --git a/public/TimeLineGraph.html b/public/TimeLineGraph.html new file mode 100644 index 0000000..9c70585 --- /dev/null +++ b/public/TimeLineGraph.html @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ +
+ +
+ +
+
+

+
+

+        
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/public/js/profileTimeLine.js b/public/js/profileTimeLine.js new file mode 100644 index 0000000..477e516 --- /dev/null +++ b/public/js/profileTimeLine.js @@ -0,0 +1,57 @@ +var events = []; + +// {id: 0, group: 0, start: new Date(2013,7,1), end: new Date(2017,5,15), content: 'High School'}, +function addRepositories(userName, groupID) +{ + return new Promise(function(resolve, reject) + { + + }) +} + + +function addOrgs(userName, groupID) +{ + return new Promise(function(resolve, reject) + { + + }) +} + + +function createProfileTimeLine(username, containerName) +{ + var container = document.getElementById(containerName); + + + var prom = [addRepositories(username, 1), addOrgs(username, 1)]; + + var groups = new vis.DataSet([ + {id: 0, content: 'Organizations', value: 1}, + {id: 1, content: 'Repositories', value: 2} + ]); + + Promise.all(prom).then(function() + { + // note that months are zero-based in the JavaScript Date object + var items = new vis.DataSet(events); + var options = { + // option groupOrder can be a property name or a sort function + // the sort function must compare two groups and return a value + // > 0 when a > b + // < 0 when a < b + // 0 when a == b + groupOrder: function (a, b) { + return a.value - b.value; + }, + margin: { + item: 20, + axis: 40 + } + }; + var timeline = new vis.Timeline(container); + timeline.setOptions(options); + timeline.setGroups(groups); + timeline.setItems(items); + }); +} \ No newline at end of file