{"action":"created","comment":{"url":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/comments/52162039","id":52162039,"diff_hunk":"@@ -0,0 +1,132 @@\n+function OverallReport(data, dmn) {\n+  var margin = {\n+      top: 60,\n+      right: 0,\n+      bottom: 30,\n+      left: 240\n+    },\n+    width = 960 - margin.left - margin.right,\n+    height = 500 - margin.top - margin.bottom;\n+\n+  var x = d3.scale.ordinal()\n+    .rangeRoundBands([0, width], .1);\n+\n+  var y = d3.scale.linear()\n+    .rangeRound([height, 0]);\n+\n+  var color = d3.scale.ordinal()\n+    .range([\"#98abc5\", \"#8a89a6\", \"#7b6888\", \"#6b486b\", \"#a05d56\", \"#d0743c\", \"#ff8c00\"]);\n+\n+  var xAxis = d3.svg.axis()\n+    .scale(x)\n+    .orient(\"bottom\");\n+\n+  var yAxis = d3.svg.axis()\n+    .scale(y)\n+    .orient(\"left\")\n+    .tickFormat(d3.format(\".2s\"));\n+\n+  var svg = d3.select(\"body\").append(\"svg\")\n+    .attr(\"width\", width + margin.left + margin.right)\n+    .attr(\"height\", height + margin.top + margin.bottom + 200)\n+    .append(\"g\")\n+    .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n+\n+  color.domain(dmn);\n+\n+  data.forEach(function(d) {\n+    var y0 = 0;\n+    d.ages = color.domain().map(function(name) {\n+      d[name] = (d[name] === undefined) ? 0 : d[name]\n+      return {\n+        name: name,\n+        y0: y0,\n+        y1: y0 += +d[name]\n+      };\n+    });\n+    d.total = d.ages[d.ages.length - 1].y1;\n+  });\n+\n+\n+  data.sort(function(a, b) {\n+    return b.total - a.total;\n+  });\n+\n+  x.domain(data.map(function(d) {\n+    return d.link;\n+  }));\n+  y.domain([0, d3.max(data, function(d) {\n+    return d.total;\n+  })]);\n+\n+  svg.append(\"g\")\n+    .attr(\"class\", \"x axis\")\n+    .attr(\"transform\", \"translate(0,\" + height + \")\")\n+    .call(xAxis)\n+    .selectAll(\"text\")\n+    .attr(\"y\", 0)\n+    .attr(\"x\", 9)\n+    .attr(\"dy\", \".35em\")\n+    .attr(\"transform\", \"rotate(90)\")\n+    .style(\"text-anchor\", \"start\");\n+\n+  svg.append(\"g\")\n+    .attr(\"class\", \"y axis\")\n+    .call(yAxis)\n+    .append(\"text\")\n+    .attr(\"transform\", \"rotate(-90)\")\n+    .attr(\"y\", 6)\n+    .attr(\"dy\", \".71em\")\n+    .style(\"text-anchor\", \"end\")\n+    .text(\"Page visits count\");\n+\n+  var state = svg.selectAll(\".state\")\n+    .data(data)\n+    .enter().append(\"g\")\n+    .attr(\"class\", \"g\")\n+    .attr(\"transform\", function(d) {\n+      return \"translate(\" + x(d.link) + \",0)\";\n+    });\n+\n+  state.selectAll(\"rect\")\n+    .data(function(d) {\n+      return d.ages;\n+    })\n+    .enter().append(\"rect\")\n+    .attr(\"width\", x.rangeBand())\n+    .attr(\"y\", function(d) {\n+      return y(d.y1);\n+    })\n+    .attr(\"height\", function(d) {\n+      return y(d.y0) - y(d.y1);\n+    })\n+    .style(\"fill\", function(d) {\n+      return color(d.name);\n+    });\n+\n+  d3.selectAll(\"text\")","path":"app/assets/javascripts/trainer_plugin/overall.js","position":107,"original_position":107,"commit_id":"9b8d87f77f35c085df94cdd8743ce7e1c60aa14d","original_commit_id":"9b8d87f77f35c085df94cdd8743ce7e1c60aa14d","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"'d3' is not defined.","created_at":"2016-02-08T12:17:33Z","updated_at":"2016-02-08T12:17:33Z","html_url":"https://github.com/Shkrt/trainer_plugin/pull/1#discussion_r52162039","pull_request_url":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/comments/52162039"},"html":{"href":"https://github.com/Shkrt/trainer_plugin/pull/1#discussion_r52162039"},"pull_request":{"href":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/1","id":58518691,"html_url":"https://github.com/Shkrt/trainer_plugin/pull/1","diff_url":"https://github.com/Shkrt/trainer_plugin/pull/1.diff","patch_url":"https://github.com/Shkrt/trainer_plugin/pull/1.patch","issue_url":"https://api.github.com/repos/Shkrt/trainer_plugin/issues/1","number":1,"state":"open","locked":false,"title":"move analytic feature to engine","user":{"login":"Shkrt","id":10468452,"avatar_url":"https://avatars.githubusercontent.com/u/10468452?v=3","gravatar_id":"","url":"https://api.github.com/users/Shkrt","html_url":"https://github.com/Shkrt","followers_url":"https://api.github.com/users/Shkrt/followers","following_url":"https://api.github.com/users/Shkrt/following{/other_user}","gists_url":"https://api.github.com/users/Shkrt/gists{/gist_id}","starred_url":"https://api.github.com/users/Shkrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shkrt/subscriptions","organizations_url":"https://api.github.com/users/Shkrt/orgs","repos_url":"https://api.github.com/users/Shkrt/repos","events_url":"https://api.github.com/users/Shkrt/events{/privacy}","received_events_url":"https://api.github.com/users/Shkrt/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-06T12:01:06Z","updated_at":"2016-02-08T12:17:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1bd2cd2cb889cc0eff891a23b42c110d998a6d28","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shkrt/trainer_plugin/issues/1/comments","statuses_url":"https://api.github.com/repos/Shkrt/trainer_plugin/statuses/9b8d87f77f35c085df94cdd8743ce7e1c60aa14d","head":{"label":"Shkrt:engine","ref":"engine","sha":"9b8d87f77f35c085df94cdd8743ce7e1c60aa14d","user":{"login":"Shkrt","id":10468452,"avatar_url":"https://avatars.githubusercontent.com/u/10468452?v=3","gravatar_id":"","url":"https://api.github.com/users/Shkrt","html_url":"https://github.com/Shkrt","followers_url":"https://api.github.com/users/Shkrt/followers","following_url":"https://api.github.com/users/Shkrt/following{/other_user}","gists_url":"https://api.github.com/users/Shkrt/gists{/gist_id}","starred_url":"https://api.github.com/users/Shkrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shkrt/subscriptions","organizations_url":"https://api.github.com/users/Shkrt/orgs","repos_url":"https://api.github.com/users/Shkrt/repos","events_url":"https://api.github.com/users/Shkrt/events{/privacy}","received_events_url":"https://api.github.com/users/Shkrt/received_events","type":"User","site_admin":false},"repo":{"id":51054823,"name":"trainer_plugin","full_name":"Shkrt/trainer_plugin","owner":{"login":"Shkrt","id":10468452,"avatar_url":"https://avatars.githubusercontent.com/u/10468452?v=3","gravatar_id":"","url":"https://api.github.com/users/Shkrt","html_url":"https://github.com/Shkrt","followers_url":"https://api.github.com/users/Shkrt/followers","following_url":"https://api.github.com/users/Shkrt/following{/other_user}","gists_url":"https://api.github.com/users/Shkrt/gists{/gist_id}","starred_url":"https://api.github.com/users/Shkrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shkrt/subscriptions","organizations_url":"https://api.github.com/users/Shkrt/orgs","repos_url":"https://api.github.com/users/Shkrt/repos","events_url":"https://api.github.com/users/Shkrt/events{/privacy}","received_events_url":"https://api.github.com/users/Shkrt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Shkrt/trainer_plugin","description":"","fork":false,"url":"https://api.github.com/repos/Shkrt/trainer_plugin","forks_url":"https://api.github.com/repos/Shkrt/trainer_plugin/forks","keys_url":"https://api.github.com/repos/Shkrt/trainer_plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shkrt/trainer_plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shkrt/trainer_plugin/teams","hooks_url":"https://api.github.com/repos/Shkrt/trainer_plugin/hooks","issue_events_url":"https://api.github.com/repos/Shkrt/trainer_plugin/issues/events{/number}","events_url":"https://api.github.com/repos/Shkrt/trainer_plugin/events","assignees_url":"https://api.github.com/repos/Shkrt/trainer_plugin/assignees{/user}","branches_url":"https://api.github.com/repos/Shkrt/trainer_plugin/branches{/branch}","tags_url":"https://api.github.com/repos/Shkrt/trainer_plugin/tags","blobs_url":"https://api.github.com/repos/Shkrt/trainer_plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shkrt/trainer_plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shkrt/trainer_plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shkrt/trainer_plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shkrt/trainer_plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/Shkrt/trainer_plugin/languages","stargazers_url":"https://api.github.com/repos/Shkrt/trainer_plugin/stargazers","contributors_url":"https://api.github.com/repos/Shkrt/trainer_plugin/contributors","subscribers_url":"https://api.github.com/repos/Shkrt/trainer_plugin/subscribers","subscription_url":"https://api.github.com/repos/Shkrt/trainer_plugin/subscription","commits_url":"https://api.github.com/repos/Shkrt/trainer_plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shkrt/trainer_plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shkrt/trainer_plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shkrt/trainer_plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shkrt/trainer_plugin/contents/{+path}","compare_url":"https://api.github.com/repos/Shkrt/trainer_plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shkrt/trainer_plugin/merges","archive_url":"https://api.github.com/repos/Shkrt/trainer_plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shkrt/trainer_plugin/downloads","issues_url":"https://api.github.com/repos/Shkrt/trainer_plugin/issues{/number}","pulls_url":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/Shkrt/trainer_plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/Shkrt/trainer_plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shkrt/trainer_plugin/labels{/name}","releases_url":"https://api.github.com/repos/Shkrt/trainer_plugin/releases{/id}","deployments_url":"https://api.github.com/repos/Shkrt/trainer_plugin/deployments","created_at":"2016-02-04T05:38:47Z","updated_at":"2016-02-04T05:38:47Z","pushed_at":"2016-02-08T12:16:47Z","git_url":"git://github.com/Shkrt/trainer_plugin.git","ssh_url":"git@github.com:Shkrt/trainer_plugin.git","clone_url":"https://github.com/Shkrt/trainer_plugin.git","svn_url":"https://github.com/Shkrt/trainer_plugin","homepage":null,"size":220,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Shkrt:master","ref":"master","sha":"5db4413676318931b5d8aeb38fdfe7969c2bbd93","user":{"login":"Shkrt","id":10468452,"avatar_url":"https://avatars.githubusercontent.com/u/10468452?v=3","gravatar_id":"","url":"https://api.github.com/users/Shkrt","html_url":"https://github.com/Shkrt","followers_url":"https://api.github.com/users/Shkrt/followers","following_url":"https://api.github.com/users/Shkrt/following{/other_user}","gists_url":"https://api.github.com/users/Shkrt/gists{/gist_id}","starred_url":"https://api.github.com/users/Shkrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shkrt/subscriptions","organizations_url":"https://api.github.com/users/Shkrt/orgs","repos_url":"https://api.github.com/users/Shkrt/repos","events_url":"https://api.github.com/users/Shkrt/events{/privacy}","received_events_url":"https://api.github.com/users/Shkrt/received_events","type":"User","site_admin":false},"repo":{"id":51054823,"name":"trainer_plugin","full_name":"Shkrt/trainer_plugin","owner":{"login":"Shkrt","id":10468452,"avatar_url":"https://avatars.githubusercontent.com/u/10468452?v=3","gravatar_id":"","url":"https://api.github.com/users/Shkrt","html_url":"https://github.com/Shkrt","followers_url":"https://api.github.com/users/Shkrt/followers","following_url":"https://api.github.com/users/Shkrt/following{/other_user}","gists_url":"https://api.github.com/users/Shkrt/gists{/gist_id}","starred_url":"https://api.github.com/users/Shkrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shkrt/subscriptions","organizations_url":"https://api.github.com/users/Shkrt/orgs","repos_url":"https://api.github.com/users/Shkrt/repos","events_url":"https://api.github.com/users/Shkrt/events{/privacy}","received_events_url":"https://api.github.com/users/Shkrt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Shkrt/trainer_plugin","description":"","fork":false,"url":"https://api.github.com/repos/Shkrt/trainer_plugin","forks_url":"https://api.github.com/repos/Shkrt/trainer_plugin/forks","keys_url":"https://api.github.com/repos/Shkrt/trainer_plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shkrt/trainer_plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shkrt/trainer_plugin/teams","hooks_url":"https://api.github.com/repos/Shkrt/trainer_plugin/hooks","issue_events_url":"https://api.github.com/repos/Shkrt/trainer_plugin/issues/events{/number}","events_url":"https://api.github.com/repos/Shkrt/trainer_plugin/events","assignees_url":"https://api.github.com/repos/Shkrt/trainer_plugin/assignees{/user}","branches_url":"https://api.github.com/repos/Shkrt/trainer_plugin/branches{/branch}","tags_url":"https://api.github.com/repos/Shkrt/trainer_plugin/tags","blobs_url":"https://api.github.com/repos/Shkrt/trainer_plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shkrt/trainer_plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shkrt/trainer_plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shkrt/trainer_plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shkrt/trainer_plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/Shkrt/trainer_plugin/languages","stargazers_url":"https://api.github.com/repos/Shkrt/trainer_plugin/stargazers","contributors_url":"https://api.github.com/repos/Shkrt/trainer_plugin/contributors","subscribers_url":"https://api.github.com/repos/Shkrt/trainer_plugin/subscribers","subscription_url":"https://api.github.com/repos/Shkrt/trainer_plugin/subscription","commits_url":"https://api.github.com/repos/Shkrt/trainer_plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shkrt/trainer_plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shkrt/trainer_plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shkrt/trainer_plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shkrt/trainer_plugin/contents/{+path}","compare_url":"https://api.github.com/repos/Shkrt/trainer_plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shkrt/trainer_plugin/merges","archive_url":"https://api.github.com/repos/Shkrt/trainer_plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shkrt/trainer_plugin/downloads","issues_url":"https://api.github.com/repos/Shkrt/trainer_plugin/issues{/number}","pulls_url":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/Shkrt/trainer_plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/Shkrt/trainer_plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shkrt/trainer_plugin/labels{/name}","releases_url":"https://api.github.com/repos/Shkrt/trainer_plugin/releases{/id}","deployments_url":"https://api.github.com/repos/Shkrt/trainer_plugin/deployments","created_at":"2016-02-04T05:38:47Z","updated_at":"2016-02-04T05:38:47Z","pushed_at":"2016-02-08T12:16:47Z","git_url":"git://github.com/Shkrt/trainer_plugin.git","ssh_url":"git@github.com:Shkrt/trainer_plugin.git","clone_url":"https://github.com/Shkrt/trainer_plugin.git","svn_url":"https://github.com/Shkrt/trainer_plugin","homepage":null,"size":220,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/1"},"html":{"href":"https://github.com/Shkrt/trainer_plugin/pull/1"},"issue":{"href":"https://api.github.com/repos/Shkrt/trainer_plugin/issues/1"},"comments":{"href":"https://api.github.com/repos/Shkrt/trainer_plugin/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shkrt/trainer_plugin/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Shkrt/trainer_plugin/statuses/9b8d87f77f35c085df94cdd8743ce7e1c60aa14d"}}}}