{"action":"created","comment":{"url":"https://api.github.com/repos/plotly/plotly.js/pulls/comments/140570191","pull_request_review_id":64668384,"id":140570191,"diff_hunk":"@@ -122,9 +106,11 @@ function style(geo) {\n             )\n         );\n \n-        s.selectAll('path.choroplethlocation').each(function(pt) {\n+        s.selectAll('path.choroplethlocation').each(function(_, i) {\n+            var pt = calcTrace[i];","path":"src/traces/choropleth/plot.js","position":158,"original_position":158,"commit_id":"ae48369eabc4c29926f3c1caa818ab43aa6853f8","original_commit_id":"a981eb5433cd34da15b46f6b8c506c29a313ebf7","user":{"login":"alexcjohnson","id":2678795,"avatar_url":"https://avatars3.githubusercontent.com/u/2678795?v=4","gravatar_id":"","url":"https://api.github.com/users/alexcjohnson","html_url":"https://github.com/alexcjohnson","followers_url":"https://api.github.com/users/alexcjohnson/followers","following_url":"https://api.github.com/users/alexcjohnson/following{/other_user}","gists_url":"https://api.github.com/users/alexcjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcjohnson/subscriptions","organizations_url":"https://api.github.com/users/alexcjohnson/orgs","repos_url":"https://api.github.com/users/alexcjohnson/repos","events_url":"https://api.github.com/users/alexcjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/alexcjohnson/received_events","type":"User","site_admin":false},"body":"why is`pt` not just the first arg?","created_at":"2017-09-22T18:51:46Z","updated_at":"2017-09-22T18:51:46Z","html_url":"https://github.com/plotly/plotly.js/pull/2030#discussion_r140570191","pull_request_url":"https://api.github.com/repos/plotly/plotly.js/pulls/2030","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/plotly/plotly.js/pulls/comments/140570191"},"html":{"href":"https://github.com/plotly/plotly.js/pull/2030#discussion_r140570191"},"pull_request":{"href":"https://api.github.com/repos/plotly/plotly.js/pulls/2030"}}},"pull_request":{"url":"https://api.github.com/repos/plotly/plotly.js/pulls/2030","id":142488755,"html_url":"https://github.com/plotly/plotly.js/pull/2030","diff_url":"https://github.com/plotly/plotly.js/pull/2030.diff","patch_url":"https://github.com/plotly/plotly.js/pull/2030.patch","issue_url":"https://api.github.com/repos/plotly/plotly.js/issues/2030","number":2030,"state":"open","locked":false,"title":"Geo refactor and lasso/select-box selections","user":{"login":"etpinard","id":6675409,"avatar_url":"https://avatars0.githubusercontent.com/u/6675409?v=4","gravatar_id":"","url":"https://api.github.com/users/etpinard","html_url":"https://github.com/etpinard","followers_url":"https://api.github.com/users/etpinard/followers","following_url":"https://api.github.com/users/etpinard/following{/other_user}","gists_url":"https://api.github.com/users/etpinard/gists{/gist_id}","starred_url":"https://api.github.com/users/etpinard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etpinard/subscriptions","organizations_url":"https://api.github.com/users/etpinard/orgs","repos_url":"https://api.github.com/users/etpinard/repos","events_url":"https://api.github.com/users/etpinard/events{/privacy}","received_events_url":"https://api.github.com/users/etpinard/received_events","type":"User","site_admin":false},"body":"In brief, this PR brings geo subplots up-to-speed with other subplots. :rocket: \r\n\r\nGeo subplots have long suffered from a few design mistakes (e.g. as discussed https://github.com/plotly/plotly.js/issues/292 and https://github.com/plotly/plotly.js/issues/1486). This PR attempts to solve these issues - which are required to make lasso/select-box selections work.\r\n\r\nSince the geo subplot constructor code was mostly rewritten (see https://github.com/plotly/plotly.js/commit/4c1ddb80dd39ae6d1ba5d51d21b95b36919a8bc5), I decided to include the new lasso/select-box logic in this PR as well. I hope the reviewers won't mind. You may consider geo as a _new_ subplot type and this its introduction PR. \r\n\r\n----\r\n\r\n### What's inside this PR:\r\n\r\n#### Stuff implemented:\r\n- :globe_with_meridians:  `geo.center` a new attribute which should've been there from the start https://github.com/plotly/plotly.js/issues/1486\r\n- :microscope:  `scattergeo` and `choropleth`(selections about centroid) lasso and select box\r\n\r\n![peek 2017-09-21 23-10](https://user-images.githubusercontent.com/6675409/30727904-27015dac-9f22-11e7-91be-fe12d136f9d4.gif)\r\n\r\n\r\n#### Stuff fixed:\r\n- :tada: no view reset on updates https://github.com/plotly/plotly.js/issues/292 (thanks to `geo.center`) :lock: in https://github.com/plotly/plotly.js/commit/3bd89d32ce50cbf771a539cf6dce013d26d552da\r\n- :white_check_mark: `scattergeo` markers outside 'usa' scope now render correctly https://github.com/plotly/plotly.js/issues/1996 :lock:  in https://github.com/plotly/plotly.js/commit/eaf44a8fb898e55a3f8679469425ab1ade7d6f7b\r\n- :world_map:  cross anti-meridian `lonaxis` ranges now behave correctly https://github.com/plotly/plotly.js/issues/1698 :lock: in https://github.com/plotly/plotly.js/commit/e59c90b0609693b7f62a5cee247b7acb40fa61f7\r\n- :mag: add miter limit to scattergeo lines https://github.com/plotly/plotly.js/issues/1995 :lock: in https://github.com/plotly/plotly.js/commit/825e24d2065114be8f5b045d63cd5235686f8ff1\r\n- :mag_right:  `marker.opacity`wasn't applied properly on `scattergeo` bubbles :lock: in https://github.com/plotly/plotly.js/commit/7e5bb41fa699e49f0c0eff84e4ea58cb044ccb20\r\n\r\n#### Baseline updates:\r\n\r\nUnfortunately, **all** geo baselines had to be updated. \r\n\r\n- Most geo subplots now render a few pixels off their position in the old baselines (see https://github.com/plotly/plotly.js/commit/a30beeaf306b3774d318bbc34cdb7829901919da). \r\n- The center of some scoped maps are shifted (see https://github.com/plotly/plotly.js/commit/be59f693383b0b746bc8947ad8e8c2c5cccb239d) due to the new default logic (of https://github.com/plotly/plotly.js/commit/a0be08795acfc0a976f7ef141a30a4a1d4e65704). \r\n- Maps with conic projections needed to be updated for similar reasons (see https://github.com/plotly/plotly.js/commit/32a29c7191efc9a96faca97ccad8a30733f09d9c). \r\n- Finally, `geo_fill` was adapted to showcase the new `geo.center` attribute (see https://github.com/plotly/plotly.js/commit/36833d4446c3b86f447407773ab8446db24e883a)\r\n\r\n#### Stuff I could do in this PR, but could wait for v2:\r\n- Rename (+ `cleanLayout` map) `geo.projection.scale` :arrow_right:  `geo.zoom` (as in mapbox subplots)\r\n- Rename (+ `cleanData` map) choropleth `z` :arrow_right:  `values` (similar to pie traces)\r\n\r\n#### Open items:\r\n- Base layer ordering changes whenever a choropleth trace is present on the subplot (see this [block](https://github.com/plotly/plotly.js/commit/4c1ddb80dd39ae6d1ba5d51d21b95b36919a8bc5#diff-b4732bdd35eeb4830531de6212e422e2R239)). This logic is meant to preserve backward compatibility (i.e. to mimic what that [block](https://github.com/plotly/plotly.js/blob/60b445d2916547f1d1a548d64209989688d7a617/src/traces/choropleth/plot.js#L65-L72) does in the current `master`). But really, we should make the base layer ordering consistent for all trace type combinations in v2. But in the meantime, we should make the base layer ordering customizable (similar to `axis.layer`).\r\n- Rewrite drag interactions using `dragElement` (i.e. get rid of `d3.behavior.drag`) and implement dragmode: 'zoom'` zoombox\r\n- Make `scattergeo/plot.js` update inner nodes instead of purging them. This is required for smooth animations and should be a performance boost.\r\n\r\n#### Stuff I believe should wait for v2:\r\n- Make geo subplot respect the `scrollZoom` config option https://github.com/plotly/plotly.js/issues/143. Unfortunately. geo assumes `scrollZoom: true`, but the `scrollZoom` default is `faise`. We could add some logic to make `scrollZoom` default to `true` if a geo subplot is present to preserve backward compatibility, but that hardly sounds worth it (to me at least).\r\n- Replace `PlotlyGeoAssets` global with some field on `Plotly`. No need to have another global variables, but this isn't a huge priority.\r\n\r\n-----\r\n\r\ncc @alexcjohnson @rreusser  @chriddyp @jackparmer @cldougl \r\nand @cpsievert (this here might make him start using `geo` in the R API :stuck_out_tongue_closed_eyes:  )","created_at":"2017-09-22T03:14:15Z","updated_at":"2017-09-22T18:51:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6cad8bce8cbf1d800fa28c73a579ee1fed990c27","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/plotly/plotly.js/milestones/27","html_url":"https://github.com/plotly/plotly.js/milestone/27","labels_url":"https://api.github.com/repos/plotly/plotly.js/milestones/27/labels","id":2715910,"number":27,"title":"v1.31.0","description":"","creator":{"login":"etpinard","id":6675409,"avatar_url":"https://avatars0.githubusercontent.com/u/6675409?v=4","gravatar_id":"","url":"https://api.github.com/users/etpinard","html_url":"https://github.com/etpinard","followers_url":"https://api.github.com/users/etpinard/followers","following_url":"https://api.github.com/users/etpinard/following{/other_user}","gists_url":"https://api.github.com/users/etpinard/gists{/gist_id}","starred_url":"https://api.github.com/users/etpinard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etpinard/subscriptions","organizations_url":"https://api.github.com/users/etpinard/orgs","repos_url":"https://api.github.com/users/etpinard/repos","events_url":"https://api.github.com/users/etpinard/events{/privacy}","received_events_url":"https://api.github.com/users/etpinard/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":3,"state":"open","created_at":"2017-08-22T13:51:14Z","updated_at":"2017-09-22T03:14:15Z","due_on":"2017-09-05T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/plotly/plotly.js/pulls/2030/commits","review_comments_url":"https://api.github.com/repos/plotly/plotly.js/pulls/2030/comments","review_comment_url":"https://api.github.com/repos/plotly/plotly.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/plotly/plotly.js/issues/2030/comments","statuses_url":"https://api.github.com/repos/plotly/plotly.js/statuses/ae48369eabc4c29926f3c1caa818ab43aa6853f8","head":{"label":"plotly:geo-refactor+lasso","ref":"geo-refactor+lasso","sha":"ae48369eabc4c29926f3c1caa818ab43aa6853f8","user":{"login":"plotly","id":5997976,"avatar_url":"https://avatars2.githubusercontent.com/u/5997976?v=4","gravatar_id":"","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"repo":{"id":45646037,"name":"plotly.js","full_name":"plotly/plotly.js","owner":{"login":"plotly","id":5997976,"avatar_url":"https://avatars2.githubusercontent.com/u/5997976?v=4","gravatar_id":"","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plotly/plotly.js","description":"The open source JavaScript graphing library that powers plotly","fork":false,"url":"https://api.github.com/repos/plotly/plotly.js","forks_url":"https://api.github.com/repos/plotly/plotly.js/forks","keys_url":"https://api.github.com/repos/plotly/plotly.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plotly/plotly.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plotly/plotly.js/teams","hooks_url":"https://api.github.com/repos/plotly/plotly.js/hooks","issue_events_url":"https://api.github.com/repos/plotly/plotly.js/issues/events{/number}","events_url":"https://api.github.com/repos/plotly/plotly.js/events","assignees_url":"https://api.github.com/repos/plotly/plotly.js/assignees{/user}","branches_url":"https://api.github.com/repos/plotly/plotly.js/branches{/branch}","tags_url":"https://api.github.com/repos/plotly/plotly.js/tags","blobs_url":"https://api.github.com/repos/plotly/plotly.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plotly/plotly.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plotly/plotly.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/plotly/plotly.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plotly/plotly.js/statuses/{sha}","languages_url":"https://api.github.com/repos/plotly/plotly.js/languages","stargazers_url":"https://api.github.com/repos/plotly/plotly.js/stargazers","contributors_url":"https://api.github.com/repos/plotly/plotly.js/contributors","subscribers_url":"https://api.github.com/repos/plotly/plotly.js/subscribers","subscription_url":"https://api.github.com/repos/plotly/plotly.js/subscription","commits_url":"https://api.github.com/repos/plotly/plotly.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/plotly/plotly.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/plotly/plotly.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/plotly/plotly.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/plotly/plotly.js/contents/{+path}","compare_url":"https://api.github.com/repos/plotly/plotly.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plotly/plotly.js/merges","archive_url":"https://api.github.com/repos/plotly/plotly.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plotly/plotly.js/downloads","issues_url":"https://api.github.com/repos/plotly/plotly.js/issues{/number}","pulls_url":"https://api.github.com/repos/plotly/plotly.js/pulls{/number}","milestones_url":"https://api.github.com/repos/plotly/plotly.js/milestones{/number}","notifications_url":"https://api.github.com/repos/plotly/plotly.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plotly/plotly.js/labels{/name}","releases_url":"https://api.github.com/repos/plotly/plotly.js/releases{/id}","deployments_url":"https://api.github.com/repos/plotly/plotly.js/deployments","created_at":"2015-11-05T23:27:17Z","updated_at":"2017-09-22T09:49:37Z","pushed_at":"2017-09-22T18:17:12Z","git_url":"git://github.com/plotly/plotly.js.git","ssh_url":"git@github.com:plotly/plotly.js.git","clone_url":"https://github.com/plotly/plotly.js.git","svn_url":"https://github.com/plotly/plotly.js","homepage":"https://plot.ly/javascript/","size":306324,"stargazers_count":6854,"watchers_count":6854,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":739,"mirror_url":null,"open_issues_count":420,"forks":739,"open_issues":420,"watchers":6854,"default_branch":"master"}},"base":{"label":"plotly:master","ref":"master","sha":"60b445d2916547f1d1a548d64209989688d7a617","user":{"login":"plotly","id":5997976,"avatar_url":"https://avatars2.githubusercontent.com/u/5997976?v=4","gravatar_id":"","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"repo":{"id":45646037,"name":"plotly.js","full_name":"plotly/plotly.js","owner":{"login":"plotly","id":5997976,"avatar_url":"https://avatars2.githubusercontent.com/u/5997976?v=4","gravatar_id":"","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plotly/plotly.js","description":"The open source JavaScript graphing library that powers plotly","fork":false,"url":"https://api.github.com/repos/plotly/plotly.js","forks_url":"https://api.github.com/repos/plotly/plotly.js/forks","keys_url":"https://api.github.com/repos/plotly/plotly.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plotly/plotly.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plotly/plotly.js/teams","hooks_url":"https://api.github.com/repos/plotly/plotly.js/hooks","issue_events_url":"https://api.github.com/repos/plotly/plotly.js/issues/events{/number}","events_url":"https://api.github.com/repos/plotly/plotly.js/events","assignees_url":"https://api.github.com/repos/plotly/plotly.js/assignees{/user}","branches_url":"https://api.github.com/repos/plotly/plotly.js/branches{/branch}","tags_url":"https://api.github.com/repos/plotly/plotly.js/tags","blobs_url":"https://api.github.com/repos/plotly/plotly.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plotly/plotly.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plotly/plotly.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/plotly/plotly.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plotly/plotly.js/statuses/{sha}","languages_url":"https://api.github.com/repos/plotly/plotly.js/languages","stargazers_url":"https://api.github.com/repos/plotly/plotly.js/stargazers","contributors_url":"https://api.github.com/repos/plotly/plotly.js/contributors","subscribers_url":"https://api.github.com/repos/plotly/plotly.js/subscribers","subscription_url":"https://api.github.com/repos/plotly/plotly.js/subscription","commits_url":"https://api.github.com/repos/plotly/plotly.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/plotly/plotly.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/plotly/plotly.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/plotly/plotly.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/plotly/plotly.js/contents/{+path}","compare_url":"https://api.github.com/repos/plotly/plotly.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plotly/plotly.js/merges","archive_url":"https://api.github.com/repos/plotly/plotly.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plotly/plotly.js/downloads","issues_url":"https://api.github.com/repos/plotly/plotly.js/issues{/number}","pulls_url":"https://api.github.com/repos/plotly/plotly.js/pulls{/number}","milestones_url":"https://api.github.com/repos/plotly/plotly.js/milestones{/number}","notifications_url":"https://api.github.com/repos/plotly/plotly.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plotly/plotly.js/labels{/name}","releases_url":"https://api.github.com/repos/plotly/plotly.js/releases{/id}","deployments_url":"https://api.github.com/repos/plotly/plotly.js/deployments","created_at":"2015-11-05T23:27:17Z","updated_at":"2017-09-22T09:49:37Z","pushed_at":"2017-09-22T18:17:12Z","git_url":"git://github.com/plotly/plotly.js.git","ssh_url":"git@github.com:plotly/plotly.js.git","clone_url":"https://github.com/plotly/plotly.js.git","svn_url":"https://github.com/plotly/plotly.js","homepage":"https://plot.ly/javascript/","size":306324,"stargazers_count":6854,"watchers_count":6854,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":739,"mirror_url":null,"open_issues_count":420,"forks":739,"open_issues":420,"watchers":6854,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/plotly/plotly.js/pulls/2030"},"html":{"href":"https://github.com/plotly/plotly.js/pull/2030"},"issue":{"href":"https://api.github.com/repos/plotly/plotly.js/issues/2030"},"comments":{"href":"https://api.github.com/repos/plotly/plotly.js/issues/2030/comments"},"review_comments":{"href":"https://api.github.com/repos/plotly/plotly.js/pulls/2030/comments"},"review_comment":{"href":"https://api.github.com/repos/plotly/plotly.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/plotly/plotly.js/pulls/2030/commits"},"statuses":{"href":"https://api.github.com/repos/plotly/plotly.js/statuses/ae48369eabc4c29926f3c1caa818ab43aa6853f8"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"alexcjohnson"}}