{"action":"created","comment":{"url":"https://api.github.com/repos/juttle/juttle-engine/pulls/comments/54662822","id":54662822,"diff_hunk":"@@ -16,6 +16,17 @@ import \"examples/aws-cloudwatch/common/aws_control_aggregate.juttle\" as control_\n import \"examples/aws-cloudwatch/common/aws_control_demographic.juttle\" as control_demo;\n import \"examples/aws-cloudwatch/common/aws_control_events.juttle\" as control_events;\n \n+// Take categories contributing less than x percent to the total and\n+// group them together in an \"Other\" category.\n+sub threshold(thresh) {\n+    (reduce total=sum(value); pass)\n+    | join\n+    | put pct = 100.0*value/total\n+    | put name=(pct >= thresh ? name : 'other')","path":"examples/aws-cloudwatch/demographic.juttle","position":10,"original_position":10,"commit_id":"268b946dee8aab2b036c53e9a7360b03c642c7bf","original_commit_id":"268b946dee8aab2b036c53e9a7360b03c642c7bf","user":{"login":"dmehra","id":5817365,"avatar_url":"https://avatars.githubusercontent.com/u/5817365?v=3","gravatar_id":"","url":"https://api.github.com/users/dmehra","html_url":"https://github.com/dmehra","followers_url":"https://api.github.com/users/dmehra/followers","following_url":"https://api.github.com/users/dmehra/following{/other_user}","gists_url":"https://api.github.com/users/dmehra/gists{/gist_id}","starred_url":"https://api.github.com/users/dmehra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmehra/subscriptions","organizations_url":"https://api.github.com/users/dmehra/orgs","repos_url":"https://api.github.com/users/dmehra/repos","events_url":"https://api.github.com/users/dmehra/events{/privacy}","received_events_url":"https://api.github.com/users/dmehra/received_events","type":"User","site_admin":false},"body":"any chance you'd get multiple values for the same category passed to here? their pct values individually could be below thresh, while combined would be above thresh, but we'd 'other' them.","created_at":"2016-03-02T00:46:11Z","updated_at":"2016-03-02T00:46:11Z","html_url":"https://github.com/juttle/juttle-engine/pull/63#discussion_r54662822","pull_request_url":"https://api.github.com/repos/juttle/juttle-engine/pulls/63","_links":{"self":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/comments/54662822"},"html":{"href":"https://github.com/juttle/juttle-engine/pull/63#discussion_r54662822"},"pull_request":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/63"}}},"pull_request":{"url":"https://api.github.com/repos/juttle/juttle-engine/pulls/63","id":61333721,"html_url":"https://github.com/juttle/juttle-engine/pull/63","diff_url":"https://github.com/juttle/juttle-engine/pull/63.diff","patch_url":"https://github.com/juttle/juttle-engine/pull/63.patch","issue_url":"https://api.github.com/repos/juttle/juttle-engine/issues/63","number":63,"state":"open","locked":false,"title":"Add thresholding to pie charts.","user":{"login":"mstemm","id":13422831,"avatar_url":"https://avatars.githubusercontent.com/u/13422831?v=3","gravatar_id":"","url":"https://api.github.com/users/mstemm","html_url":"https://github.com/mstemm","followers_url":"https://api.github.com/users/mstemm/followers","following_url":"https://api.github.com/users/mstemm/following{/other_user}","gists_url":"https://api.github.com/users/mstemm/gists{/gist_id}","starred_url":"https://api.github.com/users/mstemm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstemm/subscriptions","organizations_url":"https://api.github.com/users/mstemm/orgs","repos_url":"https://api.github.com/users/mstemm/repos","events_url":"https://api.github.com/users/mstemm/events{/privacy}","received_events_url":"https://api.github.com/users/mstemm/received_events","type":"User","site_admin":false},"body":"Based on review of the aws blog post, add thresholding to pie charts\r\nto example programs to group together low volume categories into an\r\nother category.\r\n\r\n@davidvgalbraith ","created_at":"2016-03-02T00:38:03Z","updated_at":"2016-03-02T00:46:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fe17ceb2c6e7ec0af7adddc6ba3a3e283c2e4a7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juttle/juttle-engine/pulls/63/commits","review_comments_url":"https://api.github.com/repos/juttle/juttle-engine/pulls/63/comments","review_comment_url":"https://api.github.com/repos/juttle/juttle-engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juttle/juttle-engine/issues/63/comments","statuses_url":"https://api.github.com/repos/juttle/juttle-engine/statuses/268b946dee8aab2b036c53e9a7360b03c642c7bf","head":{"label":"juttle:update-examples-aws-timerange","ref":"update-examples-aws-timerange","sha":"268b946dee8aab2b036c53e9a7360b03c642c7bf","user":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"repo":{"id":51180780,"name":"juttle-engine","full_name":"juttle/juttle-engine","owner":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juttle/juttle-engine","description":"juttle execution engine","fork":false,"url":"https://api.github.com/repos/juttle/juttle-engine","forks_url":"https://api.github.com/repos/juttle/juttle-engine/forks","keys_url":"https://api.github.com/repos/juttle/juttle-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juttle/juttle-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juttle/juttle-engine/teams","hooks_url":"https://api.github.com/repos/juttle/juttle-engine/hooks","issue_events_url":"https://api.github.com/repos/juttle/juttle-engine/issues/events{/number}","events_url":"https://api.github.com/repos/juttle/juttle-engine/events","assignees_url":"https://api.github.com/repos/juttle/juttle-engine/assignees{/user}","branches_url":"https://api.github.com/repos/juttle/juttle-engine/branches{/branch}","tags_url":"https://api.github.com/repos/juttle/juttle-engine/tags","blobs_url":"https://api.github.com/repos/juttle/juttle-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juttle/juttle-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juttle/juttle-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/juttle/juttle-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juttle/juttle-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/juttle/juttle-engine/languages","stargazers_url":"https://api.github.com/repos/juttle/juttle-engine/stargazers","contributors_url":"https://api.github.com/repos/juttle/juttle-engine/contributors","subscribers_url":"https://api.github.com/repos/juttle/juttle-engine/subscribers","subscription_url":"https://api.github.com/repos/juttle/juttle-engine/subscription","commits_url":"https://api.github.com/repos/juttle/juttle-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/juttle/juttle-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/juttle/juttle-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/juttle/juttle-engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/juttle/juttle-engine/contents/{+path}","compare_url":"https://api.github.com/repos/juttle/juttle-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juttle/juttle-engine/merges","archive_url":"https://api.github.com/repos/juttle/juttle-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juttle/juttle-engine/downloads","issues_url":"https://api.github.com/repos/juttle/juttle-engine/issues{/number}","pulls_url":"https://api.github.com/repos/juttle/juttle-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/juttle/juttle-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/juttle/juttle-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juttle/juttle-engine/labels{/name}","releases_url":"https://api.github.com/repos/juttle/juttle-engine/releases{/id}","deployments_url":"https://api.github.com/repos/juttle/juttle-engine/deployments","created_at":"2016-02-05T23:29:37Z","updated_at":"2016-02-17T20:21:52Z","pushed_at":"2016-03-02T00:38:03Z","git_url":"git://github.com/juttle/juttle-engine.git","ssh_url":"git@github.com:juttle/juttle-engine.git","clone_url":"https://github.com/juttle/juttle-engine.git","svn_url":"https://github.com/juttle/juttle-engine","homepage":null,"size":46549,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":3,"default_branch":"master"}},"base":{"label":"juttle:master","ref":"master","sha":"bfae22d9e14a96c605908e7ea59fdb326f44c7c4","user":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"repo":{"id":51180780,"name":"juttle-engine","full_name":"juttle/juttle-engine","owner":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juttle/juttle-engine","description":"juttle execution engine","fork":false,"url":"https://api.github.com/repos/juttle/juttle-engine","forks_url":"https://api.github.com/repos/juttle/juttle-engine/forks","keys_url":"https://api.github.com/repos/juttle/juttle-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juttle/juttle-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juttle/juttle-engine/teams","hooks_url":"https://api.github.com/repos/juttle/juttle-engine/hooks","issue_events_url":"https://api.github.com/repos/juttle/juttle-engine/issues/events{/number}","events_url":"https://api.github.com/repos/juttle/juttle-engine/events","assignees_url":"https://api.github.com/repos/juttle/juttle-engine/assignees{/user}","branches_url":"https://api.github.com/repos/juttle/juttle-engine/branches{/branch}","tags_url":"https://api.github.com/repos/juttle/juttle-engine/tags","blobs_url":"https://api.github.com/repos/juttle/juttle-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juttle/juttle-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juttle/juttle-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/juttle/juttle-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juttle/juttle-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/juttle/juttle-engine/languages","stargazers_url":"https://api.github.com/repos/juttle/juttle-engine/stargazers","contributors_url":"https://api.github.com/repos/juttle/juttle-engine/contributors","subscribers_url":"https://api.github.com/repos/juttle/juttle-engine/subscribers","subscription_url":"https://api.github.com/repos/juttle/juttle-engine/subscription","commits_url":"https://api.github.com/repos/juttle/juttle-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/juttle/juttle-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/juttle/juttle-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/juttle/juttle-engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/juttle/juttle-engine/contents/{+path}","compare_url":"https://api.github.com/repos/juttle/juttle-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juttle/juttle-engine/merges","archive_url":"https://api.github.com/repos/juttle/juttle-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juttle/juttle-engine/downloads","issues_url":"https://api.github.com/repos/juttle/juttle-engine/issues{/number}","pulls_url":"https://api.github.com/repos/juttle/juttle-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/juttle/juttle-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/juttle/juttle-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juttle/juttle-engine/labels{/name}","releases_url":"https://api.github.com/repos/juttle/juttle-engine/releases{/id}","deployments_url":"https://api.github.com/repos/juttle/juttle-engine/deployments","created_at":"2016-02-05T23:29:37Z","updated_at":"2016-02-17T20:21:52Z","pushed_at":"2016-03-02T00:38:03Z","git_url":"git://github.com/juttle/juttle-engine.git","ssh_url":"git@github.com:juttle/juttle-engine.git","clone_url":"https://github.com/juttle/juttle-engine.git","svn_url":"https://github.com/juttle/juttle-engine","homepage":null,"size":46549,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/63"},"html":{"href":"https://github.com/juttle/juttle-engine/pull/63"},"issue":{"href":"https://api.github.com/repos/juttle/juttle-engine/issues/63"},"comments":{"href":"https://api.github.com/repos/juttle/juttle-engine/issues/63/comments"},"review_comments":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/63/comments"},"review_comment":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/63/commits"},"statuses":{"href":"https://api.github.com/repos/juttle/juttle-engine/statuses/268b946dee8aab2b036c53e9a7360b03c642c7bf"}}}}