+
+
+
+
How to get started:
-
- Head over to the 'Generate graphs' page and enter the username of the user you want to generate your graph around.
+
+ Head over to the 'Generate graphs' page and enter
+ the username of a GitHub user. The space on that
+ page will then populate with the requested GitHub
+ user and all the related user, visualizing the
+ connections between them.
-
+
diff --git a/public/js/friendsGraph.js b/public/js/friendsGraph.js
index fe10394..b41c876 100644
--- a/public/js/friendsGraph.js
+++ b/public/js/friendsGraph.js
@@ -193,7 +193,8 @@ function createConnections()
resolve();
}).catch(function(error)
{
- reject(error);
+ console.log(error);
+ resolve();
});
});
}
@@ -246,6 +247,7 @@ function createFriendsGraph(username, containerName, graphsTitle)
edges = [];
addSelfToGraph(username).then(function()
{
+ console.log("added self");
addFriends(username, API_FOLLOWERS).then(function()
{
addFriends(username, API_FOLLOWING).then(function()
@@ -260,9 +262,9 @@ function createFriendsGraph(username, containerName, graphsTitle)
};
var network = new vis.Network(container, data, options);
- network.on("click", function (params) {
+ network.on("click", function (params)
+ {
params.event = "[original event]";
- document.getElementById('eventSpan').innerHTML = '
Click event:
' + JSON.stringify(params, null, 4);
if(Number(this.getNodeAt(params.pointer.DOM)) !== NaN)
{
bringUpProfileView(Number(this.getNodeAt(params.pointer.DOM)));
@@ -273,7 +275,7 @@ function createFriendsGraph(username, containerName, graphsTitle)
})
}).catch(function(error)
{
- console.log(error);
$("#" + graphsTitle).html("Error Fetching Data From API");
+ alert("Invalid User");
});
}
\ No newline at end of file
diff --git a/public/js/githubAPI.js b/public/js/githubAPI.js
index 7aab59d..d2dc060 100644
--- a/public/js/githubAPI.js
+++ b/public/js/githubAPI.js
@@ -38,6 +38,7 @@ function queryAPIByUser(apiPath, user, successCallBack, errorCallBack) {
crossDomain: true,
dataType: "json",
success: successCallBack,
- error:errorCallBack
+ error:errorCallBack,
+ timeout: 1500
});
}
\ 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
diff --git a/public/js/utilities.js b/public/js/utilities.js
new file mode 100644
index 0000000..99bb2b8
--- /dev/null
+++ b/public/js/utilities.js
@@ -0,0 +1,11 @@
+function findGetParameter(parameterName)
+{
+ var result = null,
+ tmp = [];
+ var items = location.search.substr(1).split("&");
+ for (var index = 0; index < items.length; index++) {
+ tmp = items[index].split("=");
+ if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
+ }
+ return result;
+}
\ No newline at end of file
diff --git a/public/style.css b/public/style.css
index 630de8f..f640648 100644
--- a/public/style.css
+++ b/public/style.css
@@ -19,7 +19,6 @@
background-color: rgb(208, 208, 208);
}
#header-title {
- width: 30%;
font-size: 25px;
}
#logo {
@@ -31,36 +30,25 @@
color: rgb(208, 208, 208);
}
#navigation {
- width: 70%;
- padding-right: 20px !important;
-}
-.error {
- color: rgb(208, 208, 208);
+ position: absolute;
+ right: 20px;
}
#dcimg {
width: 300px;
}
+.error {
+ color: rgb(208, 208, 208);
+}
.big-title {
font-family: Comfortaa;
font-weight: bold;
font-size: 60px;
- text-wrap: avoid;
}
.m-title {
font-family: Comfortaa;
font-weight: normal;
font-size: 150%;
}
-.text-title {
- height: 60px;
- background-color: rgb(208, 208, 208);
- border-radius: 20px 0px 0px 0px;
-}
-.text-content {
- height: 335px;
- background-color: rgb(242, 242, 242);
- border-radius: 0px 0px 0px 20px;
-}
.nav-sep {
position: relative;
left: 10px;
@@ -81,16 +69,31 @@
color: rgb(250, 152, 33);
text-decoration: none;
}
+.home-content {
+ padding: 20px;
+ max-height: 40px;
+}
.side-img {
- display: grid;
+ display: block;
position: relative;
width: 50%;
- border-radius: 0px 20px 20px 0px;
+ height: 100%;
+ max-height: 500px;
+ max-width: 500px;
}
.side-txt {
- display: grid;
+ display: block;
position: relative;
width: 50%;
+ max-width: 500px;
+}
+.text-title {
+ background-color: rgb(208, 208, 208);
+ border-radius: 20px 20px 0px 0px;
+}
+.text-content {
+ background-color: rgb(242, 242, 242);
+ border-radius: 0px 0px 20px 20px;
}
.main {
position: relative;
@@ -98,4 +101,35 @@
}
body {
background-color: #232323;
+}
+@media (max-width: 767px) {
+ .big-title {
+ font-size: 30px;
+ }
+ .side-img {
+ display: none;
+ }
+ #navigation {
+ position: absolute;
+ top: 50px;
+ left: 50%;
+ transform: translate(-50%, 0%);
+ width: 400px
+ }
+ .nav-item {
+ font-size: 19px;
+ }
+ #header-bar {
+ height: 100px;
+ }
+ #header-title {
+ left: 0px;
+ width: 20%;
+ }
+ #logo {
+ position: absolute;
+ left: 50%;
+ transform: translate(-50%, 0%);
+ height: 60px;
+ }
}
\ No newline at end of file
diff --git a/routes/api.js b/routes/api.js
index 418652c..ab26aea 100644
--- a/routes/api.js
+++ b/routes/api.js
@@ -33,8 +33,10 @@ function queryGitHubAPI(requestURL)
cache.put(requestURL, response.body);
}).catch(error =>
{
- resolve(response.body);
- cache.put(requestURL, response.body);
+ // resolve(response.body);
+ // cache.put(requestURL, response.body);
+ console.log(error);
+ reject(error);
});
}