{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/31822354","id":31822354,"diff_hunk":"@@ -351,7 +355,10 @@ define(function (require) {\n       // for each object in the dataArray,\n       // push the calculated y value to the initialized array (arr)\n       _.each(this.chartData(), function (chart) {\n-        min = Math.min(min, self._getYExtent(chart, 'min', getValue));\n+        var calculatedMin = self._getYExtent(chart, 'min', getValue);\n+        if (calculatedMin !== undefined) {","path":"src/kibana/components/vislib/lib/data.js","position":26,"original_position":26,"commit_id":"f035abe1776f1fea45d3cd3f6dd416f4e3ecae69","original_commit_id":"f035abe1776f1fea45d3cd3f6dd416f4e3ecae69","user":{"login":"panda01","id":549944,"avatar_url":"https://avatars.githubusercontent.com/u/549944?v=3","gravatar_id":"","url":"https://api.github.com/users/panda01","html_url":"https://github.com/panda01","followers_url":"https://api.github.com/users/panda01/followers","following_url":"https://api.github.com/users/panda01/following{/other_user}","gists_url":"https://api.github.com/users/panda01/gists{/gist_id}","starred_url":"https://api.github.com/users/panda01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panda01/subscriptions","organizations_url":"https://api.github.com/users/panda01/orgs","repos_url":"https://api.github.com/users/panda01/repos","events_url":"https://api.github.com/users/panda01/events{/privacy}","received_events_url":"https://api.github.com/users/panda01/received_events","type":"User","site_admin":false},"body":"Perhaps ```if(_.isUndef(calculatedMin))``` would be more appropriate?","created_at":"2015-06-05T15:27:15Z","updated_at":"2015-06-05T15:27:15Z","html_url":"https://github.com/elastic/kibana/pull/3987#discussion_r31822354","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/3987","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/31822354"},"html":{"href":"https://github.com/elastic/kibana/pull/3987#discussion_r31822354"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/3987"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/3987","id":36243485,"html_url":"https://github.com/elastic/kibana/pull/3987","diff_url":"https://github.com/elastic/kibana/pull/3987.diff","patch_url":"https://github.com/elastic/kibana/pull/3987.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/3987","number":3987,"state":"open","locked":false,"title":"Remove Empty Arrays from Vislib Data","user":{"login":"stormpython","id":3149785,"avatar_url":"https://avatars.githubusercontent.com/u/3149785?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpython","html_url":"https://github.com/stormpython","followers_url":"https://api.github.com/users/stormpython/followers","following_url":"https://api.github.com/users/stormpython/following{/other_user}","gists_url":"https://api.github.com/users/stormpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpython/subscriptions","organizations_url":"https://api.github.com/users/stormpython/orgs","repos_url":"https://api.github.com/users/stormpython/repos","events_url":"https://api.github.com/users/stormpython/events{/privacy}","received_events_url":"https://api.github.com/users/stormpython/received_events","type":"User","site_admin":false},"body":"Closes #3959.\r\n\r\nThere are times when the vislib is passed invalid data, i.e. data with empty arrays. All data in the object do not contain empty arrays, but a few might, which results in exceptions being thrown. This can happen when a user searches for something not present in the dataset. \r\n\r\nAt no time, should the vislib receive invalid data, even partially invalid. The assumption is that data has been curated before it gets to the vislib. However, this is not the case in some instances.\r\n\r\nIn this pull request, I attempt to address this problem by creating a `ValidateVisData` class which removes empty arrays from the data before passing it to the charting functions. It loops through each data array in the dataset and only returns those arrays which have a length `>` zero.\r\n\r\n**This will require 2 reviewers as I am not sure what all this might touch.**","created_at":"2015-05-26T20:43:41Z","updated_at":"2015-06-05T15:27:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d90d1a2da8829f58b4e1eb34de9ffc173e523a70","assignee":{"login":"rashidkpc","id":1250387,"avatar_url":"https://avatars.githubusercontent.com/u/1250387?v=3","gravatar_id":"","url":"https://api.github.com/users/rashidkpc","html_url":"https://github.com/rashidkpc","followers_url":"https://api.github.com/users/rashidkpc/followers","following_url":"https://api.github.com/users/rashidkpc/following{/other_user}","gists_url":"https://api.github.com/users/rashidkpc/gists{/gist_id}","starred_url":"https://api.github.com/users/rashidkpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rashidkpc/subscriptions","organizations_url":"https://api.github.com/users/rashidkpc/orgs","repos_url":"https://api.github.com/users/rashidkpc/repos","events_url":"https://api.github.com/users/rashidkpc/events{/privacy}","received_events_url":"https://api.github.com/users/rashidkpc/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/3987/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/3987/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/3987/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/f035abe1776f1fea45d3cd3f6dd416f4e3ecae69","head":{"label":"stormpython:fix/3959","ref":"fix/3959","sha":"f035abe1776f1fea45d3cd3f6dd416f4e3ecae69","user":{"login":"stormpython","id":3149785,"avatar_url":"https://avatars.githubusercontent.com/u/3149785?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpython","html_url":"https://github.com/stormpython","followers_url":"https://api.github.com/users/stormpython/followers","following_url":"https://api.github.com/users/stormpython/following{/other_user}","gists_url":"https://api.github.com/users/stormpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpython/subscriptions","organizations_url":"https://api.github.com/users/stormpython/orgs","repos_url":"https://api.github.com/users/stormpython/repos","events_url":"https://api.github.com/users/stormpython/events{/privacy}","received_events_url":"https://api.github.com/users/stormpython/received_events","type":"User","site_admin":false},"repo":{"id":24904921,"name":"kibana","full_name":"stormpython/kibana","owner":{"login":"stormpython","id":3149785,"avatar_url":"https://avatars.githubusercontent.com/u/3149785?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpython","html_url":"https://github.com/stormpython","followers_url":"https://api.github.com/users/stormpython/followers","following_url":"https://api.github.com/users/stormpython/following{/other_user}","gists_url":"https://api.github.com/users/stormpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpython/subscriptions","organizations_url":"https://api.github.com/users/stormpython/orgs","repos_url":"https://api.github.com/users/stormpython/repos","events_url":"https://api.github.com/users/stormpython/events{/privacy}","received_events_url":"https://api.github.com/users/stormpython/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stormpython/kibana","description":"Kibana","fork":true,"url":"https://api.github.com/repos/stormpython/kibana","forks_url":"https://api.github.com/repos/stormpython/kibana/forks","keys_url":"https://api.github.com/repos/stormpython/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stormpython/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stormpython/kibana/teams","hooks_url":"https://api.github.com/repos/stormpython/kibana/hooks","issue_events_url":"https://api.github.com/repos/stormpython/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/stormpython/kibana/events","assignees_url":"https://api.github.com/repos/stormpython/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/stormpython/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/stormpython/kibana/tags","blobs_url":"https://api.github.com/repos/stormpython/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stormpython/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stormpython/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/stormpython/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stormpython/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/stormpython/kibana/languages","stargazers_url":"https://api.github.com/repos/stormpython/kibana/stargazers","contributors_url":"https://api.github.com/repos/stormpython/kibana/contributors","subscribers_url":"https://api.github.com/repos/stormpython/kibana/subscribers","subscription_url":"https://api.github.com/repos/stormpython/kibana/subscription","commits_url":"https://api.github.com/repos/stormpython/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/stormpython/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/stormpython/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/stormpython/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/stormpython/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/stormpython/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stormpython/kibana/merges","archive_url":"https://api.github.com/repos/stormpython/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stormpython/kibana/downloads","issues_url":"https://api.github.com/repos/stormpython/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/stormpython/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/stormpython/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/stormpython/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stormpython/kibana/labels{/name}","releases_url":"https://api.github.com/repos/stormpython/kibana/releases{/id}","created_at":"2014-10-07T18:24:38Z","updated_at":"2015-05-08T14:33:22Z","pushed_at":"2015-06-05T15:06:32Z","git_url":"git://github.com/stormpython/kibana.git","ssh_url":"git@github.com:stormpython/kibana.git","clone_url":"https://github.com/stormpython/kibana.git","svn_url":"https://github.com/stormpython/kibana","homepage":"http://www.elasticsearch.org/overview/kibana/","size":58630,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"dac6df734778dff8595f9cfe15f4824db87549e0","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":"Kibana","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}","created_at":"2013-01-26T04:00:59Z","updated_at":"2015-06-05T08:45:44Z","pushed_at":"2015-06-05T01:39:46Z","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":96320,"stargazers_count":3653,"watchers_count":3653,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1349,"mirror_url":null,"open_issues_count":512,"forks":1349,"open_issues":512,"watchers":3653,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/3987"},"html":{"href":"https://github.com/elastic/kibana/pull/3987"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/3987"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/3987/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/3987/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/3987/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/f035abe1776f1fea45d3cd3f6dd416f4e3ecae69"}}}}