{"action":"created","comment":{"url":"https://api.github.com/repos/RhoInc/web-codebook/pulls/comments/132068462","pull_request_review_id":55110638,"id":132068462,"diff_hunk":"@@ -0,0 +1,66 @@\n+import {\n+  select as d3select,\n+  format as d3format,\n+  set as d3set,\n+  merge as d3merge\n+} from 'd3';\n+\n+export default function renderValues(d, list) {\n+  list.selectAll('*').remove();\n+\n+  //make a list of values\n+  if (d.type == 'categorical') {\n+    var topValues = d.statistics.values\n+      .sort(function(a, b) {\n+        return b.n - a.n;\n+      })\n+      .filter(function(d, i) {\n+        return i < 5;\n+      });\n+\n+    var valueItems = list.selectAll('li').data(topValues).enter().append('li');\n+\n+    valueItems.append('div').text(d => d.key).attr('class', 'label');\n+    valueItems\n+      .append('div')\n+      .text(d => d.n + ' (' + d3format('0.1%')(d.prop_n) + ')')\n+      .attr('class', 'value');\n+\n+    if (d.statistics.values.length > 5) {\n+      var totLength = d.statistics.values.length;\n+      var extraCount = totLength - 5;\n+      var extra_span = list\n+        .append('li')\n+        .append('div')\n+        .attr('class', 'label')\n+        .html('and ' + extraCount + ' more.');\n+    }\n+  } else if (d.type == 'continuous') {\n+    var sortedValues = d3set(d.values.map(d => +d.value))\n+      .values() //get unique\n+      .sort(function(a, b) {\n+        return a - b;\n+      }); // sort low to high\n+\n+    var minValues = sortedValues.filter(function(d, i) {\n+      return i < 3;\n+    });\n+    var nValues = sortedValues.length;\n+    var maxValues = sortedValues.filter(function(d, i) {\n+      return i >= nValues - 3;\n+    });\n+    var valList = d3merge([minValues, ['...'], maxValues]);\n+\n+    var valueItems = list.selectAll('li').data(valList).enter().append('li');\n+\n+    valueItems.append('div').attr('class', 'label').text(function(d, i) {\n+      return i == 0 ? 'Min' : i == valList.length - 1 ? 'Max' : ' ';\n+    });\n+    valueItems","path":"src/codebook/summaryTable/renderRow/details/renderValues.js","position":62,"original_position":59,"commit_id":"c6890ca49a277bb399ec1b159ad960d9fc568151","original_commit_id":"4f391258c4f03346d27b09045b865c71647f151d","user":{"login":"jwildfire","id":3680095,"avatar_url":"https://avatars1.githubusercontent.com/u/3680095?v=4","gravatar_id":"","url":"https://api.github.com/users/jwildfire","html_url":"https://github.com/jwildfire","followers_url":"https://api.github.com/users/jwildfire/followers","following_url":"https://api.github.com/users/jwildfire/following{/other_user}","gists_url":"https://api.github.com/users/jwildfire/gists{/gist_id}","starred_url":"https://api.github.com/users/jwildfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwildfire/subscriptions","organizations_url":"https://api.github.com/users/jwildfire/orgs","repos_url":"https://api.github.com/users/jwildfire/repos","events_url":"https://api.github.com/users/jwildfire/events{/privacy}","received_events_url":"https://api.github.com/users/jwildfire/received_events","type":"User","site_admin":false},"body":"used a min-width instead: afd718363c0bc46e237876b3f0b73a485fad48fe","created_at":"2017-08-09T00:48:17Z","updated_at":"2017-08-09T00:48:17Z","html_url":"https://github.com/RhoInc/web-codebook/pull/173#discussion_r132068462","pull_request_url":"https://api.github.com/repos/RhoInc/web-codebook/pulls/173","_links":{"self":{"href":"https://api.github.com/repos/RhoInc/web-codebook/pulls/comments/132068462"},"html":{"href":"https://github.com/RhoInc/web-codebook/pull/173#discussion_r132068462"},"pull_request":{"href":"https://api.github.com/repos/RhoInc/web-codebook/pulls/173"}}},"pull_request":{"url":"https://api.github.com/repos/RhoInc/web-codebook/pulls/173","id":133867930,"html_url":"https://github.com/RhoInc/web-codebook/pull/173","diff_url":"https://github.com/RhoInc/web-codebook/pull/173.diff","patch_url":"https://github.com/RhoInc/web-codebook/pull/173.patch","issue_url":"https://api.github.com/repos/RhoInc/web-codebook/issues/173","number":173,"state":"open","locked":false,"title":"Add support for generic column-level metadata","user":{"login":"jwildfire","id":3680095,"avatar_url":"https://avatars1.githubusercontent.com/u/3680095?v=4","gravatar_id":"","url":"https://api.github.com/users/jwildfire","html_url":"https://github.com/jwildfire","followers_url":"https://api.github.com/users/jwildfire/followers","following_url":"https://api.github.com/users/jwildfire/following{/other_user}","gists_url":"https://api.github.com/users/jwildfire/gists{/gist_id}","starred_url":"https://api.github.com/users/jwildfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwildfire/subscriptions","organizations_url":"https://api.github.com/users/jwildfire/orgs","repos_url":"https://api.github.com/users/jwildfire/repos","events_url":"https://api.github.com/users/jwildfire/events{/privacy}","received_events_url":"https://api.github.com/users/jwildfire/received_events","type":"User","site_admin":false},"body":"Adding support in both codebook and explorer.  #149 and #169. ","created_at":"2017-08-03T06:28:24Z","updated_at":"2017-08-09T00:48:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/RhoInc/web-codebook/pulls/173/commits","review_comments_url":"https://api.github.com/repos/RhoInc/web-codebook/pulls/173/comments","review_comment_url":"https://api.github.com/repos/RhoInc/web-codebook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RhoInc/web-codebook/issues/173/comments","statuses_url":"https://api.github.com/repos/RhoInc/web-codebook/statuses/c6890ca49a277bb399ec1b159ad960d9fc568151","head":{"label":"RhoInc:colMetadata","ref":"colMetadata","sha":"c6890ca49a277bb399ec1b159ad960d9fc568151","user":{"login":"RhoInc","id":10836202,"avatar_url":"https://avatars0.githubusercontent.com/u/10836202?v=4","gravatar_id":"","url":"https://api.github.com/users/RhoInc","html_url":"https://github.com/RhoInc","followers_url":"https://api.github.com/users/RhoInc/followers","following_url":"https://api.github.com/users/RhoInc/following{/other_user}","gists_url":"https://api.github.com/users/RhoInc/gists{/gist_id}","starred_url":"https://api.github.com/users/RhoInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RhoInc/subscriptions","organizations_url":"https://api.github.com/users/RhoInc/orgs","repos_url":"https://api.github.com/users/RhoInc/repos","events_url":"https://api.github.com/users/RhoInc/events{/privacy}","received_events_url":"https://api.github.com/users/RhoInc/received_events","type":"Organization","site_admin":false},"repo":{"id":66024406,"name":"web-codebook","full_name":"RhoInc/web-codebook","owner":{"login":"RhoInc","id":10836202,"avatar_url":"https://avatars0.githubusercontent.com/u/10836202?v=4","gravatar_id":"","url":"https://api.github.com/users/RhoInc","html_url":"https://github.com/RhoInc","followers_url":"https://api.github.com/users/RhoInc/followers","following_url":"https://api.github.com/users/RhoInc/following{/other_user}","gists_url":"https://api.github.com/users/RhoInc/gists{/gist_id}","starred_url":"https://api.github.com/users/RhoInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RhoInc/subscriptions","organizations_url":"https://api.github.com/users/RhoInc/orgs","repos_url":"https://api.github.com/users/RhoInc/repos","events_url":"https://api.github.com/users/RhoInc/events{/privacy}","received_events_url":"https://api.github.com/users/RhoInc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RhoInc/web-codebook","description":"A web-based version of the codebook, which generates a concise summary of every variable in a dataset.","fork":false,"url":"https://api.github.com/repos/RhoInc/web-codebook","forks_url":"https://api.github.com/repos/RhoInc/web-codebook/forks","keys_url":"https://api.github.com/repos/RhoInc/web-codebook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RhoInc/web-codebook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RhoInc/web-codebook/teams","hooks_url":"https://api.github.com/repos/RhoInc/web-codebook/hooks","issue_events_url":"https://api.github.com/repos/RhoInc/web-codebook/issues/events{/number}","events_url":"https://api.github.com/repos/RhoInc/web-codebook/events","assignees_url":"https://api.github.com/repos/RhoInc/web-codebook/assignees{/user}","branches_url":"https://api.github.com/repos/RhoInc/web-codebook/branches{/branch}","tags_url":"https://api.github.com/repos/RhoInc/web-codebook/tags","blobs_url":"https://api.github.com/repos/RhoInc/web-codebook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RhoInc/web-codebook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RhoInc/web-codebook/git/refs{/sha}","trees_url":"https://api.github.com/repos/RhoInc/web-codebook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RhoInc/web-codebook/statuses/{sha}","languages_url":"https://api.github.com/repos/RhoInc/web-codebook/languages","stargazers_url":"https://api.github.com/repos/RhoInc/web-codebook/stargazers","contributors_url":"https://api.github.com/repos/RhoInc/web-codebook/contributors","subscribers_url":"https://api.github.com/repos/RhoInc/web-codebook/subscribers","subscription_url":"https://api.github.com/repos/RhoInc/web-codebook/subscription","commits_url":"https://api.github.com/repos/RhoInc/web-codebook/commits{/sha}","git_commits_url":"https://api.github.com/repos/RhoInc/web-codebook/git/commits{/sha}","comments_url":"https://api.github.com/repos/RhoInc/web-codebook/comments{/number}","issue_comment_url":"https://api.github.com/repos/RhoInc/web-codebook/issues/comments{/number}","contents_url":"https://api.github.com/repos/RhoInc/web-codebook/contents/{+path}","compare_url":"https://api.github.com/repos/RhoInc/web-codebook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RhoInc/web-codebook/merges","archive_url":"https://api.github.com/repos/RhoInc/web-codebook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RhoInc/web-codebook/downloads","issues_url":"https://api.github.com/repos/RhoInc/web-codebook/issues{/number}","pulls_url":"https://api.github.com/repos/RhoInc/web-codebook/pulls{/number}","milestones_url":"https://api.github.com/repos/RhoInc/web-codebook/milestones{/number}","notifications_url":"https://api.github.com/repos/RhoInc/web-codebook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RhoInc/web-codebook/labels{/name}","releases_url":"https://api.github.com/repos/RhoInc/web-codebook/releases{/id}","deployments_url":"https://api.github.com/repos/RhoInc/web-codebook/deployments","created_at":"2016-08-18T19:20:34Z","updated_at":"2017-02-18T02:21:56Z","pushed_at":"2017-08-09T00:47:52Z","git_url":"git://github.com/RhoInc/web-codebook.git","ssh_url":"git@github.com:RhoInc/web-codebook.git","clone_url":"https://github.com/RhoInc/web-codebook.git","svn_url":"https://github.com/RhoInc/web-codebook","homepage":null,"size":649,"stargazers_count":0,"watchers_count":0,"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":32,"forks":0,"open_issues":32,"watchers":0,"default_branch":"master"}},"base":{"label":"RhoInc:v1.2.0-dev-v3","ref":"v1.2.0-dev-v3","sha":"29bcf824bf0e4b86c8f8eff5669418a82bc818bd","user":{"login":"RhoInc","id":10836202,"avatar_url":"https://avatars0.githubusercontent.com/u/10836202?v=4","gravatar_id":"","url":"https://api.github.com/users/RhoInc","html_url":"https://github.com/RhoInc","followers_url":"https://api.github.com/users/RhoInc/followers","following_url":"https://api.github.com/users/RhoInc/following{/other_user}","gists_url":"https://api.github.com/users/RhoInc/gists{/gist_id}","starred_url":"https://api.github.com/users/RhoInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RhoInc/subscriptions","organizations_url":"https://api.github.com/users/RhoInc/orgs","repos_url":"https://api.github.com/users/RhoInc/repos","events_url":"https://api.github.com/users/RhoInc/events{/privacy}","received_events_url":"https://api.github.com/users/RhoInc/received_events","type":"Organization","site_admin":false},"repo":{"id":66024406,"name":"web-codebook","full_name":"RhoInc/web-codebook","owner":{"login":"RhoInc","id":10836202,"avatar_url":"https://avatars0.githubusercontent.com/u/10836202?v=4","gravatar_id":"","url":"https://api.github.com/users/RhoInc","html_url":"https://github.com/RhoInc","followers_url":"https://api.github.com/users/RhoInc/followers","following_url":"https://api.github.com/users/RhoInc/following{/other_user}","gists_url":"https://api.github.com/users/RhoInc/gists{/gist_id}","starred_url":"https://api.github.com/users/RhoInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RhoInc/subscriptions","organizations_url":"https://api.github.com/users/RhoInc/orgs","repos_url":"https://api.github.com/users/RhoInc/repos","events_url":"https://api.github.com/users/RhoInc/events{/privacy}","received_events_url":"https://api.github.com/users/RhoInc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RhoInc/web-codebook","description":"A web-based version of the codebook, which generates a concise summary of every variable in a dataset.","fork":false,"url":"https://api.github.com/repos/RhoInc/web-codebook","forks_url":"https://api.github.com/repos/RhoInc/web-codebook/forks","keys_url":"https://api.github.com/repos/RhoInc/web-codebook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RhoInc/web-codebook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RhoInc/web-codebook/teams","hooks_url":"https://api.github.com/repos/RhoInc/web-codebook/hooks","issue_events_url":"https://api.github.com/repos/RhoInc/web-codebook/issues/events{/number}","events_url":"https://api.github.com/repos/RhoInc/web-codebook/events","assignees_url":"https://api.github.com/repos/RhoInc/web-codebook/assignees{/user}","branches_url":"https://api.github.com/repos/RhoInc/web-codebook/branches{/branch}","tags_url":"https://api.github.com/repos/RhoInc/web-codebook/tags","blobs_url":"https://api.github.com/repos/RhoInc/web-codebook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RhoInc/web-codebook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RhoInc/web-codebook/git/refs{/sha}","trees_url":"https://api.github.com/repos/RhoInc/web-codebook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RhoInc/web-codebook/statuses/{sha}","languages_url":"https://api.github.com/repos/RhoInc/web-codebook/languages","stargazers_url":"https://api.github.com/repos/RhoInc/web-codebook/stargazers","contributors_url":"https://api.github.com/repos/RhoInc/web-codebook/contributors","subscribers_url":"https://api.github.com/repos/RhoInc/web-codebook/subscribers","subscription_url":"https://api.github.com/repos/RhoInc/web-codebook/subscription","commits_url":"https://api.github.com/repos/RhoInc/web-codebook/commits{/sha}","git_commits_url":"https://api.github.com/repos/RhoInc/web-codebook/git/commits{/sha}","comments_url":"https://api.github.com/repos/RhoInc/web-codebook/comments{/number}","issue_comment_url":"https://api.github.com/repos/RhoInc/web-codebook/issues/comments{/number}","contents_url":"https://api.github.com/repos/RhoInc/web-codebook/contents/{+path}","compare_url":"https://api.github.com/repos/RhoInc/web-codebook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RhoInc/web-codebook/merges","archive_url":"https://api.github.com/repos/RhoInc/web-codebook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RhoInc/web-codebook/downloads","issues_url":"https://api.github.com/repos/RhoInc/web-codebook/issues{/number}","pulls_url":"https://api.github.com/repos/RhoInc/web-codebook/pulls{/number}","milestones_url":"https://api.github.com/repos/RhoInc/web-codebook/milestones{/number}","notifications_url":"https://api.github.com/repos/RhoInc/web-codebook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RhoInc/web-codebook/labels{/name}","releases_url":"https://api.github.com/repos/RhoInc/web-codebook/releases{/id}","deployments_url":"https://api.github.com/repos/RhoInc/web-codebook/deployments","created_at":"2016-08-18T19:20:34Z","updated_at":"2017-02-18T02:21:56Z","pushed_at":"2017-08-09T00:47:52Z","git_url":"git://github.com/RhoInc/web-codebook.git","ssh_url":"git@github.com:RhoInc/web-codebook.git","clone_url":"https://github.com/RhoInc/web-codebook.git","svn_url":"https://github.com/RhoInc/web-codebook","homepage":null,"size":649,"stargazers_count":0,"watchers_count":0,"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":32,"forks":0,"open_issues":32,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RhoInc/web-codebook/pulls/173"},"html":{"href":"https://github.com/RhoInc/web-codebook/pull/173"},"issue":{"href":"https://api.github.com/repos/RhoInc/web-codebook/issues/173"},"comments":{"href":"https://api.github.com/repos/RhoInc/web-codebook/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/RhoInc/web-codebook/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/RhoInc/web-codebook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RhoInc/web-codebook/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/RhoInc/web-codebook/statuses/c6890ca49a277bb399ec1b159ad960d9fc568151"}}}}
{"actor":{"display_login":"jwildfire"}}