{"action":"created","comment":{"url":"https://api.github.com/repos/williamngan/pt/pulls/comments/82357454","pull_request_review_id":3269937,"id":82357454,"diff_hunk":"@@ -0,0 +1,154 @@\n+Function::property = (prop, desc) ->\n+  Object.defineProperty @prototype, prop, desc\n+\n+\n+# Hacky Edge implementation\n+class Edge\n+  constructor: (source, target) ->\n+    @source = source\n+    @target = target\n+\n+  @property 'p1',\n+    get: ->\n+      return {\n+        x: @target.x,\n+        y: @target.y,\n+        z: @target.z\n+      }\n+\n+  @property 'x',\n+    get: ->\n+      return @source.x\n+\n+  @property 'y',\n+    get: ->\n+      return @source.y\n+\n+  @property 'z',\n+    get: ->\n+      return @source.z\n+\n+  clone: () ->\n+    return new Edge(@source.clone(), @target.clone())\n+\n+\n+class Vertex extends Vector\n+  constructor: () ->\n+    super\n+    @displacement = new Vector()\n+\n+class Graph\n+  constructor: () ->\n+    @vertices = []\n+    @edges = []\n+\n+  addVertex: (vertex) ->\n+    @vertices.push(vertex)\n+    return @\n+\n+  addEdge: (edge) ->\n+    @edges.push(edge)\n+    return @\n+\n+\n+class ForceDirectedGraph extends Graph\n+  # Fruchterman & Reingold algorithm: http://citeseer.ist.psu.edu/viewdoc/download?doi=10.1.1.13.8444&rep=rep1&type=pdf\n+  # Walshaw's algorithm: http://jgaa.info/accepted/2003/Walshaw2003.7.3.pdf\n+\n+  # ## Create a new force-directed graph. Vertices and Edges are stored in `this.vertices` and `this.edges`, respectively.\n+  # @return new ForceDirectedGraph object\n+  constructor: (width, height) ->\n+    super()\n+    @width = width\n+    @height = height\n+    @frames = []\n+\n+  _fa: (x, k) ->","path":"src/coffee/extend/ForceDirectedGraph.coffee","position":66,"original_position":66,"commit_id":"b3cad65faa8010d06a07210e8297767aba00f018","original_commit_id":"b3cad65faa8010d06a07210e8297767aba00f018","user":{"login":"williamngan","id":4358746,"avatar_url":"https://avatars.githubusercontent.com/u/4358746?v=3","gravatar_id":"","url":"https://api.github.com/users/williamngan","html_url":"https://github.com/williamngan","followers_url":"https://api.github.com/users/williamngan/followers","following_url":"https://api.github.com/users/williamngan/following{/other_user}","gists_url":"https://api.github.com/users/williamngan/gists{/gist_id}","starred_url":"https://api.github.com/users/williamngan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamngan/subscriptions","organizations_url":"https://api.github.com/users/williamngan/orgs","repos_url":"https://api.github.com/users/williamngan/repos","events_url":"https://api.github.com/users/williamngan/events{/privacy}","received_events_url":"https://api.github.com/users/williamngan/received_events","type":"User","site_admin":false},"body":"May want to move `_fa`, `_fa`, and `_cool` inside `generate`, since they are only used inside it.","created_at":"2016-10-07T09:33:50Z","updated_at":"2016-10-07T09:34:16Z","html_url":"https://github.com/williamngan/pt/pull/25#discussion_r82357454","pull_request_url":"https://api.github.com/repos/williamngan/pt/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/williamngan/pt/pulls/comments/82357454"},"html":{"href":"https://github.com/williamngan/pt/pull/25#discussion_r82357454"},"pull_request":{"href":"https://api.github.com/repos/williamngan/pt/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/williamngan/pt/pulls/25","id":85895007,"html_url":"https://github.com/williamngan/pt/pull/25","diff_url":"https://github.com/williamngan/pt/pull/25.diff","patch_url":"https://github.com/williamngan/pt/pull/25.patch","issue_url":"https://api.github.com/repos/williamngan/pt/issues/25","number":25,"state":"open","locked":false,"title":"Add force-directed graph","user":{"login":"tofuness","id":2232877,"avatar_url":"https://avatars.githubusercontent.com/u/2232877?v=3","gravatar_id":"","url":"https://api.github.com/users/tofuness","html_url":"https://github.com/tofuness","followers_url":"https://api.github.com/users/tofuness/followers","following_url":"https://api.github.com/users/tofuness/following{/other_user}","gists_url":"https://api.github.com/users/tofuness/gists{/gist_id}","starred_url":"https://api.github.com/users/tofuness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofuness/subscriptions","organizations_url":"https://api.github.com/users/tofuness/orgs","repos_url":"https://api.github.com/users/tofuness/repos","events_url":"https://api.github.com/users/tofuness/events{/privacy}","received_events_url":"https://api.github.com/users/tofuness/received_events","type":"User","site_admin":false},"body":"Let's get this party started 🎊 \r\n\r\n* I've added a very simple demo.\r\n* I've changed the `demo/index.html` file and the `gulpfile.js` to make this easier to review. Just run `gulp extend` and check out the demo to get started 😄 .\r\n\r\nProblems:\r\n\r\n* In the `ForceDirectedGraph` file, I have multiple classes implemented.\r\n  * Ideally:\r\n    * We'd like `Graph` to maybe extend `PointSet`\r\n    * We'd like `Edge` to maybe extend `Pair`\r\n* No live (force) simulation. I am unsure how to approach this. I initially thought just moving a vertex and running the algorithm again would be an option, but it gets super jittery.\r\n* The current `Edge` implementation is bad and looks like that because I wanted it to be compatible with `Form.lines`.\r\n\r\nLet me know your thoughts. Please take a look at this when you have time and sorry for not splitting it into multiple commits 💦 ..","created_at":"2016-09-20T00:58:20Z","updated_at":"2016-10-07T09:52:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"566567e51f73279a5ecb822b3ea902e5ec87aebc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/williamngan/pt/pulls/25/commits","review_comments_url":"https://api.github.com/repos/williamngan/pt/pulls/25/comments","review_comment_url":"https://api.github.com/repos/williamngan/pt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/williamngan/pt/issues/25/comments","statuses_url":"https://api.github.com/repos/williamngan/pt/statuses/b3cad65faa8010d06a07210e8297767aba00f018","head":{"label":"tofuness:master","ref":"master","sha":"b3cad65faa8010d06a07210e8297767aba00f018","user":{"login":"tofuness","id":2232877,"avatar_url":"https://avatars.githubusercontent.com/u/2232877?v=3","gravatar_id":"","url":"https://api.github.com/users/tofuness","html_url":"https://github.com/tofuness","followers_url":"https://api.github.com/users/tofuness/followers","following_url":"https://api.github.com/users/tofuness/following{/other_user}","gists_url":"https://api.github.com/users/tofuness/gists{/gist_id}","starred_url":"https://api.github.com/users/tofuness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofuness/subscriptions","organizations_url":"https://api.github.com/users/tofuness/orgs","repos_url":"https://api.github.com/users/tofuness/repos","events_url":"https://api.github.com/users/tofuness/events{/privacy}","received_events_url":"https://api.github.com/users/tofuness/received_events","type":"User","site_admin":false},"repo":{"id":68658995,"name":"pt","full_name":"tofuness/pt","owner":{"login":"tofuness","id":2232877,"avatar_url":"https://avatars.githubusercontent.com/u/2232877?v=3","gravatar_id":"","url":"https://api.github.com/users/tofuness","html_url":"https://github.com/tofuness","followers_url":"https://api.github.com/users/tofuness/followers","following_url":"https://api.github.com/users/tofuness/following{/other_user}","gists_url":"https://api.github.com/users/tofuness/gists{/gist_id}","starred_url":"https://api.github.com/users/tofuness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofuness/subscriptions","organizations_url":"https://api.github.com/users/tofuness/orgs","repos_url":"https://api.github.com/users/tofuness/repos","events_url":"https://api.github.com/users/tofuness/events{/privacy}","received_events_url":"https://api.github.com/users/tofuness/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tofuness/pt","description":"An experimental library on point, form, and space.","fork":true,"url":"https://api.github.com/repos/tofuness/pt","forks_url":"https://api.github.com/repos/tofuness/pt/forks","keys_url":"https://api.github.com/repos/tofuness/pt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tofuness/pt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tofuness/pt/teams","hooks_url":"https://api.github.com/repos/tofuness/pt/hooks","issue_events_url":"https://api.github.com/repos/tofuness/pt/issues/events{/number}","events_url":"https://api.github.com/repos/tofuness/pt/events","assignees_url":"https://api.github.com/repos/tofuness/pt/assignees{/user}","branches_url":"https://api.github.com/repos/tofuness/pt/branches{/branch}","tags_url":"https://api.github.com/repos/tofuness/pt/tags","blobs_url":"https://api.github.com/repos/tofuness/pt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tofuness/pt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tofuness/pt/git/refs{/sha}","trees_url":"https://api.github.com/repos/tofuness/pt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tofuness/pt/statuses/{sha}","languages_url":"https://api.github.com/repos/tofuness/pt/languages","stargazers_url":"https://api.github.com/repos/tofuness/pt/stargazers","contributors_url":"https://api.github.com/repos/tofuness/pt/contributors","subscribers_url":"https://api.github.com/repos/tofuness/pt/subscribers","subscription_url":"https://api.github.com/repos/tofuness/pt/subscription","commits_url":"https://api.github.com/repos/tofuness/pt/commits{/sha}","git_commits_url":"https://api.github.com/repos/tofuness/pt/git/commits{/sha}","comments_url":"https://api.github.com/repos/tofuness/pt/comments{/number}","issue_comment_url":"https://api.github.com/repos/tofuness/pt/issues/comments{/number}","contents_url":"https://api.github.com/repos/tofuness/pt/contents/{+path}","compare_url":"https://api.github.com/repos/tofuness/pt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tofuness/pt/merges","archive_url":"https://api.github.com/repos/tofuness/pt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tofuness/pt/downloads","issues_url":"https://api.github.com/repos/tofuness/pt/issues{/number}","pulls_url":"https://api.github.com/repos/tofuness/pt/pulls{/number}","milestones_url":"https://api.github.com/repos/tofuness/pt/milestones{/number}","notifications_url":"https://api.github.com/repos/tofuness/pt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tofuness/pt/labels{/name}","releases_url":"https://api.github.com/repos/tofuness/pt/releases{/id}","deployments_url":"https://api.github.com/repos/tofuness/pt/deployments","created_at":"2016-09-20T00:49:12Z","updated_at":"2016-09-20T00:49:14Z","pushed_at":"2016-09-20T00:49:34Z","git_url":"git://github.com/tofuness/pt.git","ssh_url":"git@github.com:tofuness/pt.git","clone_url":"https://github.com/tofuness/pt.git","svn_url":"https://github.com/tofuness/pt","homepage":"","size":5613,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"williamngan:master","ref":"master","sha":"6d226390803684189e87f96aaa6ebf33f12b758a","user":{"login":"williamngan","id":4358746,"avatar_url":"https://avatars.githubusercontent.com/u/4358746?v=3","gravatar_id":"","url":"https://api.github.com/users/williamngan","html_url":"https://github.com/williamngan","followers_url":"https://api.github.com/users/williamngan/followers","following_url":"https://api.github.com/users/williamngan/following{/other_user}","gists_url":"https://api.github.com/users/williamngan/gists{/gist_id}","starred_url":"https://api.github.com/users/williamngan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamngan/subscriptions","organizations_url":"https://api.github.com/users/williamngan/orgs","repos_url":"https://api.github.com/users/williamngan/repos","events_url":"https://api.github.com/users/williamngan/events{/privacy}","received_events_url":"https://api.github.com/users/williamngan/received_events","type":"User","site_admin":false},"repo":{"id":38919012,"name":"pt","full_name":"williamngan/pt","owner":{"login":"williamngan","id":4358746,"avatar_url":"https://avatars.githubusercontent.com/u/4358746?v=3","gravatar_id":"","url":"https://api.github.com/users/williamngan","html_url":"https://github.com/williamngan","followers_url":"https://api.github.com/users/williamngan/followers","following_url":"https://api.github.com/users/williamngan/following{/other_user}","gists_url":"https://api.github.com/users/williamngan/gists{/gist_id}","starred_url":"https://api.github.com/users/williamngan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamngan/subscriptions","organizations_url":"https://api.github.com/users/williamngan/orgs","repos_url":"https://api.github.com/users/williamngan/repos","events_url":"https://api.github.com/users/williamngan/events{/privacy}","received_events_url":"https://api.github.com/users/williamngan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/williamngan/pt","description":"An experimental library on point, form, and space.","fork":false,"url":"https://api.github.com/repos/williamngan/pt","forks_url":"https://api.github.com/repos/williamngan/pt/forks","keys_url":"https://api.github.com/repos/williamngan/pt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/williamngan/pt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/williamngan/pt/teams","hooks_url":"https://api.github.com/repos/williamngan/pt/hooks","issue_events_url":"https://api.github.com/repos/williamngan/pt/issues/events{/number}","events_url":"https://api.github.com/repos/williamngan/pt/events","assignees_url":"https://api.github.com/repos/williamngan/pt/assignees{/user}","branches_url":"https://api.github.com/repos/williamngan/pt/branches{/branch}","tags_url":"https://api.github.com/repos/williamngan/pt/tags","blobs_url":"https://api.github.com/repos/williamngan/pt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/williamngan/pt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/williamngan/pt/git/refs{/sha}","trees_url":"https://api.github.com/repos/williamngan/pt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/williamngan/pt/statuses/{sha}","languages_url":"https://api.github.com/repos/williamngan/pt/languages","stargazers_url":"https://api.github.com/repos/williamngan/pt/stargazers","contributors_url":"https://api.github.com/repos/williamngan/pt/contributors","subscribers_url":"https://api.github.com/repos/williamngan/pt/subscribers","subscription_url":"https://api.github.com/repos/williamngan/pt/subscription","commits_url":"https://api.github.com/repos/williamngan/pt/commits{/sha}","git_commits_url":"https://api.github.com/repos/williamngan/pt/git/commits{/sha}","comments_url":"https://api.github.com/repos/williamngan/pt/comments{/number}","issue_comment_url":"https://api.github.com/repos/williamngan/pt/issues/comments{/number}","contents_url":"https://api.github.com/repos/williamngan/pt/contents/{+path}","compare_url":"https://api.github.com/repos/williamngan/pt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/williamngan/pt/merges","archive_url":"https://api.github.com/repos/williamngan/pt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/williamngan/pt/downloads","issues_url":"https://api.github.com/repos/williamngan/pt/issues{/number}","pulls_url":"https://api.github.com/repos/williamngan/pt/pulls{/number}","milestones_url":"https://api.github.com/repos/williamngan/pt/milestones{/number}","notifications_url":"https://api.github.com/repos/williamngan/pt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/williamngan/pt/labels{/name}","releases_url":"https://api.github.com/repos/williamngan/pt/releases{/id}","deployments_url":"https://api.github.com/repos/williamngan/pt/deployments","created_at":"2015-07-11T08:13:52Z","updated_at":"2016-10-04T02:49:37Z","pushed_at":"2016-09-25T10:18:32Z","git_url":"git://github.com/williamngan/pt.git","ssh_url":"git@github.com:williamngan/pt.git","clone_url":"https://github.com/williamngan/pt.git","svn_url":"https://github.com/williamngan/pt","homepage":"","size":5617,"stargazers_count":737,"watchers_count":737,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":42,"mirror_url":null,"open_issues_count":7,"forks":42,"open_issues":7,"watchers":737,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/williamngan/pt/pulls/25"},"html":{"href":"https://github.com/williamngan/pt/pull/25"},"issue":{"href":"https://api.github.com/repos/williamngan/pt/issues/25"},"comments":{"href":"https://api.github.com/repos/williamngan/pt/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/williamngan/pt/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/williamngan/pt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/williamngan/pt/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/williamngan/pt/statuses/b3cad65faa8010d06a07210e8297767aba00f018"}}}}
{"actor":{"display_login":"williamngan"}}