{"action":"created","comment":{"url":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/comments/91135966","pull_request_review_id":11645340,"id":91135966,"diff_hunk":"@@ -27,6 +28,23 @@ var Segment = function(data, map) {\n     });\n   };\n \n+  this.trafficCount = ko.observable(0); // No traffic by default\n+\n+  this.trafficColor = ko.computed(function() {\n+    // High value hard-coded at the moment\n+    var high_value = 8;\n+    var valuePCT = (parseInt(thisSegment.trafficCount(), 10) / high_value);\n+    if (valuePCT > 1) {\n+      valuePCT = 1;\n+    }\n+    // Conversion function takes a scaled hue [0,1]\n+    var hue = ((1-valuePCT) * 120) / 360;\n+    // Saturation and lightness set to produce red-green scale\n+    var rgb = hslToRgb(hue, 1, 0.7);\n+    var hex = '#' + RGBToHex(rgb[0], rgb[1], rgb[2]);","path":"static/js/trailTraffic.js","position":25,"original_position":25,"commit_id":"ee059d31fcb109a04a396e8abb58e279767bf4d8","original_commit_id":"ee059d31fcb109a04a396e8abb58e279767bf4d8","user":{"login":"ashleycoxley","id":7006859,"avatar_url":"https://avatars.githubusercontent.com/u/7006859?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleycoxley","html_url":"https://github.com/ashleycoxley","followers_url":"https://api.github.com/users/ashleycoxley/followers","following_url":"https://api.github.com/users/ashleycoxley/following{/other_user}","gists_url":"https://api.github.com/users/ashleycoxley/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleycoxley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleycoxley/subscriptions","organizations_url":"https://api.github.com/users/ashleycoxley/orgs","repos_url":"https://api.github.com/users/ashleycoxley/repos","events_url":"https://api.github.com/users/ashleycoxley/events{/privacy}","received_events_url":"https://api.github.com/users/ashleycoxley/received_events","type":"User","site_admin":false},"body":"the color is passed to the Google Maps API, which only takes hex","created_at":"2016-12-06T18:05:28Z","updated_at":"2016-12-06T18:05:28Z","html_url":"https://github.com/ashleycoxley/trail-traffic/pull/19#discussion_r91135966","pull_request_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/comments/91135966"},"html":{"href":"https://github.com/ashleycoxley/trail-traffic/pull/19#discussion_r91135966"},"pull_request":{"href":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/19","id":96641803,"html_url":"https://github.com/ashleycoxley/trail-traffic/pull/19","diff_url":"https://github.com/ashleycoxley/trail-traffic/pull/19.diff","patch_url":"https://github.com/ashleycoxley/trail-traffic/pull/19.patch","issue_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/issues/19","number":19,"state":"open","locked":false,"title":"Added segment colors to indicate traffic severity","user":{"login":"ashleycoxley","id":7006859,"avatar_url":"https://avatars.githubusercontent.com/u/7006859?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleycoxley","html_url":"https://github.com/ashleycoxley","followers_url":"https://api.github.com/users/ashleycoxley/followers","following_url":"https://api.github.com/users/ashleycoxley/following{/other_user}","gists_url":"https://api.github.com/users/ashleycoxley/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleycoxley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleycoxley/subscriptions","organizations_url":"https://api.github.com/users/ashleycoxley/orgs","repos_url":"https://api.github.com/users/ashleycoxley/repos","events_url":"https://api.github.com/users/ashleycoxley/events{/privacy}","received_events_url":"https://api.github.com/users/ashleycoxley/received_events","type":"User","site_admin":false},"body":"- Traffic for each segment scaled to reflect a percentage of 8 cyclists (a reasonable guess at the 90th percentile; can be automatically generated in future)\r\n- Color scaling computed using HSL, then converted to RGB and finally hex\r\n- Segment color lines change when traffic is updated\r\n- Default color before the first traffic update is green, indicating no traffic\r\n\r\n@harperj","created_at":"2016-12-06T01:04:15Z","updated_at":"2016-12-06T18:05:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d260d1781b12065c6d05507840e1dd670904a91","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/19/commits","review_comments_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/19/comments","review_comment_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/issues/19/comments","statuses_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/statuses/ee059d31fcb109a04a396e8abb58e279767bf4d8","head":{"label":"ashleycoxley:traffic_colors","ref":"traffic_colors","sha":"ee059d31fcb109a04a396e8abb58e279767bf4d8","user":{"login":"ashleycoxley","id":7006859,"avatar_url":"https://avatars.githubusercontent.com/u/7006859?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleycoxley","html_url":"https://github.com/ashleycoxley","followers_url":"https://api.github.com/users/ashleycoxley/followers","following_url":"https://api.github.com/users/ashleycoxley/following{/other_user}","gists_url":"https://api.github.com/users/ashleycoxley/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleycoxley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleycoxley/subscriptions","organizations_url":"https://api.github.com/users/ashleycoxley/orgs","repos_url":"https://api.github.com/users/ashleycoxley/repos","events_url":"https://api.github.com/users/ashleycoxley/events{/privacy}","received_events_url":"https://api.github.com/users/ashleycoxley/received_events","type":"User","site_admin":false},"repo":{"id":74771448,"name":"trail-traffic","full_name":"ashleycoxley/trail-traffic","owner":{"login":"ashleycoxley","id":7006859,"avatar_url":"https://avatars.githubusercontent.com/u/7006859?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleycoxley","html_url":"https://github.com/ashleycoxley","followers_url":"https://api.github.com/users/ashleycoxley/followers","following_url":"https://api.github.com/users/ashleycoxley/following{/other_user}","gists_url":"https://api.github.com/users/ashleycoxley/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleycoxley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleycoxley/subscriptions","organizations_url":"https://api.github.com/users/ashleycoxley/orgs","repos_url":"https://api.github.com/users/ashleycoxley/repos","events_url":"https://api.github.com/users/ashleycoxley/events{/privacy}","received_events_url":"https://api.github.com/users/ashleycoxley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ashleycoxley/trail-traffic","description":"One-page map application showing recent bicycle traffic on local park trails. ","fork":false,"url":"https://api.github.com/repos/ashleycoxley/trail-traffic","forks_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/forks","keys_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/teams","hooks_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/hooks","issue_events_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/issues/events{/number}","events_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/events","assignees_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/assignees{/user}","branches_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/branches{/branch}","tags_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/tags","blobs_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/git/refs{/sha}","trees_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/statuses/{sha}","languages_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/languages","stargazers_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/stargazers","contributors_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/contributors","subscribers_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/subscribers","subscription_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/subscription","commits_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/commits{/sha}","git_commits_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/git/commits{/sha}","comments_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/comments{/number}","issue_comment_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/issues/comments{/number}","contents_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/contents/{+path}","compare_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/merges","archive_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/downloads","issues_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/issues{/number}","pulls_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls{/number}","milestones_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/milestones{/number}","notifications_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/labels{/name}","releases_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/releases{/id}","deployments_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/deployments","created_at":"2016-11-25T15:58:22Z","updated_at":"2016-12-05T17:48:21Z","pushed_at":"2016-12-06T01:04:15Z","git_url":"git://github.com/ashleycoxley/trail-traffic.git","ssh_url":"git@github.com:ashleycoxley/trail-traffic.git","clone_url":"https://github.com/ashleycoxley/trail-traffic.git","svn_url":"https://github.com/ashleycoxley/trail-traffic","homepage":null,"size":652,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"ashleycoxley:master","ref":"master","sha":"c94ed041deb05d21defd3437f3f04ebb7d8bdba3","user":{"login":"ashleycoxley","id":7006859,"avatar_url":"https://avatars.githubusercontent.com/u/7006859?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleycoxley","html_url":"https://github.com/ashleycoxley","followers_url":"https://api.github.com/users/ashleycoxley/followers","following_url":"https://api.github.com/users/ashleycoxley/following{/other_user}","gists_url":"https://api.github.com/users/ashleycoxley/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleycoxley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleycoxley/subscriptions","organizations_url":"https://api.github.com/users/ashleycoxley/orgs","repos_url":"https://api.github.com/users/ashleycoxley/repos","events_url":"https://api.github.com/users/ashleycoxley/events{/privacy}","received_events_url":"https://api.github.com/users/ashleycoxley/received_events","type":"User","site_admin":false},"repo":{"id":74771448,"name":"trail-traffic","full_name":"ashleycoxley/trail-traffic","owner":{"login":"ashleycoxley","id":7006859,"avatar_url":"https://avatars.githubusercontent.com/u/7006859?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleycoxley","html_url":"https://github.com/ashleycoxley","followers_url":"https://api.github.com/users/ashleycoxley/followers","following_url":"https://api.github.com/users/ashleycoxley/following{/other_user}","gists_url":"https://api.github.com/users/ashleycoxley/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleycoxley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleycoxley/subscriptions","organizations_url":"https://api.github.com/users/ashleycoxley/orgs","repos_url":"https://api.github.com/users/ashleycoxley/repos","events_url":"https://api.github.com/users/ashleycoxley/events{/privacy}","received_events_url":"https://api.github.com/users/ashleycoxley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ashleycoxley/trail-traffic","description":"One-page map application showing recent bicycle traffic on local park trails. ","fork":false,"url":"https://api.github.com/repos/ashleycoxley/trail-traffic","forks_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/forks","keys_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/teams","hooks_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/hooks","issue_events_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/issues/events{/number}","events_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/events","assignees_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/assignees{/user}","branches_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/branches{/branch}","tags_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/tags","blobs_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/git/refs{/sha}","trees_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/statuses/{sha}","languages_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/languages","stargazers_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/stargazers","contributors_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/contributors","subscribers_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/subscribers","subscription_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/subscription","commits_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/commits{/sha}","git_commits_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/git/commits{/sha}","comments_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/comments{/number}","issue_comment_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/issues/comments{/number}","contents_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/contents/{+path}","compare_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/merges","archive_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/downloads","issues_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/issues{/number}","pulls_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls{/number}","milestones_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/milestones{/number}","notifications_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/labels{/name}","releases_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/releases{/id}","deployments_url":"https://api.github.com/repos/ashleycoxley/trail-traffic/deployments","created_at":"2016-11-25T15:58:22Z","updated_at":"2016-12-05T17:48:21Z","pushed_at":"2016-12-06T01:04:15Z","git_url":"git://github.com/ashleycoxley/trail-traffic.git","ssh_url":"git@github.com:ashleycoxley/trail-traffic.git","clone_url":"https://github.com/ashleycoxley/trail-traffic.git","svn_url":"https://github.com/ashleycoxley/trail-traffic","homepage":null,"size":652,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/19"},"html":{"href":"https://github.com/ashleycoxley/trail-traffic/pull/19"},"issue":{"href":"https://api.github.com/repos/ashleycoxley/trail-traffic/issues/19"},"comments":{"href":"https://api.github.com/repos/ashleycoxley/trail-traffic/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ashleycoxley/trail-traffic/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/ashleycoxley/trail-traffic/statuses/ee059d31fcb109a04a396e8abb58e279767bf4d8"}}}}
{"actor":{"display_login":"ashleycoxley"}}