{"action":"created","comment":{"url":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/comments/93683855","pull_request_review_id":14217231,"id":93683855,"diff_hunk":"@@ -0,0 +1,176 @@\n+class HistoricalChart {\n+  constructor(data, chartElement) {\n+    this.data = data;\n+    this.chartElement = chartElement;\n+    this.dimensions = {};\n+    this.filters = {};\n+    this.counts = [];\n+  }\n+\n+  filtersUpdated(data) {\n+    this.data = data;\n+    this.update();\n+  }\n+\n+  render() {\n+\n+    function setDates() {\n+      var latestDate = new Date();\n+      var counterDate = new Date(2016, 1, 1);\n+      var week;\n+      var dates = [counterDate];\n+\n+      while (latestDate >= counterDate) {\n+        week = counterDate.getDate() + 7\n+        counterDate = new Date(counterDate.setDate(++week));\n+        dates.push(counterDate);\n+      }\n+      return dates;\n+    }\n+\n+    var datesArray = setDates();\n+\n+    var bookings = crossfilter(this.data);","path":"app/assets/javascripts/historical.js.es6","position":33,"original_position":33,"commit_id":"8c335d6013d7391936d4b9af3c9f052f89a1b199","original_commit_id":"8c335d6013d7391936d4b9af3c9f052f89a1b199","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","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":"'crossfilter' is not defined                    no-undef","created_at":"2016-12-22T19:36:17Z","updated_at":"2016-12-22T19:36:17Z","html_url":"https://github.com/codeforamerica/jail-dashboard/pull/99#discussion_r93683855","pull_request_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/99","_links":{"self":{"href":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/comments/93683855"},"html":{"href":"https://github.com/codeforamerica/jail-dashboard/pull/99#discussion_r93683855"},"pull_request":{"href":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/99"}}},"pull_request":{"url":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/99","id":99066312,"html_url":"https://github.com/codeforamerica/jail-dashboard/pull/99","diff_url":"https://github.com/codeforamerica/jail-dashboard/pull/99.diff","patch_url":"https://github.com/codeforamerica/jail-dashboard/pull/99.patch","issue_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/issues/99","number":99,"state":"open","locked":false,"title":"Historical trendline chart","user":{"login":"jennifermarie","id":1070220,"avatar_url":"https://avatars.githubusercontent.com/u/1070220?v=3","gravatar_id":"","url":"https://api.github.com/users/jennifermarie","html_url":"https://github.com/jennifermarie","followers_url":"https://api.github.com/users/jennifermarie/followers","following_url":"https://api.github.com/users/jennifermarie/following{/other_user}","gists_url":"https://api.github.com/users/jennifermarie/gists{/gist_id}","starred_url":"https://api.github.com/users/jennifermarie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennifermarie/subscriptions","organizations_url":"https://api.github.com/users/jennifermarie/orgs","repos_url":"https://api.github.com/users/jennifermarie/repos","events_url":"https://api.github.com/users/jennifermarie/events{/privacy}","received_events_url":"https://api.github.com/users/jennifermarie/received_events","type":"User","site_admin":false},"body":"\r\n![image](https://cloud.githubusercontent.com/assets/1070220/21419570/4f3b1fbe-c7dd-11e6-8d31-fc9342f02a90.png)\r\n\r\nCouple of quick notes:\r\n- There’s a big refactor opportunity but I held off because I wasn’t sure about the best place to put the date/count stuff since there's a ticket (#97) for extracting out the filters — it’s in `historical.js` right now but I basically duped the active pop count filter from `filter.js` inside of the `getCounts()` function, so that feels like it could be nicer\r\n- Right now, I’m grabbing date points for the trendline in weekly batches — daily was super expensive\r\n- Filters work, but there's a caveat. The trendline data set does reflect the selected filters, but it's only starting with the full data set on first render. After a filter is selected, the trendline becomes limited to the current active bookings set. The solution here is to modify `filters.onUpdate()` but I wanted to leave that open-ended since #97 is open -- the filter tables should reflect active bookings only, but the historical chart should draw from the full bookings set.\r\n- Sorry I'm a weirdo and committing so late; I remembered that @graysonwright is in a different time zone and didn't want to miss a handoff for tomorrow morning","created_at":"2016-12-22T08:36:33Z","updated_at":"2016-12-22T19:36:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9542b930d3cefb6197f482b8570365dfe93ac82","assignee":{"login":"jennifermarie","id":1070220,"avatar_url":"https://avatars.githubusercontent.com/u/1070220?v=3","gravatar_id":"","url":"https://api.github.com/users/jennifermarie","html_url":"https://github.com/jennifermarie","followers_url":"https://api.github.com/users/jennifermarie/followers","following_url":"https://api.github.com/users/jennifermarie/following{/other_user}","gists_url":"https://api.github.com/users/jennifermarie/gists{/gist_id}","starred_url":"https://api.github.com/users/jennifermarie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennifermarie/subscriptions","organizations_url":"https://api.github.com/users/jennifermarie/orgs","repos_url":"https://api.github.com/users/jennifermarie/repos","events_url":"https://api.github.com/users/jennifermarie/events{/privacy}","received_events_url":"https://api.github.com/users/jennifermarie/received_events","type":"User","site_admin":false},"assignees":[{"login":"jennifermarie","id":1070220,"avatar_url":"https://avatars.githubusercontent.com/u/1070220?v=3","gravatar_id":"","url":"https://api.github.com/users/jennifermarie","html_url":"https://github.com/jennifermarie","followers_url":"https://api.github.com/users/jennifermarie/followers","following_url":"https://api.github.com/users/jennifermarie/following{/other_user}","gists_url":"https://api.github.com/users/jennifermarie/gists{/gist_id}","starred_url":"https://api.github.com/users/jennifermarie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennifermarie/subscriptions","organizations_url":"https://api.github.com/users/jennifermarie/orgs","repos_url":"https://api.github.com/users/jennifermarie/repos","events_url":"https://api.github.com/users/jennifermarie/events{/privacy}","received_events_url":"https://api.github.com/users/jennifermarie/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/99/commits","review_comments_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/99/comments","review_comment_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/issues/99/comments","statuses_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/statuses/8c335d6013d7391936d4b9af3c9f052f89a1b199","head":{"label":"codeforamerica:historical_chart","ref":"historical_chart","sha":"8c335d6013d7391936d4b9af3c9f052f89a1b199","user":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"repo":{"id":72130706,"name":"jail-dashboard","full_name":"codeforamerica/jail-dashboard","owner":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeforamerica/jail-dashboard","description":"A tool to help jail administrators, judges, and other stakeholders understand the conditions in metro jails, and use this data to visualize how their decisions–at both the individual and policy level–affect program, facility, and inmate outcomes.","fork":false,"url":"https://api.github.com/repos/codeforamerica/jail-dashboard","forks_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/forks","keys_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/teams","hooks_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/hooks","issue_events_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/events","assignees_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/tags","blobs_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/languages","stargazers_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/stargazers","contributors_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/contributors","subscribers_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/subscribers","subscription_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/subscription","commits_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/merges","archive_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/downloads","issues_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/labels{/name}","releases_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/releases{/id}","deployments_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/deployments","created_at":"2016-10-27T17:14:21Z","updated_at":"2016-12-22T12:24:35Z","pushed_at":"2016-12-22T19:36:06Z","git_url":"git://github.com/codeforamerica/jail-dashboard.git","ssh_url":"git@github.com:codeforamerica/jail-dashboard.git","clone_url":"https://github.com/codeforamerica/jail-dashboard.git","svn_url":"https://github.com/codeforamerica/jail-dashboard","homepage":null,"size":24527,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":2,"default_branch":"master"}},"base":{"label":"codeforamerica:crossfilter","ref":"crossfilter","sha":"015a061489f73dde6d938fa1c28775f62ead2ad9","user":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"repo":{"id":72130706,"name":"jail-dashboard","full_name":"codeforamerica/jail-dashboard","owner":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeforamerica/jail-dashboard","description":"A tool to help jail administrators, judges, and other stakeholders understand the conditions in metro jails, and use this data to visualize how their decisions–at both the individual and policy level–affect program, facility, and inmate outcomes.","fork":false,"url":"https://api.github.com/repos/codeforamerica/jail-dashboard","forks_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/forks","keys_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/teams","hooks_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/hooks","issue_events_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/events","assignees_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/tags","blobs_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/languages","stargazers_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/stargazers","contributors_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/contributors","subscribers_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/subscribers","subscription_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/subscription","commits_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/merges","archive_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/downloads","issues_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/labels{/name}","releases_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/releases{/id}","deployments_url":"https://api.github.com/repos/codeforamerica/jail-dashboard/deployments","created_at":"2016-10-27T17:14:21Z","updated_at":"2016-12-22T12:24:35Z","pushed_at":"2016-12-22T19:36:06Z","git_url":"git://github.com/codeforamerica/jail-dashboard.git","ssh_url":"git@github.com:codeforamerica/jail-dashboard.git","clone_url":"https://github.com/codeforamerica/jail-dashboard.git","svn_url":"https://github.com/codeforamerica/jail-dashboard","homepage":null,"size":24527,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/99"},"html":{"href":"https://github.com/codeforamerica/jail-dashboard/pull/99"},"issue":{"href":"https://api.github.com/repos/codeforamerica/jail-dashboard/issues/99"},"comments":{"href":"https://api.github.com/repos/codeforamerica/jail-dashboard/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codeforamerica/jail-dashboard/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/codeforamerica/jail-dashboard/statuses/8c335d6013d7391936d4b9af3c9f052f89a1b199"}}}}
{"actor":{"display_login":"houndci-bot"}}