{"action":"created","comment":{"url":"https://api.github.com/repos/dssg/tyra/pulls/comments/131192280","pull_request_review_id":54150050,"id":131192280,"diff_hunk":"@@ -0,0 +1,74 @@\n+import { Hint, HeatmapSeries, HorizontalGridLines, XAxis, XYPlot, YAxis } from 'react-vis'\n+import { values, reverse } from 'ramda'\n+import React from 'react'\n+\n+\n+export default React.createClass({\n+  getInitialState: function() {\n+    return {\n+      data: [],\n+      loading: false,\n+    }\n+  },\n+\n+  ajax_call: function() {\n+    const self = this\n+    self.setState({ loading: true })\n+    $.ajax({\n+      type: \"GET\",\n+      url: \"/evaluations/\" + this.props.modelId + \"/individual_feature_importance/\" + this.props.entity_id + '/' + this.props.asOfDate,\n+      success: function(result) {\n+        self.setState({\n+          data: reverse(values(result.results[0])),\n+          loading: false\n+        })\n+      }\n+    })\n+  },\n+\n+  componentDidUpdate: function(prevProps, prevState) {\n+    const self = this\n+    if (self.props.entity_id !== prevProps.entity_id) {\n+      this.ajax_call()\n+    }\n+  },\n+\n+  render: function() {\n+    if(this.state.loading) {\n+      return (\n+        <div>\n+          <h4>Individual Feature Importance</h4>\n+          <div id=\"loader\" style={{ margin: \"0 auto\" }} className=\"loader\"></div>\n+        </div>\n+      )\n+    } else if (this.state.data.length == 0) {\n+      return (\n+        <div>\n+          <h4>Individual Feature Importance</h4>\n+          <strong>No data. </strong>\n+        </div>\n+      )\n+    } else {\n+      return (\n+        <div>\n+          <h4>Individual Feature Importance</h4>\n+          <XYPlot\n+            margin={{left: 0}}\n+            width={320}\n+            height={320}>\n+            <XAxis hideTicks />\n+            <HeatmapSeries\n+              opacity={0.7}\n+              data={[\n+                {x: 1, y: 0, label: \"risk1\", color: 20},\n+                {x: 1, y: 5, label: \"risk2\", color: 15},\n+                {x: 1, y: 10, label: \"risk3\", color: 10},","path":"frontend/components/individual_importance-chart/component.js","position":65,"original_position":65,"commit_id":"17020b063c98e10bf3a055b87e00ddf9fc31e612","original_commit_id":"17020b063c98e10bf3a055b87e00ddf9fc31e612","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"A space is required after '{'                                                                      object-curly-spacing<br>A space is required before '}'                                                                     object-curly-spacing","created_at":"2017-08-03T16:30:48Z","updated_at":"2017-08-03T16:30:48Z","html_url":"https://github.com/dssg/tyra/pull/69#discussion_r131192280","pull_request_url":"https://api.github.com/repos/dssg/tyra/pulls/69","_links":{"self":{"href":"https://api.github.com/repos/dssg/tyra/pulls/comments/131192280"},"html":{"href":"https://github.com/dssg/tyra/pull/69#discussion_r131192280"},"pull_request":{"href":"https://api.github.com/repos/dssg/tyra/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/dssg/tyra/pulls/69","id":133986263,"html_url":"https://github.com/dssg/tyra/pull/69","diff_url":"https://github.com/dssg/tyra/pull/69.diff","patch_url":"https://github.com/dssg/tyra/pull/69.patch","issue_url":"https://api.github.com/repos/dssg/tyra/issues/69","number":69,"state":"open","locked":false,"title":"Individual feature importance","user":{"login":"tweddielin","id":9650575,"avatar_url":"https://avatars1.githubusercontent.com/u/9650575?v=4","gravatar_id":"","url":"https://api.github.com/users/tweddielin","html_url":"https://github.com/tweddielin","followers_url":"https://api.github.com/users/tweddielin/followers","following_url":"https://api.github.com/users/tweddielin/following{/other_user}","gists_url":"https://api.github.com/users/tweddielin/gists{/gist_id}","starred_url":"https://api.github.com/users/tweddielin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tweddielin/subscriptions","organizations_url":"https://api.github.com/users/tweddielin/orgs","repos_url":"https://api.github.com/users/tweddielin/repos","events_url":"https://api.github.com/users/tweddielin/events{/privacy}","received_events_url":"https://api.github.com/users/tweddielin/received_events","type":"User","site_admin":false},"body":"- Linked entity_id with individual feature importance. \r\n- Changed metric overtime's layout\r\n- Fixed bugs in feature-block and feature_importance","created_at":"2017-08-03T16:20:25Z","updated_at":"2017-08-03T16:30:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"014fd59212b678014945f1df80654b238fb786b6","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dssg/tyra/pulls/69/commits","review_comments_url":"https://api.github.com/repos/dssg/tyra/pulls/69/comments","review_comment_url":"https://api.github.com/repos/dssg/tyra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dssg/tyra/issues/69/comments","statuses_url":"https://api.github.com/repos/dssg/tyra/statuses/17020b063c98e10bf3a055b87e00ddf9fc31e612","head":{"label":"dssg:individual_feature","ref":"individual_feature","sha":"17020b063c98e10bf3a055b87e00ddf9fc31e612","user":{"login":"dssg","id":3827384,"avatar_url":"https://avatars1.githubusercontent.com/u/3827384?v=4","gravatar_id":"","url":"https://api.github.com/users/dssg","html_url":"https://github.com/dssg","followers_url":"https://api.github.com/users/dssg/followers","following_url":"https://api.github.com/users/dssg/following{/other_user}","gists_url":"https://api.github.com/users/dssg/gists{/gist_id}","starred_url":"https://api.github.com/users/dssg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dssg/subscriptions","organizations_url":"https://api.github.com/users/dssg/orgs","repos_url":"https://api.github.com/users/dssg/repos","events_url":"https://api.github.com/users/dssg/events{/privacy}","received_events_url":"https://api.github.com/users/dssg/received_events","type":"Organization","site_admin":false},"repo":{"id":75334747,"name":"tyra","full_name":"dssg/tyra","owner":{"login":"dssg","id":3827384,"avatar_url":"https://avatars1.githubusercontent.com/u/3827384?v=4","gravatar_id":"","url":"https://api.github.com/users/dssg","html_url":"https://github.com/dssg","followers_url":"https://api.github.com/users/dssg/followers","following_url":"https://api.github.com/users/dssg/following{/other_user}","gists_url":"https://api.github.com/users/dssg/gists{/gist_id}","starred_url":"https://api.github.com/users/dssg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dssg/subscriptions","organizations_url":"https://api.github.com/users/dssg/orgs","repos_url":"https://api.github.com/users/dssg/repos","events_url":"https://api.github.com/users/dssg/events{/privacy}","received_events_url":"https://api.github.com/users/dssg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dssg/tyra","description":"Prediction model evaluation","fork":false,"url":"https://api.github.com/repos/dssg/tyra","forks_url":"https://api.github.com/repos/dssg/tyra/forks","keys_url":"https://api.github.com/repos/dssg/tyra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dssg/tyra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dssg/tyra/teams","hooks_url":"https://api.github.com/repos/dssg/tyra/hooks","issue_events_url":"https://api.github.com/repos/dssg/tyra/issues/events{/number}","events_url":"https://api.github.com/repos/dssg/tyra/events","assignees_url":"https://api.github.com/repos/dssg/tyra/assignees{/user}","branches_url":"https://api.github.com/repos/dssg/tyra/branches{/branch}","tags_url":"https://api.github.com/repos/dssg/tyra/tags","blobs_url":"https://api.github.com/repos/dssg/tyra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dssg/tyra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dssg/tyra/git/refs{/sha}","trees_url":"https://api.github.com/repos/dssg/tyra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dssg/tyra/statuses/{sha}","languages_url":"https://api.github.com/repos/dssg/tyra/languages","stargazers_url":"https://api.github.com/repos/dssg/tyra/stargazers","contributors_url":"https://api.github.com/repos/dssg/tyra/contributors","subscribers_url":"https://api.github.com/repos/dssg/tyra/subscribers","subscription_url":"https://api.github.com/repos/dssg/tyra/subscription","commits_url":"https://api.github.com/repos/dssg/tyra/commits{/sha}","git_commits_url":"https://api.github.com/repos/dssg/tyra/git/commits{/sha}","comments_url":"https://api.github.com/repos/dssg/tyra/comments{/number}","issue_comment_url":"https://api.github.com/repos/dssg/tyra/issues/comments{/number}","contents_url":"https://api.github.com/repos/dssg/tyra/contents/{+path}","compare_url":"https://api.github.com/repos/dssg/tyra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dssg/tyra/merges","archive_url":"https://api.github.com/repos/dssg/tyra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dssg/tyra/downloads","issues_url":"https://api.github.com/repos/dssg/tyra/issues{/number}","pulls_url":"https://api.github.com/repos/dssg/tyra/pulls{/number}","milestones_url":"https://api.github.com/repos/dssg/tyra/milestones{/number}","notifications_url":"https://api.github.com/repos/dssg/tyra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dssg/tyra/labels{/name}","releases_url":"https://api.github.com/repos/dssg/tyra/releases{/id}","deployments_url":"https://api.github.com/repos/dssg/tyra/deployments","created_at":"2016-12-01T21:33:22Z","updated_at":"2017-02-27T05:13:10Z","pushed_at":"2017-08-03T16:30:34Z","git_url":"git://github.com/dssg/tyra.git","ssh_url":"git@github.com:dssg/tyra.git","clone_url":"https://github.com/dssg/tyra.git","svn_url":"https://github.com/dssg/tyra","homepage":null,"size":2132,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":16,"forks":0,"open_issues":16,"watchers":1,"default_branch":"master"}},"base":{"label":"dssg:master","ref":"master","sha":"2eb986705a443c8335423b722b10ef2d84ed4c53","user":{"login":"dssg","id":3827384,"avatar_url":"https://avatars1.githubusercontent.com/u/3827384?v=4","gravatar_id":"","url":"https://api.github.com/users/dssg","html_url":"https://github.com/dssg","followers_url":"https://api.github.com/users/dssg/followers","following_url":"https://api.github.com/users/dssg/following{/other_user}","gists_url":"https://api.github.com/users/dssg/gists{/gist_id}","starred_url":"https://api.github.com/users/dssg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dssg/subscriptions","organizations_url":"https://api.github.com/users/dssg/orgs","repos_url":"https://api.github.com/users/dssg/repos","events_url":"https://api.github.com/users/dssg/events{/privacy}","received_events_url":"https://api.github.com/users/dssg/received_events","type":"Organization","site_admin":false},"repo":{"id":75334747,"name":"tyra","full_name":"dssg/tyra","owner":{"login":"dssg","id":3827384,"avatar_url":"https://avatars1.githubusercontent.com/u/3827384?v=4","gravatar_id":"","url":"https://api.github.com/users/dssg","html_url":"https://github.com/dssg","followers_url":"https://api.github.com/users/dssg/followers","following_url":"https://api.github.com/users/dssg/following{/other_user}","gists_url":"https://api.github.com/users/dssg/gists{/gist_id}","starred_url":"https://api.github.com/users/dssg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dssg/subscriptions","organizations_url":"https://api.github.com/users/dssg/orgs","repos_url":"https://api.github.com/users/dssg/repos","events_url":"https://api.github.com/users/dssg/events{/privacy}","received_events_url":"https://api.github.com/users/dssg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dssg/tyra","description":"Prediction model evaluation","fork":false,"url":"https://api.github.com/repos/dssg/tyra","forks_url":"https://api.github.com/repos/dssg/tyra/forks","keys_url":"https://api.github.com/repos/dssg/tyra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dssg/tyra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dssg/tyra/teams","hooks_url":"https://api.github.com/repos/dssg/tyra/hooks","issue_events_url":"https://api.github.com/repos/dssg/tyra/issues/events{/number}","events_url":"https://api.github.com/repos/dssg/tyra/events","assignees_url":"https://api.github.com/repos/dssg/tyra/assignees{/user}","branches_url":"https://api.github.com/repos/dssg/tyra/branches{/branch}","tags_url":"https://api.github.com/repos/dssg/tyra/tags","blobs_url":"https://api.github.com/repos/dssg/tyra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dssg/tyra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dssg/tyra/git/refs{/sha}","trees_url":"https://api.github.com/repos/dssg/tyra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dssg/tyra/statuses/{sha}","languages_url":"https://api.github.com/repos/dssg/tyra/languages","stargazers_url":"https://api.github.com/repos/dssg/tyra/stargazers","contributors_url":"https://api.github.com/repos/dssg/tyra/contributors","subscribers_url":"https://api.github.com/repos/dssg/tyra/subscribers","subscription_url":"https://api.github.com/repos/dssg/tyra/subscription","commits_url":"https://api.github.com/repos/dssg/tyra/commits{/sha}","git_commits_url":"https://api.github.com/repos/dssg/tyra/git/commits{/sha}","comments_url":"https://api.github.com/repos/dssg/tyra/comments{/number}","issue_comment_url":"https://api.github.com/repos/dssg/tyra/issues/comments{/number}","contents_url":"https://api.github.com/repos/dssg/tyra/contents/{+path}","compare_url":"https://api.github.com/repos/dssg/tyra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dssg/tyra/merges","archive_url":"https://api.github.com/repos/dssg/tyra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dssg/tyra/downloads","issues_url":"https://api.github.com/repos/dssg/tyra/issues{/number}","pulls_url":"https://api.github.com/repos/dssg/tyra/pulls{/number}","milestones_url":"https://api.github.com/repos/dssg/tyra/milestones{/number}","notifications_url":"https://api.github.com/repos/dssg/tyra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dssg/tyra/labels{/name}","releases_url":"https://api.github.com/repos/dssg/tyra/releases{/id}","deployments_url":"https://api.github.com/repos/dssg/tyra/deployments","created_at":"2016-12-01T21:33:22Z","updated_at":"2017-02-27T05:13:10Z","pushed_at":"2017-08-03T16:30:34Z","git_url":"git://github.com/dssg/tyra.git","ssh_url":"git@github.com:dssg/tyra.git","clone_url":"https://github.com/dssg/tyra.git","svn_url":"https://github.com/dssg/tyra","homepage":null,"size":2132,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":16,"forks":0,"open_issues":16,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dssg/tyra/pulls/69"},"html":{"href":"https://github.com/dssg/tyra/pull/69"},"issue":{"href":"https://api.github.com/repos/dssg/tyra/issues/69"},"comments":{"href":"https://api.github.com/repos/dssg/tyra/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/dssg/tyra/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/dssg/tyra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dssg/tyra/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/dssg/tyra/statuses/17020b063c98e10bf3a055b87e00ddf9fc31e612"}}}}
{"actor":{"display_login":"houndci-bot"}}