Graph database Analysis of the Steam 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.

252 lines
9.2 KiB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Jrtechs Steam Friend Graph Project</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  8. <link rel="stylesheet" href="css/bootstrap.css" media="screen">
  9. <script src="src/sigma.core.js"></script>
  10. <script src="src/conrad.js"></script>
  11. <script src="src/utils/sigma.utils.js"></script>
  12. <script src="src/utils/sigma.polyfills.js"></script>
  13. <script src="src/sigma.settings.js"></script>
  14. <script src="src/classes/sigma.classes.dispatcher.js"></script>
  15. <script src="src/classes/sigma.classes.configurable.js"></script>
  16. <script src="src/classes/sigma.classes.graph.js"></script>
  17. <script src="src/classes/sigma.classes.camera.js"></script>
  18. <script src="src/classes/sigma.classes.quad.js"></script>
  19. <script src="src/classes/sigma.classes.edgequad.js"></script>
  20. <script src="src/captors/sigma.captors.mouse.js"></script>
  21. <script src="src/captors/sigma.captors.touch.js"></script>
  22. <script src="src/renderers/sigma.renderers.canvas.js"></script>
  23. <script src="src/renderers/sigma.renderers.webgl.js"></script>
  24. <script src="src/renderers/sigma.renderers.svg.js"></script>
  25. <script src="src/renderers/sigma.renderers.def.js"></script>
  26. <script src="src/renderers/webgl/sigma.webgl.nodes.def.js"></script>
  27. <script src="src/renderers/webgl/sigma.webgl.nodes.fast.js"></script>
  28. <script src="src/renderers/webgl/sigma.webgl.edges.def.js"></script>
  29. <script src="src/renderers/webgl/sigma.webgl.edges.fast.js"></script>
  30. <script src="src/renderers/webgl/sigma.webgl.edges.arrow.js"></script>
  31. <script src="src/renderers/canvas/sigma.canvas.labels.def.js"></script>
  32. <script src="src/renderers/canvas/sigma.canvas.hovers.def.js"></script>
  33. <script src="src/renderers/canvas/sigma.canvas.nodes.def.js"></script>
  34. <script src="src/renderers/canvas/sigma.canvas.edges.def.js"></script>
  35. <script src="src/renderers/canvas/sigma.canvas.edges.curve.js"></script>
  36. <script src="src/renderers/canvas/sigma.canvas.edges.arrow.js"></script>
  37. <script src="src/renderers/canvas/sigma.canvas.edges.curvedArrow.js"></script>
  38. <script src="src/renderers/canvas/sigma.canvas.edgehovers.def.js"></script>
  39. <script src="src/renderers/canvas/sigma.canvas.edgehovers.curve.js"></script>
  40. <script src="src/renderers/canvas/sigma.canvas.edgehovers.arrow.js"></script>
  41. <script src="src/renderers/canvas/sigma.canvas.edgehovers.curvedArrow.js"></script>
  42. <script src="src/renderers/canvas/sigma.canvas.extremities.def.js"></script>
  43. <script src="src/renderers/svg/sigma.svg.utils.js"></script>
  44. <script src="src/renderers/svg/sigma.svg.nodes.def.js"></script>
  45. <script src="src/renderers/svg/sigma.svg.edges.def.js"></script>
  46. <script src="src/renderers/svg/sigma.svg.edges.curve.js"></script>
  47. <script src="src/renderers/svg/sigma.svg.labels.def.js"></script>
  48. <script src="src/renderers/svg/sigma.svg.hovers.def.js"></script>
  49. <script src="src/middlewares/sigma.middlewares.rescale.js"></script>
  50. <script src="src/middlewares/sigma.middlewares.copy.js"></script>
  51. <script src="src/misc/sigma.misc.animation.js"></script>
  52. <script src="src/misc/sigma.misc.bindEvents.js"></script>
  53. <script src="src/misc/sigma.misc.bindDOMEvents.js"></script>
  54. <script src="src/misc/sigma.misc.drawHovers.js"></script>
  55. </head>
  56. <body>
  57. <div class="navbar navbar-expand-lg fixed-top navbar-dark bg-primary">
  58. <div class="container">
  59. <a href="index.html" class="navbar-brand">Jrtechs Steam Graph Project</a>
  60. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
  61. <span class="navbar-toggler-icon"></span>
  62. </button>
  63. <div class="collapse navbar-collapse" id="navbarResponsive">
  64. <ul class="navbar-nav">
  65. <li class="nav-item dropdown">
  66. <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="themes">Graphs <span class="caret"></span></a>
  67. <div class="dropdown-menu" aria-labelledby="themes">
  68. <a class="dropdown-item" href="friendsOfFriends.html">Friends of Friends</a>
  69. <a class="dropdown-item" href="commonFriends.html">Common Friends</a>
  70. <a class="dropdown-item" href="closestPath.html">Closest Path</a>
  71. <a class="dropdown-item" href="commonGames.html">Common Games</a>
  72. <a class="dropdown-item" href="friendsWithFriends.html">Best Friends</a>
  73. </div>
  74. </li>
  75. <li class="nav-item">
  76. <a class="nav-link" href="https://jrtechs.net">Blog</a>
  77. </li>
  78. <li class="nav-item">
  79. <a class="nav-link" href="https://jrtechs.me">Resume</a>
  80. </li>
  81. <li class="nav-item">
  82. <a class="nav-link" href="https://github.com/jrtechs">Github</a>
  83. </li>
  84. </ul>
  85. </div>
  86. </div>
  87. </div>
  88. <!-- END SIGMA IMPORTS -->
  89. <div id="container">
  90. <style>
  91. #graph-container {
  92. top: 5%;
  93. bottom: 0;
  94. left: 0;
  95. right: 0;
  96. z-index: 0;
  97. position: absolute;
  98. }
  99. </style>
  100. <div id="graph-container" style="width:100%; height:100%"></div>
  101. </div>
  102. <script>
  103. var s,
  104. r,
  105. g = {
  106. nodes: [],
  107. edges: []
  108. },
  109. colors = [
  110. '#617db4',
  111. '#668f3c',
  112. '#c6583e',
  113. '#b956af'
  114. ];
  115. s = new sigma({
  116. graph: g,
  117. renderer: {
  118. container: document.getElementById('graph-container'),
  119. type: 'canvas'
  120. },
  121. settings: {
  122. minNodeSize: 8,
  123. maxNodeSize: 16,
  124. }
  125. });
  126. connection = new WebSocket('ws://jrtechs.student.rit.edu:4444');
  127. connection.onopen = function ()
  128. {
  129. console.log('Connected!');
  130. if(r != undefined)
  131. {
  132. connection.send("{id:'" + r.id + "', graph:" + r.graph + "}");
  133. }
  134. else
  135. {
  136. connection.close();
  137. }
  138. };
  139. // Log errors
  140. connection.onerror = function (error)
  141. {
  142. console.log('WebSocket Error ' + error);
  143. };
  144. function addNodeToGraph(request)
  145. {
  146. if(s.graph.nodes(request.id) == undefined)
  147. {
  148. s.graph.addNode({
  149. id: request.id,
  150. label: request.name,
  151. x: request.x,
  152. y: request.y,
  153. size: Math.random(),
  154. color: colors[Math.floor(Math.random() * colors.length)]
  155. });
  156. s.refresh();
  157. }
  158. }
  159. function addEdgeToGraph(request)
  160. {
  161. s.graph.addEdge({
  162. id: request.id,
  163. source: request.p1,
  164. target: request.p2,
  165. size: Math.random(),
  166. });
  167. s.refresh();
  168. }
  169. // Log messages from the server
  170. connection.onmessage = function (e)
  171. {
  172. var request = JSON.parse(e.data);
  173. if(request.action == 1)
  174. {
  175. addNodeToGraph(request);
  176. }
  177. else if(request.action == 2)
  178. {
  179. addEdgeToGraph(request);
  180. }
  181. };
  182. $(document).ready(function() {
  183. var ids = prompt("Enter the steam id to graph:", "76561198188400721");
  184. if(ids != null)
  185. {
  186. r = new Object();
  187. r.graph = 2;
  188. r.id = ids;
  189. }
  190. });
  191. </script>
  192. <!-
  193. ┈┈╱▔▔▔▔▔╲┈┈┈HM┈HM
  194. ┈╱┈┈╱▔╲╲╲▏┈┈┈HMMM
  195. ╱┈┈╱━╱▔▔▔▔▔╲━╮┈┈
  196. ▏┈▕┃▕╱▔╲╱▔╲▕╮┃┈┈
  197. ▏┈▕╰━▏▊▕▕▋▕▕━╯┈┈
  198. ╲┈┈╲╱▔╭╮▔▔┳╲╲┈┈┈
  199. ┈╲┈┈▏╭━━━━╯▕▕┈┈┈
  200. ┈┈╲┈╲▂▂▂▂▂▂╱╱┈┈┈
  201. ┈┈┈┈▏┊┈┈┈┈┊┈┈┈╲┈
  202. ┈┈┈┈▏┊┈┈┈┈┊▕╲┈┈╲
  203. ┈╱▔╲▏┊┈┈┈┈┊▕╱▔╲▕
  204. ┈▏ ┈┈┈╰┈┈┈┈╯┈┈┈▕▕
  205. ┈╲┈┈┈╲┈┈┈┈╱┈┈┈╱┈╲
  206. ┈┈╲┈┈▕▔▔▔▔▏┈┈╱╲╲╲▏
  207. ┈╱▔┈┈▕┈┈┈┈▏┈┈▔╲▔▔
  208. ┈╲▂▂▂╱┈┈┈┈╲▂▂▂╱┈
  209. If you are seeing this monkey that means that you are interested in my
  210. code. Yay!! If you are not here to hack me ... you should really consider
  211. contributing to some of my public projects on github.
  212. https://github.com/jrtechs
  213. -->
  214. <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  215. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
  216. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
  217. </body>
  218. </html>