{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/85260381","pull_request_review_id":5985729,"id":85260381,"diff_hunk":"@@ -0,0 +1,35 @@\n+import _ from 'lodash';\n+import uiModules from 'ui/modules';\n+\n+const module = uiModules.get('kibana/tagcloud', ['kibana']);\n+\n+module.controller('KbnCloudController', function ($scope) {\n+\n+  $scope.$watch('esResponse', function (response) {\n+\n+    if (!response) {\n+      $scope.data = null;\n+      return;\n+    }\n+\n+    const tagsAggId = _.first(_.pluck($scope.vis.aggs.bySchemaName.segment, 'id'));\n+    if (!tagsAggId || !response.aggregations) {\n+      $scope.data = null;\n+      return;\n+    }\n+\n+    const metricsAgg = _.first($scope.vis.aggs.bySchemaName.metric);\n+    const buckets = response.aggregations[tagsAggId].buckets;\n+\n+    const tags = buckets.map(function (bucket) {\n+      return {\n+        text: bucket.key,\n+        size: metricsAgg.getValue(bucket)\n+      };\n+    });\n+\n+    $scope.data = [{tags: tags}];\n+  });\n+});","path":"src/core_plugins/tag_cloud/public/cloud_controller.js","position":33,"original_position":33,"commit_id":"d4b5f7f99bb724aa5d9c33317d59271c463b58fa","original_commit_id":"d4b5f7f99bb724aa5d9c33317d59271c463b58fa","user":{"login":"cjcenizal","id":1238659,"avatar_url":"https://avatars.githubusercontent.com/u/1238659?v=3","gravatar_id":"","url":"https://api.github.com/users/cjcenizal","html_url":"https://github.com/cjcenizal","followers_url":"https://api.github.com/users/cjcenizal/followers","following_url":"https://api.github.com/users/cjcenizal/following{/other_user}","gists_url":"https://api.github.com/users/cjcenizal/gists{/gist_id}","starred_url":"https://api.github.com/users/cjcenizal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjcenizal/subscriptions","organizations_url":"https://api.github.com/users/cjcenizal/orgs","repos_url":"https://api.github.com/users/cjcenizal/repos","events_url":"https://api.github.com/users/cjcenizal/events{/privacy}","received_events_url":"https://api.github.com/users/cjcenizal/received_events","type":"User","site_admin":false},"body":"Can we leave a breadcrumb trail for future devs who come to this file? Can we document where esResponse is coming from? Can we add comments at each of the conditions explaining the intent/end result of each one?","created_at":"2016-10-27T03:20:42Z","updated_at":"2016-10-27T04:03:47Z","html_url":"https://github.com/elastic/kibana/pull/8104#discussion_r85260381","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/8104","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/85260381"},"html":{"href":"https://github.com/elastic/kibana/pull/8104#discussion_r85260381"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/8104"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/8104","id":82916737,"html_url":"https://github.com/elastic/kibana/pull/8104","diff_url":"https://github.com/elastic/kibana/pull/8104.diff","patch_url":"https://github.com/elastic/kibana/pull/8104.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/8104","number":8104,"state":"open","locked":false,"title":"Tagcloud","user":{"login":"thomasneirynck","id":1833023,"avatar_url":"https://avatars.githubusercontent.com/u/1833023?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasneirynck","html_url":"https://github.com/thomasneirynck","followers_url":"https://api.github.com/users/thomasneirynck/followers","following_url":"https://api.github.com/users/thomasneirynck/following{/other_user}","gists_url":"https://api.github.com/users/thomasneirynck/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasneirynck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasneirynck/subscriptions","organizations_url":"https://api.github.com/users/thomasneirynck/orgs","repos_url":"https://api.github.com/users/thomasneirynck/repos","events_url":"https://api.github.com/users/thomasneirynck/events{/privacy}","received_events_url":"https://api.github.com/users/thomasneirynck/received_events","type":"User","site_admin":false},"body":"See #8149 \r\n\r\n\r\nmoving tagcloud PR (#6975). resolved merge conflicts, checking if it runs in CI","created_at":"2016-08-26T16:29:40Z","updated_at":"2016-10-27T04:03:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48f52ac18be9a278d3bbc49986f618b00043817c","assignee":{"login":"cjcenizal","id":1238659,"avatar_url":"https://avatars.githubusercontent.com/u/1238659?v=3","gravatar_id":"","url":"https://api.github.com/users/cjcenizal","html_url":"https://github.com/cjcenizal","followers_url":"https://api.github.com/users/cjcenizal/followers","following_url":"https://api.github.com/users/cjcenizal/following{/other_user}","gists_url":"https://api.github.com/users/cjcenizal/gists{/gist_id}","starred_url":"https://api.github.com/users/cjcenizal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjcenizal/subscriptions","organizations_url":"https://api.github.com/users/cjcenizal/orgs","repos_url":"https://api.github.com/users/cjcenizal/repos","events_url":"https://api.github.com/users/cjcenizal/events{/privacy}","received_events_url":"https://api.github.com/users/cjcenizal/received_events","type":"User","site_admin":false},"assignees":[{"login":"cjcenizal","id":1238659,"avatar_url":"https://avatars.githubusercontent.com/u/1238659?v=3","gravatar_id":"","url":"https://api.github.com/users/cjcenizal","html_url":"https://github.com/cjcenizal","followers_url":"https://api.github.com/users/cjcenizal/followers","following_url":"https://api.github.com/users/cjcenizal/following{/other_user}","gists_url":"https://api.github.com/users/cjcenizal/gists{/gist_id}","starred_url":"https://api.github.com/users/cjcenizal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjcenizal/subscriptions","organizations_url":"https://api.github.com/users/cjcenizal/orgs","repos_url":"https://api.github.com/users/cjcenizal/repos","events_url":"https://api.github.com/users/cjcenizal/events{/privacy}","received_events_url":"https://api.github.com/users/cjcenizal/received_events","type":"User","site_admin":false},{"login":"jbudz","id":3143860,"avatar_url":"https://avatars.githubusercontent.com/u/3143860?v=3","gravatar_id":"","url":"https://api.github.com/users/jbudz","html_url":"https://github.com/jbudz","followers_url":"https://api.github.com/users/jbudz/followers","following_url":"https://api.github.com/users/jbudz/following{/other_user}","gists_url":"https://api.github.com/users/jbudz/gists{/gist_id}","starred_url":"https://api.github.com/users/jbudz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbudz/subscriptions","organizations_url":"https://api.github.com/users/jbudz/orgs","repos_url":"https://api.github.com/users/jbudz/repos","events_url":"https://api.github.com/users/jbudz/events{/privacy}","received_events_url":"https://api.github.com/users/jbudz/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/8104/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/8104/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/8104/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/d4b5f7f99bb724aa5d9c33317d59271c463b58fa","head":{"label":"thomasneirynck:tagcloud","ref":"tagcloud","sha":"d4b5f7f99bb724aa5d9c33317d59271c463b58fa","user":{"login":"thomasneirynck","id":1833023,"avatar_url":"https://avatars.githubusercontent.com/u/1833023?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasneirynck","html_url":"https://github.com/thomasneirynck","followers_url":"https://api.github.com/users/thomasneirynck/followers","following_url":"https://api.github.com/users/thomasneirynck/following{/other_user}","gists_url":"https://api.github.com/users/thomasneirynck/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasneirynck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasneirynck/subscriptions","organizations_url":"https://api.github.com/users/thomasneirynck/orgs","repos_url":"https://api.github.com/users/thomasneirynck/repos","events_url":"https://api.github.com/users/thomasneirynck/events{/privacy}","received_events_url":"https://api.github.com/users/thomasneirynck/received_events","type":"User","site_admin":false},"repo":{"id":63882657,"name":"kibana","full_name":"thomasneirynck/kibana","owner":{"login":"thomasneirynck","id":1833023,"avatar_url":"https://avatars.githubusercontent.com/u/1833023?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasneirynck","html_url":"https://github.com/thomasneirynck","followers_url":"https://api.github.com/users/thomasneirynck/followers","following_url":"https://api.github.com/users/thomasneirynck/following{/other_user}","gists_url":"https://api.github.com/users/thomasneirynck/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasneirynck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasneirynck/subscriptions","organizations_url":"https://api.github.com/users/thomasneirynck/orgs","repos_url":"https://api.github.com/users/thomasneirynck/repos","events_url":"https://api.github.com/users/thomasneirynck/events{/privacy}","received_events_url":"https://api.github.com/users/thomasneirynck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thomasneirynck/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":true,"url":"https://api.github.com/repos/thomasneirynck/kibana","forks_url":"https://api.github.com/repos/thomasneirynck/kibana/forks","keys_url":"https://api.github.com/repos/thomasneirynck/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thomasneirynck/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thomasneirynck/kibana/teams","hooks_url":"https://api.github.com/repos/thomasneirynck/kibana/hooks","issue_events_url":"https://api.github.com/repos/thomasneirynck/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/thomasneirynck/kibana/events","assignees_url":"https://api.github.com/repos/thomasneirynck/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/thomasneirynck/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/thomasneirynck/kibana/tags","blobs_url":"https://api.github.com/repos/thomasneirynck/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thomasneirynck/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thomasneirynck/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/thomasneirynck/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thomasneirynck/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/thomasneirynck/kibana/languages","stargazers_url":"https://api.github.com/repos/thomasneirynck/kibana/stargazers","contributors_url":"https://api.github.com/repos/thomasneirynck/kibana/contributors","subscribers_url":"https://api.github.com/repos/thomasneirynck/kibana/subscribers","subscription_url":"https://api.github.com/repos/thomasneirynck/kibana/subscription","commits_url":"https://api.github.com/repos/thomasneirynck/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/thomasneirynck/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/thomasneirynck/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/thomasneirynck/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/thomasneirynck/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/thomasneirynck/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thomasneirynck/kibana/merges","archive_url":"https://api.github.com/repos/thomasneirynck/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thomasneirynck/kibana/downloads","issues_url":"https://api.github.com/repos/thomasneirynck/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/thomasneirynck/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/thomasneirynck/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/thomasneirynck/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thomasneirynck/kibana/labels{/name}","releases_url":"https://api.github.com/repos/thomasneirynck/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/thomasneirynck/kibana/deployments","created_at":"2016-07-21T15:51:25Z","updated_at":"2016-07-21T15:51:31Z","pushed_at":"2016-10-26T05:45:19Z","git_url":"git://github.com/thomasneirynck/kibana.git","ssh_url":"git@github.com:thomasneirynck/kibana.git","clone_url":"https://github.com/thomasneirynck/kibana.git","svn_url":"https://github.com/thomasneirynck/kibana","homepage":"https://www.elastic.co/products/kibana","size":218747,"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":"elastic:master","ref":"master","sha":"51b112124415c562173f98779bc7755ec088fdae","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"name":"kibana","full_name":"elastic/kibana","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2016-10-26T16:46:29Z","pushed_at":"2016-10-27T02:26:39Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":270532,"stargazers_count":6194,"watchers_count":6194,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2291,"mirror_url":null,"open_issues_count":1245,"forks":2291,"open_issues":1245,"watchers":6194,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/8104"},"html":{"href":"https://github.com/elastic/kibana/pull/8104"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/8104"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/8104/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/8104/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/8104/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/d4b5f7f99bb724aa5d9c33317d59271c463b58fa"}}}}
{"actor":{"display_login":"cjcenizal"}}