Website for visualizing a persons github network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB

  1. var events = [];
  2. // {id: 0, group: 0, start: new Date(2013,7,1), end: new Date(2017,5,15), content: 'High School'},
  3. function addRepositories(userName, groupID)
  4. {
  5. return new Promise(function(resolve, reject)
  6. {
  7. })
  8. }
  9. function addOrgs(userName, groupID)
  10. {
  11. return new Promise(function(resolve, reject)
  12. {
  13. })
  14. }
  15. function createProfileTimeLine(username, containerName)
  16. {
  17. var container = document.getElementById(containerName);
  18. var prom = [addRepositories(username, 1), addOrgs(username, 1)];
  19. var groups = new vis.DataSet([
  20. {id: 0, content: 'Organizations', value: 1},
  21. {id: 1, content: 'Repositories', value: 2}
  22. ]);
  23. Promise.all(prom).then(function()
  24. {
  25. // note that months are zero-based in the JavaScript Date object
  26. var items = new vis.DataSet(events);
  27. var options = {
  28. // option groupOrder can be a property name or a sort function
  29. // the sort function must compare two groups and return a value
  30. // > 0 when a > b
  31. // < 0 when a < b
  32. // 0 when a == b
  33. groupOrder: function (a, b) {
  34. return a.value - b.value;
  35. },
  36. margin: {
  37. item: 20,
  38. axis: 40
  39. }
  40. };
  41. var timeline = new vis.Timeline(container);
  42. timeline.setOptions(options);
  43. timeline.setGroups(groups);
  44. timeline.setItems(items);
  45. });
  46. }