{"action":"created","comment":{"url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/comments/181097019","pull_request_review_id":111640244,"id":181097019,"diff_hunk":"@@ -3,3 +3,142 @@ var svgStates = d3.select(\"#rank-states-interactive\")\n   .append(\"svg\")\n   .attr('viewBox', '0 0 1000 300')\n   .attr('preserveAspectRatio', 'xMidYMid');\n+\n+var stateMap = svgStates.append('g')\n+  .attr('id','ranked-states-map')\n+  .attr('transform',\"scale(0.4)\");\n+\n+stateMap.append('g')\n+  .attr('id','ranked-states-moved');\n+\n+stateMap.append('g')\n+  .attr('id','ranked-states-dragable');","path":"js/rank_states_utils.js","position":13,"original_position":13,"commit_id":"cce598a69d0c2de71769739e2613e68b0379cc9c","original_commit_id":"cce598a69d0c2de71769739e2613e68b0379cc9c","user":{"login":"lindsaycarr","id":13220910,"avatar_url":"https://avatars3.githubusercontent.com/u/13220910?v=4","gravatar_id":"","url":"https://api.github.com/users/lindsaycarr","html_url":"https://github.com/lindsaycarr","followers_url":"https://api.github.com/users/lindsaycarr/followers","following_url":"https://api.github.com/users/lindsaycarr/following{/other_user}","gists_url":"https://api.github.com/users/lindsaycarr/gists{/gist_id}","starred_url":"https://api.github.com/users/lindsaycarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindsaycarr/subscriptions","organizations_url":"https://api.github.com/users/lindsaycarr/orgs","repos_url":"https://api.github.com/users/lindsaycarr/repos","events_url":"https://api.github.com/users/lindsaycarr/events{/privacy}","received_events_url":"https://api.github.com/users/lindsaycarr/received_events","type":"User","site_admin":false},"body":"just to be consistent since the classes spell this right, might want to add another `g` 😄 ","created_at":"2018-04-12T14:15:43Z","updated_at":"2018-04-12T14:15:43Z","html_url":"https://github.com/USGS-VIZLAB/water-use-15/pull/182#discussion_r181097019","pull_request_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/182","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/comments/181097019"},"html":{"href":"https://github.com/USGS-VIZLAB/water-use-15/pull/182#discussion_r181097019"},"pull_request":{"href":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/182"}}},"pull_request":{"url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/182","id":181202727,"html_url":"https://github.com/USGS-VIZLAB/water-use-15/pull/182","diff_url":"https://github.com/USGS-VIZLAB/water-use-15/pull/182.diff","patch_url":"https://github.com/USGS-VIZLAB/water-use-15/pull/182.patch","issue_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/issues/182","number":182,"state":"open","locked":false,"title":"Rank em","user":{"login":"jread-usgs","id":2349007,"avatar_url":"https://avatars2.githubusercontent.com/u/2349007?v=4","gravatar_id":"","url":"https://api.github.com/users/jread-usgs","html_url":"https://github.com/jread-usgs","followers_url":"https://api.github.com/users/jread-usgs/followers","following_url":"https://api.github.com/users/jread-usgs/following{/other_user}","gists_url":"https://api.github.com/users/jread-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jread-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jread-usgs/subscriptions","organizations_url":"https://api.github.com/users/jread-usgs/orgs","repos_url":"https://api.github.com/users/jread-usgs/repos","events_url":"https://api.github.com/users/jread-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/jread-usgs/received_events","type":"User","site_admin":false},"body":"This is a start on the interactive fig for figure 4, where users can try ranking three states after we give them values for the remaining states/territories. \r\n\r\nI moved the states around in the map visual (fig 1) by creating `<defs>` and turning the references to the states from `<path>` to `<use>`. I did this so I could re-use the same paths in this figure w/o having to read in the data and retroject it. I think this is a really efficient way to do things, but if there are performance issues w/ `<use>`, we should be aware of them.\r\n\r\nI made some fake data for this and am assuming we'll create json in a processing task to do this. I am not up to speed with the various ways to read in external data in d3, so I skipped over that and hard-coded example data. \r\n\r\nI assume there are better ways to filter selections that I am doing (e.g., putting a bunch of `if else` logic in that depends on classes). \r\n\r\nI also assume there is an easy way to create the movable states based on the `bardata` array's value for `open` instead of having a separate array of movable state names. \r\n\r\nWhat I haven't done yet: \r\n - it doesn't tell you when your guess is wrong\r\n - add real data\r\n - add mouseovers so you can get state names or stuff like that - tabling that for now\r\n - figured out how to deal with the mix of classes and style properties that are in js or css. I am really enjoying d3, but finding it challenging to get the proper way to deal with js vs css style stuff into my head.\r\n - clean up details\r\n - gotten peer review on this approach ;) \r\n\r\nwhat it looks like now: \r\n![ezgif com-video-to-gif](https://user-images.githubusercontent.com/2349007/38680046-f7552446-3e2a-11e8-817f-3ccbb98ec97d.gif)\r\n\r\nYou can pick up a state and \"drop\" it - will go back to its original place if you aren't hovering over a bar or it will become a bar if you are on an open one. Supporting users being able to drop into a new place and then pick it back up seemed to not be worth the complexity to me. ","created_at":"2018-04-12T13:27:36Z","updated_at":"2018-04-12T14:15:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61de705432368512d22a2d5e91f5cb0519f0c001","assignee":null,"assignees":[],"requested_reviewers":[{"login":"aappling-usgs","id":12039957,"avatar_url":"https://avatars0.githubusercontent.com/u/12039957?v=4","gravatar_id":"","url":"https://api.github.com/users/aappling-usgs","html_url":"https://github.com/aappling-usgs","followers_url":"https://api.github.com/users/aappling-usgs/followers","following_url":"https://api.github.com/users/aappling-usgs/following{/other_user}","gists_url":"https://api.github.com/users/aappling-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/aappling-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aappling-usgs/subscriptions","organizations_url":"https://api.github.com/users/aappling-usgs/orgs","repos_url":"https://api.github.com/users/aappling-usgs/repos","events_url":"https://api.github.com/users/aappling-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/aappling-usgs/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/182/commits","review_comments_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/182/comments","review_comment_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/comments{/number}","comments_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/issues/182/comments","statuses_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/statuses/cce598a69d0c2de71769739e2613e68b0379cc9c","head":{"label":"jread-usgs:rank_em","ref":"rank_em","sha":"cce598a69d0c2de71769739e2613e68b0379cc9c","user":{"login":"jread-usgs","id":2349007,"avatar_url":"https://avatars2.githubusercontent.com/u/2349007?v=4","gravatar_id":"","url":"https://api.github.com/users/jread-usgs","html_url":"https://github.com/jread-usgs","followers_url":"https://api.github.com/users/jread-usgs/followers","following_url":"https://api.github.com/users/jread-usgs/following{/other_user}","gists_url":"https://api.github.com/users/jread-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jread-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jread-usgs/subscriptions","organizations_url":"https://api.github.com/users/jread-usgs/orgs","repos_url":"https://api.github.com/users/jread-usgs/repos","events_url":"https://api.github.com/users/jread-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/jread-usgs/received_events","type":"User","site_admin":false},"repo":{"id":118145638,"name":"water-use-15","full_name":"jread-usgs/water-use-15","owner":{"login":"jread-usgs","id":2349007,"avatar_url":"https://avatars2.githubusercontent.com/u/2349007?v=4","gravatar_id":"","url":"https://api.github.com/users/jread-usgs","html_url":"https://github.com/jread-usgs","followers_url":"https://api.github.com/users/jread-usgs/followers","following_url":"https://api.github.com/users/jread-usgs/following{/other_user}","gists_url":"https://api.github.com/users/jread-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jread-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jread-usgs/subscriptions","organizations_url":"https://api.github.com/users/jread-usgs/orgs","repos_url":"https://api.github.com/users/jread-usgs/repos","events_url":"https://api.github.com/users/jread-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/jread-usgs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jread-usgs/water-use-15","description":"USGS water use data visualization emphasizing the newly added 2015 dataset.","fork":true,"url":"https://api.github.com/repos/jread-usgs/water-use-15","forks_url":"https://api.github.com/repos/jread-usgs/water-use-15/forks","keys_url":"https://api.github.com/repos/jread-usgs/water-use-15/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jread-usgs/water-use-15/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jread-usgs/water-use-15/teams","hooks_url":"https://api.github.com/repos/jread-usgs/water-use-15/hooks","issue_events_url":"https://api.github.com/repos/jread-usgs/water-use-15/issues/events{/number}","events_url":"https://api.github.com/repos/jread-usgs/water-use-15/events","assignees_url":"https://api.github.com/repos/jread-usgs/water-use-15/assignees{/user}","branches_url":"https://api.github.com/repos/jread-usgs/water-use-15/branches{/branch}","tags_url":"https://api.github.com/repos/jread-usgs/water-use-15/tags","blobs_url":"https://api.github.com/repos/jread-usgs/water-use-15/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jread-usgs/water-use-15/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jread-usgs/water-use-15/git/refs{/sha}","trees_url":"https://api.github.com/repos/jread-usgs/water-use-15/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jread-usgs/water-use-15/statuses/{sha}","languages_url":"https://api.github.com/repos/jread-usgs/water-use-15/languages","stargazers_url":"https://api.github.com/repos/jread-usgs/water-use-15/stargazers","contributors_url":"https://api.github.com/repos/jread-usgs/water-use-15/contributors","subscribers_url":"https://api.github.com/repos/jread-usgs/water-use-15/subscribers","subscription_url":"https://api.github.com/repos/jread-usgs/water-use-15/subscription","commits_url":"https://api.github.com/repos/jread-usgs/water-use-15/commits{/sha}","git_commits_url":"https://api.github.com/repos/jread-usgs/water-use-15/git/commits{/sha}","comments_url":"https://api.github.com/repos/jread-usgs/water-use-15/comments{/number}","issue_comment_url":"https://api.github.com/repos/jread-usgs/water-use-15/issues/comments{/number}","contents_url":"https://api.github.com/repos/jread-usgs/water-use-15/contents/{+path}","compare_url":"https://api.github.com/repos/jread-usgs/water-use-15/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jread-usgs/water-use-15/merges","archive_url":"https://api.github.com/repos/jread-usgs/water-use-15/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jread-usgs/water-use-15/downloads","issues_url":"https://api.github.com/repos/jread-usgs/water-use-15/issues{/number}","pulls_url":"https://api.github.com/repos/jread-usgs/water-use-15/pulls{/number}","milestones_url":"https://api.github.com/repos/jread-usgs/water-use-15/milestones{/number}","notifications_url":"https://api.github.com/repos/jread-usgs/water-use-15/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jread-usgs/water-use-15/labels{/name}","releases_url":"https://api.github.com/repos/jread-usgs/water-use-15/releases{/id}","deployments_url":"https://api.github.com/repos/jread-usgs/water-use-15/deployments","created_at":"2018-01-19T15:56:27Z","updated_at":"2018-04-05T21:07:44Z","pushed_at":"2018-04-12T13:13:56Z","git_url":"git://github.com/jread-usgs/water-use-15.git","ssh_url":"git@github.com:jread-usgs/water-use-15.git","clone_url":"https://github.com/jread-usgs/water-use-15.git","svn_url":"https://github.com/jread-usgs/water-use-15","homepage":null,"size":1984,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"USGS-VIZLAB:master","ref":"master","sha":"97917a8741ab3df7920bceb7bdd9cf4c184c3831","user":{"login":"USGS-VIZLAB","id":18291557,"avatar_url":"https://avatars2.githubusercontent.com/u/18291557?v=4","gravatar_id":"","url":"https://api.github.com/users/USGS-VIZLAB","html_url":"https://github.com/USGS-VIZLAB","followers_url":"https://api.github.com/users/USGS-VIZLAB/followers","following_url":"https://api.github.com/users/USGS-VIZLAB/following{/other_user}","gists_url":"https://api.github.com/users/USGS-VIZLAB/gists{/gist_id}","starred_url":"https://api.github.com/users/USGS-VIZLAB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGS-VIZLAB/subscriptions","organizations_url":"https://api.github.com/users/USGS-VIZLAB/orgs","repos_url":"https://api.github.com/users/USGS-VIZLAB/repos","events_url":"https://api.github.com/users/USGS-VIZLAB/events{/privacy}","received_events_url":"https://api.github.com/users/USGS-VIZLAB/received_events","type":"Organization","site_admin":false},"repo":{"id":118043504,"name":"water-use-15","full_name":"USGS-VIZLAB/water-use-15","owner":{"login":"USGS-VIZLAB","id":18291557,"avatar_url":"https://avatars2.githubusercontent.com/u/18291557?v=4","gravatar_id":"","url":"https://api.github.com/users/USGS-VIZLAB","html_url":"https://github.com/USGS-VIZLAB","followers_url":"https://api.github.com/users/USGS-VIZLAB/followers","following_url":"https://api.github.com/users/USGS-VIZLAB/following{/other_user}","gists_url":"https://api.github.com/users/USGS-VIZLAB/gists{/gist_id}","starred_url":"https://api.github.com/users/USGS-VIZLAB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGS-VIZLAB/subscriptions","organizations_url":"https://api.github.com/users/USGS-VIZLAB/orgs","repos_url":"https://api.github.com/users/USGS-VIZLAB/repos","events_url":"https://api.github.com/users/USGS-VIZLAB/events{/privacy}","received_events_url":"https://api.github.com/users/USGS-VIZLAB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/USGS-VIZLAB/water-use-15","description":"USGS water use data visualization emphasizing the newly added 2015 dataset.","fork":false,"url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15","forks_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/forks","keys_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/keys{/key_id}","collaborators_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/teams","hooks_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/hooks","issue_events_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/issues/events{/number}","events_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/events","assignees_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/assignees{/user}","branches_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/branches{/branch}","tags_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/tags","blobs_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/git/refs{/sha}","trees_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/git/trees{/sha}","statuses_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/statuses/{sha}","languages_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/languages","stargazers_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/stargazers","contributors_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/contributors","subscribers_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/subscribers","subscription_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/subscription","commits_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/commits{/sha}","git_commits_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/git/commits{/sha}","comments_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/comments{/number}","issue_comment_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/issues/comments{/number}","contents_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/contents/{+path}","compare_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/compare/{base}...{head}","merges_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/merges","archive_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/downloads","issues_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/issues{/number}","pulls_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls{/number}","milestones_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/milestones{/number}","notifications_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/labels{/name}","releases_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/releases{/id}","deployments_url":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/deployments","created_at":"2018-01-18T22:00:40Z","updated_at":"2018-04-11T20:17:05Z","pushed_at":"2018-04-12T13:27:36Z","git_url":"git://github.com/USGS-VIZLAB/water-use-15.git","ssh_url":"git@github.com:USGS-VIZLAB/water-use-15.git","clone_url":"https://github.com/USGS-VIZLAB/water-use-15.git","svn_url":"https://github.com/USGS-VIZLAB/water-use-15","homepage":null,"size":1962,"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":8,"mirror_url":null,"archived":false,"open_issues_count":42,"license":null,"forks":8,"open_issues":42,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/182"},"html":{"href":"https://github.com/USGS-VIZLAB/water-use-15/pull/182"},"issue":{"href":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/issues/182"},"comments":{"href":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/issues/182/comments"},"review_comments":{"href":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/182/comments"},"review_comment":{"href":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/pulls/182/commits"},"statuses":{"href":"https://api.github.com/repos/USGS-VIZLAB/water-use-15/statuses/cce598a69d0c2de71769739e2613e68b0379cc9c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lindsaycarr"}}