{"action":"created","comment":{"url":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/comments/243775737","pull_request_review_id":187632105,"id":243775737,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0Mzc3NTczNw==","diff_hunk":"@@ -350,17 +367,77 @@ export default class GraphComponent {\n    * @private\n    * @return {{array, number}} A tuple of the x, y translation and the zoom scale\n    */\n-  private _getGraphTranslationAndScale(): {translation: number[], scale: number} {\n+  private _getGraphTranslationAndScale(): { translation: number[], scale: number } {\n     const transformRaw = this._g.attr('transform')\n-    if (transformRaw === null) return {translation: [0, 0], scale: 1}\n+    if (transformRaw === null) return { translation: [0, 0], scale: 1 }\n     const [translationRaw, scaleRaw] = transformRaw.split(' ')\n     const translation = translationRaw\n       .replace('translate(', '')\n       .replace(')', '')\n       .split(',')\n       .map(Number)\n     const scale = Number(scaleRaw.match(/\\d(\\.\\d+)*/)[0])\n-    return {translation, scale}\n+    return { translation, scale }\n+  }\n+\n+  /**\n+   * @private\n+   * @return {{array}} A tuple of the x, y position relative to the SVG\n+   */\n+  private _graphToSVGPosition(d: any): { position: number[] } {\n+    const { points } = this._getGraphCornerPoints()\n+    const w = document.documentElement.clientWidth\n+    const h = document.documentElement.clientHeight\n+    const position = [\n+      w * (d.x - points[0]) / (points[1] - points[0]),\n+      h * (d.y - points[2]) / (points[3] - points[2]),\n+    ]\n+    return { position }\n+  }\n+\n+  /**\n+   * @private\n+   * @return {{array}} A tuple of the lower and upper x and y coordinates of the graph\n+   */\n+  private _getGraphCornerPoints(): { points: number[] } {\n+    const { translation, scale } = this._getGraphTranslationAndScale()\n+    const w = document.documentElement.clientWidth\n+    const h = document.documentElement.clientHeight\n+    const points = [\n+      -translation[0] / scale,\n+      w / scale - (translation[0] + 15) / scale,\n+      -translation[1] / scale,\n+      h / scale - (translation[1] + 15) / scale,\n+    ]\n+    return { points }\n+  }\n+\n+  /**\n+   * @private\n+   * @return {{string}} A string of the translation and scale","path":"src/components/graph/graph.ts","position":194,"original_position":194,"commit_id":"1dd7be59375e37bc33f3b30b6552a863223aee29","original_commit_id":"1dd7be59375e37bc33f3b30b6552a863223aee29","user":{"login":"francium","id":15352422,"node_id":"MDQ6VXNlcjE1MzUyNDIy","avatar_url":"https://avatars0.githubusercontent.com/u/15352422?v=4","gravatar_id":"","url":"https://api.github.com/users/francium","html_url":"https://github.com/francium","followers_url":"https://api.github.com/users/francium/followers","following_url":"https://api.github.com/users/francium/following{/other_user}","gists_url":"https://api.github.com/users/francium/gists{/gist_id}","starred_url":"https://api.github.com/users/francium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francium/subscriptions","organizations_url":"https://api.github.com/users/francium/orgs","repos_url":"https://api.github.com/users/francium/repos","events_url":"https://api.github.com/users/francium/events{/privacy}","received_events_url":"https://api.github.com/users/francium/received_events","type":"User","site_admin":false},"body":"doc string remove","created_at":"2018-12-23T21:03:30Z","updated_at":"2018-12-23T21:06:25Z","html_url":"https://github.com/BigBlockDataChain/morbo/pull/26#discussion_r243775737","pull_request_url":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/26","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/comments/243775737"},"html":{"href":"https://github.com/BigBlockDataChain/morbo/pull/26#discussion_r243775737"},"pull_request":{"href":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/26","id":240699761,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwNjk5NzYx","html_url":"https://github.com/BigBlockDataChain/morbo/pull/26","diff_url":"https://github.com/BigBlockDataChain/morbo/pull/26.diff","patch_url":"https://github.com/BigBlockDataChain/morbo/pull/26.patch","issue_url":"https://api.github.com/repos/BigBlockDataChain/morbo/issues/26","number":26,"state":"open","locked":false,"title":"Fix/graph coordinates","user":{"login":"miktime148","id":26146405,"node_id":"MDQ6VXNlcjI2MTQ2NDA1","avatar_url":"https://avatars2.githubusercontent.com/u/26146405?v=4","gravatar_id":"","url":"https://api.github.com/users/miktime148","html_url":"https://github.com/miktime148","followers_url":"https://api.github.com/users/miktime148/followers","following_url":"https://api.github.com/users/miktime148/following{/other_user}","gists_url":"https://api.github.com/users/miktime148/gists{/gist_id}","starred_url":"https://api.github.com/users/miktime148/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miktime148/subscriptions","organizations_url":"https://api.github.com/users/miktime148/orgs","repos_url":"https://api.github.com/users/miktime148/repos","events_url":"https://api.github.com/users/miktime148/events{/privacy}","received_events_url":"https://api.github.com/users/miktime148/received_events","type":"User","site_admin":false},"body":"I implemented the ability to center the graph by clicking on the  node. Also i added a localstorage variable that stores the graph transform, so that whenever the user opens the app, the graph is in the same position as it was when they last closed","created_at":"2018-12-23T20:36:59Z","updated_at":"2018-12-23T21:06:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[{"login":"liam-casola","id":18732000,"node_id":"MDQ6VXNlcjE4NzMyMDAw","avatar_url":"https://avatars3.githubusercontent.com/u/18732000?v=4","gravatar_id":"","url":"https://api.github.com/users/liam-casola","html_url":"https://github.com/liam-casola","followers_url":"https://api.github.com/users/liam-casola/followers","following_url":"https://api.github.com/users/liam-casola/following{/other_user}","gists_url":"https://api.github.com/users/liam-casola/gists{/gist_id}","starred_url":"https://api.github.com/users/liam-casola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liam-casola/subscriptions","organizations_url":"https://api.github.com/users/liam-casola/orgs","repos_url":"https://api.github.com/users/liam-casola/repos","events_url":"https://api.github.com/users/liam-casola/events{/privacy}","received_events_url":"https://api.github.com/users/liam-casola/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/26/commits","review_comments_url":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/26/comments","review_comment_url":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BigBlockDataChain/morbo/issues/26/comments","statuses_url":"https://api.github.com/repos/BigBlockDataChain/morbo/statuses/1dd7be59375e37bc33f3b30b6552a863223aee29","head":{"label":"BigBlockDataChain:fix/graph-coordinates","ref":"fix/graph-coordinates","sha":"1dd7be59375e37bc33f3b30b6552a863223aee29","user":{"login":"BigBlockDataChain","id":43867546,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzODY3NTQ2","avatar_url":"https://avatars0.githubusercontent.com/u/43867546?v=4","gravatar_id":"","url":"https://api.github.com/users/BigBlockDataChain","html_url":"https://github.com/BigBlockDataChain","followers_url":"https://api.github.com/users/BigBlockDataChain/followers","following_url":"https://api.github.com/users/BigBlockDataChain/following{/other_user}","gists_url":"https://api.github.com/users/BigBlockDataChain/gists{/gist_id}","starred_url":"https://api.github.com/users/BigBlockDataChain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigBlockDataChain/subscriptions","organizations_url":"https://api.github.com/users/BigBlockDataChain/orgs","repos_url":"https://api.github.com/users/BigBlockDataChain/repos","events_url":"https://api.github.com/users/BigBlockDataChain/events{/privacy}","received_events_url":"https://api.github.com/users/BigBlockDataChain/received_events","type":"Organization","site_admin":false},"repo":{"id":151902372,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE5MDIzNzI=","name":"morbo","full_name":"BigBlockDataChain/morbo","private":false,"owner":{"login":"BigBlockDataChain","id":43867546,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzODY3NTQ2","avatar_url":"https://avatars0.githubusercontent.com/u/43867546?v=4","gravatar_id":"","url":"https://api.github.com/users/BigBlockDataChain","html_url":"https://github.com/BigBlockDataChain","followers_url":"https://api.github.com/users/BigBlockDataChain/followers","following_url":"https://api.github.com/users/BigBlockDataChain/following{/other_user}","gists_url":"https://api.github.com/users/BigBlockDataChain/gists{/gist_id}","starred_url":"https://api.github.com/users/BigBlockDataChain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigBlockDataChain/subscriptions","organizations_url":"https://api.github.com/users/BigBlockDataChain/orgs","repos_url":"https://api.github.com/users/BigBlockDataChain/repos","events_url":"https://api.github.com/users/BigBlockDataChain/events{/privacy}","received_events_url":"https://api.github.com/users/BigBlockDataChain/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/BigBlockDataChain/morbo","description":null,"fork":false,"url":"https://api.github.com/repos/BigBlockDataChain/morbo","forks_url":"https://api.github.com/repos/BigBlockDataChain/morbo/forks","keys_url":"https://api.github.com/repos/BigBlockDataChain/morbo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BigBlockDataChain/morbo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BigBlockDataChain/morbo/teams","hooks_url":"https://api.github.com/repos/BigBlockDataChain/morbo/hooks","issue_events_url":"https://api.github.com/repos/BigBlockDataChain/morbo/issues/events{/number}","events_url":"https://api.github.com/repos/BigBlockDataChain/morbo/events","assignees_url":"https://api.github.com/repos/BigBlockDataChain/morbo/assignees{/user}","branches_url":"https://api.github.com/repos/BigBlockDataChain/morbo/branches{/branch}","tags_url":"https://api.github.com/repos/BigBlockDataChain/morbo/tags","blobs_url":"https://api.github.com/repos/BigBlockDataChain/morbo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BigBlockDataChain/morbo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BigBlockDataChain/morbo/git/refs{/sha}","trees_url":"https://api.github.com/repos/BigBlockDataChain/morbo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BigBlockDataChain/morbo/statuses/{sha}","languages_url":"https://api.github.com/repos/BigBlockDataChain/morbo/languages","stargazers_url":"https://api.github.com/repos/BigBlockDataChain/morbo/stargazers","contributors_url":"https://api.github.com/repos/BigBlockDataChain/morbo/contributors","subscribers_url":"https://api.github.com/repos/BigBlockDataChain/morbo/subscribers","subscription_url":"https://api.github.com/repos/BigBlockDataChain/morbo/subscription","commits_url":"https://api.github.com/repos/BigBlockDataChain/morbo/commits{/sha}","git_commits_url":"https://api.github.com/repos/BigBlockDataChain/morbo/git/commits{/sha}","comments_url":"https://api.github.com/repos/BigBlockDataChain/morbo/comments{/number}","issue_comment_url":"https://api.github.com/repos/BigBlockDataChain/morbo/issues/comments{/number}","contents_url":"https://api.github.com/repos/BigBlockDataChain/morbo/contents/{+path}","compare_url":"https://api.github.com/repos/BigBlockDataChain/morbo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BigBlockDataChain/morbo/merges","archive_url":"https://api.github.com/repos/BigBlockDataChain/morbo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BigBlockDataChain/morbo/downloads","issues_url":"https://api.github.com/repos/BigBlockDataChain/morbo/issues{/number}","pulls_url":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls{/number}","milestones_url":"https://api.github.com/repos/BigBlockDataChain/morbo/milestones{/number}","notifications_url":"https://api.github.com/repos/BigBlockDataChain/morbo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BigBlockDataChain/morbo/labels{/name}","releases_url":"https://api.github.com/repos/BigBlockDataChain/morbo/releases{/id}","deployments_url":"https://api.github.com/repos/BigBlockDataChain/morbo/deployments","created_at":"2018-10-07T03:22:03Z","updated_at":"2018-12-23T07:20:53Z","pushed_at":"2018-12-23T20:36:59Z","git_url":"git://github.com/BigBlockDataChain/morbo.git","ssh_url":"git@github.com:BigBlockDataChain/morbo.git","clone_url":"https://github.com/BigBlockDataChain/morbo.git","svn_url":"https://github.com/BigBlockDataChain/morbo","homepage":null,"size":917,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":16,"license":null,"forks":0,"open_issues":16,"watchers":0,"default_branch":"master"}},"base":{"label":"BigBlockDataChain:master","ref":"master","sha":"9641726bc82f0458914d556859454f2e6481b796","user":{"login":"BigBlockDataChain","id":43867546,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzODY3NTQ2","avatar_url":"https://avatars0.githubusercontent.com/u/43867546?v=4","gravatar_id":"","url":"https://api.github.com/users/BigBlockDataChain","html_url":"https://github.com/BigBlockDataChain","followers_url":"https://api.github.com/users/BigBlockDataChain/followers","following_url":"https://api.github.com/users/BigBlockDataChain/following{/other_user}","gists_url":"https://api.github.com/users/BigBlockDataChain/gists{/gist_id}","starred_url":"https://api.github.com/users/BigBlockDataChain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigBlockDataChain/subscriptions","organizations_url":"https://api.github.com/users/BigBlockDataChain/orgs","repos_url":"https://api.github.com/users/BigBlockDataChain/repos","events_url":"https://api.github.com/users/BigBlockDataChain/events{/privacy}","received_events_url":"https://api.github.com/users/BigBlockDataChain/received_events","type":"Organization","site_admin":false},"repo":{"id":151902372,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE5MDIzNzI=","name":"morbo","full_name":"BigBlockDataChain/morbo","private":false,"owner":{"login":"BigBlockDataChain","id":43867546,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzODY3NTQ2","avatar_url":"https://avatars0.githubusercontent.com/u/43867546?v=4","gravatar_id":"","url":"https://api.github.com/users/BigBlockDataChain","html_url":"https://github.com/BigBlockDataChain","followers_url":"https://api.github.com/users/BigBlockDataChain/followers","following_url":"https://api.github.com/users/BigBlockDataChain/following{/other_user}","gists_url":"https://api.github.com/users/BigBlockDataChain/gists{/gist_id}","starred_url":"https://api.github.com/users/BigBlockDataChain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigBlockDataChain/subscriptions","organizations_url":"https://api.github.com/users/BigBlockDataChain/orgs","repos_url":"https://api.github.com/users/BigBlockDataChain/repos","events_url":"https://api.github.com/users/BigBlockDataChain/events{/privacy}","received_events_url":"https://api.github.com/users/BigBlockDataChain/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/BigBlockDataChain/morbo","description":null,"fork":false,"url":"https://api.github.com/repos/BigBlockDataChain/morbo","forks_url":"https://api.github.com/repos/BigBlockDataChain/morbo/forks","keys_url":"https://api.github.com/repos/BigBlockDataChain/morbo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BigBlockDataChain/morbo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BigBlockDataChain/morbo/teams","hooks_url":"https://api.github.com/repos/BigBlockDataChain/morbo/hooks","issue_events_url":"https://api.github.com/repos/BigBlockDataChain/morbo/issues/events{/number}","events_url":"https://api.github.com/repos/BigBlockDataChain/morbo/events","assignees_url":"https://api.github.com/repos/BigBlockDataChain/morbo/assignees{/user}","branches_url":"https://api.github.com/repos/BigBlockDataChain/morbo/branches{/branch}","tags_url":"https://api.github.com/repos/BigBlockDataChain/morbo/tags","blobs_url":"https://api.github.com/repos/BigBlockDataChain/morbo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BigBlockDataChain/morbo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BigBlockDataChain/morbo/git/refs{/sha}","trees_url":"https://api.github.com/repos/BigBlockDataChain/morbo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BigBlockDataChain/morbo/statuses/{sha}","languages_url":"https://api.github.com/repos/BigBlockDataChain/morbo/languages","stargazers_url":"https://api.github.com/repos/BigBlockDataChain/morbo/stargazers","contributors_url":"https://api.github.com/repos/BigBlockDataChain/morbo/contributors","subscribers_url":"https://api.github.com/repos/BigBlockDataChain/morbo/subscribers","subscription_url":"https://api.github.com/repos/BigBlockDataChain/morbo/subscription","commits_url":"https://api.github.com/repos/BigBlockDataChain/morbo/commits{/sha}","git_commits_url":"https://api.github.com/repos/BigBlockDataChain/morbo/git/commits{/sha}","comments_url":"https://api.github.com/repos/BigBlockDataChain/morbo/comments{/number}","issue_comment_url":"https://api.github.com/repos/BigBlockDataChain/morbo/issues/comments{/number}","contents_url":"https://api.github.com/repos/BigBlockDataChain/morbo/contents/{+path}","compare_url":"https://api.github.com/repos/BigBlockDataChain/morbo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BigBlockDataChain/morbo/merges","archive_url":"https://api.github.com/repos/BigBlockDataChain/morbo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BigBlockDataChain/morbo/downloads","issues_url":"https://api.github.com/repos/BigBlockDataChain/morbo/issues{/number}","pulls_url":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls{/number}","milestones_url":"https://api.github.com/repos/BigBlockDataChain/morbo/milestones{/number}","notifications_url":"https://api.github.com/repos/BigBlockDataChain/morbo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BigBlockDataChain/morbo/labels{/name}","releases_url":"https://api.github.com/repos/BigBlockDataChain/morbo/releases{/id}","deployments_url":"https://api.github.com/repos/BigBlockDataChain/morbo/deployments","created_at":"2018-10-07T03:22:03Z","updated_at":"2018-12-23T07:20:53Z","pushed_at":"2018-12-23T20:36:59Z","git_url":"git://github.com/BigBlockDataChain/morbo.git","ssh_url":"git@github.com:BigBlockDataChain/morbo.git","clone_url":"https://github.com/BigBlockDataChain/morbo.git","svn_url":"https://github.com/BigBlockDataChain/morbo","homepage":null,"size":917,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":16,"license":null,"forks":0,"open_issues":16,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/26"},"html":{"href":"https://github.com/BigBlockDataChain/morbo/pull/26"},"issue":{"href":"https://api.github.com/repos/BigBlockDataChain/morbo/issues/26"},"comments":{"href":"https://api.github.com/repos/BigBlockDataChain/morbo/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BigBlockDataChain/morbo/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/BigBlockDataChain/morbo/statuses/1dd7be59375e37bc33f3b30b6552a863223aee29"}},"author_association":"NONE"}}
{"actor":{"display_login":"francium"}}